Here are the code that im using for my online list
index
genproc
and core
Code:
else if($action=="online") { $showavatar = mysql_fetch_array(mysql_query("SELECT showavatar FROM ibwf_users WHERE id='".$uid."'")); $mmsg = htmlspecialchars(getsetmood(getuid_sid($sid))); addonline(getuid_sid($sid),"Online list Xhtml-$mmsg","index.php?action=online"); $pstyle = gettheme($sid); echo xhtmlhead("Online List",$pstyle); echo "<body>"; echo "<p align=\"center\">"; getalert($sid); //////ALL LISTS SCRIPT << if($page=="" || $page<=0)$page=1; $num_items = getnumonline(); //changable $items_per_page= 10; $num_pages = ceil($num_items/$items_per_page); if($page>$num_pages)$page= $num_pages; $limit_start = ($page-1)*$items_per_page; $sql = "SELECT a.name, a.perm, b.place, b.userid, a.sex, a.mood FROM ibwf_users a INNER JOIN ibwf_online b ON a.id = b.userid GROUP BY 1,2 LIMIT $limit_start, $items_per_page"; boxstart("Online List"); echo "<p align=\"left\">"; $items = mysql_query($sql); echo mysql_error(); while ($item = mysql_fetch_array($items)) { if($item[1]=='0') { $tit = ""; }if($item[1]=='1') { $tit = "³"; }if($item[1]=='2') { $tit = "²"; } if($item[1]=='3') { $tit = "¹"; } if($item[1]=='4') { $tit = "º"; } $sex = mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE name='$item[0]'")); if($sex[0]=="M"){$usersex = "<img src=\"images/male.gif\" alt=\"(M)\"/>";} if($sex[0]=="F"){$usersex = "<img src=\"images/female.gif\" alt=\"(F)\"/>";} if($sex[0]==""){$usersex = "";} if($item[1]>'0') { $lnk = "$usersex<a href=\"index.php?action=viewuser&who=$item[3]&sid=$sid\">$tit$item[0]</a>"; }else{ $lnk = "$usersex<a href=\"index.php?action=viewuser&who=$item[3]&sid=$sid\">$tit$item[0]</a>"; } ////////////////////online avatar if($showavatar[0]=="1") { $avlink = getavatar($item[3]); if ($avlink!=""){ echo "<img src=\"$avlink\" height=\"25\" width=\"25\" alt=\"avatar\"/>"; }else{ echo "<img src=\"/images/nopic.jpg\" height=\"25\" width=\"25\" alt=\"avatar\"/>"; } } echo "$lnk - $item[2] <br/>"; } $mmsg1 = parsemsg(getsetmood($item[2]), $sid); if(!$mmsg1=="") { echo "($mmsg1) - $item[1] "; }else{ echo " $item[1]<br/>"; } //echo "</p>"; //echo "<p align=\"center\">"; if($page>1) { $ppage = $page-1; echo "<a href=\"index.php?action=online&page=$ppage&sid=$sid\">Prev</a> "; } if($page<$num_pages) { $npage = $page+1; echo "<a href=\"index.php?action=online&page=$npage&sid=$sid\">Next</a>"; } echo "<br/>$page/$num_pages"; if($num_pages>2) { echo getjumper($action, $sid,"index"); } echo "</p>"; ////// UNTILL HERE >> boxend(); $nick = getnick_sid($sid); boxstart("Menu"); echo "<a href=\"index.php?action=mood&sid=$sid\">Update Mood</a><br/>"; $tmsg = getpmcount(getuid_sid($sid)); $umsg = getunreadpm(getuid_sid($sid)); echo "<a href=\"inbox.php?action=main&sid=$sid\">Inbox($umsg/$tmsg)</a><br/>"; echo "<a href=\"index.php?action=formmenu&sid=$sid\">Forums</a><br/>"; echo "<a href=\"lists.php?action=buds&sid=$sid\">BuddyList</a><br/>"; echo "<a href=\"index.php?action=chat&sid=$sid\">Chatrooms</a><br/>"; /////////main menu footer echo "<div class=\"footer\">"; $thid = mysql_fetch_array(mysql_query("SELECT themeid FROM ibwf_users WHERE id='".$uid."'")); $themeimageset = mysql_fetch_array(mysql_query("SELECT themedir FROM ibwf_iconset WHERE id='".$thid[0]."'")); echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/themes/$themeimageset[0]/home.gif\" alt=\"*\"/>"; echo "Home</a>"; echo xhtmlfoot(); boxend(); echo "</div>"; }
Code:
else if($action=="mood") {boxstart("Set Moods"); $pstyle = gettheme($sid); echo xhtmlhead("Sign a Guestbook",$pstyle); echo "<p align=\"center\">";getalert($sid); $mmsg = htmlspecialchars(getsetmood(getuid_sid($sid))); $uid = getuid_sid($sid); echo "<form action=\"genproc.php?action=upmood&sid=$sid\" method=\"post\">"; echo "SET MOOD TO:<br/><input name=\"mmsg\" maxlength=\"30\"/><br/>"; echo "<input type=\"Submit\" name=\"submit\" Value=\"Submit\"></form>"; echo "</p>"; /////////main menu footer echo "<div class=\"footer\">"; $thid = mysql_fetch_array(mysql_query("SELECT themeid FROM ibwf_users WHERE id='".$uid."'")); $themeimageset = mysql_fetch_array(mysql_query("SELECT themedir FROM ibwf_iconset WHERE id='".$thid[0]."'")); echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/themes/$themeimageset[0]/home.gif\" alt=\"*\"/>"; echo "Home</a>"; echo xhtmlfoot(); boxend(); echo "</div>"; }
Code:
else if($action=="upmood") {$pstyle = gettheme($sid); echo xhtmlhead("$stitle",$pstyle); boxstart("Update Font Size"); addonline(getuid_sid($sid),"Updating My Mood",""); $mmsg = $_POST["mmsg"]; echo "<head>"; echo "<title>Set OnlineList Mood</title>"; echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"styles/style.css\">"; echo "</head>"; echo "<body>"; echo "<p align=\"center\">"; $res = mysql_query("UPDATE ibwf_users SET setmood='".$mmsg."' WHERE id='".$uid."'"); if($res) { echo "<img src=\"images/ok.gif\" alt=\"o\"/>Mood updated successfully<br/>"; }else{ echo "<img src=\"images/notok.gif\" alt=\"x\"/>Can't update your Mood<br/>"; } echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"\"/>Home</a>"; echo "</p>"; echo "</body>"; }
Code:
/////////////////////////////////////////////Get Mood function getsetmood($uid) { $getdata = mysql_fetch_array(mysql_query("SELECT setmood FROM ibwf_users WHERE id='".$uid."'")); return $getdata[0]; $text = getsmilies($text); }
Comment