上一篇:
有点累了

转自:BO-BLOG
之前曾经说过,侧边栏项目支持PHP代码,而不仅仅是html。但是为了保险起见,程序要求所有出现在侧边栏项目中的PHP代码全部用base64编码。以侧边模板切换器的代码为例:
这一部分,也就是被 包围起来的部分,就是base64_encode后的php代码。
不过这样一来,改写代码和编码就显得比较麻烦。以下是我自己写的一个小程序,非常简陋,用于快速base64_encode与base64_decode。贴出来给需要的插件开发者使用。(顺便测试代码高亮功能)
以下请另存为 decodephp.php,直接打开就能用了。
将侧边栏模板切换器的编码部分(不包含和 )拷贝到输入框内,解码后的结果为:
之前曾经说过,侧边栏项目支持PHP代码,而不仅仅是html。但是为了保险起见,程序要求所有出现在侧边栏项目中的PHP代码全部用base64编码。以侧边模板切换器的代码为例:
<php>Z2xvYmFsICRsYW5nZnJvbnQsICR0ZW1wbGF0ZTsNCiRsYW5nZm
(中间省略)
</php>
(中间省略)
</php>
这一部分,也就是被
不过这样一来,改写代码和编码就显得比较麻烦。以下是我自己写的一个小程序,非常简陋,用于快速base64_encode与base64_decode。贴出来给需要的插件开发者使用。(顺便测试代码高亮功能)
以下请另存为 decodephp.php,直接打开就能用了。
<?PHP
error_reporting(E_ERROR | E_WARNING | E_PARSE);
@set_magic_quotes_runtime (0);
@header("Content-Type: text/html; charset=utf-8");
$code=$_POST['code'];
$action=$_REQUEST['action'];
if (get_magic_quotes_gpc()) $code=stripslashes($code);
if ($action=='decode') {
$code=base64_decode($code);
$code=nl2br(htmlspecialchars($code));
}
else $code=base64_encode($code);
?>
<html>
<body style="text-align: center;">
<div style="text-align: left; width: 90%; font-family: Verdana; font-size: 14px; margin: auto; background: #EFEFEF; color: #000;"><b>Result: </b><br><br><?php echo ($code);?><br><br></div><br><br>
<form action="decodephp.php" method='post'>
<textarea name='code' cols='100' rows='16'></textarea><br>
<input type='radio' name='action' value='decode' checked>DECODE <input type='radio' name='action' value='encode'>ENCODE<br><br>
<input type='submit'> <input type='reset'>
</form>
</body>
</html>
将侧边栏模板切换器的编码部分(不包含
<?
global $langfront, $template;
$langforselskin=($langfront=='zh-tw') ? '恢復預設' : '恢复默认';
include_once ("data/cache_skinlist.php");
if (is_array($skinset)) {
foreach ($skinset as $skin) {
@list($skid, $skname, $skauthor, $skintro, $skdir, $skthumbnail)=@explode('|', $skin);
if ($skid==$template['id']) $optionskinlist.="<option value='{$skdir}' selected='selected'>{$skname}</option>";
else $optionskinlist.="<option value='{$skdir}'>{$skname}</option>";
}
}
$phpreturn="<form action='index.php' method='post' id='skinselector'><select name='tem' onchange="document.getElementById('skinselector').submit();"><option value='____'>{$langforselskin}</option>{$optionskinlist}</select></form>";
?>
robbi

2007/03/04 00:36
好可爱~~
我汗

伊朵可儿
2007/03/03 16:15
你好啊,无意中看到你的博客,好可爱的……顶一下
totti 回复于 2007/03/03 22:11
:)
haha
2007/03/01 13:32















分页: 1/1
1

