Exemplo n.º 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;
}
Exemplo n.º 2
0
<?php

header("Content-Type: text/html; charset=utf-8");
include_once "include/function.php";
include_once F2BLOG_ROOT . "./cache/cache_members.php";
//下载文件
if ($settingInfo['showPrint'] == 1) {
    $sql = "select id,logTitle,logContent,postTime,author,password from " . $DBPrefix . "logs where id='" . $_GET['id'] . "' and saveType='1'";
    if ($fa = $DMC->fetchArray($DMC->query($sql))) {
        if ($fa['password'] != "" && strpos(";" . $_SESSION['logpassword'], $fa['password']) < 1 && $_SESSION['rights'] != "admin") {
            $content = $strLogPasswordHelp;
        } else {
            $content = formatBlogContent($fa['logContent'], 1, $fa['id']);
            if (!empty($fa['logsediter']) && $fa['logsediter'] == "ubb") {
                $content = nl2br($content);
            }
        }
        $author = $memberscache[$fa['author']] != "" ? $memberscache[$fa['author']] : $fa['author'];
        echo "<font size=\"5\"><b>{$fa['logTitle']}</b></font><br /><br />\n";
        echo "<font size=\"2\">{$strAuthor}: " . $author . " &nbsp;\n";
        echo "{$strLogDate}: " . format_time("Y-m-d H:i:s", $fa['postTime']) . " &nbsp;\n";
        echo "{$strLogRead}: " . $settingInfo['blogUrl'] . "index.php?load=read&id=" . $fa['id'] . "</font>\n";
        echo "<hr style=\"color:#CCCCCC;height:1px;\"/>\n\n";
        echo $content;
    } else {
        echo "<script language=\"Javascript\"> \n";
        echo "alert(\"{$strErrorNoExistsLog}\");\n";
        echo "window.close();\n";
        echo "</script>\n";
    }
} else {
Exemplo n.º 3
0
     $str = "";
     while ($fa = $DMC->fetchArray($find_result)) {
         $str .= " or a.cateId='" . $fa['id'] . "'";
     }
     $find .= " and (" . substr($str, 4) . ")";
     $sql = "select a.logsediter,a.password,a.cateId,a.logTitle,a.logContent,a.author,a.postTime,b.name,a.id as cid from " . $DBPrefix . "logs as a inner join " . $DBPrefix . "categories as b on a.cateId=b.id where (a.saveType=1 or a.saveType=3) {$find} order by a.postTime desc";
 } else {
     $sql = "select a.logsediter,a.password,a.cateId,a.logTitle,a.logContent,a.author,a.postTime,b.name,a.id as cid from " . $DBPrefix . "logs as a inner join " . $DBPrefix . "categories as b on a.cateId=b.id where a.saveType=1 or a.saveType=3 order by a.postTime desc";
 }
 $rssbody = "";
 $rows = 0;
 $p = 1;
 $error = "";
 $result = $DMC->query($sql);
 while ($row = $DMC->fetchArray($result)) {
     $content = formatBlogContent($row['logContent'], 0, $row['cid']);
     if ($row['logsediter'] == "ubb") {
         $content = nl2br($content);
     }
     $rssbody .= "<item>\r\n";
     $rssbody .= "\t<link>" . $home_url . "index.php?load=read&amp;id=" . $row['cid'] . "</link>\r\n";
     $rssbody .= "\t<title><![CDATA[" . $row['logTitle'] . "]]></title>\r\n";
     $rssbody .= "\t<author>" . $row['author'] . "</author>\r\n";
     $rssbody .= "\t<category><![CDATA[" . $row['name'] . "]]></category>\r\n";
     $rssbody .= "\t<pubDate>" . format_time("L", $row['postTime']) . "</pubDate>\r\n";
     $rssbody .= "\t<guid>" . $home_url . "index.php?load=read&amp;id=" . $row['cid'] . "</guid>\r\n";
     $rssbody .= "\t<description><![CDATA[" . $content . "]]></description>\r\n";
     $rssbody .= "</item>\r\n";
     $rows++;
     if ($rows >= $recordNum) {
         $filename = $backup . ("_v" . $p . $filext);
Exemplo n.º 4
0
} else {
    echo format_time("Y-m-d H:i:s", time());
}
?>
</updated> 
<?php 
foreach ($arr_array as $key => $fa) {
    if ($fa['password'] != "" && strpos(";" . $_SESSION['logpassword'], $fa['password']) < 1 && $_SESSION['rights'] != "admin") {
        $content = "<img src=\"" . $home_url . "images/icon_lock.gif\" alt=\"\" /> {$strLogPasswordHelp} \n";
    } else {
        $content = $fa['logContent'];
        $rssLength = $settingInfo['rssLength'] < 1 ? 500 : $settingInfo['rssLength'];
        if ($settingInfo['rssContentType'] == "1") {
            $content = htmlSubString($content, $rssLength);
        }
        $content = formatBlogContent($content, 0, $fa['cid']);
        $content = str_replace("attachments/", $home_url . "attachments/", $content);
        $content = preg_replace("/src=\"([^http].*?)\"/is", "src=\"{$home_url}\\1\"", $content);
        $content = str_replace("download.php", $home_url . "download.php", $content);
        if ($fa['logsediter'] == "ubb") {
            $content = nl2br($content);
        }
    }
    $author = empty($fa['nickname']) ? $fa['author'] : $fa['nickname'];
    ?>
<entry>
  <title type="html"><![CDATA[<?php 
    echo $fa['logTitle'];
    echo $fa['saveType'] == 3 ? " [{$strHidLog}]" : "";
    ?>
]]></title>
Exemplo n.º 5
0
                     $content_index = formatBlogContent($content_index, 0, $fa['id'], 1);
                     if ($fa['logsediter'] == "ubb") {
                         $content_index = nl2br($content_index);
                     }
                     $content_index .= "<p><a class=\"more\" href=\"{$gourl}" . $fa['id'] . $settingInfo['stype'] . "\">[{$strContentAll}]</a></p> \n";
                 } else {
                     $content_index = htmlSubString($content, $fa['autoSplit']);
                     $content_index = formatBlogContent($content_index, 0, $fa['id'], 1);
                     if ($fa['logsediter'] == "ubb") {
                         $content_index = nl2br($content_index);
                     }
                 }
             }
         }
         //生成阅读日志
         $content = formatBlogContent($content, 0, $fa['id'], 1);
         if ($fa['logsediter'] == "ubb") {
             $content = nl2br($content);
         }
         //生成静态页面
         if ($content_index != "") {
             writetohtml($html_path . "/" . $fa['id'] . "_index", $content_index);
         }
         writetohtml($html_path . "/" . $fa['id'], $content);
     }
 }
 $next_index = $_GET['index'] + 1;
 header("Content-Type: text/html; charset=utf-8");
 if ($next_index < count($array_logid) + 1) {
     $url = "create_html.inc.php?edittype=" . $_GET['edittype'] . "&arrayhtmlid=" . $_GET['arrayhtmlid'] . "&index={$next_index}";
     $content = "{$strLogsCreateHtmlAlert1}" . $_GET['index'] . "/" . count($array_logid) . "{$strLogsCreateHtmlAlert2}";
Exemplo n.º 6
0
	<url><?php 
echo $site_home . "attachments/" . $settingInfo['logo'];
?>
</url> 
	<link><?php 
echo $site_home;
?>
</link> 
	<description><?php 
echo $settingInfo['name'];
?>
</description> 
</image>
<?php 
for ($k = 0; $k < count($arr_array); $k++) {
    $content = str_replace("attachments/", $site_home . "attachments/", formatBlogContent($arr_array[$k]['logContent']));
    $content = str_replace("images/", $site_home . "images/", $content);
    $content = str_replace("download.php", $site_home . "download.php", $content);
    ?>
<item>
	<link><?php 
    echo $site_home . "index.php?load=read&amp;id=" . $arr_array[$k]['cid'];
    ?>
</link>
	<title><![CDATA[<?php 
    echo $arr_array[$k]['logTitle'];
    ?>
]]></title>
	<author><?php 
    echo $arr_array[$k]['author'];
    ?>