Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[原创] · 嘘~~~论坛发贴机器(人) by oytktk (10/1)更新

[复制链接]
lqliang 发表于 2005-9-30 19:43:13 | 显示全部楼层
占用资源大吗?
回复

使用道具 举报

天随人愿 发表于 2005-9-30 21:16:07 | 显示全部楼层
“对不起, 没有找到符合条件的记录!

如果您的浏览器没有自动跳转,请点击这里 ”

点开启机器人后就提示这样,是那里没设置好呢。
参数,发言内容,机器人名都设置好了
回复

使用道具 举报

防雨布 发表于 2005-9-30 21:51:49 | 显示全部楼层
老大,有数据库反安装的程序吗?
回复

使用道具 举报

renlang111 发表于 2005-9-30 22:28:30 | 显示全部楼层
爱死你了
回复

使用道具 举报

renlang111 发表于 2005-9-30 23:02:45 | 显示全部楼层
Fatal error: Call to a member function query() on a non-object in d:\wwwusers\localuser\renlang111\bbs\macher.php on line 80

怎么办啊?大哥帮帮忙
回复

使用道具 举报

111122221111 发表于 2005-9-30 23:19:47 | 显示全部楼层

我用了出现这个怎么回事

Fatal error: Call to undefined function: 错误信息() in /home/commrox/public_html/include/db_mysql_error.php on line 20
回复

使用道具 举报

天随人愿 发表于 2005-9-30 23:21:18 | 显示全部楼层
我加入了这段代码后,开启机器人就出现错误。
$upalltime=$uptime*rand(5,20);
$upmonth=date(n);
if($lastmonth<$upmonth){
        $upmonthtime=0;
}else{
        $upmonthtime="onlinemonth+".$upalltime;
}
$db->$db->query("UPDATE $table_members SET onlinetime=onlinetime+$upalltime, onlinemonth=$upmonthtime, lastmonth=$upmonth WHERE username='$userplay[value]'");

错误提示:
Fatal error: Call to undefined method dbstuff::unbuffered_query() in F:\WWW\BBS\macher.php on line 80

不家的话就可以正常使用。
???????????????

[ 本帖最后由 天随人愿 于 2005-10-17 22:47 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

被抛弃的神 发表于 2005-9-30 23:33:40 | 显示全部楼层
机器人名是不是有限制?
多了就不能用了
回复

使用道具 举报

 楼主| oytktk 发表于 2005-9-30 23:43:45 | 显示全部楼层
凡有错误的到455楼重新改过.我之前的代码是有些问题,给大家带来不便请见谅!!
今天晚上有事.
回复

使用道具 举报

111122221111 发表于 2005-9-30 23:50:17 | 显示全部楼层

帮看看不行阿

<script language="JavaScript">
if(top.location==window.location) top.location = "postmach.php";
</script>
<?

require './include/common.php';
require './include/post.php';
if($adminid!=1)exit;



//参数设置=====================

$query = $db->query("SELECT * FROM cdb_postmach WHERE style='set'");
while($dataset = $db->fetch_array($query)){
$set[$dataset['value']]=$dataset['sside'];
}

$thison=$set['thison'];
$reftime=$set['reftime'];
$whatis=$set['whatis'];
$usertime=$set['usertime'];
$psottime=$set['psottime'];
$postmachother=$set['other'];
$fids=$thison?$set['fids']:NULL;
$tids=$thison?$set['posttid']:NULL;
$reftime=$reftime+rand(-3,3);
$moneys=$set['moneys'];
$moneys=$moneys?"money=money+".$moneys.", ":NULL;

$whatis=$whatis?"replies<=".$whatis." and ":NULL;
//参数结束=====================

$cccc="creditsrequire=0 and";

//取出FID,TID值

if (!$fids){
$fidis=NULL;
}else{
$fidis=NULL;
$fidis = "fid IN (".$fids.") and";
}

if (!$tids){
$tidis=NULL;
}else{
$fidis=NULL;
$tidis=NULL;
$whatis=NULL;
$cccc=NULL;
$tidis = "tid IN (".$tids.") and";
}


if($thison){
$stime=time();
$dtime=3600*20;#3600=1天, *10表示10天, 意思是机器人只顶10天内的新贴.
$ltime=$stime-$dtime;
$timecc="and dateline>$ltime";
}else{$timecc=NULL;}
$query = $db->query("SELECT fid, tid, subject, author, replies FROM $table_threads WHERE $fidis $tidis $whatis $cccc closed=0 $timecc ORDER BY rand() DESC LIMIT 1");
if(!$thread = $db->fetch_array($query))showmessage("对不起, 没有找到符合条件的记录!", "javascript:history.go(-1);");



//取出发言机器人的名字
$uptime=$usertime;
$usertime=time()-$usertime;
$query = $db->query("SELECT d.*, a.logintime FROM cdb_postmach d LEFT JOIN $table_members a ON a.uid=d.sside WHERE d.style='user' and d.cdate<'$usertime' ORDER BY rand() DESC LIMIT 1");
if(!$userplay = $db->fetch_array($query))showmessage("对不起, 没有找到可用的参数, 请设置好所有参数后使用!", "javascript:history.go(-1);");

$upalltime=$uptime*rand(5,20);
$upmonth=date(n);
if($lastmonth<$upmonth){
        $upmonthtime=0;
}else{
        $upmonthtime="onlinemonth+".$upalltime;
}
$db->query("UPDATE $table_members SET onlinetime=onlinetime+$upalltime, onlinemonth=$upmonthtime, lastmonth=$upmonth WHERE username='$userplay[value]'");



if($thison){


//沙发,板凳,地板的特殊效果
if($postmachother){
if($thread['replies']==0){
        $seles="style='onep'";
}elseif($thread['replies']==1){
        $seles="style='twop'";
}elseif($thread['replies']==3){
        $seles="style='thrp'";
}else{
        $seles="style='post' and ( sside='$thread[fid]' or sside='0' )";
}
}else{
        $seles="style='post' and ( sside='$thread[fid]' or sside='0' )";
}


//取出发言信息
$posttime=time()-$posttime;
$query = $db->query("SELECT * FROM cdb_postmach WHERE $seles and cdate<'$posttime' ORDER BY rand() DESC LIMIT 1");
if(!$postplay = $db->fetch_array($query))showmessage("对不起, 没有找到可用的参数, 请设置好所有参数后使用!", "javascript:history.go(-1);");


$aslong = "主题:<b>".$thread['subject']."</b><hr>(<font color=red>".$userplay['value']."</font>)回复: ".$postplay['value'];


//增加机器人发言


$timeer=time();
$db->query("INSERT INTO $table_posts (fid, tid, author, authorid, dateline, message, bbcodeoff)
                                VALUES ('$thread[fid]', '$thread[tid]', '$userplay[value]', '$userplay[sside]', '$timeer', '$postplay[value]', '0')");
$db->query("UPDATE $table_threads SET lastpost='$timeer', lastposter='$userplay[value]', views=views+1, replies=replies+1 WHERE tid='$thread[tid]'");


$db->query("UPDATE $table_forums SET lastpost='".addslashes($thread['subject'])."\t$timestamp\t$userplay[value]', posts=posts+1 WHERE fid='$thread[fid]'", 'UNBUFFERED');
if ($forum['fup'] && $forum['type'] == 'sub' && !$forum['viewperm']) {
                $db->query("UPDATE $table_forums SET lastpost='".addslashes($thread['subject'])."\t$timestamp\t$userplay[value]'  WHERE fid='$forum[fup]'", 'UNBUFFERED');
        }

machermember($userplay['sside'], $replycredits);


machersession($userplay['sside'], $userplay['value'], $thread['fid'], $thread['tid']);

}

else{

$aslong = "发言功能为关闭状态, 目前只启动机器人在线功能!刷新速度:".$reftime;

machersession($userplay['sside'], $userplay['value'], $thread['fid'], $thread['tid']);

}


include template('macher');




//定义机器人在线函数
function machersession($uids, $userss, $fid, $tid) {
        global $db, $sid, $sessionexists, $timestamp, $onlinehold, $table_sessions, $table_members, $onlineip;
                        $ips = explode('.', $onlineip);
                        $acti = rand(0,3)<2 ? 3 : 12;
                        $query = $db->query("SELECT groupid, styleid, invisible FROM $table_members WHERE uid='$uids'");
                        $usergid = $db->fetch_array($query);
                        $db->query("DELETE FROM $table_sessions WHERE sid='$uids'");
                        $db->query("INSERT INTO $table_sessions (sid, ip1, ip2, ip3, ip4, uid, username, groupid, styleid, invisible, action, lastactivity, fid, tid)
                                VALUES ('$uids', '$ips[0]', '$ips[1]', '$ips[2]', '$ips[3]', '$uids', '$userss', '$usergid[groupid]', '$usergid[styleid]', '$usergid[invisible]', '$acti', '$timestamp', '$fid', '$tid')");
                        if($discuz_uid) {
                                $db->query("UPDATE $table_members SET sinew=sinew+1, credit=credit+".intval($logincredits).", lastip='$onlineip', lastvisit=lastactivity, lastactivity=$timestamp WHERE uid='$uids'", 'UNBUFFERED');
                }
                $sessionupdated = 1;
}




//机器人发贴加积分,金钱,及升级函数
function machermember($uidss, $credits) {
        global $db, $table_members, $table_usergroups, $timestamp;
       
        $addcredit = $addpost = $newcredit = $newpost =0;
        if(!$uidss ) return;
        $query = $db->query("SELECT credit FROM $table_members WHERE uid='$uidss'");
        $usercr = $db->fetch_array($query);
        $groupidadd = NULL;
        $newcredit = $usercr['credit'] + intval("$credits");
        if($credits <> 0 && !($newcredit % 10)) {
                $query = $db->query("SELECT groupid FROM $table_usergroups WHERE type='member' AND '$newcredit'>=creditshigher AND '$newcredit'<creditslower");
                $groupidadd = ", groupid='".$db->result($query, 0)."'";
        }
        $db->query("UPDATE $table_members SET $moneys postnum=postnum+1, credit=$newcredit, lastpost='$timestamp' $groupidadd WHERE uid='$uidss'");
}

?>
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-11-22 12:12 , Processed in 0.030000 second(s), 3 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表