ady_constantine
Active Member
کد:
##############################################################
## MOD Title: Online/Offline Mod
## MOD Author: MohamadReza Zarif < [email][email protected][/email] > (n/a) http://www.yarantoos.com/forum
## MOD Description: This mod will show the Online status of a user, stating if
## he is "Online", "Offline" (with images)
## MOD Version: 1.0.0
## Compatibility: 2.0.3 - 2.0.8
##
## Installation Level: Very Easy
## Installation Time: 2-5 minutes
## Files To Edit: 4
## viewtopic.php
## includes/usercp_viewprofile.php
## templates/Your Templates/profile_view_body.tpl
## templates/Your Templates/viewtopic_body.tpl
## Included Files: 2
## green.gif
## red.gif
##
##############################################################
## Author Notes:
##
## 1. Copyright and special thanks!
## -----------
## Thanks to Kooky < [email][email protected][/email] > (Online/Offline/hidden Mod)
##
## 2. Official last version link
## -----------
## Check this official link for latest updates...
## http://www.yarantoos.com/forum or http://forum.majidonline.com
##
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#
#-----[ COPY ]------------------------------------------
#
copy red.gif to /images
copy green.gif to /images
#
#-----[ OPEN ]------------------------------------------
#viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
//
// Go ahead and pull all data for this topic
//
$sql = "SELECT u.username
#
#-----[ IN-LINE FIND ]------------------------------------------
#
u.user_allowavatar, u.user_allowsmile
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------
#
, u.user_session_time
#
#-----[ FIND ]------------------------------------------
#
$temp_url = '';
if ( $poster_id != ANONYMOUS )
#
#-----[ Change with ]------------------------------------
#
$temp_url = '';
$status ='';
if ( $poster_id != ANONYMOUS )
{
//
// Status User in forum
//
if ( $postrow[$i]['user_session_time'] >= (time()-60) )
$status = '<img border="0" src="images\green.gif" alt="User is Online" >';
else
$status = '<img border="0" src="images\red.gif" alt="User is Offine">';
// Online/Offline Mod
#
#-----[ FIND ]------------------------------------------
#
'DELETE' => $delpost,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'STATUS' => $status,
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_viewprofile.php
#
#-----[ FIND ]------------------------------------------
#
$poster_rank = '';
$rank_image = '';
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Start add - Online/Offline
if ( $profiledata['user_session_time'] >= (time()-60) )
$status = '<img border="0" src="images\green.gif" alt="User is Online" >';
else
$status = '<img border="0" src="images\red.gif" alt="User is Offine">';
// End add - Online/Offline
#
#-----[ FIND ]------------------------------------------
#
'YIM' => $yim,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'STATUS' => $status,
#
#
#-----[ OPEN ]------------------------------------------
#
templates/Your templates/viewtopic_body.tpl
#
#-----[ FIND ]------------------------------------------
#
{postrow.POSTER_FROM}<br />
#
#-----[ AFTER ADD ]------------------------------------------
#
{postrow.STATUS}<br />
#
#-----[ OPEN ]------------------------------------------
#
templates/Your Templates/profile_view_body.tpl
#
#-----[ FIND ]------------------------------------------
#
{ICQ_IMG}</span></font></td>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<tr>
<td valign="middle" nowrap align="right"><span class="gen">
<font face="Tahoma" size="2">
<span lang="fa">وضعیت کاربر</span>
<span lang="fa">در فروم</span></font></span><font face="Tahoma" size="2"><span class="gen">:</span></font></td>
<td class="row1" valign="middle"><font face="Tahoma" size="2"><span class="gen">{STATUS}</span></font></td>
</tr>
#
#
#-----[ SAVE/CLOSE ALL FILES ]----------------------------------------
#
# EoM