コード例 #1
0
ファイル: www2-board.php プロジェクト: bianle/www2
 function find_content($parent, $name)
 {
     $nodes = $parent->child_nodes();
     while ($node = array_shift($nodes)) {
         if ($node->node_name() == $name) {
             return undo_html_format(urldecode(get_content($node)));
         }
     }
     return "";
 }
コード例 #2
0
ファイル: pcnsearch.php プロジェクト: bianle/www2
function pc_search_display_result($rows, $keyword)
{
    global $pcconfig;
    if ($rows[htmltag]) {
        $rows[body] = undo_html_format(strip_tags($rows[body]));
    }
    $bodylen = strlen($rows[body]);
    if ($bodylen < 500) {
        $body = $rows[body];
    } else {
        $keypos = array();
        foreach ($keyword as $key) {
            $keypos[$key] = strpos($rows[body], $key) - 100;
        }
        $start = min($keypos);
        if ($start > 0) {
            $body = "... " . substr($rows[body], $start, 500) . " ...";
        } else {
            $body = substr($rows[body], 0, 500) . " ...";
        }
    }
    @($body = pc_search_special_keyword(html_format($body), $keyword));
    ?>
<table cellspacing="0" cellpadding="3" border="0" class="f1" width="500">
<tr><td>
<font class="f5">
<a href="pccon.php?<?php 
    echo "id=" . $rows[uid] . "&nid=" . $rows[nid] . "&tid=" . $rows[tid];
    ?>
">
<?php 
    echo pc_search_special_keyword(html_format($rows[subject]), $keyword);
    ?>
&nbsp;
</a>
</font>
</td></tr>
<tr><td class="f6">
<?php 
    echo $body;
    ?>
</td></tr>
<tr><td>
<font color="#336600">
http://<?php 
    echo $pcconfig["SITE"];
    ?>
/pc/pccon.php?<?php 
    echo "id=" . $rows[uid] . "&nid=" . $rows[nid] . "&tid=" . $rows[tid];
    ?>
&nbsp;-<?php 
    echo (int) (strlen($rows[body] . $rows[subject]) / 100) / 10;
    ?>
K-
<?php 
    echo time_format($rows[created]);
    ?>
-
</font>
</td></tr>
</table><br><br>	
<?php 
}
コード例 #3
0
ファイル: pcmanage.php プロジェクト: bianle/www2
     $log_action = "DEL TOPIC: " . $topicname;
     pc_return("pcdoc.php?userid=" . $pc["USER"] . "&tag=6");
 } elseif ($act == "tadd" && $_POST["topicname"]) {
     if (!pc_add_topic($link, $pc, $_POST["access"], $_POST["topicname"])) {
         html_error_quit("分类添加失败");
         exit;
     }
     $log_action = "ADD TOPIC: " . $_POST["topicname"];
     pc_return("pcdoc.php?userid=" . $pc["USER"] . "&tag=6");
 } elseif ($act == "sedit" && $_POST["pcname"]) {
     $favmode = (int) $_POST["pcfavmode"];
     if ($favmode != 1 && $favmode != 2) {
         $favmode = 0;
     }
     $tmpsave = $_POST["pctmpsave"] == 0 ? 0 : 1;
     $query = "UPDATE `users` SET `createtime` = `createtime` , `corpusname` = '" . addslashes(undo_html_format($_POST["pcname"])) . "',`description` = '" . addslashes(undo_html_format($_POST["pcdesc"])) . "',`theme` = '" . addslashes(undo_html_format($_POST["pcthem"])) . "' , `backimage` = '" . addslashes(undo_html_format($_POST["pcbkimg"])) . "' , `logoimage` = '" . addslashes(undo_html_format($_POST["pclogo"])) . "' , `htmleditor` = '" . (int) $_POST["htmleditor"] . "', `style` = '" . (int) $_POST["template"] . "' , `indexnodechars` = '" . (int) $_POST["indexnodechars"] . "' , `indexnodes` = '" . (int) $_POST["indexnodes"] . "' , `favmode` = '" . $favmode . "' , `useremail` = '" . addslashes(trim($_POST["pcuseremail"])) . "' , `userinfor` = '" . addslashes(trim($_POST["userinfor"])) . "' , `defaulttopic` = '" . addslashes(trim($_POST["pcdefaulttopic"])) . "'";
     if (defined("_BLOG_ANONY_COMMENT_")) {
         $query .= " , `anonycomment` = " . ($_POST["anonycomment"] == "yes" ? "1" : "0");
     }
     $query .= " WHERE `uid` = '" . $pc["UID"] . "';";
     mysql_query($query, $link);
     $log_action = "UPDATE SETTINGS";
     pc_return("pcdoc.php?userid=" . $pc["USER"] . "&tag=7");
 } elseif ($act == "adddir" && $_POST["dir"]) {
     $ret = pc_add_favdir($link, $pc, $_POST["pid"], $_POST["dir"]);
     switch ($ret) {
         case -1:
             html_error_quit("缺少Blog信息!");
             exit;
         case -2:
             html_error_quit("缺少父目录ID!");
コード例 #4
0
ファイル: pcfuncs.php プロジェクト: bianle/www2
function pc_fwd_getbody($node)
{
    global $pcconfig;
    $body = "【以下文章转自 " . $node[username] . " 的BLOG:" . $node[corpusname] . "】\n";
    $body .= "BLOG地址:http://" . $pcconfig["SITE"] . "/pc/index.php?id=" . $node[username] . "\n";
    $body .= "日志地址:http://" . $pcconfig["SITE"] . "/pc/pccon.php?id=" . $node[uid] . "&nid=" . $node[nid] . "&s=all\n\n\n";
    $body .= "    " . $node[subject] . "\n\n";
    if ($node[htmltag]) {
        $content = $node[body];
        $content = eregi_replace("<p>", "", $content);
        $content = eregi_replace("</p>", "\n\n", $content);
        $content = eregi_replace("&nbsp;", " ", $content);
        $content = eregi_replace("<br />", "\n", $content);
        $content = undo_html_format(strip_tags($content));
        $body .= $content;
    } else {
        $body .= $node[body];
    }
    return $body;
}
コード例 #5
0
ファイル: pcstyle.php プロジェクト: bianle/www2
     exit;
 }
 if (!pc_is_admin($currentuser, $pc)) {
     pc_db_close($link);
     html_error_quit("对不起,您要查看的Blog不存在");
     exit;
 }
 if ($_POST["key"] == "indexxsl" || $_POST["key"] == "nodexsl" || $_POST["key"] == "css") {
     $query = "SELECT uid FROM userstyle WHERE uid = " . $pc["UID"] . ";";
     $result = mysql_query($query, $link);
     $rows = mysql_fetch_array($result);
     mysql_free_result($result);
     if ($rows) {
         $query = "UPDATE userstyle SET `" . $_POST["key"] . "` = '" . addslashes(undo_html_format($_POST["userstyle"])) . "' , `hostname` = '" . addslashes($_SERVER["REMOTE_ADDR"]) . "' , `stylesheet` = '" . intval($_POST["stylesheet"]) . "' WHERE uid = " . $pc["UID"] . " ;";
     } else {
         $query = "INSERT INTO `userstyle` ( `uid` , `username` , `hostname` , `changed` , `" . $_POST["key"] . "` , `stylesheet` ) " . "VALUES ('" . $pc["UID"] . "', '" . addslashes($pc["USER"]) . "', '" . addslashes($_SERVER["REMOTE_ADDR"]) . "', NOW( ) , '" . addslashes(undo_html_format($_POST["userstyle"])) . "' , '" . intval($_POST["stylesheet"]) . "');";
     }
     mysql_query($query, $link);
 }
 $type = $_POST["type"] ? intval($_POST["type"]) : intval($_GET["type"]);
 switch ($type) {
     case 1:
         $query = "SELECT indexxsl,changed,hostname,stylesheet FROM userstyle WHERE uid = " . $pc["UID"] . " ;";
         $title = "Blog首页样式表";
         $key = "indexxsl";
         break;
     case 2:
         $query = "SELECT nodexsl,changed,hostname,stylesheet FROM userstyle WHERE uid = " . $pc["UID"] . " ;";
         $title = "Blog文章样式表";
         $key = "nodexsl";
         break;
コード例 #6
0
ファイル: index.php プロジェクト: bianle/www2
function display_blog_tools($pc, $pur)
{
    global $loginok, $currentuser, $pcconfig;
    ?>
<table cellpadding=3 cellspacing=0 width="100%" border=0 class=t1>
			<form action="pcnsearch.php" method="get" onsubmit="if(this.keyword.value==''){alert('请输入关键字');return false;}">
			<input type="hidden" name="area" value="<?php 
    echo $pc["USER"];
    ?>
">
			<tr><td align="left" class="t3">
			<strong>Blog搜索</strong>
			</td></tr>
			<tr><td class="t4">
			<input type="text" name="keyword" id="keyword" class="f1">
			<input type="submit" value="GO" class="f1">
			</td></tr>
			</form>
			<tr><td align="left" class="t3">
			<strong>登录</strong>
			</td></tr>
			<?php 
    if ($loginok == 1 && strcmp($currentuser["userid"], "guest")) {
        ?>
<tr><td class="t4">
<strong><?php 
        echo $currentuser["userid"];
        ?>
</strong>
&nbsp;
[<a href="/bbslogout.php" target="_top" class="f1">注销</a>]<br/>
[<?php 
        bbs_add_super_fav('[BLOG] ' . undo_html_format($pc['NAME']), '/pc/index.php?id=' . $pc['USER']);
        ?>
]
</td></tr>
<?php 
    } else {
        ?>
<form action="/bbslogin.php?mainurl=/pc/index.php?id=<?php 
        echo $pc["USER"];
        ?>
" method="post" name="form1" target="_top" >
<tr><td class="t4">
用户名:
<INPUT TYPE=text class="f1" size="12" onMouseOver="this.focus()" onFocus="this.select()" name="id" >
<br>
密&nbsp;&nbsp;码:
<INPUT TYPE=password  class="f1" size="12" name="passwd" maxlength="39">
<br>
<INPUT TYPE=submit value="Login" class="f1"></form>
</td></tr>
<?php 
    }
    ?>
			
<?php 
    if ($pur == 3) {
        ?>
			
			<tr><td align="left" class="t3">
			[
			<a href="pcmanage.php?userid=<?php 
        echo $pc["USER"];
        ?>
&act=post&tag=0&pid=0">添加文章</a>
			]
			[
			<a href="pcdoc.php?userid=<?php 
        echo $pc["USER"];
        ?>
&tag=7">参数设定</a>
			]
			</td></tr>
<?php 
    }
    ?>
		</table>
<?php 
}
コード例 #7
0
ファイル: nodexml.php プロジェクト: bianle/www2
		<smthBlog:title><?php 
        echo htmlspecialchars(stripslashes($trackback[title]));
        ?>
</smthBlog:title>
		<smthBlog:name><?php 
        echo htmlspecialchars(stripslashes($trackback[blogname]));
        ?>
</smthBlog:name>
		<smthBlog:link><?php 
        echo htmlspecialchars(stripslashes($trackback[url]));
        ?>
</smthBlog:link>
		<smthBlog:excerpt>
			<![CDATA[
			<?php 
        echo undo_html_format(html_format($trackback[excerpt], TRUE));
        ?>
			]]>
		</smthBlog:excerpt>
	</smthBlog:trackback>
<?php 
    }
    ?>
</smthBlog:trackbacks>
<?php 
}
?>
</channel>

<item rdf:about="nodexml.php?id=<?php 
echo $node[nid];