Exemple #1
0
function get_pagepost($post_id, $curpage, $id)
{
    global $DBPrefix, $strContentAll;
    //$post = getRecordValue($post_id);
    $post = getRecordValue($DBPrefix . "logs", " id='{$post_id}'");
    $content = $post['logContent'];
    $pages = preg_split("/(<p>)?\\s*<!--\\s*nextpage\\s*-->\\s*(<\\/p>)?/is", $content, -1, PREG_SPLIT_NO_EMPTY);
    $totalpage = count($pages);
    if ($curpage > 0) {
        $content = formatBlogContent($pages[$curpage - 1], 0);
    } else {
        for ($i = 0; $i < count($pages); $i++) {
            $pages[$i] = formatBlogContent($pages[$i], 0);
        }
        $content = join('', $pages);
    }
    if ($curpage > 0) {
        $pagebar = "<a href=\"###pp=0\" onclick=\"pagepost({$post_id}, 0, {$id});\">&#23436;&#25972;&#26174;&#31034;</a> &nbsp; ";
    } else {
        $pagebar = '<strong style="color: green">&#23436;&#25972;&#26174;&#31034;</strong> &nbsp; ';
    }
    for ($i = 1; $i <= $totalpage; $i++) {
        if ($i != $curpage) {
            $pagebar .= "<a href=\"###pp={$i}\" onclick=\"pagepost({$post_id}, {$i}, {$id});\">{$i}</a> ";
        } else {
            $pagebar .= "<strong style=\"color: green\">{$i}</strong> ";
        }
    }
    $pagebar_top = "<div id=\"pagebar_top_{$id}\" class=\"pagebar\">" . $pagebar . "</div>";
    $pagebar_bottom = "<div id=\"pagebar_bottom_{$id}\" class=\"pagebar\">" . $pagebar . "</div>";
    //$content=substr($content,0,strpos($content,"<!--more-->"));
    //$content.="<p><a class=\"more\" href=\"index.php?load=read&id=".$post_id."\">[$strContentAll]</a></p> \n";
    echo $pagebar_top . $content . $pagebar_bottom;
}
Exemple #2
0
        categories_recache();
        settings_recache();
        recentLogs_recache();
        recentComments_recache();
        archives_recache();
        calendar_recache();
        attachments_recache();
        logsTitle_recache();
        logs_sidebar_recache($arrSideModule);
    }
}
//引用传送
if ($action == "sendtb") {
    $mark_id = $_GET['mark_id'];
    $quoteUrl = $_POST['quoteUrl'];
    $dataInfo = getRecordValue($DBPrefix . "logs", " id='{$mark_id}'");
    header("Content-Type: text/html; charset=utf-8");
    $pingurl = explode(";", $quoteUrl);
    $logurl = $settingInfo['blogUrl'] . "index.php?load=read&id={$mark_id}";
    foreach ($pingurl as $durl) {
        $result = send_trackback($durl, $dataInfo['logTitle'], $dataInfo['logContent'], $logurl);
        //echo $ActionMessage.=$durl." : ".$result."\n";
    }
    if ($result == "ok") {
        $quoteUrl = $dataInfo['quoteUrl'] == "" ? $quoteUrl : $dataInfo['quoteUrl'] . ";" . $quoteUrl;
        $modify_sql = "UPDATE " . $DBPrefix . "logs set quoteUrl='{$quoteUrl}' WHERE id='{$mark_id}'";
        $DMC->query($modify_sql);
        $ActionMessage = "{$strSendTbSucc}";
        $action = "";
    } else {
        $ActionMessage = "{$strSendTbError}" . $result;
    $my = getRecordValue($DBPrefix . "comments", " id='{$mark_id}'");
    $logId = $my['logId'];
    //add_bloginfo("tbNums","minus",1);
    //update_num($DBPrefix."logs","quoteNums"," id='$logId'","minus",1);
    $sql = "delete from " . $DBPrefix . "comments where id='{$mark_id}'";
    $DMC->query($sql);
    header("Location:../index.php?load=read&id={$logId}");
}
//其它操作行为:编辑、删除等
if ($action == "operation") {
    $stritem = "";
    $itemlist = $_POST['itemlist'];
    $otype = $_POST['operation'] == "show" ? "adding" : "minus";
    $nums = 0;
    for ($i = 0; $i < count($itemlist); $i++) {
        $my = getRecordValue($DBPrefix . "comments", " id='{$itemlist[$i]}'");
        $logId = $my['logId'];
        $isSecret = $my['isSecret'];
        if ($_POST['operation'] == "delete" or $_POST['operation'] == "show" and $isSecret == 1 or $_POST['operation'] == "hidden" and $isSecret == 0) {
            update_num($DBPrefix . "logs", "commNums", " id='{$logId}'", $otype, 1);
            $nums = $nums + 1;
            if ($stritem != "") {
                $stritem .= " or id='{$itemlist[$i]}'";
            } else {
                $stritem .= "id='{$itemlist[$i]}'";
            }
            //删除的是主留言,其子留言也删除
            if ($_POST['operation'] == "delete") {
                $stritem .= " or parent='{$itemlist[$i]}'";
            }
        }
    addFilterUrl($my['blogUrl']);
    filters_recache();
    $sql = "delete from " . $DBPrefix . "trackbacks where id='{$mark_id}'";
    $DMC->query($sql);
    settings_recount("trackbacks");
    settings_recache();
    header("Location:../index.php?load=read&id={$logId}");
}
//其它操作行为:编辑、删除等
if ($action == "operation") {
    $stritem = "";
    $itemlist = $_POST['itemlist'];
    $otype = $_POST['operation'] == "show" ? "adding" : "minus";
    $nums = 0;
    for ($i = 0; $i < count($itemlist); $i++) {
        $my = getRecordValue($DBPrefix . "trackbacks", " id='{$itemlist[$i]}'");
        $logId = $my['logId'];
        $isApp = $my['isApp'];
        if ($_POST['operation'] == "delete" or $_POST['operation'] == "show" and $isApp == 0 or $_POST['operation'] == "hidden" and $isApp == 1) {
            if ($_POST['operation'] != "delete" or $_POST['operation'] == "delete" and $my['isApp'] == 1) {
                update_num($DBPrefix . "logs", "quoteNums", " id='{$logId}'", $otype, 1);
            }
            $nums = $nums + 1;
            if ($stritem != "") {
                $stritem .= " or id='{$itemlist[$i]}'";
            } else {
                $stritem .= "id='{$itemlist[$i]}'";
            }
            if ($_POST['operation'] == "delete") {
                //加入刪除的引用網址到過濾列表
                addFilterUrl($my['blogUrl']);
function getLogs($logId)
{
    global $DBPrefix;
    $dataInfo = getRecordValue($DBPrefix . "logs", "id='{$logId}'");
    return $dataInfo;
}
<?php

$PATH = "./";
include "{$PATH}/function.php";
// 验证用户是否处于登陆状态
check_login();
//保存参数
$action = $_GET['action'];
$order = $_GET['order'];
$page = $_GET['page'];
$seekname = $_REQUEST['seekname'];
$mark_id = $_GET['id'];
if ($action == "deltb") {
    $my = getRecordValue($DBPrefix . "guestbook", " id='{$mark_id}'");
    $logId = $my['logId'];
    //add_bloginfo("tbNums","minus",1);
    update_num($DBPrefix . "logs", "quoteNums", " id='{$logId}'", "minus", 1);
    $sql = "delete from " . $DBPrefix . "guestbook where id='{$mark_id}'";
    $DMC->query($sql);
    header("Location:../index.php?load=read&id={$logId}");
}
//其它操作行为:编辑、删除等
if ($action == "operation") {
    $stritem = "";
    $itemlist = $_POST['itemlist'];
    $otype = $_POST['operation'] == "show" ? "adding" : "minus";
    $nums = 0;
    for ($i = 0; $i < count($itemlist); $i++) {
        if ($stritem != "") {
            $stritem .= " or id='{$itemlist[$i]}'";
        } else {
function nfo($source)
{
    global $DMC, $DBPrefix;
    if (!empty($source) && file_exists($source)) {
        $filext = substr($source, -3);
        if ($filext == "nfo") {
            include "../plugins/nfo/nfo_config.php";
            include "../plugins/nfo/class.NFOPiC.php";
            $pos = strrpos($source, "/");
            $savedir = substr($source, 1, $pos);
            $savedir = F2BLOG_ROOT . str_replace("../", "./", $savedir);
            $nfoname = substr($source, $pos + 1, 15);
            $pic_name = str_replace(".nfo", "." . $imgtype, $nfoname);
            $nfopic = new NFOPiC($nfoname);
            $nfopic->setvar("server_save_dir", $savedir);
            $nfopic->setvar("nfo-dir", $savedir);
            $nfopic->setvar("fontcolor", $txtcolor);
            $nfopic->setvar("bgcolor", $bgcolor);
            $nfopic->setvar("pic_name", $pic_name);
            $nfopic->nfo2pic($imgtype);
            @unlink($source);
            //更新数据内容
            $targetname = str_replace("../attachments/", "", $source);
            $att = getRecordValue($DBPrefix . "attachments", "name='{$targetname}'");
            $newname = str_replace(".nfo", "." . $imgtype, strtolower($att['name']));
            $newtitle = str_replace(".nfo", "." . $imgtype, strtolower($att['attTitle']));
            $gid = $att['id'];
            $imageAtt = @getimagesize($savedir . $pic_name);
            $fileWidth = $imageAtt[0];
            $fileHeight = $imageAtt[1];
            $fileSize = @filesize($savedir . $pic_name);
            $sql = "update {$DBPrefix}attachments set name='{$newname}',attTitle='{$newtitle}',fileType='{$imgtype}',fileSize='{$fileSize}',fileHeight='{$fileHeight}',fileWidth='{$fileWidth}' where id='{$gid}'";
            $DMC->query($sql);
        }
    }
}
<?php

include_once "include/function.php";
include_once "include/cache.php";
//下载文件
$id = $_GET['id'];
if (is_numeric($id)) {
    $attInfo = getRecordValue($DBPrefix . "attachments", " id='{$id}' or name like '%{$id}'");
    if ($attInfo) {
        $file_path = $attInfo['name'];
        $filename = $attInfo['attTitle'];
        $filetime = $attInfo['postTime'];
        $fileType = $attInfo['fileType'];
        //UTF8中文名在Firefox下显示正常,但在IE下会出现乱码。
        $filename = strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') > 0 ? urlencode($filename) : $filename;
        //非法盗连
        if ($settingInfo['downcode'] == 1) {
            $urlself = $_SERVER['HTTP_HOST'];
            $referer = empty($_SERVER['HTTP_REFERER']) ? "" : $_SERVER['HTTP_REFERER'];
            if (strpos(";{$referer}", $urlself) < 1) {
                ?>
			<head>
			<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
			<meta http-equiv="Content-Language" content="UTF-8" />
			<meta http-equiv="pragma" content="no-cache">
			<meta http-equiv="refresh" content="3; url=index.php?load=read&amp;id=<?php 
                echo $attInfo['logId'];
                ?>
"> 
			<title><?php 
                echo $strDownloadNoValid;
function makefile($fileid)
{
    global $DMF, $DBPrefix, $strDownFile1, $strDownFile2, $strPlayMusic, $strOnlinePlay, $strOnlineStop, $strDownload, $strRightBtnSave;
    $kkstr = "";
    $arrId = explode("|", $fileid);
    for ($i = 0; $i < count($arrId); $i++) {
        $aid = $arrId[$i];
        //地址有可能是ID,也可能是文件路径。
        $dataInfo = getRecordValue($DBPrefix . "attachments", " id='{$aid}' or name like '%{$aid}'");
        if ($dataInfo != "") {
            if (in_array($dataInfo['fileType'], array('wma', 'mp3', 'rm', 'ra', 'qt', 'wmv'))) {
                for ($index = 0; $index < 4; $index++) {
                    $default_id .= rand(0, 9);
                }
                $fid = "music" . $default_id;
                $kkstr .= "<div class=\"UBBPanel\">";
                $kkstr .= "<div class=\"UBBTitle\"><img src=\"images/music.gif\" alt=\"\" style=\"margin:0px 2px -3px 0px\" border=\"0\"/>{$strPlayMusic} -- " . $dataInfo['attTitle'] . "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style='font-weight:normal;'><a href='" . $arrId[0] . "'>{$strDownload}</a>" . "&nbsp;({$strRightBtnSave})</span></div>";
                $kkstr .= "<div class=\"UBBContent\">";
                $kkstr .= "<a id=\"" . $fid . "_href\" href=\"javascript:MediaShow('" . $dataInfo['fileType'] . "','{$fid}','attachments/" . $dataInfo['name'] . "','400','300','{$strOnlinePlay}','{$strOnlineStop}')\">";
                $kkstr .= "<img name=\"" . $fid . "_img\" src=\"images/mm_snd.gif\" style=\"margin:0px 3px -2px 0px\" border=\"0\" alt=\"\"/>";
                $kkstr .= "<span id=\"" . $fid . "_text\">{$strOnlinePlay}</span></a><div id=\"" . $fid . "\">";
                $kkstr .= "</div></div></div>";
            } else {
                $kkstr .= "<img src=\"images/download.gif\" alt=\"{$strDownFile}\" style=\"margin:0px 2px -4px 0px\"/><a href=\"download.php?id={$aid}\">" . $dataInfo['attTitle'] . "</a>&nbsp;({$strDownFile1}" . $dataInfo['downloads'] . "{$strDownFile2})";
            }
        }
    }
    return $kkstr;
}
<?php

include_once "include/function.php";
if ($_GET['author'] != "") {
    $userinfo = getRecordValue($DBPrefix . "members", "username='******'author'] . "'");
    $show_user['username'] = $userinfo['username'];
    $show_user['nickname'] = $userinfo['nickname'];
    $show_user['email'] = $userinfo['email'];
    $show_user['homepage'] = $userinfo['homePage'];
}
if ($_GET['userid'] != "") {
    $userinfo = getRecordValue($DBPrefix . "guestbook", "id='" . $_GET['userid'] . "'");
    $show_user['nickname'] = $userinfo['author'];
    $show_user['email'] = $userinfo['email'];
    $show_user['homepage'] = $userinfo['homepage'];
}
//装载头部文件
include_once "header.php";
?>
<!--内容-->
<div id="Tbody">
<br/><br/>
   <div style="text-align:center;">
    <div id="MsgContent" style="width:420px">
      <div id="MsgHead"><?php 
echo $strUserInfoShow;
?>
</div>
      <div id="MsgBody">		  
		  <table width="100%" cellpadding="0" cellspacing="0">	 
			<?php