Edgein |
28th December 2009 10:59 |
[FTS 1.1] Make usernames by whats going on a clickable link
include/facktory.php
find
PHP Code:
public function whatsgoingon() { $a = @mysql_fetch_assoc(@sql_query("SELECT id,username FROM users WHERE status='confirmed' ORDER BY id DESC LIMIT 1")) or sqlerr(__FILE__, __LINE__); if ($CURUSER) $latestuser = "<a href=userdetails.php?id=" . $a["id"] . ">" . $a["username"] . "</a>"; else $latestuser = $a['username'];
//stats $dt24 = gmtime() - 86400; $arr = mysql_fetch_assoc(sql_query("SELECT * FROM avps WHERE arg='last24'")) or $no24=true; $res=sql_query("SELECT * FROM users WHERE last_access >= '". get_date_time($dt24). "' ORDER BY username") or sqlerr(__FILE__, __LINE__); $totalonline24 = mysql_num_rows($res);
$_ss24 = ($totalonline24 != 1) ? 's':'';
$last24record = get_date_time($arr["value_u"]); $last24 = $arr["value_i"]; if ($no24 || $totalonline24 > $last24 ) { $last24 = $totalonline24;
$period = strtotime(gmdate("Y-m-d H:i:s")); sql_query(($no24 ? 'INSERT':'UPDATE'). " avps SET value_i = $last24 , value_u = $period ". ($no24 ? ", arg='last24'":"WHERE arg='last24'")) or sqlerr(); } while ($arr = mysql_fetch_assoc($res)) { if ($activeusers24) $activeusers24 .= ",\n";
$arr["username"] = get_style($arr['class'],$arr['username']);
if($donator = $arr["donor"] === "yes"); $activeusers24 .= "<nobr>"; if ($warned = $arr["warned"] === "yes") $activeusers24 .= "<nobr>"; if ($CURUSER) $activeusers24 .= "<a href=userdetails.php?id={$arr["id"]}><b>{$arr["username"]}</b></a>"; else $activeusers24 .= "<b>{$arr["username"]}</b>"; if ($donator) $activeusers24 .= "<img src={$pic_base_url}star.gif alt='Donated {$$arr["donor"]}'></nobr>"; if ($warned) $activeusers24 .= "<img src={$pic_base_url}warned.gif alt='Warned {$$arr["warned"]}'></nobr>"; }
if (!$activeusers24) $activeusers24 = "There have been no active users in the last 24 hours."; $dt = gmtime() - 180; $dt = sqlesc(get_date_time($dt)); $res = sql_query("SELECT id, username, class FROM users WHERE last_access >= $dt ORDER BY username") or print(mysql_error()); while ($arr = mysql_fetch_assoc($res)) { if ($activeusers) $activeusers .= ",\n"; $arr['username'] = get_style($arr['class'],$arr['username']); $dispclass = get_user_class_name($arr['class']); $donator = $arr["donated"] > 0; if ($donator) $activeusers .= "<nobr>"; if ($CURUSER) $activeusers .= "<a href=userdetails.php?id=" . $arr["id"] . "><b>" . $arr["username"] . "</b></a>"; else $activeusers .= "<b>$arr[username]</b>"; if ($donator) $activeusers .= "<img src=pic/star.gif alt='Donated $$arr[donated]'></nobr>"; } if (!$activeusers) $activeusers = "There have been no active users in the last 15 minutes."; echo _br; global $BASEURL; collapses('whatisgon','<b>Whats goin on?</b>'); $activeusers24 = explode(",",$activeusers24); $activeusers = explode(",",$activeusers); ?> <center> <?=$totalonline24?> Member<?=$_ss24?> has visited during the last 24 hours <a href="javascript:klappe_news('u24')"><img border="0" src='<?$BASEURL?>/pic/plus.gif' id="pica0"/></a> <div id="ku24" style="display: none;"> <?php $i = 0 ; foreach($activeusers24 as $fts) { $perrow = 17 ; echo $fts; print ( ($i && $i % $perrow == 0) ? "" : "" ) ; $i++; } ?> </div> Welcome to our newest member, <b><?=$latestuser?></b>! Active users <a href="javascript:klappe_news('a0')"><img border="0" src='<?$BASEURL?>/pic/plus.gif' id="pica0"/></a> <div id="ka0" style="display: none;"> <p align="justify"> <?php foreach($activeusers as $fts) { $perrow = 17 ; echo $fts; print ( ($i && $i % $perrow == 0) ? "" : "" ) ; $i++; } ?></p> </div> </center>
<?php collapsee(); }
and replace with
PHP Code:
public function whatsgoingon() { $a = @mysql_fetch_assoc(@sql_query("SELECT id,username FROM users WHERE status='confirmed' ORDER BY id DESC LIMIT 1")) or sqlerr(__FILE__, __LINE__); if ($CURUSER) $latestuser = "<a href=userdetails.php?id=" . $a["id"] . ">" . $a["username"] . "</a>"; else $latestuser = "<a href=userdetails.php?id=" . $a["id"] . ">" . $a["username"] . "</a>";
//stats $dt24 = gmtime() - 86400; $arr = mysql_fetch_assoc(sql_query("SELECT * FROM avps WHERE arg='last24'")) or $no24=true; $res=sql_query("SELECT * FROM users WHERE last_access >= '". get_date_time($dt24). "' ORDER BY username") or sqlerr(__FILE__, __LINE__); $totalonline24 = mysql_num_rows($res);
$_ss24 = ($totalonline24 != 1) ? 's':'';
$last24record = get_date_time($arr["value_u"]); $last24 = $arr["value_i"]; if ($no24 || $totalonline24 > $last24 ) { $last24 = $totalonline24;
$period = strtotime(gmdate("Y-m-d H:i:s")); sql_query(($no24 ? 'INSERT':'UPDATE'). " avps SET value_i = $last24 , value_u = $period ". ($no24 ? ", arg='last24'":"WHERE arg='last24'")) or sqlerr(); } while ($arr = mysql_fetch_assoc($res)) { if ($activeusers24) $activeusers24 .= ",\n";
$arr["username"] = get_style($arr['class'],$arr['username']);
if($donator = $arr["donor"] === "yes"); $activeusers24 .= "<nobr>"; if ($warned = $arr["warned"] === "yes") $activeusers24 .= "<nobr>"; if ($CURUSER) $activeusers24 .= "<b><a href=userdetails.php?id={$arr["id"]}><b>{$arr["username"]}</b></a>"; else $activeusers24 .= "<b><a href=userdetails.php?id={$arr["id"]}><b>{$arr["username"]}</b></a>"; if ($donator) $activeusers24 .= "<img src={$pic_base_url}star.gif alt='Donated {$$arr["donor"]}'></nobr>"; if ($warned) $activeusers24 .= "<img src={$pic_base_url}warned.gif alt='Warned {$$arr["warned"]}'></nobr>"; }
if (!$activeusers24) $activeusers24 = "There have been no active users in the last 24 hours."; $dt = gmtime() - 180; $dt = sqlesc(get_date_time($dt)); $res = sql_query("SELECT id, username, class FROM users WHERE last_access >= $dt ORDER BY username") or print(mysql_error()); while ($arr = mysql_fetch_assoc($res)) { if ($activeusers) $activeusers .= ",\n"; $arr['username'] = get_style($arr['class'],$arr['username']); $dispclass = get_user_class_name($arr['class']); $donator = $arr["donated"] > 0; if ($donator) $activeusers .= "<nobr>"; if ($CURUSER) $activeusers .= "<b><a href=userdetails.php?id=" . $arr["id"] . "><b>" . $arr["username"] . "</b></a>"; else $activeusers .= "<b><a href=userdetails.php?id=" . $arr["id"] . "><b>" . $arr["username"] . "</b></a>"; if ($donator) $activeusers .= "<img src=pic/star.gif alt='Donated $$arr[donated]'></nobr>"; } if (!$activeusers) $activeusers = "There have been no active users in the last 15 minutes."; echo _br; global $BASEURL; collapses('whatisgon','<b>Whats goin on?</b>'); $activeusers24 = explode(",",$activeusers24); $activeusers = explode(",",$activeusers); ?> <center> <?=$totalonline24?> Member<?=$_ss24?> has visited during the last 24 hours <a href="javascript:klappe_news('u24')"><img border="0" src='<?$BASEURL?>/pic/plus.gif' id="pica0"/></a> <div id="ku24" style="display: none;"> <?php $i = 0 ; foreach($activeusers24 as $fts) { $perrow = 17 ; echo $fts; print ( ($i && $i % $perrow == 0) ? "" : "" ) ; $i++; } ?> </div> Welcome to our newest member, <b><?=$latestuser?></b>! Active users <a href="javascript:klappe_news('a0')"><img border="0" src='<?$BASEURL?>/pic/plus.gif' id="pica0"/></a> <div id="ka0" style="display: none;"> <p align="justify"> <?php foreach($activeusers as $fts) { $perrow = 17 ; echo $fts; print ( ($i && $i % $perrow == 0) ? "" : "" ) ; $i++; } ?></p> </div> </center>
<?php collapsee(); }
greetzz Edgein :drink:
|