} if ($rowuser["reputation"] >= 1) { $rep = "<a href=index.php?page=reputationpage > Reputace <img src='images/rep/reputation_pos.gif' border='0' alt='" . $setrep["good_level"] . "' title='" . $setrep["good_level"] . "' /></a>"; } if ($rowuser["reputation"] <= -1) { $rep = "<a href=index.php?page=reputationpage > Reputace <img src='images/rep/reputation_neg.gif'border='0' alt='" . $setrep["bad_level"] . "' title='" . $setrep["bad_level"] . "' /></a>"; } if ($rowuser["reputation"] >= 101) { $rep = "<a href=index.php?page=reputationpage > Reputace <img src='images/rep/reputation_highpos.gif' border='0' alt='" . $setrep["best_level"] . "' title='" . $setrep["best_level"] . "' /></a>"; } if ($rowuser["reputation"] <= -101) { $rep = "<a href=index.php?page=reputationpage > Reputace <img src='images/rep/reputation_highneg.gif'border='0' alt='" . $setrep["worse_level"] . "' title='" . $setrep["worse_level"] . "' /></a>"; } } // DT end reputation system print "<td class=\"blocklist\" align=\"center\" style=\"text-align:left;\">" . $language["WELCOME_BACK"] . "<a href='index.php?page=userdetails&id=" . $CURUSER["uid"] . "'> " . user_with_color($CURUSER["username"], $CURUSER["prefixcolor"], $CURUSER["suffixcolor"]) . get_user_icons($CURUSER) . warn($CURUSER) . $rra . $upr . $udo . $udob . $ubir . $umal . $ufem . $uban . $uwar . $upar . $ubot . $utrmu . $utrmo . $uvimu . $uvimo . $ufrie . $ujunk . $ustaf . $usys . " </a> \n"; if ($CURUSER["announce"] == "yes") { print "<td class=\"blocklist\" align=\"left\" style=\"text-align:left;\"><a href=\"index.php?page=announcement&uid=" . $CURUSER["uid"] . "\"><img src=\"images/ann.png\"></a></td>\n"; } print "<td class=\"blocklist\" align=\"left\" style=\"text-align:left;\">" . $rep . " \n"; print "<td class=\"blocklist\" align=\"left\" style=\"text-align:left;\">" . $col . "<font color='{$freec}'>{$till}" . ucfirst($post) . "</font> {$pic}</td>\n"; print "<td class=\"blocklist\" align=\"left\" style=\"text-align:center;\"><a class=\"mainmenu\" href=\"logout.php\"><img src=\"images/logout.png \" /></a></td>\n"; ?> </tr> </table> <?php if (!$CURUSER || $CURUSER["view_torrents"] == "no") { // do nothing } else { if ($XBTT_USE) { $res = get_result("select count(*) as tot, sum(f.seeds)+sum(ifnull(x.seeders,0)) as seeds, sum(f.leechers)+sum(ifnull(x.leechers,0)) as leechs FROM {$TABLE_PREFIX}files f LEFT JOIN xbt_files x ON f.bin_hash=x.info_hash", true, $btit_settings['cache_duration']);
if (isset($_GET['delete'])) { if (!is_numeric($_GET['delete'])) { die; } $id = mysqli_real_escape_string($DBDT, $_GET['delete']); mysqli_query($GLOBALS["___mysqli_ston"], "DELETE FROM {$TABLE_PREFIX}radio_wish WHERE id='" . $id . "'"); } $wishsql = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM {$TABLE_PREFIX}radio_wish ORDER BY date DESC"); echo "<table border=\"0\">\n"; echo "<tr><td class=\"header\" colspan=5>Radio Requests:</td></tr>\n"; echo " <tr ><br />\n"; echo " <th class=\"header\" width=20%>User:</th><th class=\"header\" width=20%>Artist:</th><th class=\"header\" width=20%>Title:</th><th class=\"header\" width=20%>Genre:</th><th class=\"header\" width=20%>Date and Time</th>\n"; if ($CURUSER["admin_access"] == "yes") { echo "<th class=\"header\" width=10%>Action</th>\n"; } echo "</tr>\n"; while ($wishes = mysqli_fetch_assoc($wishsql)) { $wishname = user_with_color($wishes['name']); echo "<tr>\n"; echo "<td class=\"lista\">" . $wishname . "</td><td class=\"lista\">" . $wishes['title'] . "</td><td class=\"lista\">" . nl2br($wishes['comment']) . "</td></td><td class=\"lista\">" . nl2br($wishes['genre']) . "</td><td class=\"lista\">" . date('d-m-Y H:i:s', $wishes['date']) . "</td>\n"; if ($CURUSER["admin_access"] == "yes") { echo "<td class=\"lista\"><a href=\"index.php?page=modules&module=Radio_request&delete=" . $wishes['ID'] . "\">Remove</a></td>\n"; } echo "</tr>\n"; } echo "</table>\n"; } else { echo '<center><br><br>Access Denied<center>'; } $module_out = ob_get_contents(); ob_end_clean();
} if ($row["up_med"] >= 3) { $upl = "<img src='images/goblet/medaille_or.gif' alt='Gold Medal' title='Gold Medal' />"; } // DT Uploader Medals // DT arcade if ($row["trophy"] == 0) { $rra = ""; } if ($row["trophy"] == 1) { $rra = "<img src='images/crown.gif' alt='Arcade King' title='Arcade King' />"; } // DT arcade $style = style_list(); $langue = language_list(); print "\n<form name=\"jump\" method=\"post\" action=\"index.php\">\n<table class=\"poller\" width=\"100%\" cellspacing=\"0\">\n<tr><td align=\"center\">" . $language["USER_NAME"] . ":<a href='index.php?page=userdetails&id=" . $CURUSER["uid"] . "'> " . user_with_color(unesc($CURUSER["username"] . immunity($CURUSER) . get_user_icons($CURUSER)), $CURUSER["prefixcolor"], $CURUSER["suffixcolor"]) . $rra . $upl . warn($CURUSER) . "</a></td></tr>\n"; print "<tr><td align=\"center\">" . $language["USER_LEVEL"] . ": " . $CURUSER["level"] . "</td></tr>\n"; // DT reputation system start $reput = do_sqlquery("SELECT * FROM {$TABLE_PREFIX}reputation_settings WHERE id =1"); $setrep = mysqli_fetch_array($reput); if ($setrep["rep_is_online"] == 'false') { //do nothing } else { if ($row["reputation"] == 0) { $rep = "<img src='images/rep/reputation_balance.gif' alt='" . $setrep["no_level"] . "' title='" . $setrep["no_level"] . "' />"; } if ($row["reputation"] >= 1) { $rep = "<img src='images/rep/reputation_pos.gif' alt='" . $setrep["good_level"] . "' title='" . $setrep["good_level"] . "' />"; } if ($row["reputation"] <= -1) { $rep = "<img src='images/rep/reputation_neg.gif' alt='" . $setrep["bad_level"] . "' title='" . $setrep["bad_level"] . "' />";
} $expectdetailstpl->set("NO_COMMENTS", true, TRUE); } else { $expectdetailstpl->set("NO_COMMENTS", false, TRUE); if ($CURUSER["uid"] > 1) { $expectdetailstpl->set("INSERT_COMMENT", TRUE, TRUE); } else { $expectdetailstpl->set("INSERT_COMMENT", false, TRUE); } $comments = array(); $count = 0; foreach ($subres as $iid => $subrow) { $level = do_sqlquery("SELECT level FROM {$TABLE_PREFIX}users_level WHERE id_level='{$subrow['id_level']}'"); $lvl = mysqli_fetch_assoc($level); $title = "" . $lvl['level'] . ""; $comments[$count]["user"] = "******"index.php?page=userdetails&id=" . $subrow["uid"] . "\">" . user_with_color($subrow["user"]) . get_user_icons($row) . "</a> .::. " . $title; $comments[$count]["date"] = date("d/m/Y H.i.s", $subrow["data"] - $offset); // only users able to delete torrents can delete comments... if ($CURUSER["delete_torrents"] == "yes") { $comments[$count]["delete"] = "<a onclick=\"return confirm('" . str_replace("'", "\\'", $language["DELETE_CONFIRM"]) . "')\" href=\"index.php?page=offer_comment&id={$id}&cid=" . $subrow["id"] . "&action=delete\">" . image_or_link("{$STYLEPATH}/images/delete.png", "", $language["DELETE"]) . "</a>"; } $comments[$count]["comment"] = format_comment($subrow["text"]); $comments[$count]["elapsed"] = "(" . get_elapsed_time($subrow["data"]) . " ago)"; $comments[$count]["avatar"] = "<img onload=\"resize_avatar(this);\" src=\"" . ($subrow["avatar"] && $subrow["avatar"] != "" ? htmlspecialchars($subrow["avatar"]) : "{$STYLEURL}/images/default_avatar.gif") . "\" alt=\"\" />"; $comments[$count]["ratio"] = "<img src=\"images/arany.png\"> " . (intval($subrow['downloaded']) > 0 ? number_format($subrow['uploaded'] / $subrow['downloaded'], 2) : "---"); $comments[$count]["uploaded"] = "<img src=\"images/speed_up.png\"> " . makesize($subrow["uploaded"]); $comments[$count]["downloaded"] = "<img src=\"images/speed_down.png\"> " . makesize($subrow["downloaded"]); $count++; } unset($subrow); unset($subres);
$pre = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT COUNT(*) FROM {$TABLE_PREFIX}sb ") or sqlerr(); $row = mysqli_fetch_row($pre); $count = $row[0]; $perpage = 25; list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, "index.php?page=admin&user="******"uid"] . "&code=" . $CURUSER["random"] . "&do=sb_control&"); $admintpl->set("language", $language); $admintpl->set("pager_top", $pagertop); if ($count == 0) { $sb[$i]["name"] = "<center><font color=red> no seedbonus </font></center>"; $sb[$i]["item"] = "<center><font color=green> points </font></center>"; $sb[$i]["gb"] = "<center><font color=red> exchanged yet </center>"; $sb[$i]["points"] = "<center><font color=green> so </font></center></center>"; $sb[$i]["date"] = "<center><font color=red>nothing here ;)</font></center>"; $i++; } else { $data = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM {$TABLE_PREFIX}sb ORDER BY date DESC {$limit}") or die(is_object($GLOBALS["___mysqli_ston"]) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)); $sb = array(); $i = 0; while ($info = mysqli_fetch_array($data)) { $name = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT username FROM {$TABLE_PREFIX}users WHERE id=" . $info["id"]) or die(is_object($GLOBALS["___mysqli_ston"]) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)); $naam = mysqli_fetch_array($name); $sb[$i]["name"] = "<center><a href=\"index.php?page=userdetails&id=" . $info["id"] . "\">" . unesc(user_with_color($naam["username"])) . "</a></center>"; $sb[$i]["item"] = "<center>{$info['what']}</center>"; $sb[$i]["gb"] = "<center>" . makesize($info["gb"]) . "</center>"; $sb[$i]["points"] = "<center>{$info['points']}</center>"; $sb[$i]["date"] = "<center>{$info['date']}</center>"; $i++; } } $admintpl->set("sb", $sb); $admintpl->set("BACK2", "<br /><br /><center><a href=\"javascript: history.go(-1);\"><tag:language.BACK /></a></center>");
} if ($subrow["warn"] == "yes") { $war = "<img src='images/warn.gif'>"; } else { $war = ""; } $level = do_sqlquery("SELECT level FROM {$TABLE_PREFIX}users_level WHERE id_level='{$subrow['id_level']}'"); $lvl = mysqli_fetch_assoc($level); if (!$subrow[uid]) { $title = "orphaned"; } elseif (!"{$subrow['custom_title']}") { $title = "" . $lvl['level'] . ""; } else { $title = unesc($subrow["custom_title"]); } $comments[$count]["user"] = "******"index.php?page=userdetails&id=" . $subrow["uid"] . "\">" . user_with_color(unesc($subrow["user"])) . get_user_icons($subrow) . $spp . $war; $comments[$count]["user"] .= "</a><br>Rank: " . $title; // DT reputation system start $reput = do_sqlquery("SELECT * FROM {$TABLE_PREFIX}reputation_settings WHERE id =1"); $setrep = mysqli_fetch_array($reput); $torrenttpl->set("comments_reputation", $setrep["rep_is_online"] == "true" ? TRUE : FALSE, TRUE); if ($setrep["rep_is_online"] == 'false') { //do nothing } else { if ($subrow["reputation"] == 0) { $reput = "<img src='images/rep/reputation_balance.gif' alt='" . $setrep["no_level"] . "' title='" . $setrep["no_level"] . "' />"; } if ($subrow["reputation"] >= 1) { $reput = "<img src='images/rep/reputation_pos.gif' alt='" . $setrep["good_level"] . "' title='" . $setrep["good_level"] . "' />"; } if ($subrow["reputation"] <= -1) {
$id = AddSlashes($_GET["id"]); if (!isset($id) || !$id) { die("Error ID"); } $pre = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT COUNT(*) FROM {$TABLE_PREFIX}sb WHERE id='{$id}'") or sqlerr(); $row = mysqli_fetch_row($pre); $count = $row[0]; if ($count == 0) { $sb[$i]["name"] = "<center><font color=red> no seedbonus </font></center>"; $sb[$i]["item"] = "<center><font color=green> points </font></center>"; $sb[$i]["gb"] = "<center><font color=red> exchanged yet </center>"; $sb[$i]["points"] = "<center><font color=green> so </font></center></center>"; $sb[$i]["date"] = "<center><font color=red>nothing here ;)</font></center>"; $i++; } else { $data = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM {$TABLE_PREFIX}sb WHERE id='{$id}' ORDER BY date DESC") or die(is_object($GLOBALS["___mysqli_ston"]) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)); $sb = array(); $i = 0; while ($info = mysqli_fetch_array($data)) { $name = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT username FROM {$TABLE_PREFIX}users WHERE id='{$id}'") or die(is_object($GLOBALS["___mysqli_ston"]) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)); $naam = mysqli_fetch_array($name); $sb[$i]["name"] = "<center>" . unesc(user_with_color($naam["username"])) . "</center>"; $sb[$i]["item"] = "<center>{$info['what']}</center>"; $sb[$i]["gb"] = "<center>" . makesize($info["gb"]) . "</center>"; $sb[$i]["points"] = "<center>{$info['points']}</center>"; $sb[$i]["date"] = "<center>{$info['date']}</center>"; $i++; } } $sbtpl->set("sb", $sb); $sbtpl->set("BACK2", "<br /><br /><center><a href=\"javascript: history.go(-1);\"><tag:language.BACK /></a></center>");
function getData($lastID) { include "include/settings.php"; # getting table prefix include "include/offset.php"; # discard it if we are editing $sid = isset($_GET["sid"]) ? $_GET["sid"] : 0; # get shout id (sid)and set it to zero for bool $sql = "SELECT * FROM {$TABLE_PREFIX}chat WHERE id > " . $lastID . " AND id != " . $sid . " AND `private`='no' OR (" . $CURUSER['uid'] . " = `toid` OR " . $CURUSER['uid'] . "= `fromid` AND `private`='yes') ORDER BY id DESC"; $conn = his_getDBConnection(); # establishes the connection to the database $results = mysqli_query($conn, $sql); # getting the data array while ($row = mysqli_fetch_array($results)) { # creating and naming array $id = $row[id]; $uid = $row[uid]; $time = $row[time]; $rd = mysqli_fetch_row(mysqli_query($GLOBALS["___mysqli_ston"], "SELECT donor,warn,immunity FROM {$TABLE_PREFIX}users WHERE id={$uid}")); $row["donor"] = $rd[0]; $row["warn"] = $rd[1]; $row["immunity"] = $rd[2]; unset($rd); if ($row["warn"] == "no" or $uid == 0) { $st = ""; } else { $st = "<img src='images/warn.gif'>"; } if ($row["immunity"] == "no" or $uid == 0) { $set = ""; } else { $set = "<img src='images/shield.png'>"; } $name = user_with_color($row[name]); $text = $row[text]; $getsbox = @mysqli_fetch_array(@mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM {$TABLE_PREFIX}users WHERE id=" . $uid)); $sbox = "{$getsbox['sbox']}"; if ($sbox == "no" || $uid == "0") { //make sure system can still post # if no name is present somehow, $name and $text are set to the strings under # we assume all must be ok, othervise no post will be made by javascript check # if ($name == '') { $name = 'Anonymous'; $text = 'No message'; } //private chat if ($row["private"] == "yes") { $name = "<b><font color=orangered>[PM]</font></b> " . user_with_color($row["name"]) . ""; } $name = $name . $st . $set . get_user_icons($row); # we lego put together our chat using some conditions and css and javascript this time print "<span class='name'>" . date("d/m/Y H:i:s", $time - $offset) . " | <a href=\"javascript:windowunder('index.php?page=userdetails&id=" . $uid . "')\">" . $name . "</a>:</span>"; global $CURUSER; if ($CURUSER["admin_access"] != "yes" && $CURUSER["uid"] != "" . $uid . "") { } else { # edit/delete buttons --> print "<div style='text-align:right;\n margin-top:-13px;\n margin-bottom:-3.5px;\n '>\n <a href='index.php?page=allshout&sid={$id}&edit'><img border='0' class='EditSwap' src='images/canvas.gif' alt='' /></a>\n <a onclick=\"return confirm('" . str_replace("'", "\\'", DELETE_CONFIRM) . "')\" href='index.php?page=allshout&sid={$id}&delete'>\n <img border='0' class='DeleteSwap' src='images/canvas.gif' alt='' /></a>\n </div>"; } # chat output --> print "<div class='chatoutput'>" . format_shout($text) . "</div>"; } } }
} if ($resu) { if ($XBTT_USE) { $rowuser["username"] = $row["username"]; $rowuser["id"] = $row["uid"]; $rowuser["flagpic"] = $row["flagpic"]; $rowuser["name"] = $row["name"]; } else { $rowuser = $resu[0]; } if ($rowuser && $rowuser["id"] > 1) { if ($GLOBALS["usepopup"]) { $peers[$i]["USERNAME"] = "******"javascript: windowunder('index.php?page=userdetails&id=" . $rowuser["id"] . "')\">" . user_with_color(unesc($rowuser["username"])) . get_user_icons($rowuser) . "</a>"; $peers[$i]["PM"] = "<a href=\"javascript: windowunder('index.php?page=usercp&do=pm&action=edit&uid={$CURUSER['uid']}&what=new&to=" . urlencode(unesc($rowuser["username"])) . "')\">" . image_or_link("{$STYLEPATH}/images/pm.png", "", "PM") . "</a>"; } else { $peers[$i]["USERNAME"] = "******"index.php?page=userdetails&id=" . $rowuser["id"] . "\">" . user_with_color(unesc($rowuser["username"])) . get_user_icons($rowuser) . "</a>"; $peers[$i]["PM"] = "<a href=\"index.php?page=usercp&do=pm&action=edit&uid=" . $CURUSER["uid"] . "&what=new&to=" . urlencode(unesc($rowuser["username"])) . "\">" . image_or_link("{$STYLEPATH}/images/pm.png", "", "PM") . "</a>"; } } else { $peers[$i]["USERNAME"] = $language["GUEST"]; $peers[$i]["PM"] = ""; } } else { $peers[$i]["USERNAME"] = $language["GUEST"]; $peers[$i]["PM"] = ""; } if ($row["flagpic"] != "" && $row["flagpic"] != "unknown.gif") { $peers[$i]["FLAG"] = "<img src=\"images/flag/" . $row["flagpic"] . "\" alt=\"" . unesc($row["name"]) . "\" />"; } elseif ($rowuser["flagpic"] != "" && !empty($rowuser["flagpic"])) { $peers[$i]["FLAG"] = "<img src=\"images/flag/" . $rowuser["flagpic"] . "\" alt=\"" . unesc($rowuser["name"]) . "\" />"; } else {
} } # get posts [ shoult also test for permissions ] if ($FORUMLINK == "smf") { $lastPosts = get_result("SELECT `m`.`ID_TOPIC` `tid`, `m`.`ID_MSG` `pid`, `t`.`ID_FIRST_MSG` `spid`, `m`.`posterTime` `added`, `m`.`posterName` `username`, `m`.`body`, `m`.`ID_MEMBER` `userid` FROM `{$db_prefix}messages` `m` LEFT JOIN `{$db_prefix}topics` `t` ON `m`.`ID_TOPIC`=`t`.`ID_TOPIC` " . $exclude . " ORDER BY `m`.`posterTime` DESC " . $limit, true, $btit_settings['cache_duration']); } else { $lastPosts = get_result("SELECT `m`.`id_topic` `tid`, `m`.`id_msg` `pid`, `t`.`id_first_msg` `spid`, `m`.`poster_time` `added`, `m`.`poster_name` `username`, `m`.`body`, `m`.`id_member` `userid` FROM `{$db_prefix}messages` `m` LEFT JOIN `{$db_prefix}topics` `t` ON `m`.`id_topic`=`t`.`id_topic` " . $exclude . " ORDER BY `m`.`poster_time` DESC " . $limit, true, $btit_settings['cache_duration']); } # format posts foreach ($lastPosts as $post) { # get topic subject $title = get_result("SELECT `subject` FROM `{$db_prefix}messages` WHERE " . ($FORUMLINK == "smf" ? "`ID_MSG`" : "`id_msg`") . "=" . $post['spid'] . " LIMIT 1", true, $btit_settings['cache_duration']); $title = $title[0]['subject']; # cut it if necessary $post['title'] = strlen($title > 33) ? substr($title, 0, 30) . '...' : $title; $postsList .= '<tr><td class="lista"><b><a class="forum" title="' . $language['FIRST_UNREAD'] . ': ' . $post['title'] . '" href="' . $btit_settings['url'] . '/index.php?page=forum&action=viewtopic&topicid=' . $post['tid'] . '.msg' . $post['pid'] . '#msg' . $post['pid'] . '">' . $post['title'] . '</a></b><br />' . $language['LAST_POST_BY'] . ' <a class="forum" href="' . $btit_settings['url'] . '/index.php?page=forum&action=profile;u=' . $post['userid'] . '">' . user_with_color($post['username']) . '</a><br />On ' . date('d/m/Y H:i:s', $post['added']) . '</td></tr>'; } } elseif ($FORUMLINK == "ipb") { $level = $CURUSER["id_level"]; $query = get_result("SELECT `f`.`id`, `p`.`perm_view`, `f`.`parent_id` FROM `{$ipb_prefix}forums` `f` LEFT JOIN `{$ipb_prefix}permission_index` `p` ON (`f`.`id`=`p`.`perm_type_id` AND `p`.`app`='forums' AND `p`.`perm_type`='forum') ORDER BY `f`.`id` ASC", true, $btit_settings["cache_duration"]); $exclude = ""; foreach ($query as $check) { $forumid = $check["id"]; if ($check["parent_id"] == -1) { $exclude = $exclude . " AND forum_id!=" . $forumid; } else { if ($check["perm_view"] != "*") { $perm = trim($check["perm_view"], ","); $read = explode(',', $perm); if (is_array($read)) { if (!in_array($level, $read)) {
function getData($lastID) { require_once "conn.php"; # getting connection data include "../include/settings.php"; # getting table prefix include "../include/offset.php"; global $CURUSER, $btit_settings; if ($CURUSER["view_users"] != "yes") { die("Sorry, Shoutbox is not available..."); } $shoutline = $btit_settings["shoutline"]; $sql = "SELECT * FROM {$TABLE_PREFIX}chat WHERE id > " . $lastID . " AND `private`='no' OR (" . $CURUSER['uid'] . " = `toid` OR " . $CURUSER['uid'] . "= `fromid` AND `private`='yes') ORDER BY id DESC LIMIT {$shoutline}"; $conn = getDBConnection(); # establishes the connection to the database $results = mysqli_query($conn, $sql); # getting the data array while ($row = mysqli_fetch_array($results)) { # getting the data array $id = $row[id]; $uid = $row[uid]; $rd = mysqli_fetch_row(mysqli_query($GLOBALS["___mysqli_ston"], "SELECT donor,warn,immunity,avatar FROM {$TABLE_PREFIX}users WHERE id={$uid}")); $row["donor"] = $rd[0]; $row["warn"] = $rd[1]; $row["immunity"] = $rd[2]; $row["avatar"] = $rd[3]; unset($rd); if ($row["warn"] == "no" or $uid == 0) { $st = ""; } else { $st = "<img src='images/warn.gif'>"; } if ($row["immunity"] == "no" or $uid == 0) { $set = ""; } else { $set = "<img src='images/shield.png'>"; } $time = $row[time]; $name = "<a href='index.php?page=userdetails&id=" . $uid . "'> " . user_with_color($row["name"]) . $st . $set . get_user_icons($row) . "</a>"; $text = $row[text]; $shout_reply = "<a href='javascript:window.top.SmileIT(\"[b][color=crimson]@ " . htmlspecialchars($row['name']) . "... [/color][/b]\")'><img src='images/rep.gif' title='Reply' alt='Reply' /></a>"; $name = $name . " <a href=\"javascript:PopPshout('" . $CURUSER["uid"] . "','" . $uid . "','" . $CURUSER["pchat"] . "');\"><img src='images/pchat.png'></a>"; if ($row["private"] == "yes") { $name = "<b><span style='color:orangered;'><img src='images/privatec.png'></span></b> " . $name . " " . ($uid != $CURUSER["uid"] ? "<a href=\"javascript:PopPshout('" . $CURUSER["uid"] . "','" . $uid . "','" . $CURUSER["pchat"] . "');\"><b>[reply]</b></a>" : "") . ""; } $getsbox = @mysqli_fetch_array(@mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM {$TABLE_PREFIX}users WHERE id=" . $uid)); $sbox = "{$getsbox['sbox']}"; if ($sbox == "no" || $uid == "0") { //make sure system can still post # if no name is present somehow, $name and $text are set to the strings under # we assume all must be ok, othervise no post will be made by javascript check # if ($name == '') { $name = 'Anonymous'; $text = 'No message'; } //online status $ol = @mysqli_fetch_array(@mysqli_query($GLOBALS["___mysqli_ston"], "SELECT u.lastconnect, o.lastaction FROM {$TABLE_PREFIX}users u LEFT JOIN {$TABLE_PREFIX}online o ON u.id = o.user_id WHERE u.id=" . $uid)); is_null($ol["lastaction"]) ? $lastseen = $ol["lastconnect"] : ($lastseen = $ol["lastaction"]); time() - $lastseen > 900 ? $status = "<img src='images/button_offline.gif' border='0' title='Offline' alt='" . $language["OFFLINE"] . "'>" : ($status = "<img src='images/button_online.gif' border='0' title='Online' alt='" . $language["ONLINE"] . "'>"); @(mysqli_free_result($ol) || is_object($ol) && get_class($ol) == "mysqli_result" ? true : false); // end online status if ($btit_settings["shoutdel"] == true and $CURUSER["edit_users"] == "yes") { $editt = "<a href='javascript:editup({$id},{$CURUSER['uid']});' style='font-size: 8px'><img src='images/edit.png' title='edit' alt='edit' border='0'></a> <a class=\"stdelete\" href=\"#\" id=\"" . $id . "\" title=\"Delete\"><img src='images/delete.png' border='0' title='del' alt='del'></a> "; } else { $editt = ""; } if ($btit_settings["shoutdt"] == true) { // avatar if ($btit_settings["shoutdtav"] == true) { if ($row["avatar"] && $row["avatar"] != "") { $av = "<img width=40 height=40 border=0 src=" . unesc($row["avatar"]) . " />"; } else { $av = "<img width=40 height=40 border=0 src=\"images/default_avatar.gif\">"; if ($uid == '0') { $av = "<img width=40 height=40 border=0 src=\"images/system.png\">"; } } } else { $av = ""; } // avatar if ($btit_settings["shoutdtz"] == true) { $f = '2'; } else { $f = '1'; } # we put together our dt chat $chatout = "\n <li><span>" . $av . " " . $editt . $status . " <font color = green size=" . $f . ">" . date("d/m/Y H:i:s", $time - $offset) . " </font> | <font size=" . $f . "><b><a href=index.php?page=userdetails&id=" . $uid . ">" . $name . "</a>: " . format_shout($text) . $shout_reply . "</b></font></span></li>"; } else { # we put together our chat using some css $chatout = "\n <li><span class='name'>" . $editt . date("d/m/Y H:i:s", $time - $offset) . " " . $status . " | <a href=index.php?page=userdetails&id=" . $uid . ">" . $name . "</a>:</span></li>\n <div class='lista' style='text-align:right;\n margin-top:-13px;\n margin-bottom:0px;\n /* color: #006699;*/\n '>\n # {$id}</div>\n \n <!-- # chat output -->\n <div class='chatoutput'>" . format_shout($text) . $shout_reply . "</div>\n "; } echo $chatout; # echo as known handles arrays very fast... } } }