(maybe i missed a previous post.. but upto now it only showed on index or the forums)
this method also calculates a realistic online time (bot is always there)
i use 184 minutes before the users session time. you could also use a random timeframe... but then it would change every time the page is reloaded
mt_rand is used to show the page the bot is on... this one changes every time the page is reloading.
you can also specify 2 forums it is surfing on ... (more could be added)
I'd like your opinion and suggestions!!! (and corrections)
demo on http://www.sunmod.net/forum/viewonline.php
(guess what.. wild betty is the bot)
do a page reload to follow her steps...
ok.. here it is:
in viewonline.php find
Code: Select all
$registered_users = 0;
Code: Select all
if ( $board_config['iai_active_all'] == 1 )
{
$registered_users = 1;
}
else
{
$registered_users = 0;
}
Code: Select all
if ( $guest_users == 0 )
{
$template->assign_vars(array(
'L_NO_GUESTS_BROWSING' => $lang['No_users_browsing'])
);
}
Code: Select all
if ( $board_config['iai_active_all'] == 1 )
{
/**********************************************************
config part which forums should the bot be browsing. choose 2!
**********************************************************/
$bot_forum_1 =1;
$bot_forum_2 =2;
// use this one if you want random time
// $sub_mins = mt_rand(100, 300);
// use this one if you want a steady time
$sub_mins = 184; // in minutes compared to the user looking at the page.
/**********************************************************
Configuration END
**********************************************************/
// now mt_rand so the page will change every reload..
mt_srand((double)microtime()*1000000);
$bot_loc = mt_rand(1, 11);
switch( $bot_loc )
{
case 1:
$bot_location = $lang['Forum_index'];
$bot_location_url = "index.$phpEx";
break;
case 2:
$bot_location = $lang['Posting_message'];
$bot_location_url = "index.$phpEx";
break;
case 3:
$bot_location = $lang['Logging_on'];
$bot_location_url = "index.$phpEx";
break;
case 4:
$bot_location = $lang['Searching_forums'];
$bot_location_url = "search.$phpEx";
break;
case 5:
$bot_location = $lang['Viewing_profile'];
$bot_location_url = "index.$phpEx";
break;
case 6:
$bot_location = $lang['Viewing_online'];
$bot_location_url = "viewonline.$phpEx";
break;
case 7:
$bot_location = $lang['Viewing_member_list'];
$bot_location_url = "memberlist.$phpEx";
break;
case 8:
$bot_location = $lang['Viewing_priv_msgs'];
$bot_location_url = "privmsg.$phpEx";
break;
case 9:
$bot_location = $lang['Viewing_FAQ'];
$bot_location_url = "faq.$phpEx";
break;
case 10:
$bot_location_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $bot_forum_1);
$bot_location = $forum_data[$bot_forum_1];
break;
case 11:
$bot_location_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $bot_forum_2);
$bot_location = $forum_data[$bot_forum_2];
break;
default:
$bot_location = $lang['Forum_index'];
$bot_location_url = "index.$phpEx";
}
$bot_session_time = time() - ($sub_mins * 60);
$bot_time = create_date($board_config['default_dateformat'], $bot_session_time, $board_config['board_timezone']);
$show_bot = '<tr><td width="35%" class="row2">&<span class="genmed2"><a class="genmed2" href="' . append_sid('profile.' . $phpEx . '?mode=viewprofile&' . POST_USERS_URL . '=' . $board_config['iai_userid']) . '">' . $board_config['iai_username'] . '</a></span>&</td><td width="25%" align="center" nowrap="nowrap" class="row2">&<span class="genmed">'.$bot_time.'</span>&</td><td width="40%" class="row2">&<span class="genmed"><a href="'.$bot_location_url.'" class="genmed2">'.$bot_location.'</a></span>&</td> </tr>';
$template->assign_vars(array(
'SHOW_BOT' => $show_bot )
);
}
in viewonline_body.tpl
find:
Code: Select all
<!-- BEGIN reg_user_row -->
Code: Select all
{SHOW_BOT}
<!-- BEGIN reg_user_row -->