</div>
	<?php 
    //读取內容插件或模組
    for ($i = 0; $i < count($arrMainModule); $i++) {
        $mainname = $arrMainModule[$i]['name'];
        $maintitle = replace_string($arrMainModule[$i]['modTitle']);
        $htmlcode = $arrMainModule[$i]['htmlCode'];
        $indexOnly = $arrMainModule[$i]['indexOnly'];
        $installDate = $arrMainModule[$i]['installDate'];
        $pluginPath = $arrMainModule[$i]['pluginPath'];
        //$strModuleContentShow=array("0所有内容头部","1所有内容尾部","2首页内容头部","3首页内容尾部","4首页日志尾部","5读取日志尾部");
        if ($indexOnly == 5) {
            //读取日志尾部
            if ($installDate > 0) {
                //表示为插件
                do_filter($mainname, $mainname, $maintitle, $htmlcode);
            } else {
                main_module($mainname, $maintitle, $htmlcode);
            }
        }
    }
    if ($settingInfo['isLinkTagLog'] == 1 and $tags != "") {
        //取得关联Tag的文章
        $arrTags = explode(";", $tags);
        $tagsql = "";
        for ($y = 0; $y < count($arrTags); $y++) {
            $tagsql .= " or concat(';',tags,';') like '%;" . $arrTags[$y] . ";%'";
        }
        $tagsql = "(" . substr($tagsql, 4) . ") and ";
        $tag_sql = "select * from " . $DBPrefix . "logs where {$tagsql} saveType='1' and id!='{$id}' order by postTime desc limit 0," . $settingInfo['linkTagLog'] . "";
        $tag_result = $DMF->query($tag_sql);
Exemple #2
0
" alt="<?php 
echo $strEditorPluginPage;
?>
"/>
		<a href="../editor/wind/f2mcEditor.php?TB_iframe=true&height=110&width=500" title="<?php 
echo $strEditorPluginMusic;
?>
" class="thickbox"><img src="../images/mm_snd.gif" title="<?php 
echo $strEditorPluginMusic;
?>
" alt="<?php 
echo $strEditorPluginMusic;
?>
" border="0" /></a>
		<?php 
do_filter("f2_editor", $editorcode);
?>
	  </td>
    </tr>
    <tr>
      <td colspan="2">
		<?php 
echo $strAttType . "<font color=red>" . $settingInfo['attachType'] . "</font>";
?>
		<INPUT TYPE="checkbox" NAME="chkname" value="1" <?php 
echo $_POST['chkname'] == 1 ? "checked" : "";
?>
  onclick="onclick_attachment(this.checked)"><?php 
echo $strAttachShowTitle;
?>
		<input class="btn" type="button" name="selectfile" value="<?php 
    //检测输入内容
    if ($_FILES['myfile'] == "") {
        $ActionMessage = $strErrNull;
        $check_info = 0;
        $action = "add";
    }
    //检测允许上传类型
    if ($check_info == 1 && !checkFileType($_FILES["myfile"]["name"])) {
        $ActionMessage = $strAttachmentsError;
        $check_info = 0;
        $action = "add";
    }
    if ($check_info == 1 && $_FILES["myfile"]["name"] != "") {
        //上传
        $attachment = upload_file($_FILES["myfile"]["tmp_name"], $_FILES["myfile"]["name"], $basedir);
        do_filter("f2_attach", $basedir . "/" . $attachment);
    }
}
//保存修改文件名
if ($action == "savefile") {
    $attach_id = $_POST['attach_id'];
    $new_file = $_POST['attach_name'] . substr($attach_id, strrpos($attach_id, "."));
    $sql = "update " . $DBPrefix . "attachments set attTitle='" . $new_file . "' where name like '%" . $attach_id . "'";
    $DMC->query($sql);
}
//其它操作行为:编辑、删除等
if ($action == "operation") {
    $stritem = "";
    $itemlist = $_POST['itemlist'];
    for ($i = 0; $i < count($itemlist); $i++) {
        //echo $basedir.$itemlist[$i];
function formatBlogContent($content, $attr, $logId, $statichtml = 0)
{
    global $settingInfo, $DMC;
    $content = str_replace("../attachments", "attachments", $content);
    $content = str_replace("../editor", "editor", $content);
    $content = preg_replace("/alt=\"open_img\\(&#39;(.+?)&#39;\\)\"/is", "style=\"cursor:pointer;\" onclick=\"open_img(&#39;\\1&#39;)\" alt=\"\\1\"", $content);
    $content = preg_replace("/alt=\"open_img\\(&amp;#39(.+?)&amp;#39\\)\"/is", "style=\"cursor:pointer;\" onclick=\"open_img(&#39;\\1&#39;)\" alt=\"\\1\"", $content);
    $content = preg_replace("/alt=\"open_img\\('(.+?)'\\)\"/is", "style=\"cursor:pointer;\" onclick=\"open_img(&#39;\\1&#39;)\" alt=\"\\1\"", $content);
    if ($attr == 0) {
        //展开与隐藏,首页才隐藏,阅读的时候全展开。
        $content = preg_replace("/<!--hideBegin-->(.+?)<!--hideEnd-->/ie", "makeMoreLess('\\1')", $content);
    }
    if (preg_match("/\\[.+?\\]/i", $content)) {
        $content = ubb($content);
    }
    if (preg_match("/<!--(.*?)Begin-->(.+?)<!--(.*?)End-->/i", $content)) {
        $reg_search = array("/<!--musicBegin-->(.+?)<!--musicEnd-->/ie", "/<!--galleryBegin-->(.+?)<!--galleryEnd-->/ie", "/<!--mfileBegin-->(.+?)<!--mfileEnd-->/ie", "/<!--fileBegin-->(.+?)<!--fileEnd-->/ie", "/<!--fileBegin-->(.+?)<!--fileEnd-->/ie");
        $reg_replace = array("makemusic('\\1')", "makegallery('\\1')", "makemfile('\\1',{$statichtml})", "makefile('\\1',{$statichtml})");
        $content = preg_replace($reg_search, $reg_replace, $content);
    }
    //插件
    $content = do_filter("f2_content", $content, $logId);
    //自动转换连接,非常耗时
    if ($settingInfo['autoUrl'] == 1) {
        $content = preg_replace("/([^\\/\"\\'\\=\\>&#39;&quot;])(mms|http|ftp|telnet)\\:\\/\\/(.[^ \r\n\\<\"\\'\\)]+)/is", "\\1<a href=\"\\2://\\3\" target=\"_blank\">\\2://\\3</a>", $content);
    }
    //显示关键字,非常耗时
    if ($settingInfo['showKeyword'] == 1) {
        $content = repKeyword($content);
    }
    //mysql4.0下
    if ($DMC->getServerInfo() < '4.1') {
        $content = stripslashes($content);
    }
    return $content;
}
Exemple #5
0
if ($action == "save") {
    if (count($_FILES) == 1) {
        $attachment_file = $_FILES["attfile"]["tmp_name"];
        $path = "../attachments/month_" . date("Ym");
        $fileName = $_FILES["attfile"]["name"];
        $fileSize = $_FILES["attfile"]["size"];
        $info = $fileName . " (" . formatFileSize($fileSize) . ")";
        if (!checkFileSize($fileSize)) {
            print_message($strAttachmentsError1 . formatFileSize($cfg_upload_size));
        } else {
            $attachment = upload_file($attachment_file, $fileName, $path);
            if ($attachment == "") {
                print_message($strAttachmentsError);
            } else {
                $value = "month_" . date("Ym") . "/" . $attachment;
                do_filter("f2_attach", "../attachments/" . $value);
                //写进数据库
                $fileType = getFileType($fileName);
                if ($imageAtt = @getimagesize($path . "/" . $attachment)) {
                    $fileWidth = $imageAtt[0];
                    $fileHeight = $imageAtt[1];
                } else {
                    $fileWidth = 0;
                    $fileHeight = 0;
                }
                $rsexits = getFieldValue($DBPrefix . "attachments", "attTitle='" . $fileName . "' and fileType='" . $fileType . "' and fileSize='" . $fileSize . "'", "name");
                if ($rsexits == "") {
                    $sql = "INSERT INTO " . $DBPrefix . "attachments(name,attTitle,fileType,fileSize,fileWidth,fileHeight,postTime) VALUES ('{$value}','{$fileName}','{$fileType}','{$fileSize}','{$fileWidth}','{$fileHeight}','" . time() . "')";
                    $DMC->fetchArray($DMC->query($sql));
                } else {
                    print_message($strDataExists);
<?php

do_action('before_title');
?>

<h1><?php 
echo do_filter('title', 'This is my title');
?>
</h1>

<?php 
do_action('after_title');
?>

<?php 
do_action('before_content');
?>

<?php 
echo do_filter('content', $content);
?>

<?php 
do_action('after_content');
Exemple #7
0
function apply_filters( &$controller, $action, $before_filters, $after_filters )
{
	do_filter( $controller, $action, $before_filters );
	$controller->$action();
	do_filter( $controller, $action, $after_filters );
}
Exemple #8
0
		<li class="menuL"></li>
		<?php 
//读取顶部栏
for ($i = 0; $i < count($arrTopModule); $i++) {
    $topid = $arrTopModule[$i]['id'];
    $topname = $arrTopModule[$i]['name'];
    $toptitle = replace_string($arrTopModule[$i]['modTitle']);
    $htmlcode = $arrTopModule[$i]['htmlCode'];
    $pluginPath = $arrTopModule[$i]['pluginPath'];
    $installDate = $arrTopModule[$i]['installDate'];
    if ($pluginPath == "#") {
        echo "<li><a class=\"menuA\" id=\"{$topname}\" title=\"{$toptitle}\">{$toptitle}</a>" . str_replace("&quot;", "\"", dencode($htmlcode)) . "</li> \n";
    } else {
        if (strpos($pluginPath, ".inc.php") > 0 || strpos($pluginPath, ".big.php") > 0) {
            echo "<li><a class=\"menuA\" id=\"{$topname}\" title=\"{$toptitle}\" href=\"index.php?load={$topname}\">{$toptitle}</a></li> \n";
        } else {
            if ($installDate > 0) {
                //表示为插件
                do_filter($topname, $topname, $toptitle);
            } else {
                echo "<li><a class=\"menuA\" id=\"{$topname}\" title=\"{$toptitle}\" href=\"{$pluginPath}\">{$toptitle}</a></li> \n";
            }
        }
    }
}
?>
        
        <li class="menuR"></li>
      </ul>
    </div>
  </div>
function formatBlogContent($content, $attr, $logId)
{
    global $plugins_path;
    $content = str_replace("../attachments", "attachments", $content);
    $content = str_replace("alt=\"open_img", "onclick=\"open_img", $content);
    $content = str_replace("../editor/plugins/", "editor/plugins/", $content);
    if ($attr == 0) {
        $content = preg_replace("/<!--hideBegin-->(.+?)<!--hideEnd-->/ie", "makeMoreLess('\\1')", $content);
    }
    $reg_search = array("/<!--musicBegin-->(.+?)<!--musicEnd-->/ie", "/<!--galleryBegin-->(.+?)<!--galleryEnd-->/ie", "/<!--fileBegin-->(.+?)<!--fileEnd-->/ie", "/([^\\/\"\\'\\=\\>&#39;&quot;])(mms|http|ftp|telnet)\\:\\/\\/(.[^ \r\n\\<\"\\'\\)]+)/is");
    $reg_replace = array("makemusic('\\1')", "makegallery('\\1')", "makefile('\\1')", "\\1<a href=\"\\2://\\3\" target=\"_blank\">\\2://\\3</a>");
    $content = preg_replace($reg_search, $reg_replace, $content);
    $content = repKeyword($content);
    //插件
    $content = do_filter("f2_content", $content, $logId);
    return $content;
}
Exemple #10
0
$key = 1;
while ($aryDetail = $DMC->fetchArray($result)) {
    //	var_dump($aryDetail);
    if (strpos($aryDetail['modTitle'], "[/var]") > 0) {
        $aryDetail['modTitle'] = replace_string($aryDetail['modTitle']);
    }
    $topname = is_int($key) ? $aryDetail['name'] : $key;
    $toptitle = $aryDetail['modTitle'];
    $htmlcode = $aryDetail['htmlCode'];
    $pluginPath = $aryDetail['pluginPath'];
    $installDate = empty($aryDetail['installDate']) ? "" : $aryDetail['installDate'];
    $indexOnly = $aryDetail['indexOnly'];
    $gourl = "index.php?load={$topname}";
    if ($installDate > 0) {
        //表示为插件
        do_filter("'.{$topname}.'", "'.{$topname}.'", "',{$toptitle}.'");
    } else {
        print "<li><a class=\"menuA\" id=\"{$topname}\" title=\"{$toptitle}\" href=\"{$gourl}\">{$toptitle}</a></li> \n";
    }
    $k++;
}
?>
                <li class="menuR"></li>
            </ul>
        </div>
    </div>
    <!--内容-->
    <div id="Tbody">
        <!--正文-->
        <div id="mainContent">
            <div id="innermainContent">
            case "archives":
                side_archive($sidename, $sidetitle, $isInstall);
                #归档8
                break;
            case "statistics":
                side_bloginfo($sidename, $sidetitle, $isInstall);
                #日志信息9
                break;
            case "aboutBlog":
                side_description($sidename, $sidetitle, $isInstall);
                #blog说明11
                break;
            case "search":
                side_search($sidename, $sidetitle, $isInstall);
                #搜索13
                break;
            case "skinSwitch":
                side_skin_switch($sidename, $sidetitle, $isInstall);
                #皮肤转换14
                break;
        }
    } else {
        if ($installDate > 0) {
            //表示为插件
            do_filter($sidename, $sidename, $sidetitle, $htmlcode, $isInstall);
        } else {
            //自定HTML代码
            side_other($sidename, $sidetitle, $htmlcode, $isInstall);
        }
    }
}