웹마스터 팁

<block cond="$_COOKIE['img_remove'] == 'Y'">
{@
$strfront = strpos($content,'BeforeDocument');
$strbehind = strpos($content,'AfterDocument');
$content_find = substr($content,$strfront);
$content_find = substr($content_find,0,strlen($content_find) - (strlen($content_find)-$strbehind));
$content_rep = preg_replace("/<img[^>]+\>/i", "", $content_find);
$content = str_replace($content_find,$content_rep,$content);
    
}
</block>
<script>function setCookie(a,b,c){var expire=new Date();expire.setDate(expire.getDate()+c);cookies=a+'='+escape(b)+';path=/';if(typeof c!='undefined')cookies+=';expires='+expire.toGMTString()+';';document.cookie=cookies}</script>

 

모바일의 layout.html에 다음의 코드를 삽입합니다.

 

<li><button type="button" onclick="setCookie('img_remove','Y',60);top.location.reload()" cond="$_COOKIE['img_remove'] != 'Y'">절약모드 ON</button></li>
<li><button type="button" onclick="setCookie('img_remove','N',60);top.location.reload()" cond="$_COOKIE['img_remove'] == 'Y'">절약모드 OFF</button></li>

 

이미지 제거모드를 켜고 끄기위한 버튼을 추가합니다.