يك هك جالب كه باعث ميشه وضعيت آنلاين و يا آفلاين بودن كاربري كه نظر داده رو فهميد.
1- فايل Engine/Modules/show.full.php را باز كنيد و به دنبال كد زير بگرديد:
$sql_result = $db->query("SELECT " . PREFIX . "_comments.id, post_id, " . PREFIX . "_comments.user_id, date, autor as gast_name, " . PREFIX . "_comments.email as gast_email, text, ip, is_register, name, " . USERPREFIX . "_users.email, news_num, comm_num, user_group, reg_date, signature, foto, fullname, land, icq, xfields FROM " . PREFIX . "_comments LEFT JOIN " . USERPREFIX . "_users ON " . PREFIX . "_comments.user_id=" . USERPREFIX . "_users.user_id WHERE " . PREFIX . "_comments.post_id = '$news_id'".$where_approve." ORDER BY date ".$config['comm_msort']." LIMIT ".$cstart.",".$config['comm_nummers']);
كد زير را به جاي آن قرار دهيد (Replace) :
$sql_result = $db->query("SELECT " . PREFIX . "_comments.id, post_id, " . PREFIX . "_comments.user_id, date, autor as gast_name, " . PREFIX . "_comments.email as gast_email, text, ip, is_register, name, " . USERPREFIX . "_users.email, news_num, comm_num, user_group, lastdate, reg_date, signature, foto, fullname, land, icq, xfields FROM " . PREFIX . "_comments LEFT JOIN " . USERPREFIX . "_users ON " . PREFIX . "_comments.user_id=" . USERPREFIX . "_users.user_id WHERE " . PREFIX . "_comments.post_id = '$news_id'".$where_approve." ORDER BY date ".$config['comm_msort']." LIMIT ".$cstart.",".$config['comm_nummers']);
2- در همان فايل به دنبال كد زير بگرديد:
if ($row['is_register'] AND $row['icq']) $tpl->set('{icq}', stripslashes($row['icq']));
else $tpl->set('{icq}', '--');
else $tpl->set('{icq}', '--');
بعد از آن كد زير را قرار دهيد:
if ($row['is_register'])
{
$timer = 5; #время, в течении которого пользователь считается онлайн (в минутах)
$ddata = $row['lastdate'] + ($timer*60);
$_REAL_TIME = time()+($config['date_adjust']*60);
if ($_REAL_TIME < $ddata) $fuser_status = "<font color=green>آنلاين</font>";
else $fuser_status = "<font color=red>آفلاين</font>";
}
else
{
$fuser_status = "";
}
$tpl->set('{fuser-status}',$fuser_status);
{
$timer = 5; #время, в течении которого пользователь считается онлайн (в минутах)
$ddata = $row['lastdate'] + ($timer*60);
$_REAL_TIME = time()+($config['date_adjust']*60);
if ($_REAL_TIME < $ddata) $fuser_status = "<font color=green>آنلاين</font>";
else $fuser_status = "<font color=red>آفلاين</font>";
}
else
{
$fuser_status = "";
}
$tpl->set('{fuser-status}',$fuser_status);
3- فايل Engine/Modules/lastcomments.php را باز كنيد و به دنبال كد زير بگرديد:
$sql_comm = "SELECT SQL_CALC_FOUND_ROWS " . PREFIX . "_comments.id, post_id, " . PREFIX . "_comments.user_id, " . PREFIX . "_comments.date, " . PREFIX . "_comments.autor as gast_name, " . PREFIX . "_comments.email as gast_email, text, ip, is_register, name, " . USERPREFIX . "_users.email, news_num, " . USERPREFIX . "_users.comm_num, user_group, reg_date, signature, foto, fullname, land, icq, " . USERPREFIX . "_users.xfields as xprofile, " . PREFIX . "_post.title, " . PREFIX . "_post.date as newsdate, " . PREFIX . "_post.alt_name, " . PREFIX . "_post.category, " . PREFIX . "_post.flag FROM " . PREFIX . "_comments LEFT JOIN " . PREFIX . "_post ON " . PREFIX . "_comments.post_id=" . PREFIX . "_post.id LEFT JOIN " . USERPREFIX . "_users ON " . PREFIX . "_comments.user_id=" . USERPREFIX . "_users.user_id ".$where." ORDER BY date desc LIMIT ".$cstart.",".$number;
كد زير را به جاي آن قرار دهيد:
$sql_result = $db->query("SELECT " . PREFIX . "_comments.id, post_id, " . PREFIX . "_comments.user_id, date, autor as gast_name, " . PREFIX . "_comments.email as gast_email, text, ip, is_register, name, " . USERPREFIX . "_users.email, news_num, comm_num, user_group, lastdate, reg_date, signature, foto, fullname, land, icq, xfields FROM " . PREFIX . "_comments LEFT JOIN " . USERPREFIX . "_users ON " . PREFIX . "_comments.user_id=" . USERPREFIX . "_users.user_id WHERE " . PREFIX . "_comments.post_id = '$news_id'".$where_approve." ORDER BY date ".$config['comm_msort']." LIMIT ".$cstart.",".$config['comm_nummers']);
4- در همان فايل به دنبال كد زير بگرديد:
if ($row['is_register'] AND $row['icq']) $tpl->set('{icq}', stripslashes($row['icq']));
else $tpl->set('{icq}', '--');
else $tpl->set('{icq}', '--');
بعد از آن كد زير را قرار دهيد:
if ($row['is_register'])
{
$timer = 5; #время, в течении которого пользователь считается онлайн (в минутах)
$ddata = $row['lastdate'] + ($timer*60);
$_REAL_TIME = time()+($config['date_adjust']*60);
if ($_REAL_TIME < $ddata) $fuser_status = "<font color=green>آنلاين</font>";
else $fuser_status = "<font color=red>آفلاين</font>";
}
else
{
$fuser_status = "";
}
$tpl->set('{fuser-status}',$fuser_status);
{
$timer = 5; #время, в течении которого пользователь считается онлайн (в минутах)
$ddata = $row['lastdate'] + ($timer*60);
$_REAL_TIME = time()+($config['date_adjust']*60);
if ($_REAL_TIME < $ddata) $fuser_status = "<font color=green>آنلاين</font>";
else $fuser_status = "<font color=red>آفلاين</font>";
}
else
{
$fuser_status = "";
}
$tpl->set('{fuser-status}',$fuser_status);
حالا با قرار دادن كد {fuser-status} در هر جاي comments.tpl كه ميخواهيد , ميتوانيد اين هك را به نمايش در بياوريد.