Ejemplo n.º 1
0
function blogconfig_exportlist($id)
{
    global $zbp;
    $html = '';
    $i = 0;
    $html .= '<div class="DIVBlogConfigtop"><span id="name">';
    $html .= $id . '</span><a href="javascript:;" onclick="run2(\'new\',\'' . $id . '\')">新建</a></div>';
    $html .= '<table width="100%" style="padding:0px;" cellspacing="0" cellpadding="0" id="configt">';
    $html .= '<tr height="32"><th width="25%">项</th><th>内容 <a onclick="alert(\'点击表格即可开始编辑。如果标注有array的话则无法编辑。\')" href="javascript:void(0);">?</a> </th><th width="10%"></th></tr>';
    if (isset($zbp->configs[$id]->Data)) {
        $data = $zbp->configs[$id]->Data;
    } else {
        $data = $zbp->configs[$id]->GetData();
    }
    ksort($data);
    foreach ($data as $name => $value) {
        $show_submit_button = true;
        $have_textarea = true;
        $show_in_span_html = '';
        $name = TransferHTML((string) $name, '[html-format]');
        if (gettype($value) == 'array') {
            $value = '[array][' . implode(",", $value) . ']';
            $show_in_span_html = $value;
            $show_submit_button = false;
            $have_textarea = false;
        } elseif (gettype($value) == 'boolean') {
            $value = (int) $value;
            $show_in_span_html = '<input type="text" id="ta' . $i . '" class="checkbox" value="' . (bool) $value . '" />';
            $have_textarea = false;
        } else {
            $value = TransferHTML((string) $value, '[html-format]');
            $show_in_span_html = $value;
        }
        //echo $value;
        //echo "\n";
        $html .= '<tr height="32">';
        $html .= '<td><input type="hidden" value="' . $i . '"/><span id="txt' . $i . '">';
        $html .= $name;
        $html .= '</span></td><td ';
        if ($have_textarea) {
            $html .= 'onclick="$(\'#ta' . $i . '\').show();$(\'#show' . $i . '\').hide()"';
        }
        $html .= '><span id="show' . $i . '">' . $show_in_span_html . '</span>';
        if ($have_textarea) {
            $html .= '<textarea id="ta' . $i . '" style="display:none;width:100%">' . $value . '</textarea></td>';
        }
        $html .= '<td class="tdCenter">';
        if ($show_submit_button) {
            $html .= '<a href="javascript:;" onclick="run2(\'edit\',\'' . $i . '\',\'' . $id . '\')">';
            $html .= '<img src="../../../../../zb_system/image/admin/ok.png" alt="提交" title="提交" width="16" /></a>';
            $html .= '&nbsp;&nbsp;&nbsp;&nbsp;';
        }
        $html .= '<a onclick="if(window.confirm(\'单击“确定”继续。单击“取消”停止。\')){run2(\'del\',\'' . $i . '\',\'' . $id . '\')};"';
        $html .= 'href="javascript:;" onclick="run2(\'del\',\'' . $i . '\',\'' . $id . '\')">';
        $html .= '<img src="../../../../../zb_system/image/admin/delete.png" alt="删除" title="删除" width="16" /></a></td></tr>';
        $html .= PHP_EOL . PHP_EOL;
        $i++;
    }
    return $html;
}
Ejemplo n.º 2
0
function BuildModule_comments()
{
    global $zbp;
    $comments = $zbp->GetCommentList(array('*'), array(array('=', 'comm_IsChecking', 0)), array('comm_PostTime' => 'DESC'), array(10), null);
    $s = '';
    foreach ($comments as $comment) {
        $s .= '<li><a href="' . $comment->Post->Url . '#cmt' . $comment->ID . '" title="' . htmlspecialchars($comment->Author->Name . ' @ ' . $comment->Time()) . '">' . TransferHTML($comment->Content, '[noenter]') . '</a></li>';
    }
    return $s;
}
Ejemplo n.º 3
0
                plugininterface_formatfilter($interface_name);
            } else {
                plugininterface_getall();
            }
            echo '<table width="100%"><tr><td height="40">挂接口数量(共' . count($GLOBALS['zbdk_interface_defined_plugins']['filter']) . '个)</td></tr>';
            foreach ($GLOBALS['zbdk_interface_defined_plugins']['filter'] as $temp) {
                echo '<tr onclick="show_code(\'' . $temp['orig'] . '\',$(this).attr(\'_interface\'),this)" _interface="' . $temp['interface_name'] . '">';
                echo '<td height="40">' . TransferHTML($temp['output'], "[html-format]") . '</td></tr>';
            }
            echo '</table>';
            exit;
            break;
        case 'showcode':
            $func_name = GetVars("func", "POST");
            $interface_name = GetVars("if", "POST");
            echo TransferHTML(plugininterface_outputfunc($interface_name, $func_name), "[html-format][enter]");
            exit;
            break;
    }
}
require $blogpath . 'zb_system/admin/admin_header.php';
?>
<script type="text/javascript">
<?php 
$defined_interface = array("action" => array(), "filter" => array(), "response" => array());
if (isset($hooks)) {
    $zbpdk_allhooks =& $hooks;
} else {
    $zbpdk_allhooks =& $GLOBALS;
}
foreach ($zbpdk_allhooks as $temp_name => $temp_value) {
Ejemplo n.º 4
0
/**
 *  XML-RPC应答错误页面
 * @param string $faultString 错误提示字符串
 * @return void 
*/
function RespondError($faultString)
{
    $strXML = '<?xml version="1.0" encoding="UTF-8"?><methodResponse><fault><value><struct><member><name>faultCode</name><value><int>$1</int></value></member><member><name>faultString</name><value><string>$2</string></value></member></struct></value></fault></methodResponse>';
    $faultCode = time();
    $strError = $strXML;
    $strError = str_replace("\$1", TransferHTML($faultCode, "[html-format]"), $strError);
    $strError = str_replace("\$2", TransferHTML($faultString, "[html-format]"), $strError);
    ob_clean();
    echo $strError;
    die;
}
Ejemplo n.º 5
0
 function output_config($type, $name, $convert = TRUE)
 {
     global $zbp;
     $content = $this->config_array[$type][$name]['VALUE'];
     return $convert ? TransferHTML($content, '[html-format]') : $content;
 }
Ejemplo n.º 6
0
/**
 * 过滤tag数据
 * @param $tag
 */
function FilterTag(&$tag)
{
    global $zbp;
    $tag->Name = strip_tags($tag->Name);
    $tag->Alias = TransferHTML($tag->Alias, '[normalname]');
}
Ejemplo n.º 7
0
       <?php 
}
?>
		</div>
		<div id="divIntro" <?php 
if (!$article->Intro) {
    echo 'style="display:none;"';
}
?>
>
       <div id='introheader' class='editmod'><label for="editor_intro" class="editinputname" ><?php 
echo $lang['msg']['intro'];
?>
</label></div>
       <textarea id="editor_intro" name="Intro"><?php 
echo TransferHTML($article->Intro, '[html-format]');
?>
</textarea>
       <div id="introready" style="display:none"><img alt="loading" id="statloading2" src="../image/admin/loading.gif"/>Waiting...</div>
	   <hr/>
    </div>
    <!-- 2号输出接口 -->
       <div id='response2' class='editmod'>
<?php 
foreach ($GLOBALS['Filter_Plugin_Edit_Response2'] as $fpname => &$fpsignal) {
    $fpname();
}
?>
	   </div>

Ejemplo n.º 8
0
function step1()
{
    ?>
<div style="text-indent:2em;" class="text-note">在主题include文件夹内的文件将在这里即时显示。</div>
<div id="help001" style="display:none">
  <p>文本文件指扩展名为txt、htm、js、css等允许用户直接使用记事本修改的文件。多媒体文件指图片、视频等无法直接修改的、只能由用户上传的文件。 </p>
  <p>&nbsp;</p>
  <p>建议图片等使用“多媒体”,广告位、标语等用“文本”。</p>
</div>
<div id="help002" style="display:none">
  <p>指展现给用户看的文字</p>
</div>
<form action="?step=2" method="post">
  <table width="100%" border="1" width="100%" class="tableBorder">
  <tr>
    <th scope="col" height="32" width="150px">文件名</th>
    <th scope="col" width="100px">文件类型 <a id="help01" href="$help001?width=320" class="betterTip" title="帮助">?</a></th>
    <th scope="col">文件注释 <a id="help02" href="$help002?width=320" class="betterTip" title="帮助">?</a></th>
    <th scope="col" width="100px"></th>
  </tr>
  <?php 
    $array = get_theme_data($GLOBALS['blogtheme']);
    foreach ($array as $name => $value) {
        $encode = htmlspecialchars($value['name']);
        ?>
  <tr>
    <td><?php 
        echo $encode;
        ?>
</td>
    <td><select name="tplugin_type_<?php 
        echo $encode;
        ?>
">
        <option value="1">文本</option>
        <option value="2"<?php 
        echo $value["type"] == 1 ? "" : " selected=\"selected\")";
        ?>
>多媒体</option>
      </select></td>
    <td><input type="text" id="<?php 
        echo $encode;
        ?>
" name="tplugin_include_<?php 
        echo $encode;
        ?>
" value="<?php 
        echo TransferHTML($value["value"], '[textarea]');
        ?>
" style="width:98%"/></td>
    </td>
    <td align="center"><a href="javascript:;" class="href-rename" data-name="<?php 
        echo $encode;
        ?>
">改名</a>&nbsp;&nbsp;<a href="javascript:;" class="href-delete" data-name="<?php 
        echo $encode;
        ?>
">删除</a></td>
    <input type="hidden" value="<?php 
        echo $encode;
        ?>
" name="tplugin_name_<?php 
        echo $encode;
        ?>
" />
  </tr>
  <?php 
    }
    ?>
  </table>
  <input type="submit" class="button" value="提交" />
</form>
<script type="text/javascript">
(function(){
	
	$(".href-rename").click(function(){
		var that = $(this)
			p = that.parent().parent().children("td"),
			filename = that.attr("data-name");
			
		$(p[0]).html((function(){
			var str = ['<input type="text" name="tplugin_rename_' + filename + '" ',
					   'value="' + filename + '" />'];
			return str.join("");
		})());
	});
	
	$(".href-delete").click(function(){
		var that = $(this);
		if( that.attr("data-confirm") != "1" )
		{
			that.text("确定?").css("color", "red").attr("data-confirm", 1);
			return false;
		}
		that.parent().parent().fadeOut(1000, function(){
			$(this).html('<input type="hidden" name="tplugin_delete_' + that.attr("data-name") + '" value="1"/>');
		});
	});
	
})();
</script>
<?php 
}
Ejemplo n.º 9
0
*/
if (GetVars('type', 'GET') == 'test') {
    set_error_handler(create_function('', ''));
    set_exception_handler(create_function('', ''));
    register_shutdown_function(create_function('', ''));
    $regex = GetVars('regexp', 'POST');
    $regex = "/(" . $regex . ")/si";
    $matches = array();
    $string = GetVars('string', 'POST');
    $value = preg_match_all($regex, $string, $matches);
    if ($value) {
        foreach ($matches[0] as $v) {
            //echo $v;
            $string = str_replace($v, '$$$fuabcdeck$$a$' . $v . '$$a$fuckd$b$', $string);
        }
        $string = TransferHTML($string, '[html-format]');
        $string = str_replace('$$$fuabcdeck$$a$', '<span style="background-color:#92d050">', $string);
        $string = str_replace('$$a$fuckd$b$', '</span>', $string);
        echo $string;
    } else {
        echo "正则有误或未匹配到:<br/><br/>可能的情况是:<ol><li>少打了某个符号</li><li>没有在[ ] ( ) ^ . ? !等符号前加\\</li></ol>";
    }
    exit;
}
require $blogpath . 'zb_system/admin/admin_header.php';
?>
<style type="text/css">
.text-config {
	width: 95%
}
</style>