function dotown() { // Spit out the main town page. global $userrow, $controlrow, $numqueries; $townquery = doquery("SELECT * FROM {{table}} WHERE latitude='" . $userrow["latitude"] . "' AND longitude='" . $userrow["longitude"] . "' LIMIT 1", "towns"); if (mysql_num_rows($townquery) == 0) { display("Há um erro com sua conta, ou com os dados da cidade. Por favor tente novamente.", "Error"); } $townrow = mysql_fetch_array($townquery); // News box. Grab latest news entry and display it. Something a little more graceful coming soon maybe. if ($controlrow["shownews"] == 1) { $newsquery = doquery("SELECT * FROM {{table}} ORDER BY id DESC LIMIT 1", "news"); $newsrow = mysql_fetch_array($newsquery); $townrow["news"] = "<table width=\"95%\"><tr><td align=\"center\"><center><img src=\"images/ultimas.gif\"></center></td></tr><tr><td>\n"; $townrow["news"] .= "<span class=\"light\">[" . prettydate($newsrow["postdate"]) . "]</span><br />" . nl2br($newsrow["content"]); $townrow["news"] .= "</td></tr></table>\n"; } else { $townrow["news"] = ""; } // Who's Online. Currently just members. Guests maybe later. if ($controlrow["showonline"] == 1) { $onlinequery = doquery("SELECT * FROM {{table}} WHERE UNIX_TIMESTAMP(onlinetime) >= '" . (time() - 600) . "' ORDER BY charname", "users"); $townrow["whosonline"] = "<table width=\"95%\"><tr><td align=\"center\"><center><img src=\"images/online.gif\"></center></td></tr><tr><td>\n"; $townrow["whosonline"] .= "Há <b>" . mysql_num_rows($onlinequery) . "</b> usuários online nos últimos 10 minutos: "; while ($onlinerow = mysql_fetch_array($onlinequery)) { $querycor = doquery("SELECT * FROM {{table}} WHERE charname='" . $onlinerow["charname"] . "' LIMIT 1", "users"); $usercor = mysql_fetch_array($querycor); if ($usercor["authlevel"] == 1) { $link = " id=\"adm\" "; } elseif ($usercor["acesso"] == 2) { $link = " id=\"tutor\" "; } elseif ($usercor["acesso"] == 3) { $link = " id=\"gm\" "; } $townrow["whosonline"] .= "<a href=\"javascript: opcaochar('" . $onlinerow["charname"] . "')\" " . $link . ">" . $onlinerow["charname"] . "</a>" . ", "; } $townrow["whosonline"] = rtrim($townrow["whosonline"], ", "); $townrow["whosonline"] .= "</td></tr></table>\n"; } else { $townrow["whosonline"] = ""; } if ($controlrow["showbabble"] == 1) { $townrow["babblebox"] = "<table width=\"100%\"><tr><td align=\"center\"><center><img src=\"images/texto.gif\"></center></td></tr></table></center>"; $townrow["babblebox"] .= babbleboxpage('460', '10'); } else { $townrow["babblebox"] = ""; } //mostrar valores de texto na página. global $indexconteudo, $htmlnapag; //mostrar valores na index. $townrow["indexconteudo"] = $indexconteudo; $townrow["htmlnapag"] = $htmlnapag; //outros / senjutsu, jutsu de busca, etc... include 'cidadesconteudo.php'; $townrow['fimconteudo'] = conteudo($townrow); $page = gettemplate("towns"); $page = parsetemplate($page, $townrow); return $page; }
function dotown() { // Spit out the main town page. global $userrow, $controlrow, $numqueries; //imagem da cidade, etc global $imagemtv; //imagem da tv... if ($imagemtv == "") { $updatequery = doquery("UPDATE {{table}} SET imagem='nacidade.png' WHERE charname='" . $userrow["charname"] . "' LIMIT 1", "users"); } else { $updatequery = doquery("UPDATE {{table}} SET imagem='{$imagemtv}' WHERE charname='" . $userrow["charname"] . "' LIMIT 1", "users"); } $townquery = doquery("SELECT * FROM {{table}} WHERE latitude='" . $userrow["latitude"] . "' AND longitude='" . $userrow["longitude"] . "' LIMIT 1", "towns"); if (mysql_num_rows($townquery) == 0) { display("Há um erro com sua conta, ou com os dados da cidade. Por favor tente novamente.", "Error"); } $townrow = mysql_fetch_array($townquery); // News box. Grab latest news entry and display it. Something a little more graceful coming soon maybe. if ($controlrow["shownews"] == 1) { $newsquery = doquery("SELECT * FROM {{table}} ORDER BY id DESC LIMIT 1", "news"); $newsrow = mysql_fetch_array($newsquery); $townrow["news"] = "<table width=\"95%\"><tr><td align=\"center\"><center><img src=\"images/ultimas.gif\"></center></td></tr><tr><td>\n"; $townrow["news"] .= "<span class=\"light\">[" . prettydate($newsrow["postdate"]) . "]</span><br />" . nl2br($newsrow["content"]); $townrow["news"] .= "</td></tr></table>\n"; } else { $townrow["news"] = ""; } // Who's Online. Currently just members. Guests maybe later. if ($controlrow["showonline"] == 1) { $onlinequery = doquery("SELECT * FROM {{table}} WHERE UNIX_TIMESTAMP(onlinetime) >= '" . (time() - 600) . "' ORDER BY charname", "users"); $townrow["whosonline"] = "<table width=\"95%\"><tr><td align=\"center\"><center><img src=\"images/online.gif\"></center></td></tr><tr><td>\n"; $townrow["whosonline"] .= "Há <b>" . mysql_num_rows($onlinequery) . "</b> usuários online nos últimos 10 minutos: "; while ($onlinerow = mysql_fetch_array($onlinequery)) { $townrow["whosonline"] .= "<a href=\"index.php?do=onlinechar:" . $onlinerow["id"] . "\">" . $onlinerow["charname"] . "</a>" . ", "; } $townrow["whosonline"] = rtrim($townrow["whosonline"], ", "); $townrow["whosonline"] .= "</td></tr></table>\n"; } else { $townrow["whosonline"] = ""; } if ($controlrow["showbabble"] == 1) { $townrow["babblebox"] = "<table width=\"95%\"><tr><td align=\"center\"><img src=\"images/texto.gif\"></td></tr><tr><td>\n"; $townrow["babblebox"] .= "<iframe src=\"index.php?do=babblebox\" name=\"sbox\" width=\"100%\" height=\"250\" frameborder=\"0\" id=\"bbox\">Your browser does not support inline frames! The Babble Box will not be available until you upgrade to a newer <a href=\"http://www.mozilla.org\" target=\"_new\">browser</a>.</iframe>"; $townrow["babblebox"] .= "</td></tr></table>\n"; } else { $townrow["babblebox"] = ""; } //imagem do hokage global $indexconteudo; //mostrar valores na index. $townrow["indexconteudo"] = $indexconteudo; if ($townrow["id"] == 1) { $townrow["kage"] = "Hokage"; } if ($townrow["id"] == 2) { $townrow["kage"] = "Fukasaku & Shima"; } if ($townrow["id"] == 3) { $townrow["kage"] = "Tsuchikage"; } if ($townrow["id"] == 4) { $townrow["kage"] = "Mizukage"; } if ($townrow["id"] == 5) { $townrow["kage"] = "Kazekage"; } if ($townrow["id"] == 6) { $townrow["kage"] = "Raikage"; } if ($townrow["id"] == 7) { $townrow["kage"] = "Shodaime"; } if ($townrow["id"] == 8) { $townrow["kage"] = "Tobi"; } //outros / senjutsu, jutsu de busca, etc... $townrow["outros"] = ""; if ($townrow["id"] == 5) { $townrow["outros"] = "<li /><a href=\"jutsudebusca.php?do=jutsu\">Treinar o Jutsu de Busca</a>"; } if ($townrow["id"] == 2) { $townrow["outros"] = "<li /><a href=\"senjutsu.php?do=jutsu\">Treinar Senjutsu</a><li /><a href=\"senjutsu.php?do=chamar\">Chamar Fukasaku & Shima Para o Grupo</a>"; } $page = gettemplate("towns"); $page = parsetemplate($page, $townrow); return $page; }
function dotown() { // Spit out the main town page. global $userrow, $controlrow, $numqueries; $townquery = doquery("SELECT * FROM {{table}} WHERE latitude='" . $userrow["latitude"] . "' AND longitude='" . $userrow["longitude"] . "' LIMIT 1", "towns"); if (mysql_num_rows($townquery) == 0) { display("There is an error with your user account, or with the town data. Please try again.", "Error"); } $townrow = mysql_fetch_array($townquery); // News box. Grab latest news entry and display it. Something a little more graceful coming soon maybe. if ($controlrow["shownews"] == 1) { $newsquery = doquery("SELECT * FROM {{table}} ORDER BY id DESC LIMIT 1", "news"); $newsrow = mysql_fetch_array($newsquery); $townrow["news"] = "<table width=\"95%\"><tr><td class=\"title\">Latest News</td></tr><tr><td>\n"; $townrow["news"] .= "<span class=\"light\">[" . prettydate($newsrow["postdate"]) . "]</span><br />" . nl2br($newsrow["content"]); $townrow["news"] .= "</td></tr></table>\n"; } else { $townrow["news"] = ""; } // Who's Online. Currently just members. Guests maybe later. if ($controlrow["showonline"] == 1) { $onlinequery = doquery("SELECT * FROM {{table}} WHERE UNIX_TIMESTAMP(onlinetime) >= '" . (time() - 600) . "' ORDER BY charname", "users"); $townrow["whosonline"] = "<table width=\"95%\"><tr><td class=\"title\">Who's Online</td></tr><tr><td>\n"; $townrow["whosonline"] .= "There are <b>" . mysql_num_rows($onlinequery) . "</b> user(s) online within the last 10 minutes: "; while ($onlinerow = mysql_fetch_array($onlinequery)) { $townrow["whosonline"] .= "<a href=\"index.php?do=onlinechar:" . $onlinerow["id"] . "\">" . $onlinerow["charname"] . "</a>" . ", "; } $townrow["whosonline"] = rtrim($townrow["whosonline"], ", "); $townrow["whosonline"] .= "</td></tr></table>\n"; } else { $townrow["whosonline"] = ""; } if ($controlrow["showbabble"] == 1) { $townrow["babblebox"] = "<table width=\"95%\"><tr><td class=\"title\">Babble Box</td></tr><tr><td>\n"; $townrow["babblebox"] .= "<iframe src=\"index.php?do=babblebox\" name=\"sbox\" width=\"100%\" height=\"250\" frameborder=\"0\" id=\"bbox\">Your browser does not support inline frames! The Babble Box will not be available until you upgrade to a newer <a href=\"http://www.mozilla.org\" target=\"_new\">browser</a>.</iframe>"; $townrow["babblebox"] .= "</td></tr></table>\n"; } else { $townrow["babblebox"] = ""; } $page = gettemplate("towns"); $page = parsetemplate($page, $townrow); return $page; }