Welcome to OzziesWorld.com. Click here to register

Mods Database - Mod Detail

Mod Title:
Bots Page 1.0.2
Author:
Ulrik Christensen (Stoker)
phpbb Version:
3.0.4
Website:

Description

This modification will add a Bots page containing info about the installed bots.

Comments

Added BOT Last Visit and changed formatting of page.

#
#-----[ OPEN ]------------------------------------------
#

bots.php

#
#-----[ FIND ]------------------------------------------
#

$sql = 'SELECT bot_id, bot_active, bot_name, bot_agent, bot_ip
FROM ' . BOTS_TABLE . '
ORDER BY bot_id ASC';

#
#-----[ REPLACE WITH ]----------------------------------
#

$sql = 'SELECT b.bot_id, b.bot_active, b.bot_name, b.bot_agent, b.bot_ip, u.user_lastvisit
FROM ' . BOTS_TABLE . ' b
LEFT JOIN ' . USERS_TABLE . ' u
ON b.user_id = u.user_id
ORDER BY bot_id ASC';

#
#-----[ FIND ]------------------------------------------
#

while ($row = $db->sql_fetchrow($result))
{

#
#-----[ ADD BEFORE ]------------------------------------
#

$i = 0;

#
#-----[ FIND ]------------------------------------------
#

'BOT_IP' => $row['bot_ip'],

#
#-----[ ADD AFTER ]-------------------------------------
#

'BOT_VISIT' => ($row['user_lastvisit']) ? create_date( $user->data['user_dateformat'], $row['user_lastvisit'], ($user->data['user_timezone'] + $user->data['user_dst'] ) ) : $user->lang['NEVER'],
'S_ROW_COUNT' => $i,

#
#-----[ FIND ]------------------------------------------
#

}
$db->sql_freeresult($result);

$template->assign_vars(array(

#
#-----[ ADD BEFORE ]------------------------------------
#

$i++;


#
#-----[ OPEN ]------------------------------------------
#

language/en/common.php

#
#-----[ FIND ]------------------------------------------
#

'BOTS_COUNT' => '%d Bots',

#
#-----[ ADD AFTER ]-------------------------------------
#

'BOTSSVISIT' => 'Last Visit',

#
#-----[ OPEN ]------------------------------------------
#

styles/prosilver/template/bots_body.html

#
#-----[ FIND ]------------------------------------------
#

<th class="info" style="width:70px;">{L_BOTSSID}</th>
<th class="info" style="width:150px;">{L_BOTSSNAME}</th>
<th class="info" style="width:250px;">{L_BOTSSAGENT}</th>
<th class="info" style="width:100px;">{L_BOTSSIP}</th>
<th class="info" style="width:70px;">{L_BOTSSACTIVE}</th>

#
#-----[ REPLACE WITH ]----------------------------------
#

<th class="navbar" style="width:8%;text-align: center;"><b>{L_BOTSSID}</b></th>
<th class="navbar" style="width:20%;text-align: left;"><b>{L_BOTSSNAME}</b></th>
<th class="navbar" style="width:32%;text-align: left;"><b>{L_BOTSSAGENT}</b></th>
<th class="navbar" style="width:12%;text-align: left;"><b>{L_BOTSSIP}</b></th>
<th class="navbar" style="width:8%;text-align: center;"><b>{L_BOTSSACTIVE}</b></th>
<th class="navbar" style="width:20%;text-align: center;"><b>{L_BOTSSVISIT}</b></th>

#
#-----[ FIND ]------------------------------------------
#

<!-- IF bots.S_ROW_COUNT is even --><tr class="bg1"><!-- ELSE --><tr class="bg2"><!-- ENDIF -->
<td>{bots.BOT_ID}</td>
<td>{bots.BOT_NAME}</td>
<td>{bots.BOT_AGENT}&nbsp;</td>
<td>{bots.BOT_IP}&nbsp;</td>
<td><!-- IF bots.BOT_ACTIVE -->{L_YES}<!-- ELSE -->{L_NO}<!-- ENDIF --></td>


#
#-----[ REPLACE WITH ]----------------------------------
#

<tr>
<!-- IF bots.S_ROW_COUNT is even --><td class="row1" style="text-align: center;"><!-- ELSE --><td class="row2" style="text-align: center;"><!-- ENDIF -->{bots.BOT_ID}</td>
<!-- IF bots.S_ROW_COUNT is even --><td class="row1" style="text-align: left;"><!-- ELSE --><td class="row2" style="text-align: left;"><!-- ENDIF -->{bots.BOT_NAME}</td>
<!-- IF bots.S_ROW_COUNT is even --><td class="row1" style="text-align: left;"><!-- ELSE --><td class="row2" style="text-align: left;"><!-- ENDIF -->{bots.BOT_AGENT}&nbsp;</td>
<!-- IF bots.S_ROW_COUNT is even --><td class="row1" style="text-align: left;"><!-- ELSE --><td class="row2" style="text-align: left;"><!-- ENDIF -->{bots.BOT_IP}&nbsp;</td>
<!-- IF bots.S_ROW_COUNT is even --><td class="row1" style="text-align: center;"><!-- ELSE --><td class="row2" style="text-align: center;"><!-- ENDIF --><!-- IF bots.BOT_ACTIVE -->{L_YES}<!-- ELSE -->{L_NO}<!-- ENDIF --></td>
<!-- IF bots.S_ROW_COUNT is even --><td class="row1" style="text-align: left;"><!-- ELSE --><td class="row2" style="text-align: left;"><!-- ENDIF -->{bots.BOT_VISIT}&nbsp;</td>

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM