本帖最后由 taoyilong 于 2009-3-29 05:39 编辑
修改了一下bbs.php文件,加入随即动态推送。有需要的就复制下面的代码,修改bbs.php文件吧。
<?php
include_once('./common.php');
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: faq.php 9804 2007-08-15 05:56:19Z cnteacher $
*/
//是否关闭站点
checkclose();
//获取当前用户的空间信息
$space = getspace($_SGLOBAL['supe_uid']);
//获取空间
if(empty($_SGLOBAL['supe_uid'])) {
ssetcookie('_refer', rawurlencode($_SERVER['REQUEST_URI']));
showmessage('to_login', 'do.php?ac=login', 0);
}
$uid = $_SGLOBAL['supe_uid'];
function updatecredit($uid, $credit, $method='+')
{
global $_SGLOBAL;
$credit = intval($credit);
if (empty($credit)) {
return;
}
$sqlcredit = ($credit > 0) ? " {$method} {$credit} " : " {$method} {$credit} ";
$newcredit = $num * $credit;
$_SGLOBAL['db']->query("UPDATE ".tname('space')." SET credit=credit {$sqlcredit} WHERE uid = $uid ");
//$_SGLOBAL['db']->query("UPDATE ".tname('session')." SET credit=credit {$sqlcredit} WHERE uid = $uid ");
}
$suijishu=rand(1,3);
require_once './common.php';
require_once './source/function_common.php';
include_once(S_ROOT.'./source/function_cp.php');
$icon = 'bbs';
if($suijishu==1){
$title_template = '{actor} 正在浏览<a href="bbs.php">论坛最新话题</a>!';
}
if($suijishu==2){
$title_template = '{actor} 现在进入了<a href="bbs.php">论坛</a>!';
}
if($suijishu==3){
$title_template = '{actor} 潜水进入了<a href="bbs.php">论坛</a>,!';
}
feed_add($icon, $title_template);
include template('bbs');
?>
//-----代码结束------
感觉有用的,给兄弟一个友情链接吧。^_^
常言道公益社区 http://www.anydao.cn/ |