function getLinks() { $res = $this->db->query("SELECT * FROM " . DB_PREFIX . "link ORDER BY taxis ASC"); $links = array(); while ($row = $this->db->fetch_array($res)) { $row['sitename'] = htmlspecialchars($row['sitename']); $row['description'] = subString(htmlClean($row['description'], false), 0, 80); $row['siteurl'] = $row['siteurl']; $links[] = $row; } return $links; }
/** * 更新最后回复状态 * * @param $fid * @param $tid * @param $type * @param $mybbs_id * @param $MyDatabase * @param $atc_title */ function lastinfo($fid, $tid, $type = '', $mybbs_id, $MyDatabase, $atc_title) { $nowtime = date('Y-m-d H:i:s', time()); $title = subString($atc_title, 24); //发帖 if ($type == 'new') { $topicadd = ",topic=topic+1,post=post+1"; } elseif ($type == 'reply') { $topicadd = ",post=post+1"; } $new_url = 'read.php?tid=' . $tid; $lastpost = $title . "\t" . addslashes($mybbs_id) . "\t" . $nowtime . "\t" . $new_url; //更新最后回复时间 $SqlStr = 'UPDATE `' . DB_TABLE_PRE . 'forums` SET `lastpost`=\'' . $lastpost . '\'' . $topicadd . ' WHERE `fid`=' . $fid; $MyDatabase->SqlStr = $SqlStr; if ($MyDatabase->ExecuteQuery()) { } else { echo '文件:' . __FILE__; echo '<br />行数:' . __LINE__; echo '<br />原因:'; DebugStr($MyDatabase->SqlStr); ErrorMsg('更新首页显示栏目最新发帖失败!'); } }
/** * 文章排行 * @author Zerolone * @version 2008年10月27日11:27:44 * @param cateid 栏目编号 默认为0, 可以为一个栏目编号, 或者多个栏目。例如:12, 或者12,13 * @param count 记录数 默认为10 * @param titlecount 文字显示数 默认为20 * @return 列表字符串 */ function getArticleRightRank($cateid = 0, $count = 10, $titlecount = 44) { $i = 1; $ReturnString = ''; //-------------------0--------1--------2---------3 $SqlStr = ' SELECT `title`, `html`, `reurl`, `title2` '; $SqlStr .= ' FROM `' . DB_TABLE_PRE . 'article` '; $SqlStr .= ' WHERE `flag`= 3 '; //栏目编号 if (strpos($cateid, ',')) { $SqlStr .= ' AND `cateid` in (' . $cateid . ')'; } elseif ($cateid > 0) { $SqlStr .= ' AND `cateid` =' . $cateid; } $SqlStr .= ' ORDER BY `hits` DESC'; $SqlStr .= ' LIMIT ' . $count; $MyDatabase = new Database(); $MyDatabase->SqlStr = $SqlStr; if ($MyDatabase->Query()) { $DB_Record_Arr = $MyDatabase->ResultArr; foreach ($DB_Record_Arr as $DB_Record) { $title = subString($DB_Record[0], $titlecount); $title2 = $DB_Record[3]; if ($title2 != '') { $title = $title2; } $url = $DB_Record[1]; $reurl = $DB_Record[2]; if ($reurl) { $url = $reurl; } $ReturnString .= '<li class="rank' . $i . '"><a title="' . $DB_Record[0] . '" href="' . $url . '">' . $title . '</a></li>'; $i++; } } return $ReturnString; }
function plugin_setting_view() { $DB = MySql::getInstance(); ?> <div class="containertitle2"> <a class="navi<?php echo isset($_GET['advance']) ? 1 : 3; ?> " href="./plugin.php?plugin=anti_spam_comment">基本设置</a> <a class="navi<?php echo isset($_GET['advance']) ? 2 : 4; ?> " href="./plugin.php?plugin=anti_spam_comment&advance=true">高级选项</a> <?php if (isset($_GET['setting'])) { ?> <span class="actived">插件设置完成</span><?php } if (isset($_GET['error'])) { ?> <span class="actived">插件设置失败</span><?php } ?> </div> <?php if (isset($_GET['advance'])) { $act = isset($_GET['act']) ? trim($_GET['act']) : ''; if ($act) { global $CACHE; switch ($act) { case 'shieldname': $id = isset($_GET['id']) ? intval($_GET['id']) : ''; //$DB->query("UPDATE ".DB_PREFIX."comment SET poster='该昵称已屏蔽' WHERE cid={$id}"); $DB->query("UPDATE " . DB_PREFIX . "comment SET comment='该评论已屏蔽',poster='该昵称已屏蔽' WHERE cid={$id}"); $CACHE->updateCache(array('sta', 'comment')); header("Location: ./plugin.php?plugin=anti_spam_comment&advance=true&setting=true"); break; case 'delurl': $id = isset($_GET['id']) ? intval($_GET['id']) : ''; $DB->query("UPDATE " . DB_PREFIX . "comment SET url='' WHERE cid={$id}"); $CACHE->updateCache(array('sta', 'comment')); header("Location: ./plugin.php?plugin=anti_spam_comment&advance=true&setting=true"); break; case 'admin_all_coms': $operate = isset($_POST['operate']) ? $_POST['operate'] : ''; $comments = isset($_POST['com']) ? array_map('intval', $_POST['com']) : array(); $commentsId = '(' . implode(',', $comments) . ')'; switch ($operate) { case 'shieldname': $DB->query("UPDATE " . DB_PREFIX . "comment SET comment='该评论已屏蔽',poster='该昵称已屏蔽' WHERE cid IN{$commentsId}"); $CACHE->updateCache(array('sta', 'comment')); header("Location: ./plugin.php?plugin=anti_spam_comment&advance=true&setting=true"); break; case 'delurl': $DB->query("UPDATE " . DB_PREFIX . "comment SET url='' WHERE cid IN{$commentsId}"); $CACHE->updateCache(array('sta', 'comment')); header("Location: ./plugin.php?plugin=anti_spam_comment&advance=true&setting=true"); break; } break; case 'save': $comname = isset($_POST['comname']) ? addslashes(trim($_POST['comname'])) : ''; $comment = isset($_POST['comment']) ? addslashes(trim($_POST['comment'])) : ''; $commail = isset($_POST['commail']) ? addslashes(trim($_POST['commail'])) : ''; $comurl = isset($_POST['comurl']) ? addslashes(trim($_POST['comurl'])) : ''; if ($comurl && strncasecmp($comurl, 'http://', 7)) { $comurl = 'http://' . $comurl; } $cid = isset($_POST['cid']) ? intval($_POST['cid']) : ''; $DB->query("UPDATE " . DB_PREFIX . "comment SET poster='{$comname}',comment='{$comment}',mail='{$commail}',url='{$comurl}' WHERE cid={$cid}"); $CACHE->updateCache(array('sta', 'comment')); header("Location: ./plugin.php?plugin=anti_spam_comment&advance=true&setting=true"); break; case 'edit': $Comment_Model = new Comment_Model(); $cid = isset($_GET['cid']) ? intval($_GET['cid']) : ''; extract($Comment_Model->getOneComment($cid)); ?> <form action="./plugin.php?plugin=anti_spam_comment&advance=true&act=save" method="post"> <div> <li>昵称</li> <li><input size="40" value="<?php echo $poster; ?> " name="comname" /></li> <li>邮箱</li> <li><input size="40" value="<?php echo $mail; ?> " name="commail" /></li> <li>地址</li> <li><input size="40" value="<?php echo $url; ?> " name="comurl" /></li> <li>内容</li> <li><textarea name="comment" rows="3" cols="45"><?php echo $comment; ?> </textarea></li> <li> <input type="hidden" value="<?php echo $cid; ?> " name="cid" /> <input type="submit" value="保 存" class="submit" /> <input type="button" value="取 消" class="submit" onclick="javascript: window.history.back();" /></li> </div> </form> <?php break; } } else { $blogid = isset($_GET['gid']) ? intval($_GET['gid']) : null; $hide = isset($_GET['hide']) ? addslashes($_GET['hide']) : ''; $page = isset($_GET['page']) ? intval($_GET['page']) : 1; $ip = isset($_GET['ip']) ? addslashes($_GET['ip']) : ''; $poster = isset($_GET['poster']) ? addslashes($_GET['poster']) : ''; $addUrl_1 = $addUrl_2 = $addUrl_3 = $addUrl_4 = ''; if ($blogid) { $addUrl_1 = "gid={$blogid}&"; $blogid = "AND a.gid={$blogid}"; } if ($hide) { $addUrl_2 = "hide={$hide}&"; $hide = "AND a.hide='{$hide}'"; } if ($ip) { $addUrl_3 = "ip={$ip}&"; $ip = "AND a.ip='{$ip}'"; } if ($poster) { $addUrl_4 = "poster={$poster}&"; $poster = "AND a.poster='{$poster}'"; } $addUrl = $addUrl_1 . $addUrl_2 . $addUrl_3 . $addUrl_4; $perpage_num = Option::get('admin_perpage_num'); if ($page) { $startId = ($page - 1) * $perpage_num; $limit = " LIMIT {$startId}, " . $perpage_num; } $sql = "SELECT a.cid,a.hide,a.date,a.comment,a.gid,a.poster,a.ip,a.mail,a.url,b.title FROM " . DB_PREFIX . "comment as a, " . DB_PREFIX . "blog as b where 1=1 {$blogid} {$hide} {$ip} {$poster} AND a.gid=b.gid ORDER BY a.cid DESC"; $query = $DB->query($sql); $cmnum = $DB->num_rows($query); $query = $DB->query($sql . $limit); $pageurl = pagination($cmnum, $perpage_num, $page, "./plugin.php?plugin=anti_spam_comment&advance=true&{$addUrl}page="); $sql = "SELECT a.cid,a.hide,a.date,a.comment,a.gid,a.poster,a.ip,a.mail,a.url,b.title FROM " . DB_PREFIX . "comment as a, " . DB_PREFIX . "blog as b where 1=1 {$blogid} AND a.hide='y' {$ip} AND a.gid=b.gid ORDER BY a.cid DESC"; $hideCommNum = $DB->num_rows($DB->query($sql)); if ($hideCommNum > 0) { $hide_ = $hide_y = $hide_n = ''; $a = "hide_{$hide}"; ${$a} = "class=\"filter\""; ?> <div class="filters"> <span <?php echo $hide_; ?> ><a href="./plugin.php?plugin=anti_spam_comment&advance=true&<?php echo $addUrl_1 . $addUrl_3; ?> ">全部</a></span> <span <?php echo $hide_y; ?> ><a href="./plugin.php?plugin=anti_spam_comment&advance=true&hide=y&<?php echo $addUrl_1 . $addUrl_3; ?> ">待审 <?php $hidecmnum = ROLE == 'admin' ? $sta_cache['hidecomnum'] : $sta_cache[UID]['hidecommentnum']; if ($hidecmnum > 0) { echo '(' . $hidecmnum . ')'; } ?> </a></span> <span <?php echo $hide_n; ?> ><a href="./plugin.php?plugin=anti_spam_comment&advance=true&hide=n&<?php echo $addUrl_1 . $addUrl_3; ?> ">已审</a></span> </div> <?php } elseif ($addUrl) { ?> <div class="filters"> <span><a href="./plugin.php?plugin=anti_spam_comment&advance=true">全部</a></span> </div> <?php } ?> <form action="./plugin.php?plugin=anti_spam_comment&advance=true&act=admin_all_coms" method="post" name="form_com" id="form_com"> <table width="100%" id="adm_comment_list" class="item_list"> <thead> <tr> <th width="19"><input onclick="CheckAll(this.form)" type="checkbox" value="on" name="chkall" /></th> <th width="350"><b>内容</b></th> <th width="300"><b>评论者</b></th> <th width="250"><b>所属日志</b></th> </tr> </thead> <tbody> <?php while ($res = $DB->fetch_array($query)) { $ishide = $res['hide'] == 'y' ? '<font color="red">[待审]</font>' : ''; $mail = !empty($res['mail']) ? "({$res['mail']})" : ''; $ip = !empty($res['ip']) ? "<br />IP:<a href=\"./plugin.php?plugin=anti_spam_comment&advance=true&ip={$res['ip']}\">{$res['ip']}</a>" : ''; $url = !empty($res['url']) ? "({$res['url']})" : ''; $res['content'] = str_replace('<br>', ' ', $res['comment']); $sub_content = subString($res['content'], 0, 50); $res['title'] = subString($res['title'], 0, 42); ?> <tr> <td><input type="checkbox" value="<?php echo $res['cid']; ?> " name="com[]" class="ids" /></td> <td><a href="./plugin.php?plugin=anti_spam_comment&advance=true&act=edit&cid=<?php echo $res['cid']; ?> "><?php echo htmlspecialchars($sub_content); ?> </a> <?php echo $ishide; ?> <br /><?php echo smartDate($res['date']); ?> <span style="display:none; margin-left:8px;"> <a href="javascript: asc_confirm(<?php echo $res['cid']; ?> , 'name');">屏蔽内容</a> <a href="javascript: asc_confirm(<?php echo $res['cid']; ?> , 'url');">删除地址</a> </span> </td> <td><a href="./plugin.php?plugin=anti_spam_comment&advance=true&poster=<?php echo urlencode($res['poster']); ?> "><?php echo htmlspecialchars($res['poster']); ?> </a> <?php echo $url; ?> <?php echo $ip; ?> <?php echo $mail; ?> </td> <td><a href="./plugin.php?plugin=anti_spam_comment&advance=true&gid=<?php echo $res['gid']; ?> "><?php echo $res['title']; ?> </a></td> </tr> <?php } ?> </tbody> </table> <div class="list_footer"> 选中项: <a href="javascript:asc_commentact('shieldname');">屏蔽内容</a> <a href="javascript:asc_commentact('delurl');">删除地址</a> <input name="operate" id="operate" res="" type="hidden" /> </div> <div class="page"><?php echo $pageurl; ?> (有<?php echo $cmnum; ?> 条评论)</div> </form> <script> $(document).ready(function(){ $("#adm_comment_list tbody tr:odd").addClass("tralt_b"); $("#adm_comment_list tbody tr") .mouseover(function(){$(this).addClass("trover");$(this).find("span").show();}) .mouseout(function(){$(this).removeClass("trover");$(this).find("span").hide();}) }); setTimeout(hideActived,2600); function asc_commentact(act){ if (getChecked('ids') == false) { alert('请选择要操作的评论'); return; } if(act == 'shieldname' && !confirm('你确定要屏蔽所选评论的内容吗?')){return;} if(act == 'delurl' && !confirm('你确定要删除所选评论的评论人地址吗?')){return;} $("#operate").val(act); $("#form_com").submit(); } function asc_confirm (id, property) { switch (property){ case 'name': var urlreturn="./plugin.php?plugin=anti_spam_comment&advance=true&act=shieldname&id="+id; var msg = "你确定要屏蔽该评论内容?";break; case 'url': var urlreturn="./plugin.php?plugin=anti_spam_comment&advance=true&act=delurl&id="+id; var msg = "你确定要删除该评论人地址吗?";break; } if(confirm(msg)){window.location = urlreturn;}else {return;} } </script> <?php } } else { $data = asc_read(); extract($data); $blacklist = implode("\n", $blacklist); $url_keywords = implode("\n", $url_keywords); $ex1 = $ex2 = ''; $vari = array(array('英文字母abc…ABC…<font color="red">*</font>:', 'asc_letter'), array('数字0-9:', 'asc_digit'), array('英文字符(包括英文字母、数字和其它英文符号)<font color="red">*</font>:', 'asc_char'), array('星号*:', 'asc_star')); if ($auto_blacklist == 1) { $ex1 = 'checked="checked"'; } if ($need_chinese == 1) { $ex2 = 'checked="checked"'; } ?> <form action="plugin.php?plugin=anti_spam_comment&action=setting" method="post"> <table cellspacing="8" cellpadding="4" width="95%" align="center" border="0"> <tbody> <tr nowrap="nowrap"> <td width="33%" align="right">评论时间间隔(秒):</td> <td width="67%"><input size="10" name="time_limit" type="text" value="<?php echo $time_limit; ?> " /></td> </tr> <tr nowrap="nowrap"> <td width="33%" align="right">必须包含汉字:</td> <td width="67%"><input size="10" name="need_chinese" type="checkbox" value="1" <?php echo $ex2; ?> /></td> </tr> <tr nowrap="nowrap"> <td align="right" valign="top">IP黑名单:<br/><br/> 可封IP段,填入IP开头地址,如162.204 </td> <td><textarea name="blacklist" cols="" rows="4" style="width:300px;height:70px;"><?php echo $blacklist; ?> </textarea></td> </tr> <tr nowrap="nowrap"> <td align="right">将频繁尝试发表评论的IP加入黑名单</td> <td><input name="auto_blacklist" type="checkbox" value="1" <?php echo $ex1; ?> /></td> </tr> <tr nowrap="nowrap"> <td align="right">每分钟允许尝试评论次数:</td> <td><input size="10" name="max_attempt" type="text" value="<?php echo $max_attempt; ?> " />(开启自动黑名单有效)</td> </tr> <tr nowrap="nowrap"> <td align="right" valign="top">屏蔽词汇(以 | 分割):<br /> 可以使用通配符*或者系统<a href="#var">内置变量</a> </td> <td><textarea name="keywords" cols="" rows="4" style="width:300px;height:70px;"><?php echo $keywords; ?> </textarea></td> </tr> <tr nowrap="nowrap"> <td align="right" valign="top">屏蔽昵称(以 | 分割):<br /> 可以使用通配符*或者系统<a href="#var">内置变量</a> </td> <td><textarea name="name_keywords" cols="" rows="4" style="width:300px;height:70px;"><?php echo $name_keywords; ?> </textarea></td> </tr> <tr nowrap="nowrap"> <td align="right" valign="top">屏蔽地址(每行一条):<br/> 可以使用通配符*或者系统<a href="#var">内置变量</a> </td> <td><textarea name="url_keywords" cols="" rows="4" style="width:300px;height:70px;"><?php echo $url_keywords; ?> </textarea></td> </tr> <tr> <td align="center" colspan="2"><input type="submit" value="保存设置" class="button" /></td> </tr> </tbody> </table> </form> <b><a name="var"></a>内置变量</b> <table cellspacing="8" cellpadding="4" width="95%" align="center" border="0"> <tbody> <?php foreach ($vari as $value) { ?> <tr nowrap="nowrap"> <td width="40%" align="right"><?php echo $value[0]; ?> </td> <td width="60%"><b><?php echo $value[1]; ?> </b></td> </tr> <?php } ?> <tr> <td align="center" colspan="2"><font color="red">*注</font>:该项仅当评论全文符合时过滤评论(例如关键字填入asc_letter时,仅过滤纯英文评论)</td> </tr> </tbody> </table> <?php } ?> <script> $("#anti_spam_comment").addClass('sidebarsubmenu1'); </script> <?php }
function blog_tool_purecontent($content, $strlen = null) { $content = str_replace('阅读全文>>', '', strip_tags($content)); if ($strlen) { $content = subString($content, 0, $strlen); } return $content; }
<th width="369" colspan="2"><b>内容</b></th> <th width="300"><b>评论者</b></th> <th width="250"><b>所属文章</b></th> </tr> </thead> <tbody> <?php if ($comment) { foreach ($comment as $key => $value) { $ishide = $value['hide'] == 'y' ? '<font color="red">[待审]</font>' : ''; $mail = !empty($value['mail']) ? "({$value['mail']})" : ''; $ip = !empty($value['ip']) ? "<br />来自:{$value['ip']}" : ''; $poster = !empty($value['url']) ? '<a href="' . $value['url'] . '" target="_blank">' . $value['poster'] . '</a>' : $value['poster']; $value['content'] = str_replace('<br>', ' ', $value['content']); $sub_content = subString($value['content'], 0, 50); $value['title'] = subString($value['title'], 0, 42); doAction('adm_comment_display'); ?> <tr> <td width="19"><input type="checkbox" value="<?php echo $value['cid']; ?> " name="com[]" class="ids" /></td> <td width="350"><a href="comment.php?action=reply_comment&cid=<?php echo $value['cid']; ?> " title="<?php echo $value['content']; ?> "><?php echo $sub_content;
页面功能:首页 创建日期:2008年5月7日21:28:16 修改日期: 作 者:Zerolone 主 页:http://www.zerolone.com/ */ require 'include/common.inc.php'; $page_name = 'index.php'; $SqlStr = ' SELECT `id`, `title`, `import` FROM `' . table_pre . 'calendar` WHERE `userid`=' . $userid; $SqlStr .= ' AND `isdone`=0'; $SqlStr .= ' ORDER BY `import` DESC , `createtime` ASC'; $SqlStr .= ' LIMIT 0, 10 '; $temp_query = query($SqlStr); $i = 0; while ($DB_Record = nqfetch($temp_query)) { $calendar_title = subString($DB_Record[1], 52); //关键度颜色 $calendar_import = $DB_Record[2]; switch ($calendar_import) { case 1: $calendar_import_color = "#000000"; break; case 2: $calendar_import_color = "#00FF00"; break; case 3: $calendar_import_color = "#0000FF"; break; case 4: $calendar_import_color = "#FF9966"; break;
//总记录 $recordcount = 0; $SqlStr = 'Select count(*) from `' . DB_TABLE_PRE . 'navbar`'; $SqlStr .= ' WHERE `pid`=' . $pid; $MyDatabase->SqlStr = $SqlStr; if ($MyDatabase->Query()) { $recordcount = $MyDatabase->ResultArr[0][0]; } //------------------0------1--------2-------3--------4 $SqlStr = 'SELECT `id`, `title`, `order`, `url`, `active` FROM `' . DB_TABLE_PRE . 'navbar`'; $SqlStr .= ' WHERE `pid`=' . $pid; $SqlStr .= ' ORDER BY `order` ASC'; $SqlStr .= ' LIMIT ' . $pagesize * ($pagenum - 1) . ' ,' . $pagesize . ';'; //echo $SqlStr; $MyDatabase->SqlStr = $SqlStr; if ($MyDatabase->Query()) { $DB_Record_Arr = $MyDatabase->ResultArr; foreach ($DB_Record_Arr as $DB_Record) { $navbar_title = subString($DB_Record[1], 76); $navbar_active_txt = '使用'; if ($DB_Record[4] == '0') { $navbar_active_txt = '不使用'; } $navbar_list[] = array('id' => $DB_Record[0], 'title' => $navbar_title, 'order' => $DB_Record[2], 'url' => $DB_Record[3], 'active_txt' => $navbar_active_txt); } } //管理员日志 $log_content = '导航菜单管理 >> 导航菜单查看'; require '../../include/log.php'; require $page_name . '.php'; require '../../include/debug.php';
if ($MyDatabase1->Query()) { $DB_Record_Arr1 = $MyDatabase1->ResultArr; foreach ($DB_Record_Arr1 as $DB_Record_Loop) { $TempStr = $LoopString; $TempTitle = subString($DB_Record_Loop[0], $txt); $TempTitle2 = $DB_Record_Loop[6]; $TempHtml = $DB_Record_Loop[1]; $TempReUrl = $DB_Record_Loop[2]; $TempPic1 = $DB_Record_Loop[3]; $TempPic2 = $DB_Record_Loop[4]; $TempMemo = $DB_Record_Loop[5]; $TempMemo = str_replace(Chr(10), "<br />", $TempMemo); $TempId = $DB_Record_Loop[7]; $Tempcustom1 = $DB_Record_Loop[8]; $TempContent = $DB_Record_Loop[9]; $TempContent = subString($TempContent, 180); $TempPosttime = $DB_Record_Loop[10]; $TempHits = $DB_Record_Loop[11]; //指定长标题 $TempStr = str_replace('{title1}', $TempTitle, $TempStr); //标题 if ($TempTitle2 != '') { $TempTitle = $TempTitle2; } $TempStr = str_replace('{title}', $TempTitle, $TempStr); //链接 if ($TempReUrl == '') { $TempStr = str_replace('{html}', $TempHtml, $TempStr); } else { $TempStr = str_replace('{html}', $TempReUrl, $TempStr); }
"></script> </head> <body> <div id="wrapper"> <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="../" target="_blank" title="在新窗口浏站点"> <?php $blog_name = Option::get('blogname'); echo empty($blog_name) ? '查看我的站点' : subString($blog_name, 0, 24); ?> </a> </div> <ul class="nav navbar-top-links navbar-right"> <li><a href="./"><i class="fa fa-home fa-fw"></i>管理首页</a></li> <li><a href="./configure.php"><i class="fa fa-wrench fa-fw"></i> 设置</a></li> <li><a href="./?action=logout"><i class="fa fa-power-off fa-fw"></i>退出</a></li> </ul> <div class="navbar-default sidebar" role="navigation"> <div class="sidebar-nav navbar-collapse"> <ul class="nav" id="side-menu"> <li class="sidebar-avatar"> <div style="text-align: center;"> <a href="./blogger.php">
if (empty($fa['logTitle'])) { $fa['logTitle'] = $strAttachmentNoLogs; } if ($fa['logId'] < 1) { echo "---"; } else { ?> <a href="../index.php?load=read&id=<?php echo $fa['logId']; ?> " target="_blank" title="<?php echo $fa['logTitle']; ?> "><?php echo $fa['logId']; echo " (" . subString($fa['logTitle'], 0, 5) . ")"; ?> </a> <?php } ?> </td> </tr> <?php } //end for ?> </table> </div> <br> <div class="bottombar-onebtn"></div>
" title="<?php echo $value['log_title']; ?> 上的评论"><?php echo $value['comnum']; ?> </a> 热度:<span class="wpviews" id="views_135"><?php echo $value['views']; ?> </span> </div> <div class="post-content"> <?php echo subString(strip_tags($value['log_description']), 0, 128, "..."); ?> </div> <div class="post-meta"> 生产日期:<?php echo gmdate('Y-n-j', $value['date']); ?> | 关键字: <?php blog_tag($value['logid']); ?> <?php editflg($value['logid'], $value['author']); ?> </div> </div>
/** * 返回文章列表 * * @return string */ function getArticleList() { //Sql语句生成 $this->InitSql(); $TempString = ''; $ReturnString = ''; //文章列表 //-------------------0---------1------------2---------------3------------4-----------5-----------6------------7-------------8 $SqlStr = 'SELECT `a`.`id`, `a`.`title`, `a`.`posttime`, `a`.`reurl`, `a`.`html`, `a`.`hits`, `c`.`title`, `a`.`title2`, `a`.`titlecolor` from `' . DB_TABLE_PRE . 'article` `a`, `' . DB_TABLE_PRE . 'article_cate` `c`'; $SqlStr .= ' WHERE 1=1'; $SqlStr .= ' AND `a`.`cateid`=`c`.`id`'; $SqlStr .= ' AND `a`.`notshowlist` = 0'; //栏目 $SqlStr .= $this->SqlCateId; //区域 $SqlStr .= $this->SqlArea; //状态 $SqlStr .= $this->SqlFlag; //排序 $SqlStr .= $this->SqlOrder; //显示个数 $SqlStr .= $this->SqlLimit; $this->SqlStr = $SqlStr; /* echo $SqlStr; echo $this->LiClassId; */ $MyDatabase = new Database(); $MyDatabase->SqlStr = $SqlStr; if ($MyDatabase->Query()) { $DB_Record_Arr = $MyDatabase->ResultArr; foreach ($DB_Record_Arr as $DB_Record) { $id = $DB_Record[0]; $title = subString($DB_Record[1], $this->TitleCount); $posttime = $DB_Record[2]; $reurl = $DB_Record[3]; $url = $DB_Record[4]; $hits = $DB_Record[5]; $catetitle = $DB_Record[6]; $title2 = $DB_Record[7]; $titlecolor = $DB_Record[8]; //如果设置为Title2显示并且存在Title2,则title为title2 if ($this->ShowTitle2 && $title2 != '') { $title = $title2; } //跳转链接,如果存在,则文章链接为跳转链接 if ($reurl != '') { $url = $reurl; } //文章标题颜色 if ($titlecolor != '') { $title = '<font color="' . $titlecolor . '">' . $title . '</font>'; } //文章标题是否显示一个Dot if ($this->ShowDot) { $title = '·' . $title; } //产生一个链接 $TempString = '<a title="' . $DB_Record[1] . '" href="' . $url . '">' . $title . '</a>'; if ($this->ShowCate) { $TempString = '<span>' . $catetitle . ' | </span>' . $TempString; } if ($this->ShowHits) { $TempString .= '(' . $hits . ')'; } if ($this->ShowDate) { $TempString .= '<span>' . $posttime . '</span>'; } if ($this->ShowLi) { if ($this->LiClass && $this->LiClassId && $this->LiClassId == $id) { $TempString = '<li class="' . $this->LiClass . '">' . $TempString . '</li>'; } else { $TempString = '<li>' . $TempString . '</li>'; } } if ($this->ShowBracket) { $TempString = '[' . $TempString . '] '; } $ReturnString .= $TempString; } } return $ReturnString; }
?> <label for="del<?php echo $tuan['id']; ?> "> <tr> <td><input type="hidden" name="id[]" value="<?php echo $tuan['id']; ?> "><select name="order[]" class="inputbox" id="order[]"><?php echo getOrderList($tuan['order']); ?> </select> </td> <td> <?php echo subString($tuan['title'], 80); ?> </td> <td> <?php echo $tuan['price']; ?> </td> <td> <a href="#" onClick="ffClick('tuan/edit.php?tid=<?php echo $tuan['id']; ?> &pagenum=<?php echo $pagenum; ?> ','修改:<?php echo $tuan['title']; ?>
echo $title; ?> </span></h3> <ul id="link"> <?php foreach ($link_cache as $value) { ?> <li style="margin-left: 0px;"><a href="<?php echo $value['url']; ?> " title="<?php echo $value['des']; ?> " target="_blank"> <?php echo subString(strip_tags($value['link']), 0, 12); ?> </a></li> <?php } ?> </ul> </div> <?php ?> </div> <div style="height:10px;"></div> <hr>
function widget_links() { ?> <div class="widget"> <h3>网站收藏</h3> <ul> <?php $links = Link_Model::getInstance()->getLinks(5); foreach ($links as $link) { $name = subString($link['link_name'], 0, 16); echo "<li><a class='link_description' href='{$link['link_url']}'>{$name}<span>{$link['link_description']}</span></a></li>"; } ?> </ul> </div> <?php }
function widget_hotlog($title) { $index_hotlognum = Option::get('index_hotlognum'); $Log_Model = new Log_Model(); $randLogs = $Log_Model->getHotLog($index_hotlognum); $row['content'] = strip_tags($row['content']); ?> <?php foreach ($randLogs as $value) { ?> <div class="random_text_log"> <a href="<?php echo Url::log($value['gid']); ?> "> <h3> <i class="fa fa-quote-left"></i> <?php echo mb_substr($value['title'], 0, 12, 'utf-8'); ?> </h3> <?php echo subString(strip_tags($value['log_description']), 0, 30); ?> </a> </div> <?php } ?> <?php }
?> <span style="dipslay:none;font-size:9px;color:<?php echo $arrNdayColor[$i * 7 + 5]; ?> " title="<?php echo $arrNdayShow[$i * 7 + 5]; ?> "><br /><?php echo subString($arrNdayShow[$i * 7 + 5], 0, 2); ?> </span></a></li> <li class="DayA"><a<?php echo $arrLogsUrl[$i * 7 + 6] . $arrClass[$i * 7 + 6] . $arrLogsTitle[$i * 7 + 6]; ?> ><?php echo $arrCurWeek[$i * 7 + 6]; ?> <span style="dipslay:none;font-size:9px;color:<?php echo $arrNdayColor[$i * 7 + 6]; ?> " title="<?php echo $arrNdayShow[$i * 7 + 6]; ?> "><br /><?php echo subString($arrNdayShow[$i * 7 + 6], 0, 2); ?> </span></a></li> </ul> </div> <?php }
/** * 最新评论缓存 */ private function mc_comment() { $query = $this->db->query("SELECT option_value,option_name FROM " . DB_PREFIX . "options WHERE option_name IN('index_comnum','comment_subnum','comment_paging','comment_pnum','comment_order')"); while ($row = $this->db->fetch_array($query)) { ${$row}['option_name'] = $row['option_value']; } $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "comment WHERE hide='n' ORDER BY date DESC LIMIT 0, {$index_comnum}"); $com_cache = array(); $com_cids = array(); while ($show_com = $this->db->fetch_array($query)) { $com_page = ''; if ($comment_paging == 'y') { $pid = $show_com['pid']; $cid = $show_com['cid']; $order = $comment_order == 'newer' ? 'DESC' : ''; while ($pid != 0) { $show_pid = $this->db->once_fetch_array("SELECT cid,pid FROM " . DB_PREFIX . "comment WHERE cid={$pid}"); $pid = $show_pid['pid']; $cid = $show_pid['cid']; } if (!isset($com_cids[$show_com['gid']])) { $com_cids[$show_com['gid']] = array(); $query2 = $this->db->query("SELECT cid FROM " . DB_PREFIX . "comment WHERE gid=" . $show_com['gid'] . " AND pid=0 AND hide='n' ORDER BY date {$order}"); while ($show_cid = $this->db->fetch_array($query2)) { $com_cids[$show_com['gid']][] = $show_cid['cid']; } } $com_page = intval(floor(array_search($cid, $com_cids[$show_com['gid']]) / $comment_pnum)) + 1; } $com_cache[] = array('cid' => $show_com['cid'], 'gid' => $show_com['gid'], 'name' => htmlspecialchars($show_com['poster']), 'date' => $show_com['date'], 'page' => $com_page, 'mail' => $show_com['mail'], 'content' => htmlClean(subString($show_com['comment'], 0, $comment_subnum), false)); } $cacheData = serialize($com_cache); $this->cacheWrite($cacheData, 'comment'); }
function recentGbooks_recache() { global $DMC, $DMF, $DBPrefix, $strGuestBookHidden; if ($DMC == "") { $DMC = $DMF; } $i = 0; $result = $DMC->query("select * from " . $DBPrefix . "guestbook order by postTime desc Limit 0,10"); $contents = "\$recentgbookscache = array(\r\n"; while ($my = $DMC->fetchArray($result)) { $content = str_replace("<br />", "", subString($my['content'], 0, 100)); if ($my['isSecret']) { $content = $strGuestBookHidden; } $contents .= "\t'" . $i . "' => array(\n\t\t'id' => '" . $my['id'] . "',\n\t\t'content' => '" . $content . "',\n\t\t'author' => '" . $my['author'] . "',\n\t\t'postTime' => '" . $my['postTime'] . "',\n\t\t),\n"; $i++; } $contents .= ");"; writetocache('recentGbooks', $contents); }
function recentGbooks_recache() { global $DMC, $DBPrefix, $strGuestBookHidden, $settingInfo, $strSideBarAnd, $strSideBarGuestBook, $strRecentGBook, $arrSideModule; $out_contents = create_sidebar_header("GuestBookForPJBlogSubItem1", $arrSideModule["guestbook"]["modTitle"], $arrSideModule["guestbook"]["isInstall"]); if ($settingInfo['rewrite'] == 0) { $gourl = "index.php?load=guestbook"; } if ($settingInfo['rewrite'] == 1) { $gourl = "rewrite.php/guestbook"; } if ($settingInfo['rewrite'] == 2) { $gourl = "guestbook"; } $i = 0; $maxlength = $settingInfo['sidegbooklength']; $result = $DMC->query("select a.id,a.content,a.author,a.postTime,b.nickname,a.isSecret from {$DBPrefix}guestbook as a left join {$DBPrefix}members as b on a.author=b.username order by postTime desc Limit 0,{$settingInfo['gbookPage']}"); while ($my = $DMC->fetchArray($result)) { $author = $my['nickname'] != "" ? $my['nickname'] : $my['author']; if ($my['isSecret']) { $content = $strGuestBookHidden; $my['content'] = $strGuestBookHidden; } else { $my['content'] = strip_tags($my['content']); $content = subString($my['content'], 0, $maxlength); } $content = str_replace("{", "!##_#_###_###_##!", $content); $content = str_replace("}", "!##_###_###_##_#!", $content); $show_content = str_replace("[", "\\[", $settingInfo['sidegbookstyle']); $show_content = str_replace("]", "\\]", $show_content); $show_content = preg_replace("/({title})/is", $content, $show_content); $show_content = preg_replace("/({author})/is", $author, $show_content); $show_content = preg_replace("/{(.*?)}/ie", "format_time('\\1',{$my['postTime']})", $show_content); $show_content = str_replace("\\[", "[", $show_content); $show_content = str_replace("\\]", "]", $show_content); $show_content = str_replace("!##_#_###_###_##!", "{", $show_content); $show_content = str_replace("!##_###_###_##_#!", "}", $show_content); $out_contents .= "\t<a class=\"sideA\" id=\"GuestBook_Link" . $my['id'] . "\" title=\"" . $author . " {$strSideBarAnd} " . format_time("L", $my['postTime']) . " {$strSideBarGuestBook} \r\n" . $my['content'] . "\" href=\"{$gourl}{$settingInfo['stype']}#book" . $my['id'] . "\">" . $show_content . "</a> \r\n"; $i++; } $out_contents .= create_sidebar_footer(); writetocache("guestbook", $out_contents, 'html'); }
/** * 文章分割 * * @param string $content 文章内容 * @param int $lid 文章id */ function breakLog($content, $lid) { $ret = explode('[break]', $content, 2); if (!empty($ret[1])) { $ret[0] .= '<p class="readmore"><a href="' . Url::log($lid) . '">阅读全文>></a></p>'; return $ret[0]; } elseif (Option::get('isexcerpt') == 'y') { return subString(trim(strip_tags($content)), 0, Option::get('excerpt_subnum')) . '<p class="readmore"><a href="' . Url::log($lid) . '">阅读全文>></a></p>'; } else { return $content; } }
<td><?php echo $object['key']; ?> </td> <td><a href="<?php echo base_url(); ?> admin_editor/show?id=<?php echo $object['id']; ?> "><?php echo $object['name']; ?> </a></td> <td><?php echo subString($object['description'], 200); ?> </td> <td><?php echo $object['link']; ?> </td> <td><a href="<?php echo base_url(); ?> admin_editor/edit?id=<?php echo $object['id']; ?> ">Edit</a></td> <td> <a href="#">
<?php if ($value['width'] && $value['height']) { ?> <br /> <?php echo $value['width']; ?> x<?php echo $value['height']; ?> <?php } else { ?> <br /> <?php echo subString($value['filename'], 0, 6); ?> <?php } ?> <br /><a href="javascript: em_confirm(<?php echo $value['aid']; ?> , 'attachment', '<?php echo LoginAuth::genToken(); ?> ');">删除</a> <?php echo $embedlink; ?> </li> <?php
$currdate_hy = gmdate("Y-n-j", $curTime); $class = $currdate == $currdate_hy ? "class=\"today\"" : ""; $calss = $calendarcache[$currdate] != "" ? "class=\"haveD\"" : $class; if ($calendarcache[$currdate] != "") { $class = "class=\"haveD\""; $curF2Day = $year . "|" . $month . "|" . $day; $href = " href=\"index.php?job=calendar&seekname={$curF2Day}\" "; $strDayLog = str_replace("1", $calendarcache[$currdate], $strDayLogs); $atitle = " title=\"{$strDayLog}\" "; } else { $href = ""; $atitle = ""; } //style=\"color:$color\" echo "<li class=\"DayA\"><a {$class}{$href}{$atitle}>{$day}"; echo "<br> <span style=\"font-size:9px;color:{$color1}\" title=\"{$chi}\">" . subString($chi, 0, 2) . "</span>"; echo "</a></li>\n"; //下一天 $day++; $md++; if ($md > $everymonth[$j][$i]) { $md = 1; $i++; } if ($i > 12 and $everymonth[$j][0] == 0 or $i > 13 and $everymonth[$j][0] != 0) { $i = 1; $j++; } } } echo "</ul>\n</div>\n";
if (Option::get('istreply') == 'n') { exit('err0'); } elseif (!$r || strlen($r) > 420) { exit('err1'); } elseif (ROLE == ROLE_VISITOR && empty($rname)) { exit('err2'); } elseif (ROLE == ROLE_VISITOR && Option::get('reply_code') == 'y' && session_start() && $rcode != $_SESSION['code']) { exit('err3'); } foreach ($user_cache as $val) { if (isset($val['name']) && $val['name'] == $rname) { exit('err4'); } } $date = time(); $name = subString(ROLE == ROLE_VISITOR ? $rname : addslashes($user_cache[UID]['name']), 0, 16); $rdata = array('tid' => $tid, 'content' => $r, 'name' => $name, 'date' => $date, 'hide' => ROLE == ROLE_VISITOR ? Option::get('ischkreply') : 'n'); $Twitter_Model = new Twitter_Model(); $Reply_Model = new Reply_Model(); $rid = $Reply_Model->addReply($rdata); if ($rid === false) { exit('err5'); } doAction('reply_twitter', $r, $name, $date, $tid); if (Option::get('ischkreply') == 'n' || ROLE != ROLE_VISITOR) { $Twitter_Model->updateReplyNum($tid, '+1'); } else { exit('succ1'); } $CACHE->updateCache('sta'); $_SESSION['code'] = null;
} //$SqlStr.= ' AND `flag` = '. $flag; $SqlStr .= ' ORDER BY `order` ASC, `id` DESC'; $SqlStr .= ' LIMIT ' . $pagesize * ($pagenum - 1) . ' ,' . $pagesize . ';'; $MyDatabase->SqlStr = $SqlStr; if ($MyDatabase->Query()) { $DB_Record_Arr = $MyDatabase->ResultArr; foreach ($DB_Record_Arr as $DB_Record) { $isvideo = $DB_Record[7]; if ($isvideo) { $article_title = '<img height="16" src="/images/dot_video.gif" border="0">' . subString($DB_Record[1], 80); } else { $article_title = subString($DB_Record[1], 82); } if ($DB_Record[8] != '') { $article_title = '<font color="' . $DB_Record[8] . '">' . subString($DB_Record[1], 52) . '</font>'; } $flag_txt = printFlag($DB_Record[3]); $article_list[] = array('id' => $DB_Record[0], 'title' => $article_title, 'posttime' => $DB_Record[2], 'flag_txt' => $flag_txt, 'url' => $DB_Record[4], 'html' => $DB_Record[5], 'hits' => $DB_Record[6], 'order' => $DB_Record[9]); } } //栏目列表 //------------------0-------1----------2--------3 $SqlStr = 'SELECT `id`, `parentid`, `level`, `title` FROM `' . DB_TABLE_PRE . 'article_cate` Order By `level`'; $MyDatabase->SqlStr = $SqlStr; if ($MyDatabase->Query()) { $DB_Record_Arr = $MyDatabase->ResultArr; foreach ($DB_Record_Arr as $DB_Record) { if ($DB_Record[0] == $cateid) { $selected = 'selected = "selected"'; } else {
?> " border="0"></a> </td> <td nowrap class="subcontent-td"> <?php echo format_time("L", $fa['postTime']); ?> </td> <td nowrap class="subcontent-td"> <?php echo $fa['name']; ?> </td> <td nowrap class="subcontent-td"> <?php echo "<a href=\"../index.php?load=read&id=" . $fa['id'] . "\" target=\"_blank\" title=\"" . $fa['logTitle'] . "\">" . subString($fa['logTitle'], 0, 18) . "</a>"; ?> </td> <td nowrap class="subcontent-td"> <?php echo !empty($fa['tags']) ? $fa['tags'] : " "; ?> </td> <td nowrap align="center" class="subcontent-td"> <?php echo $fa['autoSplit']; ?> </td> <td nowrap align="center" class="subcontent-td"> <?php echo $imgHidden;
echo "<td class='tdheader'>"; echo htmlencode($headers[$j]); echo "</td>"; } echo "</tr>"; for ($j = 0; $j < sizeof($result); $j++) { $tdWithClass = "<td class='td" . ($j % 2 ? "1" : "2") . "'>"; echo "<tr>"; for ($z = 0; $z < sizeof($headers); $z++) { echo $tdWithClass; if ($result[$j][$headers[$z]] === "") { echo " "; } elseif ($result[$j][$headers[$z]] === NULL) { echo "<i class='null'>NULL</i>"; } else { echo htmlencode(subString($result[$j][$headers[$z]])); } echo "</td>"; } echo "</tr>"; } echo "</table><br/><br/>"; } } } } else { $delimiter = ";"; $queryStr = ""; } echo "<fieldset>"; echo "<legend><b>" . sprintf($lang['run_sql'], htmlencode($db->getName())) . "</b></legend>";
echo $fa['orderNo']; ?> </td> <td nowrap class="subcontent-td"> <?php echo $fa['name']; ?> </td> <td nowrap class="subcontent-td"> <?php echo $modTitle; ?> </td> <td class="subcontent-td"> <?php echo $parent != 1 ? subString($fa['htmlCode'], 0, 30) : $fa['pluginPath']; ?> </td> <td align="center" nowrap class="subcontent-td"> <?php echo $imgHidden; ?> </td> <td align="center" nowrap class="subcontent-td"> <?php echo $imgIndexOnly . $imgSideHidden; ?> </td> <td align="center" nowrap class="subcontent-td"> <?php echo $imgPlugin;