function viewdownloadeditorial() { global $downloadsprefix, $db; $lid = intval($_GET['lid']); include "header.php"; downl_menu_tpl(1); $result = $db->sql_query("SELECT adminid, editorialtimestamp, editorialtext, editorialtitle FROM " . $downloadsprefix . "_editorials WHERE downloadid = {$lid}"); $recordexist = $db->sql_numrows($result); $displaytitle = ereg_replace("_", " ", $ttitle); echo '<br />'; OpenTable(); echo "<center><font class=\"option\"><b>" . _DOWNLOADPROFILE . ": {$displaytitle}</b></font><br />"; downl_infomenu_tpl($lid, $ttitle); if ($recordexist != 0) { while (list($adminid, $editorialtimestamp, $editorialtext, $editorialtitle) = $db->sql_fetchrow($result)) { ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $editorialtimestamp, $editorialtime); $editorialtime = strftime("%F", mktime($editorialtime[4], $editorialtime[5], $editorialtime[6], $editorialtime[2], $editorialtime[3], $editorialtime[1])); $date_array = explode("-", $editorialtime); $timestamp = mktime(0, 0, 0, $date_array["1"], $date_array["2"], $date_array["0"]); $formatted_date = date("F j, Y", $timestamp); echo "<br /><br />"; OpenTable2(); echo "<center><font class=\"option\"><b>'{$editorialtitle}'</b></font></center>" . "<center><font class=\"tiny\">" . _EDITORIALBY . " {$adminid} - {$formatted_date}</font></center><br /><br />" . "{$editorialtext}"; CloseTable2(); } } else { echo "<br /><br /><center><font class=\"option\"><b>" . _NOEDITORIAL . "</b></font></center>"; } echo "<br /><br /><center>"; downloadfooter($lid); echo "</center>"; CloseTable(); include "footer.php"; }
function viewdownloadeditorial($lid, $ttitle) { global $prefix, $dbi, $admin, $module_name; include "header.php"; include "modules/{$module_name}/d_config.php"; menu(1); $result = sql_query("SELECT adminid, editorialtimestamp, editorialtext, editorialtitle FROM " . $prefix . "_downloads_editorials WHERE downloadid = {$lid}", $dbi); $recordexist = sql_num_rows($result, $dbi); $transfertitle = ereg_replace("_", " ", $ttitle); $transfertitle = stripslashes($transfertitle); $displaytitle = $transfertitle; echo "<br>"; OpenTable(); echo "<center><font class=\"option\"><b>" . _DOWNLOADPROFILE . ": {$displaytitle}</b></font><br>"; downloadinfomenu($lid, $ttitle); if ($recordexist != 0) { while (list($adminid, $editorialtimestamp, $editorialtext, $editorialtitle) = sql_fetch_row($result, $dbi)) { $editorialtitle = stripslashes($editorialtitle); $editorialtext = stripslashes($editorialtext); ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $editorialtimestamp, $editorialtime); $editorialtime = strftime("%F", mktime($editorialtime[4], $editorialtime[5], $editorialtime[6], $editorialtime[2], $editorialtime[3], $editorialtime[1])); $date_array = explode("-", $editorialtime); $timestamp = mktime(0, 0, 0, $date_array["1"], $date_array["2"], $date_array["0"]); $formatted_date = date("F j, Y", $timestamp); echo "<br><br>"; OpenTable2(); echo "<center><font class=\"option\"><b>'{$editorialtitle}'</b></font></center>" . "<center><font class=\"tiny\">" . _EDITORIALBY . " {$adminid} - {$formatted_date}</font></center><br><br>" . "{$editorialtext}"; CloseTable2(); } } else { echo "<br><br><center><font class=\"option\"><b>" . _NOEDITORIAL . "</b></font></center>"; } echo "<br><br><center>"; downloadfooter($lid, $ttitle); echo "</center>"; CloseTable(); include "footer.php"; }
function index() { global $downloadsprefix, $db, $show_links_num, $show_links_info, $show_links_inum, $module_name, $bgcolor1, $bgcolor3; require_once 'header.php'; downl_menu_tpl(0); echo '<br />'; OpenTable(); echo "<center><font class=\"title\"><b>" . _DOWNLOADSMAINCAT . "</b></font></center><br />"; echo "<table border=\"0\" cellspacing=\"10\" cellpadding=\"0\" align=\"center\"><tr>"; $sql = "SELECT cid, title, cdescription FROM " . $downloadsprefix . "_categories WHERE parentid='0' ORDER BY title"; $result = $db->sql_query($sql); $count = $dum = 0; while ($row = $db->sql_fetchrow($result)) { $cid = $row['cid']; $title = $row['title']; $cdescription = $row['cdescription']; if ($show_links_num == 1) { list($cnumrows) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $downloadsprefix . "_downloads WHERE cid='{$cid}'", SQL_NUM); $cnumm = " ({$cnumrows})"; } else { $cnumm = ''; } if ($cnumrows > 0) { $folder = "modules/Downloads/images/openfolder.gif"; } else { $folder = "modules/Downloads/images/closedfolder.gif"; } if (can_admin('downloads')) { $folderImg = "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModCat&cat={$cid}") . "\"><img src=\"{$folder}\" border=\"0\" alt=\"" . _EDIT . "\" /></a>"; } else { $folderImg = "<img src=\"{$folder}\" border=\"0\" alt=\"{$title}\" />"; } echo "<td valign=\"top\"><font class=\"title\">{$folderImg} <a href=\"" . getlink("&d_op=viewdownload&cid={$cid}") . "\"><b>{$title}</b></a></font>{$cnumm}"; categorynewdownloadgraphic($cid); if ($cdescription) { echo "<br /><font class=\"content\">{$cdescription}</font><br />"; } else { echo '<br />'; } $result2 = $db->sql_query("SELECT cid, title FROM " . $downloadsprefix . "_categories WHERE parentid='{$cid}' ORDER BY title LIMIT 0,3"); $space = 0; while ($row2 = $db->sql_fetchrow($result2)) { $cid = $row2['cid']; $stitle = $row2['title']; if ($space > 0) { echo ', '; } if ($show_links_num == 1) { list($cnumrows2) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $downloadsprefix . "_downloads WHERE cid='{$cid}'", SQL_NUM); $cnum = " ({$cnumrows2})"; } else { $cnum = ""; } echo "<font class=\"content\"><a href=\"" . getlink("&d_op=viewdownload&cid={$cid}") . "\">{$stitle}</a>{$cnum}</font>"; $space++; } if ($count < 1) { echo "</td><td> </td>"; $dum = 1; } $count++; if ($count == 2) { echo "</td></tr><tr>"; $count = 0; $dum = 0; } } if ($dum == 1) { echo '</tr></table>'; } elseif ($dum == 0) { echo '<td></td></tr></table>'; } list($numrows) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $downloadsprefix . "_downloads", SQL_NUM); list($catnum) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $downloadsprefix . "_categories", SQL_NUM); echo "<center><font class=\"content\">" . _THEREARE . " <b>{$numrows}</b> " . _DOWNLOADS . " " . _AND . " <b>{$catnum}</b> " . _CATEGORIES . " " . _INDB . "</font></center>"; CloseTable(); if ($show_links_info == 1) { echo '<br />'; OpenTable(); echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"3\" width=\"100%\">" . "<tr><td width=\"50%\" valign=\"top\" align=\"center\">"; echo "<div align=\"center\" class=\"title\">" . _NEWDOWNLOADS . "</div>"; echo "</td><td width=\"50%\" valign=\"top\" align=\"center\">"; echo "<div align=\"center\" class=\"title\">" . _MOSTPOPULAR . " {$show_links_inum}</div>"; echo "</td></tr>" . "<tr><td width=\"50%\" valign=\"top\" align=\"center\">"; OpenTable2(); $content = '<table border="0" width="100%">'; $color = $bgcolor3; $result = $db->sql_query("SELECT lid, title, hits FROM " . $downloadsprefix . "_downloads ORDER BY date DESC LIMIT 0, {$show_links_inum}"); while ($row = $db->sql_fetchrow($result)) { $title2 = ereg_replace("_", " ", $row['title']); $color = $color == $bgcolor3 ? $bgcolor1 : $bgcolor3; $content .= "<tr><td bgcolor=\"{$color}\" align=\"left\"><a href=\"" . getlink("&d_op=viewdownloaddetails&lid={$row['lid']}") . "\">{$title2}</a></td>" . "<td bgcolor=\"{$color}\" align=\"center\" width=\"20\">{$row['hits']}</td></tr>"; } echo "{$content}</table>"; CloseTable2(); echo "|[ <a href=\"" . getlink("&d_op=NewDownloads") . "\">" . _NEWDOWNLOADS . "</a> ]|"; echo "</td><td width=\"50%\" valign=\"top\" align=\"center\">"; OpenTable2(); $content = "<table border=\"0\" width=\"100%\">"; $color = $bgcolor3; $result = $db->sql_query("SELECT lid, title, hits FROM " . $downloadsprefix . "_downloads ORDER BY hits DESC LIMIT 0, {$show_links_inum}"); while ($row = $db->sql_fetchrow($result)) { $title2 = ereg_replace("_", " ", $row['title']); $color = $color == $bgcolor3 ? $bgcolor1 : $bgcolor3; $content .= "<tr><td bgcolor=\"{$color}\" align=\"left\"><a href=\"" . getlink("&d_op=viewdownloaddetails&lid={$row['lid']}") . "\">{$title2}</a></td>" . "<td bgcolor=\"{$color}\" align=\"center\" width=\"20\">{$row['hits']}</td></tr>"; } echo "{$content}</table>"; CloseTable2(); echo "|[ <a href=\"" . getlink("&d_op=MostPopular") . "\">" . _MOSTPOPULAR . " " . _DOWNLOADS . "</a> ]|"; echo "</td></tr></table>"; CloseTable(); } include "footer.php"; }
function viewlinkeditorial($lid, $ttitle) { global $prefix, $db, $admin, $module_name; include "header.php"; include "modules/{$module_name}/l_config.php"; menu(1); $lid = intval(trim($lid)); $result = $db->sql_query("SELECT adminid, editorialtimestamp, editorialtext, editorialtitle FROM " . $prefix . "_links_editorials WHERE linkid = '{$lid}'"); $recordexist = $db->sql_numrows($result); $transfertitle = ereg_replace("_", " ", $ttitle); $displaytitle = $transfertitle; echo "<br>"; OpenTable(); echo "<center><font class=\"option\"><b>" . _LINKPROFILE . ": {$displaytitle}</b></font><br>"; linkinfomenu($lid, $ttitle); if ($recordexist != 0) { while ($row = $db->sql_fetchrow($result)) { $adminid = intval($row['adminid']); $editorialtimestamp = $row['editorialtimestamp']; $editorialtext = stripslashes($row['editorialtext']); $editorialtitle = stripslashes(check_html($row['editorialtitle'], "nohtml")); ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $editorialtimestamp, $editorialtime); $editorialtime = strftime("%F", mktime($editorialtime[4], $editorialtime[5], $editorialtime[6], $editorialtime[2], $editorialtime[3], $editorialtime[1])); $date_array = explode("-", $editorialtime); $timestamp = mktime(0, 0, 0, $date_array["1"], $date_array["2"], $date_array["0"]); $formatted_date = date("F j, Y", $timestamp); echo "<br><br>"; OpenTable2(); echo "<center><font class=\"option\"><b>'{$editorialtitle}'</b></font></center>" . "<center><font class=\"tiny\">" . _EDITORIALBY . " {$adminid} - {$formatted_date}</font></center><br><br>" . "{$editorialtext}"; CloseTable2(); } } else { echo "<br><br><center><font class=\"option\"><b>" . _NOEDITORIAL . "</b></font></center>"; } echo "<br><br><center>"; linkfooter($lid, $ttitle); echo "</center>"; CloseTable(); include "footer.php"; }
$send = "no"; } if ($message == "") { $message_err = "<center><font class=\"option\"><b><i>" . _FBENTERMESSAGE . "</i></b></font></center><br>"; $send = "no"; } if ($send != "no") { $sender_name = removecrlf($sender_name); $sender_email = removecrlf($sender_email); $msg = "{$sitename}\n\n"; $msg .= "" . _SENDERNAME . ": {$sender_name}\n"; $msg .= "" . _SENDEREMAIL . ": {$sender_email}\n"; $msg .= "" . _MESSAGE . ": {$message}\n\n"; $to = $adminmail; $mailheaders = "From: {$sender_name} <{$sender_email}>\n"; $mailheaders .= "Reply-To: {$sender_email}\n\n"; mail($to, $subject, $msg, $mailheaders); echo "<P><center>" . _FBMAILSENT . "</center></p>"; echo "<P><center>" . _FBTHANKSFORCONTACT . "</center></p>"; } elseif ($send == "no") { OpenTable2(); echo "{$name_err}"; echo "{$email_err}"; echo "{$message_err}"; CloseTable2(); echo "<br><br>"; echo "{$form_block}"; } } CloseTable(); include "footer.php";
function userinfo($username, $bypass = 0, $hid = 0, $url = 0) { global $articlecomm, $user, $cookie, $sitename, $prefix, $user_prefix, $db, $admin, $broadcast_msg, $my_headlines, $module_name, $subscription_url, $admin_file; $username = substr(htmlspecialchars(str_replace("\\'", "'", trim($username))), 0, 25); $username = rtrim($username, "\\"); $username = str_replace("'", "\\'", $username); $sql = "SELECT * FROM " . $prefix . "_bbconfig"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $board_config[$row['config_name']] = $row['config_value']; } $sql2 = "SELECT * FROM " . $user_prefix . "_users WHERE username='******'"; $result2 = $db->sql_query($sql2); $num = $db->sql_numrows($result2); if ($num != 1) { Header("Location: modules.php?name={$module_name}"); die; } $userinfo = $db->sql_fetchrow($result2); if (!$bypass) { cookiedecode($user); } include "header.php"; OpenTable(); echo "<center>"; if ($username != '') { // SecurityReason.com Fix 2005 [sp3x] if (isset($cookie[1]) and strtolower($username) == strtolower($cookie[1]) and $userinfo['user_password'] == $cookie[2]) { echo "<font class=\"option\">" . htmlentities($username) . ", " . _WELCOMETO . " {$sitename}!</font><br><br>"; echo "<font class=\"content\">" . _THISISYOURPAGE . "</font></center><br><br>"; nav(1); echo "<br><br>"; } else { echo "<font class=\"title\">" . _PERSONALINFO . ": " . htmlentities($username) . "</font></center><br><br>"; } } else { Header("Location: modules.php?name={$module_name}"); } if ($userinfo['user_website']) { if (!preg_match('#^http[s]?:\\/\\/#i', $userinfo['user_website'])) { $userinfo['user_website'] = "http://" . $userinfo['user_website']; } if (!preg_match('#^http[s]?\\:\\/\\/[a-z0-9\\-]+\\.([a-z0-9\\-]+\\.)?[a-z]+#i', $userinfo['user_website'])) { $userinfo['user_website'] = ''; } } if ($userinfo['user_avatar_type'] == 1) { $userinfo['user_avatar'] = $board_config['avatar_path'] . "/" . $userinfo['user_avatar']; } elseif ($userinfo['user_avatar_type'] == 2) { $userinfo['user_avatar'] = $userinfo['user_avatar']; } else { $userinfo['user_avatar'] = $board_config['avatar_gallery_path'] . "/" . $userinfo['user_avatar']; } if ($num == 1 && ($userinfo['user_website'] || $userinfo['femail'] || $userinfo['bio'] || $userinfo['user_avatar'] || $userinfo['user_icq'] || $userinfo['user_aim'] || $userinfo['user_yim'] || $userinfo['user_msnm'] || $userinfo['user_location'] || $userinfo['user_occ'] || $userinfo['user_interests'] || $userinfo['user_sig'])) { echo "<center><font class=\"content\">"; echo "<img src=\"" . $userinfo['user_avatar'] . "\"><br><br>\n"; if ($userinfo['user_website'] != "http://" and !empty($userinfo['user_website'])) { echo "" . _MYHOMEPAGE . " <a href=\"" . $userinfo['user_website'] . "\" target=\"new\">" . $userinfo['user_website'] . "</a><br>\n"; } if ($userinfo['femail']) { echo "" . _MYEMAIL . " <a href=\"mailto:" . $userinfo['femail'] . "\">" . $userinfo['femail'] . "</a><br>\n"; } if ($userinfo['user_icq'] && preg_match('/^[0-9]+$/', $userinfo['user_icq'])) { echo "" . _ICQ . ": " . $userinfo['user_icq'] . "<br>\n"; } if ($userinfo['user_aim']) { echo "" . _AIM . ": " . $userinfo['user_aim'] . "<br>\n"; } if ($userinfo['user_yim']) { echo "" . _YIM . ": " . $userinfo['user_yim'] . "<br>\n"; } if ($userinfo['user_msnm']) { echo "" . _MSNM . ": " . $userinfo['user_msnm'] . "<br>\n"; } if ($userinfo['user_from']) { echo "" . _LOCATION . ": " . $userinfo['user_from'] . "<br>\n"; } if ($userinfo['user_occ']) { echo "" . _OCCUPATION . ": " . $userinfo['user_occ'] . "<br>\n"; } if ($userinfo['user_interests']) { echo "" . _INTERESTS . ": " . $userinfo['user_interests'] . "<br>\n"; } $userinfo['user_sig'] = nl2br($userinfo['user_sig']); if ($userinfo['user_sig']) { echo "<br><b>" . _SIGNATURE . ":</b><br>" . $userinfo['user_sig'] . "<br>\n"; } if ($userinfo['bio']) { echo "<br><b>" . _EXTRAINFO . ":</b><br>" . $userinfo['bio'] . "<br>\n"; } $sql2 = "SELECT uname FROM " . $prefix . "_session WHERE uname='{$username}'"; $result2 = $db->sql_query($sql2); $row2 = $db->sql_fetchrow($result2); $username_pm = $username; $username_online = $row2['uname']; if (empty($username_online)) { $online = _OFFLINE; } else { $online = _ONLINE; } echo "<br><br>" . _USERSTATUS . ": <b>{$online}</b><br>\n"; if ($userinfo['newsletter'] == 1 and $username == $cookie[1] and $userinfo['user_password'] == $cookie[2] or is_admin($admin) and $userinfo['newsletter'] == 1) { echo "<i>" . _SUBSCRIBED . "</i><br>"; } elseif (isset($cookie[1]) and $userinfo['newsletter'] == 0 and $username == $cookie[1] and $userinfo['user_password'] == $cookie[2] or is_admin($admin) and $userinfo['newsletter'] == 0) { echo "<i>" . _NOTSUBSCRIBED . "</i><br>"; } if (is_user($user) and $cookie[1] == "{$username}" or is_admin($admin)) { $numpoints = $db->sql_fetchrow($db->sql_query("SELECT points FROM " . $user_prefix . "_users WHERE user_id = '" . intval($cookie[0]) . "'")); $n_points = intval($numpoints['points']); echo "" . _YOUHAVEPOINTS . " <b>{$n_points}</b><br>"; if (paid()) { $row = $db->sql_fetchrow($db->sql_query("SELECT * FROM " . $prefix . "_subscriptions WHERE userid='" . intval($cookie[0]) . "'")); if (!empty($subscription_url)) { $content = "<br><center>" . _YOUARE . " <a href='{$subscription_url}'>" . _SUBSCRIBER . "</a> " . _OF . " {$sitename}<br>"; } else { $content = "<br><center>" . _YOUARE . " " . _SUBSCRIBER . " " . _OF . " {$sitename}<br>"; } $diff = $row['subscription_expire'] - time(); $yearDiff = floor($diff / 60 / 60 / 24 / 365); $diff -= $yearDiff * 60 * 60 * 24 * 365; if ($yearDiff < 1) { $diff = $row['subscription_expire'] - time(); } $daysDiff = floor($diff / 60 / 60 / 24); $diff -= $daysDiff * 60 * 60 * 24; $hrsDiff = floor($diff / 60 / 60); $diff -= $hrsDiff * 60 * 60; $minsDiff = floor($diff / 60); $diff -= $minsDiff * 60; $secsDiff = $diff; if ($yearDiff < 1) { $rest = "{$daysDiff} " . _SBDAYS . ", {$hrsDiff} " . _SBHOURS . ", {$minsDiff} " . _SBMINUTES . ", {$secsDiff} " . _SBSECONDS . ""; } elseif ($yearDiff == 1) { $rest = "{$yearDiff} " . _SBYEAR . ", {$daysDiff} " . _SBDAYS . ", {$hrsDiff} " . _SBHOURS . ", {$minsDiff} " . _SBMINUTES . ", {$secsDiff} " . _SBSECONDS . ""; } elseif ($yearDiff > 1) { $rest = "{$yearDiff} " . _SBYEARS . ", {$daysDiff} " . _SBDAYS . ", {$hrsDiff} " . _SBHOURS . ", {$minsDiff} " . _SBMINUTES . ", {$secsDiff} " . _SBSECONDS . ""; } $content .= "<b>" . _SUBEXPIREIN . "<br><font color='#FF0000'>{$rest}</font></b></center>"; } else { if (!empty($subscription_url)) { $content .= "<br><center>" . _NOTSUB . " {$sitename}. " . _SUBFROM . " <a href='{$subscription_url}'>" . _HERE . "</a> " . _NOW . ""; } else { $content .= "<br><center>" . _NOTSUB . " {$sitename}."; } } echo "{$content}<br><br>"; if (is_admin($admin)) { $subnum = $db->sql_numrows($db->sql_query("SELECT * FROM " . $prefix . "_subscriptions WHERE userid='" . intval($userinfo['user_id']) . "'")); if ($subnum != 0) { echo "<center><b>" . _ADMSUB . "</b></center><br>"; $row = $db->sql_fetchrow($db->sql_query("SELECT * FROM " . $prefix . "_subscriptions WHERE userid='" . intval($userinfo['user_id']) . "'")); $diff = $row['subscription_expire'] - time(); $yearDiff = floor($diff / 60 / 60 / 24 / 365); $diff -= $yearDiff * 60 * 60 * 24 * 365; if ($yearDiff < 1) { $diff = $row['subscription_expire'] - time(); } $daysDiff = floor($diff / 60 / 60 / 24); $diff -= $daysDiff * 60 * 60 * 24; $hrsDiff = floor($diff / 60 / 60); $diff -= $hrsDiff * 60 * 60; $minsDiff = floor($diff / 60); $diff -= $minsDiff * 60; $secsDiff = $diff; if ($yearDiff < 1) { $rest = "{$daysDiff} " . _SBDAYS . ", {$hrsDiff} " . _SBHOURS . ", {$minsDiff} " . _SBMINUTES . ", {$secsDiff} " . _SBSECONDS . ""; } elseif ($yearDiff == 1) { $rest = "{$yearDiff} " . _SBYEAR . ", {$daysDiff} " . _SBDAYS . ", {$hrsDiff} " . _SBHOURS . ", {$minsDiff} " . _SBMINUTES . ", {$secsDiff} " . _SBSECONDS . ""; } elseif ($yearDiff > 1) { $rest = "{$yearDiff} " . _SBYEARS . ", {$daysDiff} " . _SBDAYS . ", {$hrsDiff} " . _SBHOURS . ", {$minsDiff} " . _SBMINUTES . ", {$secsDiff} " . _SBSECONDS . ""; } $content = "<b>" . _ADMSUBEXPIREIN . "<br><font color='#FF0000'>{$rest}</font></b><br><br>"; echo "{$content}"; } else { echo "<center><b>" . _ADMNOTSUB . "</b><br><br>"; } } } if (is_active("Journal") and $cookie[1] != $username) { $sql3 = "SELECT jid FROM " . $prefix . "_journal WHERE aid='{$username}' AND status='yes' ORDER BY pdate,jid DESC LIMIT 0,1"; $result3 = $db->sql_query($sql3); $row3 = $db->sql_fetchrow($result3); $jid = intval($row3['jid']); if (!empty($jid) and isset($jid)) { echo "[ <a href=\"modules.php?name=Journal&file=search&bywhat=aid&forwhat={$username}\">" . _READMYJOURNAL . "</a> ]<br>"; } } if (is_admin($admin)) { echo "<br>"; OpenTable2(); if ($userinfo['last_ip'] != 0) { echo "<center><font class=\"title\">" . _ADMINFUNCTIONS . "</font><br><br>" . _LASTIP . " <b>" . $userinfo['last_ip'] . "</b><br><br>"; echo "[ <a href='" . $admin_file . ".php?op=ipban&ip=" . $userinfo['last_ip'] . "'>" . _BANTHIS . "</a> | <a href=\"" . $admin_file . ".php?op=modifyUser&chng_uid=" . $userinfo['username'] . "\">" . _EDITUSER . "</a> ]</center>"; } else { echo "<center>[ <a href=\"" . $admin_file . ".php?op=modifyUser&chng_uid=" . $userinfo['username'] . "\">" . _EDITUSER . "</a> ]</center>"; } if ($userinfo['karma'] == 0) { $karma = _KARMAGOOD; $karma_help = _KARMAGOODHLP; $change_karma = "<a href=\"modules.php?name={$module_name}&op=change_karma&user_id=" . $userinfo['user_id'] . "&karma=1\"><img src=\"images/karma/1.gif\" border=\"0\" alt=\"" . _KARMALOW . "\" title=\"" . _KARMALOW . "\" hspace=\"5\"></a>"; $change_karma .= "<a href=\"modules.php?name={$module_name}&op=change_karma&user_id=" . $userinfo['user_id'] . "&karma=2\"><img src=\"images/karma/2.gif\" border=\"0\" alt=\"" . _KARMABAD . "\" title=\"" . _KARMABAD . "\" hspace=\"5\"></a>"; $change_karma .= "<a href=\"modules.php?name={$module_name}&op=change_karma&user_id=" . $userinfo['user_id'] . "&karma=3\"><img src=\"images/karma/3.gif\" border=\"0\" alt=\"" . _KARMADEVIL . "\" title=\"" . _KARMADEVIL . "\" hspace=\"5\"></a>"; } elseif ($userinfo['karma'] == 1) { $karma = _KARMALOW; $karma_help = _KARMALOWHLP; $change_karma = "<a href=\"modules.php?name={$module_name}&op=change_karma&user_id=" . $userinfo['user_id'] . "&karma=0\"><img src=\"images/karma/0.gif\" border=\"0\" alt=\"" . _KARMAGOOD . "\" title=\"" . _KARMAGOOD . "\" hspace=\"5\"></a>"; $change_karma .= "<a href=\"modules.php?name={$module_name}&op=change_karma&user_id=" . $userinfo['user_id'] . "&karma=2\"><img src=\"images/karma/2.gif\" border=\"0\" alt=\"" . _KARMABAD . "\" title=\"" . _KARMABAD . "\" hspace=\"5\"></a>"; $change_karma .= "<a href=\"modules.php?name={$module_name}&op=change_karma&user_id=" . $userinfo['user_id'] . "&karma=3\"><img src=\"images/karma/3.gif\" border=\"0\" alt=\"" . _KARMADEVIL . "\" title=\"" . _KARMADEVIL . "\" hspace=\"5\"></a>"; } elseif ($userinfo['karma'] == 2) { $karma = _KARMABAD; $karma_help = _KARMABADHLP; $change_karma = "<a href=\"modules.php?name={$module_name}&op=change_karma&user_id=" . $userinfo['user_id'] . "&karma=0\"><img src=\"images/karma/0.gif\" border=\"0\" alt=\"" . _KARMAGOOD . "\" title=\"" . _KARMAGOOD . "\" hspace=\"5\"></a>"; $change_karma .= "<a href=\"modules.php?name={$module_name}&op=change_karma&user_id=" . $userinfo['user_id'] . "&karma=1\"><img src=\"images/karma/1.gif\" border=\"0\" alt=\"" . _KARMALOW . "\" title=\"" . _KARMALOW . "\" hspace=\"5\"></a>"; $change_karma .= "<a href=\"modules.php?name={$module_name}&op=change_karma&user_id=" . $userinfo['user_id'] . "&karma=3\"><img src=\"images/karma/3.gif\" border=\"0\" alt=\"" . _KARMADEVIL . "\" title=\"" . _KARMADEVIL . "\" hspace=\"5\"></a>"; } elseif ($userinfo['karma'] == 3) { $karma = _KARMADEVIL; $karma_help = _KARMADEVILHLP; $change_karma = "<a href=\"modules.php?name={$module_name}&op=change_karma&user_id=" . $userinfo['user_id'] . "&karma=0\"><img src=\"images/karma/0.gif\" border=\"0\" alt=\"" . _KARMAGOOD . "\" title=\"" . _KARMAGOOD . "\" hspace=\"5\"></a>"; $change_karma .= "<a href=\"modules.php?name={$module_name}&op=change_karma&user_id=" . $userinfo['user_id'] . "&karma=1\"><img src=\"images/karma/1.gif\" border=\"0\" alt=\"" . _KARMALOW . "\" title=\"" . _KARMALOW . "\" hspace=\"5\"></a>"; $change_karma .= "<a href=\"modules.php?name={$module_name}&op=change_karma&user_id=" . $userinfo['user_id'] . "&karma=2\"><img src=\"images/karma/2.gif\" border=\"0\" alt=\"" . _KARMABAD . "\" title=\"" . _KARMABAD . "\" hspace=\"5\"></a>"; } echo "<center><br><br>" . _USERKARMA . " <img src=\"images/karma/" . $userinfo['karma'] . ".gif\" border=\"0\" alt=\"{$karma}\" title=\"{$karma}\"> ({$karma})<br>({$karma_help})</center><br><br>"; OpenTable2(); echo "<center><b>" . _CHANGEKARMA . " <i>" . $userinfo['username'] . "</i></b><br><br>"; echo "{$change_karma}</center>"; CloseTable2(); echo "<br>"; echo "<table border=\"0\" width=\"80%\" cellpadding=\"3\" cellspacing=\"3\" align=\"center\">"; echo "<tr><td valign=\"middle\"><img src=\"images/karma/0.gif\" border=\"0\" alt=\"" . _KARMAGOOD . "\" title=\"" . _KARMAGOOD . "\"></td><td>" . _KARMAGOODREF . "</td></tr>"; echo "<tr><td valign=\"middle\"><img src=\"images/karma/1.gif\" border=\"0\" alt=\"" . _KARMALOW . "\" title=\"" . _KARMALOW . "\"></td><td>" . _KARMALOWREF . "</td></tr>"; echo "<tr><td valign=\"middle\"><img src=\"images/karma/2.gif\" border=\"0\" alt=\"" . _KARMABAD . "\" title=\"" . _KARMABAD . "\"></td><td>" . _KARMABADREF . "</td></tr>"; echo "<tr><td valign=\"middle\"><img src=\"images/karma/3.gif\" border=\"0\" alt=\"" . _KARMADEVIL . "\" title=\"" . _KARMADEVIL . "\"></td><td>" . _KARMADEVILREF . "</td></tr></table>"; CloseTable2(); } if ((is_user($user) and $cookie[1] != $username or is_admin($admin)) and is_active("Private_Messages")) { echo "<br>[ <a href=\"modules.php?name=Private_Messages&mode=post&u=" . intval($userinfo['user_id']) . "\">" . _USENDPRIVATEMSG . " {$username_pm}</a> ]<br>\n"; } echo "</center></font>"; } else { echo "<center>" . _NOINFOFOR . " " . htmlentities($username) . "</center>"; } CloseTable(); if (isset($cookie[1]) and $my_headlines == 1 and $username == $cookie[1] and $userinfo['user_password'] == $cookie[2]) { echo "<br>"; OpenTable(); echo "<center><b>" . _MYHEADLINES . "</b><br><br>" . "" . _SELECTASITE . "<br><br>" . "<form action=\"modules.php?name={$module_name}\" method=\"post\">" . "<input type=\"hidden\" name=\"op\" value=\"userinfo\">" . "<input type=\"hidden\" name=\"username\" value=\"{$username}\">" . "<input type=\"hidden\" name=\"bypass\" value=\"{$bypass}\">" . "<input type=\"hidden\" name=\"url\" value=\"0\">" . "<select name=\"hid\" onChange='submit()'>\n" . "<option value=\"0\">" . _SELECTASITE2 . "</option>"; $sql4 = "SELECT hid, sitename FROM " . $prefix . "_headlines ORDER BY sitename"; $headl = $db->sql_query($sql4); while ($row4 = $db->sql_fetchrow($headl)) { $nhid = intval($row4['hid']); $hsitename = filter($row4['sitename'], "nohtml"); if ($hid == $nhid) { $sel = "selected"; } else { $sel = ""; } echo "<option value=\"{$nhid}\" {$sel}>{$hsitename}</option>\n"; } echo "</select></form>" . "" . _ORTYPEURL . "<br><br>" . "<form action=\"modules.php?name={$module_name}\" method=\"post\">" . "<input type=\"hidden\" name=\"op\" value=\"userinfo\">" . "<input type=\"hidden\" name=\"username\" value=\"{$username}\">" . "<input type=\"hidden\" name=\"bypass\" value=\"{$bypass}\">" . "<input type=\"hidden\" name=\"hid\" value=\"0\">" . "<input type=\"text\" name=\"url\" size=\"40\" maxlength=\"200\" value=\"http://\"> " . "<input type=\"submit\" value=\"" . _GO . "\"></form>" . "</center><br>"; if ($hid != 0 or $hid == 0 and $url != "0" and $url != "http://" and !empty($url)) { if ($hid != 0) { $sql5 = "SELECT sitename, headlinesurl FROM " . $prefix . "_headlines WHERE hid='{$hid}'"; $result5 = $db->sql_query($sql5); $row5 = $db->sql_fetchrow($result5); $nsitename = filter($row5[sitename], "nohtml"); $url = filter($row5[headlinesurl], "nohtml"); $title = filter($nsitename, "nohtml"); $siteurl = eregi_replace("http://", "", $url); $siteurl = explode("/", $siteurl); } else { if (!ereg("http://", $url)) { $url = "http://{$url}"; } $siteurl = eregi_replace("http://", "", $url); $siteurl = explode("/", $siteurl); $title = "http://{$siteurl['0']}"; } $rdf = parse_url($url); $fp = fsockopen($rdf['host'], 80, $errno, $errstr, 15); if (!$fp) { $content = "<center><font class=\"content\">" . _RSSPROBLEM . "</font></center>"; } if ($fp) { fputs($fp, "GET " . $rdf['path'] . "?" . $rdf['query'] . " HTTP/1.0\r\n"); fputs($fp, "HOST: " . $rdf['host'] . "\r\n\r\n"); $string = ""; while (!feof($fp)) { $pagetext = fgets($fp, 300); $string .= chop($pagetext); } fputs($fp, "Connection: close\r\n\r\n"); fclose($fp); $items = explode("</item>", $string); $content = "<font class=\"content\">"; for ($i = 0; $i < 10; $i++) { $link = ereg_replace(".*<link>", "", $items[$i]); $link = ereg_replace("</link>.*", "", $link); $link = stripslashes(check_html($link, "nohtml")); $title2 = ereg_replace(".*<title>", "", $items[$i]); $title2 = ereg_replace("</title>.*", "", $title2); $title2 = stripslashes(check_html($title2, "nohtml")); if (empty($items[$i]) and $cont != 1) { $content = "<center>" . _RSSPROBLEM . "</center>"; } else { if (strcmp($link, $title2) and !empty($items[$i])) { $cont = 1; $content .= "<img src=\"images/arrow.gif\" border=\"0\" hspace=\"5\"><a href=\"{$link}\" target=\"new\">{$title2}</a><br>\n"; } } } } if (!empty($content)) { OpenTable2(); echo "<center><b>" . _HEADLINESFROM . " <a href=\"http://{$siteurl['0']}\" target=\"new\">{$title}</a></b></center><br>"; echo "{$content}"; CloseTable2(); } elseif ($cont == 0 or empty($content)) { OpenTable2(); echo "<center>" . _RSSPROBLEM . "</center><br>"; CloseTable2(); } echo "<br>"; } CloseTable(); } if (isset($cookie[1]) and $broadcast_msg == 1 and $username == $cookie[1] and $userinfo['user_password'] == $cookie[2]) { echo "<br>"; OpenTable(); echo "<center><b>" . _BROADCAST . "</b><br><br>" . _BROADCASTTEXT . "<br><br>" . "<form action=\"modules.php?name={$module_name}\" method=\"post\">" . "<input type=\"hidden\" name=\"who\" value=\"{$username}\">" . "<input type=\"hidden\" name=\"op\" value=\"broadcast\">" . "<input type=\"text\" size=\"60\" maxlength=\"255\" name=\"the_message\"> <input type=\"submit\" value=\"" . _SEND . "\">" . "</form></center>"; CloseTable(); } if (isset($cookie[1]) and is_active("Private_Messages") and $username == $cookie[1] and $userinfo['user_password'] == $cookie[2]) { echo "<br>"; OpenTable(); echo "<center><b>" . _PRIVATEMESSAGES . "</b><br><br>"; $numrow = $db->sql_numrows($db->sql_query("SELECT * FROM " . $prefix . "_bbprivmsgs WHERE privmsgs_to_userid='" . intval($userinfo['user_id']) . "' AND (privmsgs_type='1' OR privmsgs_type='5' OR privmsgs_type='0')")); if (is_active("Members_List")) { $mem_list = "<a href=\"modules.php?name=Members_List\">" . _BROWSEUSERS . "</a>"; } else { $mem_list = ""; } if (is_active("Search")) { $mod_search = "<a href=\"modules.php?name=Search&type=users\">" . _SEARCHUSERS . "</a>"; } else { $mod_search = ""; } if (!empty($mem_list) and !empty($mod_search)) { $a = " | "; } else { $a = ""; } if (!empty($mem_list) or !empty($mod_search)) { $links = "[ {$mem_list} {$a} {$mod_search} ]"; } elseif (empty($mem_list) and empty($mod_search)) { $links = ""; } echo "" . _YOUHAVE . " <a href=\"modules.php?name=Private_Messages\"><b>{$numrow}</b></a> " . _PRIVATEMSG . "<br><br>" . "<form action=\"modules.php?name=Private_Messages\" method=\"post\">" . "" . _USENDPRIVATEMSG . ": <input type=\"text\" name=\"pm_uname\" size=\"20\"> {$links}" . "<input type=\"hidden\" name=\"send\" value=\"1\">" . "</form></center>"; CloseTable(); } if ($articlecomm == 1) { echo "<br>"; OpenTable(); echo "<b>" . _LAST10COMMENTS . " " . $userinfo['username'] . ":</b><br>"; $sql6 = "SELECT tid, sid, subject FROM " . $prefix . "_comments WHERE name='" . $userinfo['username'] . "' ORDER BY tid DESC LIMIT 0,10"; $result6 = $db->sql_query($sql6); while ($row6 = $db->sql_fetchrow($result6)) { $tid = intval($row6['tid']); $sid = intval($row6['sid']); $subject = filter($row6['subject'], "nohtml"); echo "<li><a href=\"modules.php?name=News&file=article&thold=-1&mode=flat&order=0&sid={$sid}#{$tid}\">{$subject}</a><br>"; } CloseTable(); } echo "<br>"; OpenTable(); echo "<b>" . _LAST10SUBMISSIONS . " " . $userinfo['username'] . ":</b><br>"; $sql7 = "SELECT sid, title FROM " . $prefix . "_stories WHERE informant='" . $userinfo['username'] . "' ORDER BY sid DESC LIMIT 0,10"; $result7 = $db->sql_query($sql7); while ($row7 = $db->sql_fetchrow($result7)) { $sid = intval($row7['sid']); $title = filter($row7['title'], "nohtml"); echo "<li><a href=\"modules.php?name=News&file=article&sid={$sid}\">{$title}</a><br>"; } CloseTable(); include "footer.php"; }
function Stats_Main() { global $prefix, $db, $startdate, $sitename, $ThemeSel, $user_prefix, $Version_Num, $module_name, $textcolor2; include "header.php"; $result = $db->sql_query("SELECT type, var, count from " . $prefix . "_counter order by type desc"); while ($row = $db->sql_fetchrow($result)) { $type = stripslashes(check_html($row['type'], "nohtml")); $var = stripslashes(check_html($row['var'], "nohtml")); $count = intval($row['count']); if ($type == "total" && $var == "hits") { $total = $count; } elseif ($type == "browser") { if ($var == "FireFox") { $firefox[] = $count; $firefox[] = substr(100 * $count / $total, 0, 5); } elseif ($var == "Netscape") { $netscape[] = $count; $netscape[] = substr(100 * $count / $total, 0, 5); } elseif ($var == "MSIE") { $msie[] = $count; $msie[] = substr(100 * $count / $total, 0, 5); } elseif ($var == "Konqueror") { $konqueror[] = $count; $konqueror[] = substr(100 * $count / $total, 0, 5); } elseif ($var == "Opera") { $opera[] = $count; $opera[] = substr(100 * $count / $total, 0, 5); } elseif ($var == "Lynx") { $lynx[] = $count; $lynx[] = substr(100 * $count / $total, 0, 5); } elseif ($var == "Bot") { $bot[] = $count; $bot[] = substr(100 * $count / $total, 0, 5); } elseif ($type == "browser" && $var == "Other") { $b_other[] = $count; $b_other[] = substr(100 * $count / $total, 0, 5); } } elseif ($type == "os") { if ($var == "Windows") { $windows[] = $count; $windows[] = substr(100 * $count / $total, 0, 5); } elseif ($var == "Mac") { $mac[] = $count; $mac[] = substr(100 * $count / $total, 0, 5); } elseif ($var == "Linux") { $linux[] = $count; $linux[] = substr(100 * $count / $total, 0, 5); } elseif ($var == "FreeBSD") { $freebsd[] = $count; $freebsd[] = substr(100 * $count / $total, 0, 5); } elseif ($var == "SunOS") { $sunos[] = $count; $sunos[] = substr(100 * $count / $total, 0, 5); } elseif ($var == "IRIX") { $irix[] = $count; $irix[] = substr(100 * $count / $total, 0, 5); } elseif ($var == "BeOS") { $beos[] = $count; $beos[] = substr(100 * $count / $total, 0, 5); } elseif ($var == "OS/2") { $os2[] = $count; $os2[] = substr(100 * $count / $total, 0, 5); } elseif ($var == "AIX") { $aix[] = $count; $aix[] = substr(100 * $count / $total, 0, 5); } elseif ($type == "os" && $var == "Other") { $os_other[] = $count; $os_other[] = substr(100 * $count / $total, 0, 5); } } } title("{$sitename} " . _STATS . ""); OpenTable(); OpenTable(); echo "<center><font class=\"option\"><b>{$sitename} " . _STATS . "</b></font><br><br>" . _WERECEIVED . " <b>{$total}</b> " . _PAGESVIEWS . " {$startdate}<br><br>" . "[ <a href=\"modules.php?name={$module_name}&op=Stats\">" . _VIEWDETAILED . "</a> ]</center>"; CloseTable(); echo "<br><br>"; $l_size = getimagesize("themes/{$ThemeSel}/images/leftbar.gif"); $m_size = getimagesize("themes/{$ThemeSel}/images/mainbar.gif"); $r_size = getimagesize("themes/{$ThemeSel}/images/rightbar.gif"); OpenTable2(); echo "<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\" align=\"center\"><tr><td colspan=\"2\">\n"; echo "<center><font color=\"{$textcolor2}\"><b>" . _BROWSERS . "</b></font></center><br></td></tr>\n"; echo "<tr><td><img src=\"modules/{$module_name}/images/explorer.gif\" border=\"0\" alt=\"\"> MSIE: </td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Internet Explorer\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Internet Explorer\" height=\"{$m_size['1']}\" width=", $msie[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"Internet Explorer\"> {$msie['1']} % ({$msie['0']})</td></tr>\n"; echo "<tr><td><img src=\"modules/{$module_name}/images/firefox.gif\" border=\"0\" alt=\"\"> FireFox: </td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"FireFox\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"FireFox\" height=\"{$m_size['1']}\" width=", $firefox[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"FireFox\"> {$firefox['1']} % ({$firefox['0']})</td></tr>\n"; echo "<tr><td><img src=\"modules/{$module_name}/images/netscape.gif\" border=\"0\" alt=\"\"> Netscape: </td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Netscape\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Netscape\" height=\"{$m_size['1']}\" width=", $netscape[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"Netscape\"> {$netscape['1']} % ({$netscape['0']})</td></tr>\n"; echo "<tr><td><img src=\"modules/{$module_name}/images/opera.gif\" border=\"0\" alt=\"\"> Opera: </td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Opera\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Opera\" height=\"{$m_size['1']}\" width=", $opera[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"Opera\"> {$opera['1']} % ({$opera['0']})</td></tr>\n"; echo "<tr><td><img src=\"modules/{$module_name}/images/konqueror.gif\" border=\"0\" alt=\"\"> Konqueror: </td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Konqueror\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Konqueror (KDE)\" height=\"{$m_size['1']}\" width=", $konqueror[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"Konqueror\"> {$konqueror['1']} % ({$konqueror['0']})</td></tr>\n"; echo "<tr><td><img src=\"modules/{$module_name}/images/lynx.gif\" border=\"0\" alt=\"\"> Lynx: </td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Lynx\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Lynx\" height=\"{$m_size['1']}\" width=", $lynx[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"Lynx\"> {$lynx['1']} % ({$lynx['0']})</td></tr>\n"; echo "<tr><td><img src=\"modules/{$module_name}/images/altavista.gif\" border=\"0\" alt=\"\"> " . _SEARCHENGINES . ": </td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Robots - Spiders - Buscadores\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Robots - Spiders - Buscadores\" height=\"{$m_size['1']}\" width=", $bot[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"" . _BOTS . "\"> {$bot['1']} % ({$bot['0']})</td></tr>\n"; echo "<tr><td><img src=\"modules/{$module_name}/images/question.gif\" border=\"0\" alt=\"\"> " . _UNKNOWN . ": </td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Otros - Desconocidos\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Otros - Desconocidos\" height=\"{$m_size['1']}\" width=", $b_other[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"" . _OTHER . "\"> {$b_other['1']} % ({$b_other['0']})\n"; echo "</td></tr></table>"; CloseTable2(); echo "<br><br>\n"; OpenTable2(); echo "<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\" align=\"center\"><tr><td colspan=\"2\">\n"; echo "<center><font color=\"{$textcolor2}\"><b>" . _OPERATINGSYS . "</b></font></center><br></td></tr>\n"; echo "<tr><td><img src=\"modules/{$module_name}/images/windows.gif\" border=\"0\" alt=\"\"> Windows:</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Windows\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Windows\" height=\"{$m_size['1']}\" width=", $windows[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"Windows\"> {$windows['1']} % ({$windows['0']})</td></tr>\n"; echo "<tr><td><img src=\"modules/{$module_name}/images/linux.gif\" border=\"0\" alt=\"\"> Linux:</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Linux\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Linux\" height=\"{$m_size['1']}\" width=", $linux[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"Linux\"> {$linux['1']} % ({$linux['0']})</td></tr>\n"; echo "<tr><td><img src=\"modules/{$module_name}/images/mac.gif\" border=\"0\" alt=\"\"> Mac/PPC:</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Mac/PPC\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Mac - PPC\" height=\"{$m_size['1']}\" width=", $mac[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"Mac/PPC\"> {$mac['1']} % ({$mac['0']})</td></tr>\n"; echo "<tr><td><img src=\"modules/{$module_name}/images/bsd.gif\" border=\"0\" alt=\"\"> FreeBSD:</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"FreeBSD\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"FreeBSD\" height=\"{$m_size['1']}\" width=", $freebsd[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"FreeBSD\"> {$freebsd['1']} % ({$freebsd['0']})</td></tr>\n"; echo "<tr><td><img src=\"modules/{$module_name}/images/sun.gif\" border=\"0\" alt=\"\"> SunOS:</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"SunOS\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"SunOS\" height=\"{$m_size['1']}\" width=", $sunos[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"SunOS\"> {$sunos['1']} % ({$sunos['0']})</td></tr>\n"; echo "<tr><td><img src=\"modules/{$module_name}/images/irix.gif\" border=\"0\" alt=\"\"> IRIX:</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"SGI Irix\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"SGI Irix\" height=\"{$m_size['1']}\" width=", $irix[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"SGI Irix\"> {$irix['1']} % ({$irix['0']})</td></tr>\n"; echo "<tr><td><img src=\"modules/{$module_name}/images/be.gif\" border=\"0\" alt=\"\"> BeOS:</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"BeOS\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"BeOS\" height=\"{$m_size['1']}\" width=", $beos[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"BeOS\"> {$beos['1']} % ({$beos['0']})</td></tr>\n"; echo "<tr><td><img src=\"modules/{$module_name}/images/os2.gif\" border=\"0\" alt=\"\"> OS/2:</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"OS/2\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"OS/2\" height=\"{$m_size['1']}\" width=", $os2[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"OS/2\"> {$os2['1']} % ({$os2['0']})</td></tr>\n"; echo "<tr><td><img src=\"modules/{$module_name}/images/aix.gif\" border=\"0\" alt=\"\"> AIX:</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"AIX\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"AIX\" height=\"{$m_size['1']}\" width=", $aix[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"AIX\"> {$aix['1']} % ({$aix['0']})</td></tr>\n"; echo "<tr><td><img src=\"modules/{$module_name}/images/question.gif\" border=\"0\" alt=\"\"> " . _UNKNOWN . ":</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Otros - Desconocidos\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" ALt=\"Otros - Desconocidos\" height=\"{$m_size['1']}\" width=", $os_other[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"" . _OTHER . "\"> {$os_other['1']} % ({$os_other['0']})\n"; echo "</td></tr></table>\n"; CloseTable2(); echo "<br><br>\n"; $unum = $db->sql_numrows($db->sql_query("select user_id from " . $user_prefix . "_users")); $anum = $db->sql_numrows($db->sql_query("select * from " . $prefix . "_authors")); $snum = $db->sql_numrows($db->sql_query("select sid from " . $prefix . "_stories")); $cnum = $db->sql_numrows($db->sql_query("select tid from " . $prefix . "_comments")); $subnum = $db->sql_numrows($db->sql_query("select * from " . $prefix . "_queue")); if (is_active("Topics")) { $tnum = $db->sql_numrows($db->sql_query("select * from " . $prefix . "_topics")); } if (is_active("Web_Links")) { $links = $db->sql_numrows($db->sql_query("select * from " . $prefix . "_links_links")); $cat = $db->sql_numrows($db->sql_query("select * from " . $prefix . "_links_categories")); } OpenTable2(); echo "<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\" align=\"center\"><tr><td colspan=\"2\">\n"; echo "<center><font color=\"{$textcolor2}\"><b>" . _MISCSTATS . "</b></font></center><br></td></tr>\n"; echo "<tr><td><img src=\"modules/{$module_name}/images/users.gif\" border=\"0\" alt=\"\"> " . _REGUSERS . "</td><td><b>{$unum}</b></td></tr>\n"; echo "<tr><td><img src=\"modules/{$module_name}/images/authors.gif\" border=\"0\" alt=\"\"> " . _ACTIVEAUTHORS . "</td><td><b>{$anum}</b></td></tr>\n"; echo "<tr><td><img src=\"modules/{$module_name}/images/news.gif\" border=\"0\" alt=\"\"> " . _STORIESPUBLISHED . "</td><td><b>{$snum}</b></td></tr>\n"; if (is_active("Topics")) { echo "<tr><td><img src=\"modules/{$module_name}/images/topics.gif\" border=\"0\" alt=\"\"> " . _SACTIVETOPICS . "</td><td><b>{$tnum}</b></td></tr>\n"; } echo "<tr><td><img src=\"modules/{$module_name}/images/comments.gif\" border=\"0\" alt=\"\"> " . _COMMENTSPOSTED . "</td><td><b>{$cnum}</b></td></tr>\n"; if (is_active("Web_Links")) { echo "<tr><td><img src=\"modules/{$module_name}/images/topics.gif\" border=\"0\" alt=\"\"> " . _LINKSINLINKS . "</td><td><b>{$links}</b></td></tr>\n"; echo "<tr><td><img src=\"modules/{$module_name}/images/sections.gif\" border=\"0\" alt=\"\"> " . _LINKSCAT . "</td><td><b>{$cat}</b></td></tr>\n"; } echo "</table>\n"; CloseTable2(); CloseTable(); include "footer.php"; }
function viewdownload($cid, $min, $orderby, $show) { global $prefix, $dbi, $admin, $perpage, $module_name, $user, $bgcolor1, $bgcolor3, $show_links_num; include "header.php"; if (!isset($min)) { $min = 0; } if (!isset($max)) { $max = $min + $perpage; } if (isset($orderby)) { $orderby = convertorderbyin($orderby); } else { $orderby = "title ASC"; } if ($show != "") { $perpage = $show; } else { $show = $perpage; } $result = sql_query("SELECT title,cdescription,ldescription,parentid FROM " . $prefix . "_downloads_categories WHERE cid={$cid}", $dbi); list($title, $cdescription, $ldescription, $parentid) = sql_fetch_row($result, $dbi); $title = getparentlink($parentid, $title); $title = "<a href=modules.php?name={$module_name}>" . _MAIN . "</a>/{$title}"; menu(1); echo "<br>"; if ($ldescription != '') { OpenTable2(); echo "{$ldescription}"; CloseTable2(); echo "<BR>"; } OpenTable(); if ($cdescription != '') { $cdescription = "<BR>" . $cdescription; } echo "<center><font class=\"title\"><b>" . _CATEGORY . ": {$title}</b></font>{$cdescription}</center>"; echo "<table border=\"0\" cellspacing=\"10\" cellpadding=\"0\" align=\"center\"><tr>"; $result2 = sql_query("SELECT cid, title, cdescription FROM " . $prefix . "_downloads_categories WHERE parentid={$cid} order by title", $dbi); $count = 0; while (list($cid2, $title2, $cdescription2) = sql_fetch_row($result2, $dbi)) { if ($show_links_num == 1) { $cresult = sql_query("SELECT * FROM " . $prefix . "_downloads_downloads WHERE cid={$cid2}", $dbi); $cnumrows = sql_num_rows($cresult, $dbi); $cnumm = " ({$cnumrows})"; } else { $cnum = ""; } if ($cnumrows > 0) { $folder = "modules/Downloads/images/openfolder.gif"; } else { $folder = "modules/Downloads/images/closedfolder.gif"; } if (is_admin($admin)) { $folderImg = "<A HREF=\"admin.php?op=DownloadsModCat&cat={$cid2}\"><IMG SRC=\"{$folder}\" BORDER=0 ALT=\"" . _EDIT . "\"></A>"; } else { $folderImg = "<IMG SRC=\"{$folder}\" BORDER=0 ALT=\"{$title2}\">"; } echo "<td><font class=\"title\">{$folderImg} <a href=\"modules.php?name={$module_name}&d_op=viewdownload&cid={$cid2}\"><b>{$title2}</b></a></font>{$cnumm}"; categorynewdownloadgraphic($cid2); if ($cdescription2) { echo "<BR><font class=\"content\">{$cdescription2}</font><br>"; } else { echo "<br>"; } $result3 = sql_query("SELECT cid, title FROM " . $prefix . "_downloads_categories WHERE parentid={$cid2} order by title limit 0,3", $dbi); $space = 0; while (list($cid3, $title3) = sql_fetch_row($result3, $dbi)) { if ($space > 0) { echo ", "; } if ($show_links_num == 1) { $cresult2 = sql_query("SELECT * FROM " . $prefix . "_downloads_downloads WHERE cid={$cid3}", $dbi); $cnumrows2 = sql_num_rows($cresult2, $dbi); $cnum = " ({$cnumrows2})"; } else { $cnum = ""; } echo "<font class=\"content\"><a href=\"modules.php?name={$module_name}&d_op=viewdownload&cid={$cid3}\">{$title3}</a></font>{$cnum}"; $space++; } if ($count < 1) { echo "</td><td> </td>"; $dum = 1; } $count++; if ($count == 2) { echo "</td></tr><tr>"; $count = 0; $dum = 0; } } if ($dum == 1) { echo "</tr></table>"; } elseif ($dum == 0) { echo "<td></td></tr></table>"; } echo "<hr noshade size=\"1\">"; $orderbyTrans = convertorderbytrans($orderby); echo "<center><font class=\"content\">" . _SORTDOWNLOADSBY . ": " . "" . _TITLE . " (<a href=\"modules.php?name={$module_name}&d_op=viewdownload&cid={$cid}&orderby=titleA\">A</a>\\<a href=\"modules.php?name={$module_name}&d_op=viewdownload&cid={$cid}&orderby=titleD\">D</a>) " . "" . _DATE . " (<a href=\"modules.php?name={$module_name}&d_op=viewdownload&cid={$cid}&orderby=dateA\">A</a>\\<a href=\"modules.php?name={$module_name}&d_op=viewdownload&cid={$cid}&orderby=dateD\">D</a>) " . "" . _RATING . " (<a href=\"modules.php?name={$module_name}&d_op=viewdownload&cid={$cid}&orderby=ratingA\">A</a>\\<a href=\"modules.php?name={$module_name}&d_op=viewdownload&cid={$cid}&orderby=ratingD\">D</a>) " . "" . _POPULARITY . " (<a href=\"modules.php?name={$module_name}&d_op=viewdownload&cid={$cid}&orderby=hitsA\">A</a>\\<a href=\"modules.php?name={$module_name}&d_op=viewdownload&cid={$cid}&orderby=hitsD\">D</a>)" . "<br><b>" . _RESSORTED . ": {$orderbyTrans}</b></font></center>"; echo "<hr noshade size=\"1\">"; $result = sql_query("SELECT lid, title, url, description, date, hits, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage FROM " . $prefix . "_downloads_downloads WHERE cid={$cid} order by {$orderby} limit {$min},{$perpage} ", $dbi); $fullcountresult = sql_query("SELECT lid FROM " . $prefix . "_downloads_downloads WHERE cid={$cid}", $dbi); $totalselecteddownloads = sql_num_rows($fullcountresult, $dbi); echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"10\" border=\"0\"><tr><td><font class=\"content\">"; $x = 0; $color = $bgcolor3; while (list($lid, $title, $url, $description, $time, $hits, $downloadratingsummary, $totalvotes, $totalcomments, $filesize, $version, $homepage) = sql_fetch_row($result, $dbi)) { $downloadratingsummary = number_format($downloadratingsummary, $mainvotedecimal); $title = stripslashes($title); $description = stripslashes($description); $color = switchColor($color); echo "<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 WIDTH=100%><TR BGCOLOR=\"{$color}\"><TD>"; if (is_admin($admin)) { if (eregi("http", $url)) { echo "<a href=\"admin.php?op=DownloadsModDownload&lid={$lid}\"><img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>"; } else { echo "<a href=\"admin.php?op=DownloadsModDownload&lid={$lid}\"><img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>"; } } else { if (eregi("http", $url)) { echo "<img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"\">"; } else { echo "<img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"\">"; } } echo "</td><TD WIDTH=100% CLASS=\"title\" VALIGN=TOP><a href=\"modules.php?name={$module_name}&d_op=getit&lid={$lid}\" TARGET=\"_blank\"><B>{$title}</B></a>"; newdownloadgraphic($datetime, $time); popgraphic($hits); detecteditorial($lid, $transfertitle, 1); echo "</TD></TR><TR BGCOLOR=\"{$color}\"><TD COLSPAN=2>"; echo "<DIV ALIGN=\"JUSTIFY\"><b>" . _DESCRIPTION . ":</b> {$description}</TD></TR><TR BGCOLOR=\"{$color}\"><TD COLSPAN=2>"; setlocale(LC_TIME, $locale); ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $time, $datetime); $datetime = strftime("" . _LINKSDATESTRING . "", mktime($datetime[4], $datetime[5], $datetime[6], $datetime[2], $datetime[3], $datetime[1])); $datetime = ucfirst($datetime); echo "<b>" . _VERSION . ":</b> {$version} <b>" . _FILESIZE . ":</b> " . CoolSize($filesize) . "<br>"; echo "<b>" . _ADDEDON . ":</b> {$datetime} <b>" . _UDOWNLOADS . ":</b> {$hits}"; $transfertitle = str_replace(" ", "_", $title); /* voting & comments stats */ if ($totalvotes == 1) { $votestring = _VOTE; } else { $votestring = _VOTES; } if ($downloadratingsummary != "0" || $downloadratingsummary != "0.0") { echo " <b>" . _RATING . ":</b> {$downloadratingsummary} ({$totalvotes} {$votestring})"; } if ($homepage == "") { echo "<br>"; } else { echo "<br><a href=\"{$homepage}\" target=\"new\">" . _HOMEPAGE . "</a> | "; } echo "<a href=\"modules.php?name={$module_name}&d_op=ratedownload&lid={$lid}&ttitle={$transfertitle}\">" . _RATERESOURCE . "</a>"; if (is_user($user)) { echo " | <a href=\"modules.php?name={$module_name}&d_op=brokendownload&lid={$lid}\">" . _REPORTBROKEN . "</a>"; } echo " | <a href=\"modules.php?name={$module_name}&d_op=viewdownloaddetails&lid={$lid}&ttitle={$transfertitle}\">" . _DETAILS . "</a>"; if ($totalcomments != 0) { echo " | <a href=\"modules.php?name={$module_name}&d_op=viewdownloadcomments&lid={$lid}&ttitle={$transfertitle}\">" . _SCOMMENTS . " ({$totalcomments})</a>"; } detecteditorial($lid, $transfertitle, 0); echo "</DIV></TD></TR></TABLE><br>"; $x++; } echo "</font>"; $orderby = convertorderbyout($orderby); /* Calculates how many pages exist. Which page one should be on, etc... */ $downloadpagesint = $totalselecteddownloads / $perpage; $downloadpageremainder = $totalselecteddownloads % $perpage; if ($downloadpageremainder != 0) { $downloadpages = ceil($downloadpagesint); if ($totalselecteddownloads < $perpage) { $downloadpageremainder = 0; } } else { $downloadpages = $downloadpagesint; } /* Page Numbering */ if ($downloadpages != 1 && $downloadpages != 0) { echo "<br><br>"; echo "" . _SELECTPAGE . ": "; $prev = $min - $perpage; if ($prev >= 0) { echo " <b>[ <a href=\"modules.php?name={$module_name}&d_op=viewdownload&cid={$cid}&min={$prev}&orderby={$orderby}&show={$show}\">"; echo " << " . _PREVIOUS . "</a> ]</b> "; } $counter = 1; $currentpage = $max / $perpage; while ($counter <= $downloadpages) { $cpage = $counter; $mintemp = $perpage * $counter - $perpage; if ($counter == $currentpage) { echo "<b>{$counter}</b> "; } else { echo "<a href=\"modules.php?name={$module_name}&d_op=viewdownload&cid={$cid}&min={$mintemp}&orderby={$orderby}&show={$show}\">{$counter}</a> "; } $counter++; } $next = $min + $perpage; if ($x >= $perpage) { echo " <b>[ <a href=\"modules.php?name={$module_name}&d_op=viewdownload&cid={$cid}&min={$max}&orderby={$orderby}&show={$show}\">"; echo " " . _NEXT . " >></a> ]</b> "; } } echo "</td></tr></table>"; CloseTable(); include "footer.php"; }
function moderation_reviews_view($id) { global $prefix, $db, $admin_file; $id = intval($id); include "header.php"; GraphicAdmin(); mod_menu(); OpenTable(); $comm = $db->sql_fetchrow($db->sql_query("SELECT * FROM " . $prefix . "_reviews_comments_moderated WHERE cid='{$id}'")); $comm['userid'] = intval($comm['userid']); $comm['score'] = intval($comm['score']); $comm['comments'] = filter($comm['comments']); $revi = $db->sql_fetchrow($db->sql_query("SELECT title FROM " . $prefix . "_reviews WHERE id=" . intval($comm['rid']))); $revi['title'] = filter($revi['title'], "nohtml"); echo "<center><b>Comment to the Review:</b></center><br>"; OpenTable2(); echo "<center><i>" . $revi['title'] . "</i></center>"; CloseTable2(); echo "<br><br><center><b>" . _COMMENTAPPPENDING . "</b></center><br>"; OpenTable2(); echo "<b>" . $revi['title'] . "</b><br>" . _BY . " " . $comm['userid'] . " " . _WITHSCORE . " " . $comm['score'] . "/10<br><br>" . $comm['comments'] . "<br><br>"; echo "<center><hr size=\"1\" width=\"80%\"><a href=\"" . $admin_file . ".php?op=moderation_approval§ion=reviews&id={$id}\"><img src=\"images/karma/approve.gif\" alt=\"" . _APPROVE . "\" title=\"" . _APPROVE . "\" width=\"15\" heigh=\"15\" border=\"0\"></a> <a href=\"" . $admin_file . ".php?op=moderation_reject§ion=reviews&id={$id}\"><img src=\"images/karma/reject.gif\" alt=\"" . _REJECT . "\" title=\"" . _REJECT . "\" width=\"15\" heigh=\"15\" border=\"0\"></a></center>"; CloseTable2(); echo "<br>"; CloseTable(); include "footer.php"; }
function replace_var($vars) { $var = $vars[1]; if (substr($var, 0, 9) == '?sitemgr:') { $params = explode(',', substr($var, 9)); switch (count($params)) { case 0: $val = ''; break; case 1: $val = sitemgr_link2('', $params[0]); break; case 2: $val = sitemgr_link2($params[0], $params[1]); break; default: $val = $var; } } elseif (substr($var, 0, 7) == '?phpgw:') { $params = explode(',', substr($var, 7)); switch (count($params)) { case 0: $val = ''; break; case 1: $val = phpgw_link('', $params[0]); break; case 2: $val = phpgw_link($params[0], $params[1]); break; default: $val = $var; } } elseif (substr($var, 0, 1) == '?') { $val = sitemgr_link2('/index.php', substr($var, 1)); } elseif ($var == 'news') { $ui = new ui(); $val = $ui->get_news(); unset($ui); } elseif (substr($var, 0, 6) == 'block-') { if (file_exists('blocks/' . $var . '.php')) { $title = ereg_replace('_', ' ', substr($var, 6)); include 'blocks/' . $var . '.php'; } else { $title = lang('Block not found.'); $content = lang('Contact the administrator.'); } add_theme_var('block_title', $title); add_theme_var('block_content', $content); if (function_exists('themecenterbox')) { $val = themecenterbox($title, $content); } else { $val = parse_theme_vars(implode("", file('templates/' . $GLOBALS['sitemgr_info']['themesel'] . '/centerblock.tpl'))); } } else { /* Check for reserved vars first, otherwise get from the global theme_vars */ switch (strtolower($var)) { case 'opentable': $val = OpenTable(); break; case 'opentable2': $val = OpenTable2(); break; case 'closetable': $val = CloseTable(); break; case 'closetable2': $val = CloseTable2(); break; default: $val = $GLOBALS['theme_vars'][$var]; } } return $val; }
function userinfo($username, $bypass = 0, $hid = 0, $url = 0) { global $articlecomm, $user, $cookie, $sitename, $prefix, $user_prefix, $db, $admin, $broadcast_msg, $my_headlines, $module_name, $subscription_url; $username = substr("{$username}", 0, 25); $sql = "SELECT * FROM " . $prefix . "_bbconfig"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $board_config[$row['config_name']] = $row['config_value']; } $sql2 = "SELECT * FROM " . $user_prefix . "_users WHERE username='******'"; $result2 = $db->sql_query($sql2); $num = $db->sql_numrows($result2); $userinfo = $db->sql_fetchrow($result2); if (!$bypass) { cookiedecode($user); } include "header.php"; OpenTable(); echo "<center>"; if (strtolower($username) == strtolower($cookie[1]) and $userinfo[user_password] == $cookie[2]) { echo "<font class=\"option\">{$username}, " . _WELCOMETO . " {$sitename}!</font><br><br>"; echo "<font class=\"content\">" . _THISISYOURPAGE . "</font></center><br><br>"; nav(1); echo "<br><br>"; } else { echo "<font class=\"title\">" . _PERSONALINFO . ": {$username}</font></center><br><br>"; } if ($userinfo[user_website]) { if (!eregi("http://", $userinfo[user_website])) { $userinfo[user_website] = "http://{$userinfo['user_website']}"; } } if ($userinfo[user_avatar_type] == 1) { $userinfo[user_avatar] = $board_config['avatar_path'] . "/" . $userinfo[user_avatar]; } elseif ($userinfo[user_avatar_type] == 2) { $userinfo[user_avatar] = $userinfo[user_avatar]; } else { $userinfo[user_avatar] = $board_config[avatar_gallery_path] . "/" . $userinfo[user_avatar]; } if ($num == 1 && ($userinfo[user_website] || $userinfo[femail] || $userinfo[bio] || $userinfo[user_avatar] || $userinfo[user_icq] || $userinfo[user_aim] || $userinfo[user_yim] || $userinfo[user_msnm] || $userinfo[user_location] || $userinfo[user_occ] || $userinfo[user_interests] || $userinfo[user_sig])) { echo "<center><font class=\"content\">"; echo "<img src=\"{$userinfo['user_avatar']}\"><br><br>\n"; if ($userinfo[user_website] != "http://" and $userinfo[user_website] != "") { echo "" . _MYHOMEPAGE . " <a href=\"{$userinfo['user_website']}\" target=\"new\">{$userinfo['user_website']}</a><br>\n"; } echo "<CENTER><BR>" . _FULLNAME . ": {$userinfo['name']}" . "<BR>" . _REGNEWUSERTYPE . ": {$userinfo['usertype']}" . "<BR>" . _REGNEWUSERGRADYEAR . ": {$userinfo['gradyear']}" . "<BR>" . _SPECIALIZATION . ": {$userinfo['specialization']}" . "<BR>" . _REGNEWUSERCOMPANY . ": {$userinfo['company']}" . "</font></center><br><br>"; if ($userinfo[femail]) { echo "" . _MYEMAIL . " <a href=\"mailto:{$userinfo['femail']}\">{$userinfo['femail']}</a><br>\n"; } if ($userinfo[user_icq]) { echo "" . _ICQ . ": {$userinfo['user_icq']}<br>\n"; } if ($userinfo[user_aim]) { echo "" . _AIM . ": {$userinfo['user_aim']}<br>\n"; } if ($userinfo[user_yim]) { echo "" . _YIM . ": {$userinfo['user_yim']}<br>\n"; } if ($userinfo[user_msnm]) { echo "" . _MSNM . ": {$userinfo['user_msnm']}<br>\n"; } if ($userinfo[user_from]) { echo "" . _LOCATION . ": {$userinfo['user_from']}<br>\n"; } if ($userinfo[user_occ]) { echo "" . _OCCUPATION . ": {$userinfo['user_occ']}<br>\n"; } if ($userinfo[user_interests]) { echo "" . _INTERESTS . ": {$userinfo['user_interests']}<br>\n"; } $userinfo[user_sig] = nl2br($userinfo[user_sig]); if ($userinfo[user_sig]) { echo "<br><b>" . _SIGNATURE . ":</b><br>{$userinfo['user_sig']}<br>\n"; } if ($userinfo[bio]) { echo "<br><b>" . _EXTRAINFO . ":</b><br>{$userinfo['bio']}<br>\n"; } $sql2 = "SELECT uname FROM " . $prefix . "_session WHERE uname='{$username}'"; $result2 = $db->sql_query($sql2); $row2 = $db->sql_fetchrow($result2); $username_pm = $username; $username_online = $row2[uname]; if ($username_online == "") { $online = _OFFLINE; } else { $online = _ONLINE; } echo "" . _USERSTATUS . ": <b>{$online}</b><br>\n"; if ($userinfo[newsletter] == 1 and $username == $cookie[1] and $userinfo[user_password] == $cookie[2] or is_admin($admin) and $userinfo[newsletter] == 1) { echo "<i>" . _SUBSCRIBED . "</i><br>"; } elseif ($userinfo[newsletter] == 0 and $username == $cookie[1] and $userinfo[user_password] == $cookie[2] or is_admin($admin) and $userinfo[newsletter] == 0) { echo "<i>" . _NOTSUBSCRIBED . "</i><br>"; } if (is_user($user) and $cookie[1] == "{$username}" or is_admin($admin)) { $numpoints = $db->sql_fetchrow($db->sql_query("SELECT points FROM " . $user_prefix . "_users WHERE username='******'1']}'")); $n_points = intval($numpoints['points']); echo "" . _YOUHAVEPOINTS . " <b>{$n_points}</b><br>"; if (paid()) { $row = $db->sql_fetchrow($db->sql_query("SELECT * FROM " . $prefix . "_subscriptions WHERE userid='{$cookie['0']}'")); if ($subscription_url != "") { $content = "<br><center>" . _YOUARE . " <a href='{$subscription_url}'>" . _SUBSCRIBER . "</a> " . _OF . " {$sitename}<br>"; } else { $content = "<br><center>" . _YOUARE . " " . _SUBSCRIBER . " " . _OF . " {$sitename}<br>"; } $diff = $row[subscription_expire] - time(); $yearDiff = floor($diff / 60 / 60 / 24 / 365); $diff -= $yearDiff * 60 * 60 * 24 * 365; if ($yearDiff < 1) { $diff = $row[subscription_expire] - time(); } $daysDiff = floor($diff / 60 / 60 / 24); $diff -= $daysDiff * 60 * 60 * 24; $hrsDiff = floor($diff / 60 / 60); $diff -= $hrsDiff * 60 * 60; $minsDiff = floor($diff / 60); $diff -= $minsDiff * 60; $secsDiff = $diff; if ($yearDiff < 1) { $rest = "{$daysDiff} " . _SBDAYS . ", {$hrsDiff} " . _SBHOURS . ", {$minsDiff} " . _SBMINUTES . ", {$secsDiff} " . _SBSECONDS . ""; } elseif ($yearDiff == 1) { $rest = "{$yearDiff} " . _SBYEAR . ", {$daysDiff} " . _SBDAYS . ", {$hrsDiff} " . _SBHOURS . ", {$minsDiff} " . _SBMINUTES . ", {$secsDiff} " . _SBSECONDS . ""; } elseif ($yearDiff > 1) { $rest = "{$yearDiff} " . _SBYEARS . ", {$daysDiff} " . _SBDAYS . ", {$hrsDiff} " . _SBHOURS . ", {$minsDiff} " . _SBMINUTES . ", {$secsDiff} " . _SBSECONDS . ""; } $content .= "<b>" . _SUBEXPIREIN . "<br><font color='#FF0000'>{$rest}</font></b></center>"; } else { if ($subscription_url != "") { $content .= "<br><center>" . _NOTSUB . " {$sitename}. " . _SUBFROM . " <a href='{$subscription_url}'>" . _HERE . "</a> " . _NOW . ""; } else { $content .= "<br><center>" . _NOTSUB . " {$sitename}."; } } echo "{$content}<br><br>"; if (is_admin($admin)) { $subnum = $db->sql_numrows($db->sql_query("SELECT * FROM " . $prefix . "_subscriptions WHERE userid='{$userinfo['user_id']}'")); if ($subnum != 0) { echo "<center><b>" . _ADMSUB . "</b></center><br>"; $row = $db->sql_fetchrow($db->sql_query("SELECT * FROM " . $prefix . "_subscriptions WHERE userid='{$userinfo['user_id']}'")); $diff = $row[subscription_expire] - time(); $yearDiff = floor($diff / 60 / 60 / 24 / 365); $diff -= $yearDiff * 60 * 60 * 24 * 365; if ($yearDiff < 1) { $diff = $row[subscription_expire] - time(); } $daysDiff = floor($diff / 60 / 60 / 24); $diff -= $daysDiff * 60 * 60 * 24; $hrsDiff = floor($diff / 60 / 60); $diff -= $hrsDiff * 60 * 60; $minsDiff = floor($diff / 60); $diff -= $minsDiff * 60; $secsDiff = $diff; if ($yearDiff < 1) { $rest = "{$daysDiff} " . _SBDAYS . ", {$hrsDiff} " . _SBHOURS . ", {$minsDiff} " . _SBMINUTES . ", {$secsDiff} " . _SBSECONDS . ""; } elseif ($yearDiff == 1) { $rest = "{$yearDiff} " . _SBYEAR . ", {$daysDiff} " . _SBDAYS . ", {$hrsDiff} " . _SBHOURS . ", {$minsDiff} " . _SBMINUTES . ", {$secsDiff} " . _SBSECONDS . ""; } elseif ($yearDiff > 1) { $rest = "{$yearDiff} " . _SBYEARS . ", {$daysDiff} " . _SBDAYS . ", {$hrsDiff} " . _SBHOURS . ", {$minsDiff} " . _SBMINUTES . ", {$secsDiff} " . _SBSECONDS . ""; } $content = "<b>" . _ADMSUBEXPIREIN . "<br><font color='#FF0000'>{$rest}</font></b><br><br>"; echo "{$content}"; } else { echo "<center><b>" . _ADMNOTSUB . "</b><br><br>"; } } } if (is_user($user) and $cookie[1] == "{$username}" or is_admin($admin)) { $numpoints = $db->sql_fetchrow($db->sql_query("SELECT points FROM " . $user_prefix . "_users WHERE username='******'1']}'")); echo "" . _YOUHAVEPOINTS . " <b>{$numpoints['points']}</b><br>"; } if (is_active("Journal") and $cookie[1] != $username) { $sql3 = "SELECT jid FROM " . $prefix . "_journal WHERE aid='{$username}' AND status='yes' ORDER BY pdate,jid DESC LIMIT 0,1"; $result3 = $db->sql_query($sql3); $row3 = $db->sql_fetchrow($result3); $jid = intval($row3[jid]); if ($jid != "" and isset($jid)) { echo "[ <a href=\"modules.php?name=Journal&file=search&bywhat=aid&forwhat={$username}\">" . _READMYJOURNAL . "</a> ]<br>"; } } if (is_admin($admin)) { echo "<br>"; OpenTable2(); if ($userinfo[last_ip] != 0) { echo "<center>" . _LASTIP . " <b>{$userinfo['last_ip']}</b><br><br>"; echo "[ <a href='admin.php?op=ipban&ip={$userinfo['last_ip']}'>" . _BANTHIS . "</a> | <a href=\"admin.php?op=modifyUser&chng_uid={$userinfo['user_id']}\">" . _EDITUSER . "</a> ]</center>"; } else { echo "<center>[ <a href=\"admin.php?op=modifyUser&chng_uid={$userinfo['user_id']}\">" . _EDITUSER . "</a> ]</center>"; } CloseTable2(); } if ((is_user($user) and $cookie[1] != $username or is_admin($admin)) and is_active("Private_Messages")) { echo "<br>[ <a href=\"modules.php?name=Private_Messages&mode=post&u={$userinfo['user_id']}\">" . _USENDPRIVATEMSG . " {$username_pm}</a> ]<br>\n"; } echo "</center></font>"; } else { echo "<center>" . _NOINFOFOR . " {$username}</center>"; } CloseTable(); if ($my_headlines == 1 and $username == $cookie[1] and $userinfo[user_password] == $cookie[2]) { echo "<br>"; OpenTable(); echo "<center><b>" . _MYHEADLINES . "</b><br><br>" . "" . _SELECTASITE . "<br><br>" . "<form action=\"modules.php?name={$module_name}\" method=\"post\">" . "<input type=\"hidden\" name=\"op\" value=\"userinfo\">" . "<input type=\"hidden\" name=\"username\" value=\"{$username}\">" . "<input type=\"hidden\" name=\"bypass\" value=\"{$bypass}\">" . "<input type=\"hidden\" name=\"url\" value=\"0\">" . "<select name=\"hid\" onChange='submit()'>\n" . "<option value=\"0\">" . _SELECTASITE2 . "</option>"; $sql4 = "SELECT hid, sitename FROM " . $prefix . "_headlines ORDER BY sitename"; $headl = $db->sql_query($sql4); while ($row4 = $db->sql_fetchrow($headl)) { $nhid = intval($row4[hid]); $hsitename = $row4[sitename]; if ($hid == $nhid) { $sel = "selected"; } else { $sel = ""; } echo "<option value=\"{$nhid}\" {$sel}>{$hsitename}</option>\n"; } echo "</select></form>" . "" . _ORTYPEURL . "<br><br>" . "<form action=\"modules.php?name={$module_name}\" method=\"post\">" . "<input type=\"hidden\" name=\"op\" value=\"userinfo\">" . "<input type=\"hidden\" name=\"username\" value=\"{$username}\">" . "<input type=\"hidden\" name=\"bypass\" value=\"{$bypass}\">" . "<input type=\"hidden\" name=\"hid\" value=\"0\">" . "<input type=\"text\" name=\"url\" size=\"40\" maxlength=\"200\" value=\"http://\"> " . "<input type=\"submit\" value=\"" . _GO . "\"></form>" . "</center><br>"; if ($hid != 0 or $hid == 0 and $url != "0" and $url != "http://" and $url != "") { if ($hid != 0) { $sql5 = "SELECT sitename, headlinesurl FROM " . $prefix . "_headlines WHERE hid='{$hid}'"; $result5 = $db->sql_query($sql5); $row5 = $db->sql_fetchrow($result5); $nsitename = $row5[sitename]; $url = $row5[headlinesurl]; $title = stripslashes(check_html($nsitename, "nohtml")); $siteurl = eregi_replace("http://", "", $url); $siteurl = explode("/", $siteurl); } else { if (!ereg("http://", $url)) { $url = "http://{$url}"; } $siteurl = eregi_replace("http://", "", $url); $siteurl = explode("/", $siteurl); $title = "http://{$siteurl['0']}"; } $rdf = parse_url($url); $fp = fsockopen($rdf['host'], 80, $errno, $errstr, 15); if (!$fp) { $content = "<center><font class=\"content\">" . _RSSPROBLEM . "</font></center>"; } if ($fp) { fputs($fp, "GET " . $rdf['path'] . "?" . $rdf['query'] . " HTTP/1.0\r\n"); fputs($fp, "HOST: " . $rdf['host'] . "\r\n\r\n"); $string = ""; while (!feof($fp)) { $pagetext = fgets($fp, 300); $string .= chop($pagetext); } fputs($fp, "Connection: close\r\n\r\n"); fclose($fp); $items = explode("</item>", $string); $content = "<font class=\"content\">"; for ($i = 0; $i < 10; $i++) { $link = ereg_replace(".*<link>", "", $items[$i]); $link = ereg_replace("</link>.*", "", $link); $title2 = ereg_replace(".*<title>", "", $items[$i]); $title2 = ereg_replace("</title>.*", "", $title2); if ($items[$i] == "" and $cont != 1) { $content = "<center>" . _RSSPROBLEM . "</center>"; } else { if (strcmp($link, $title2) and $items[$i] != "") { $cont = 1; $content .= "<img src=\"images/arrow.gif\" border=\"0\" hspace=\"5\"><a href=\"{$link}\" target=\"new\">{$title2}</a><br>\n"; } } } } if ($content != "") { OpenTable2(); echo "<center><b>" . _HEADLINESFROM . " <a href=\"http://{$siteurl['0']}\" target=\"new\">{$title}</a></b></center><br>"; echo "{$content}"; CloseTable2(); } elseif ($cont == 0 or $content == "") { OpenTable2(); echo "<center>" . _RSSPROBLEM . "</center><br>"; CloseTable2(); } echo "<br>"; } CloseTable(); } if ($broadcast_msg == 1 and $username == $cookie[1] and $userinfo[user_password] == $cookie[2]) { echo "<br>"; OpenTable(); echo "<center><b>" . _BROADCAST . "</b><br><br>" . _BROADCASTTEXT . "<br><br>" . "<form action=\"modules.php?name={$module_name}\" method=\"post\">" . "<input type=\"hidden\" name=\"who\" value=\"{$username}\">" . "<input type=\"hidden\" name=\"op\" value=\"broadcast\">" . "<input type=\"text\" size=\"60\" maxlength=\"255\" name=\"the_message\"> <input type=\"submit\" value=\"" . _SEND . "\">" . "</form></center>"; CloseTable(); } if (is_active("Private_Messages") and $username == $cookie[1] and $userinfo[user_password] == $cookie[2]) { echo "<br>"; OpenTable(); echo "<center><b>" . _PRIVATEMESSAGES . "</b><br><br>"; $numrow = $db->sql_numrows($db->sql_query("SELECT * FROM " . $prefix . "_bbprivmsgs WHERE privmsgs_to_userid='{$userinfo['user_id']}' AND (privmsgs_type='1' OR privmsgs_type='5' OR privmsgs_type='0')")); if (is_active("Members_List")) { $mem_list = "<a href=\"modules.php?name=Members_List\">" . _BROWSEUSERS . "</a>"; } else { $mem_list = ""; } if (is_active("Search")) { $mod_search = "<a href=\"modules.php?name=Search&type=users\">" . _SEARCHUSERS . "</a>"; } else { $mod_search = ""; } if ($mem_list != "" and $mod_search != "") { $a = " | "; } else { $a = ""; } if ($mem_list != "" or $mod_search != "") { $links = "[ {$mem_list} {$a} {$mod_search} ]"; } elseif ($mem_list == "" and $mod_search == "") { $links = ""; } echo "" . _YOUHAVE . " <a href=\"modules.php?name=Private_Messages\"><b>{$numrow}</b></a> " . _PRIVATEMSG . "<br><br>" . "<form action=\"modules.php?name=Private_Messages\" method=\"post\">" . "" . _USENDPRIVATEMSG . ": <input type=\"text\" name=\"pm_uname\" size=\"20\"> {$links}" . "<input type=\"hidden\" name=\"send\" value=\"1\">" . "</form></center>"; CloseTable(); } if ($articlecomm == 1) { echo "<br>"; OpenTable(); echo "<b>" . _LAST10COMMENTS . " {$userinfo['username']}:</b><br>"; $sql6 = "SELECT tid, sid, subject FROM " . $prefix . "_comments WHERE name='{$userinfo['username']}' ORDER BY tid DESC LIMIT 0,10"; $result6 = $db->sql_query($sql6); while ($row6 = $db->sql_fetchrow($result6)) { $tid = intval($row6[tid]); $sid = intval($row6[sid]); $subject = stripslashes(check_html($row6[subject], "nohtml")); echo "<li><a href=\"modules.php?name=News&file=article&thold=-1&mode=flat&order=0&sid={$sid}#{$tid}\">{$subject}</a><br>"; } CloseTable(); } echo "<br>"; OpenTable(); echo "<b>" . _LAST10SUBMISSIONS . " {$userinfo['username']}:</b><br>"; $sql7 = "SELECT sid, title FROM " . $prefix . "_stories WHERE informant='{$userinfo['username']}' ORDER BY sid DESC LIMIT 0,10"; $result7 = $db->sql_query($sql7); while ($row7 = $db->sql_fetchrow($result7)) { $sid = intval($row7[sid]); $title = stripslashes(check_html($row7['title'], "nohtml")); echo "<li><a href=\"modules.php?name=News&file=article&sid={$sid}\">{$title}</a><br>"; } CloseTable(); include "footer.php"; }
function block_show($bid) { global $prefix, $db; include "header.php"; GraphicAdmin(); title("" . _BLOCKSADMIN . ""); OpenTable2(); $bid = intval($bid); $row = $db->sql_fetchrow($db->sql_query("select bid, bkey, title, content, url, bposition, blockfile from " . $prefix . "_blocks where bid='{$bid}'")); $bid = intval($row['bid']); $bkey = $row['bkey']; $title = $row['title']; $content = $row['content']; $url = $row['url']; $bposition = $row['bposition']; $blockfile = $row['blockfile']; if ($bkey == main) { mainblock(); } elseif ($bkey == admin) { adminblock(); } elseif ($bkey == modules) { modules_block(); } elseif ($bkey == category) { category(); } elseif ($bkey == userbox) { userblock(); } elseif ($bkey == "") { if ($url == "") { if ($blockfile == "") { if ($bposition == "c") { themecenterbox($title, $content); } else { themesidebox($title, $content); } } else { if ($bposition == "c") { blockfileinc($title, $blockfile, 1); } else { blockfileinc($title, $blockfile); } } } else { headlines($bid); } } CloseTable2(); echo "<br>"; OpenTable(); echo "<center><font class=\"option\"><b>" . _BLOCKSADMIN . ": " . _FUNCTIONS . "</b></font><br><br>" . "[ <a href=\"admin.php?op=ChangeStatus&bid={$bid}\">" . _ACTIVATE . "</a> | <a href=\"admin.php?op=BlocksEdit&bid={$bid}\">" . _EDIT . "</a> | "; if ($bkey == "") { echo "<a href=\"admin.php?op=BlocksDelete&bid={$bid}\">" . _DELETE . "</a> | "; } else { echo "" . _DELETE . " | "; } echo "<a href=\"admin.php?op=BlocksAdmin\">" . _BLOCKSADMIN . "</a> ]</center>"; CloseTable(); include "footer.php"; }
function viewdownload() { global $downloadsprefix, $db, $perpage, $module_name, $bgcolor1, $bgcolor3, $show_links_num; $cid = intval($_GET['cid']); $min = isset($_GET['min']) ? intval($_GET['min']) : 0; $orderby = convertorderbyin($_GET['orderby']); $max = $min + $perpage; include "header.php"; $result = $db->sql_query("SELECT title,cdescription,ldescription,parentid FROM " . $downloadsprefix . "_categories WHERE cid={$cid}"); list($title, $cdescription, $ldescription, $parentid) = $db->sql_fetchrow($result); $title = getparentlink($parentid, $title); $title = "<a href=" . getlink() . ">" . _MAIN . "</a>/{$title}"; downl_menu_tpl(1); echo '<br />'; if ($ldescription != '') { OpenTable2(); echo "{$ldescription}"; CloseTable2(); echo '<br />'; } OpenTable(); if ($cdescription != '') { $cdescription = "<br />" . $cdescription; } echo "<center><font class=\"title\"><b>" . _CATEGORY . ": {$title}</b></font>{$cdescription}</center>"; echo "<table border=\"0\" cellspacing=\"10\" cellpadding=\"0\" align=\"center\"><tr>"; $result2 = $db->sql_query("SELECT cid, title, cdescription FROM " . $downloadsprefix . "_categories WHERE parentid={$cid} order by title"); $count = 0; while (list($cid2, $title2, $cdescription2) = $db->sql_fetchrow($result2)) { if ($show_links_num == 1) { $cresult = $db->sql_query("SELECT * FROM " . $downloadsprefix . "_downloads WHERE cid={$cid2}"); $cnumrows = $db->sql_numrows($cresult); $cnumm = " ({$cnumrows})"; } else { $cnum = ""; } if ($cnumrows > 0) { $folder = "modules/Downloads/images/openfolder.gif"; } else { $folder = "modules/Downloads/images/closedfolder.gif"; } if (can_admin('downloads')) { $folderImg = "<A HREF=\"" . adminlink("{$module_name}&mode=DownloadsModCat&cat={$cid2}") . "\"><IMG SRC=\"{$folder}\" BORDER=0 ALT=\"" . _EDIT . "\"></A>"; } else { $folderImg = "<IMG SRC=\"{$folder}\" BORDER=0 ALT=\"{$title2}\">"; } echo "<td valign=\"top\"><font class=\"title\">{$folderImg} <a href=\"" . getlink("&d_op=viewdownload&cid={$cid2}") . "\"><b>{$title2}</b></a></font>{$cnumm}"; categorynewdownloadgraphic($cid2); if ($cdescription2) { echo "<br /><font class=\"content\">{$cdescription2}</font><br />"; } else { echo '<br />'; } $result3 = $db->sql_query("SELECT cid, title FROM " . $downloadsprefix . "_categories WHERE parentid={$cid2} order by title limit 0,3"); $space = 0; while (list($cid3, $title3) = $db->sql_fetchrow($result3)) { if ($space > 0) { echo ", "; } if ($show_links_num == 1) { $cresult2 = $db->sql_query("SELECT * FROM " . $downloadsprefix . "_downloads WHERE cid={$cid3}"); $cnumrows2 = $db->sql_numrows($cresult2); $cnum = " ({$cnumrows2})"; } else { $cnum = ""; } echo "<font class=\"content\"><a href=\"" . getlink("&d_op=viewdownload&cid={$cid3}") . "\">{$title3}</a></font>{$cnum}"; $space++; } if ($count < 1) { echo "</td><td> </td>"; $dum = 1; } $count++; if ($count == 2) { echo "</td></tr><tr>"; $count = 0; $dum = 0; } } if ($dum == 1) { echo "</tr></table>"; } elseif ($dum == 0) { echo "<td></td></tr></table>"; } echo "<hr noshade size=\"1\">"; $orderbyTrans = convertorderbytrans($orderby); echo "<center><font class=\"content\">" . _SORTDOWNLOADSBY . ": " . _TITLE . " (<a href=\"" . getlink("&d_op=viewdownload&cid={$cid}&orderby=titleA") . "\">A</a>\\<a href=\"" . getlink("&d_op=viewdownload&cid={$cid}&orderby=titleD") . "\">D</a>) " . _DATE . " (<a href=\"" . getlink("&d_op=viewdownload&cid={$cid}&orderby=dateA") . "\">A</a>\\<a href=\"" . getlink("&d_op=viewdownload&cid={$cid}&orderby=dateD") . "\">D</a>) " . _RATING . " (<a href=\"" . getlink("&d_op=viewdownload&cid={$cid}&orderby=ratingA") . "\">A</a>\\<a href=\"" . getlink("&d_op=viewdownload&cid={$cid}&orderby=ratingD") . "\">D</a>) " . _POPULARITY . " (<a href=\"" . getlink("&d_op=viewdownload&cid={$cid}&orderby=hitsA") . "\">A</a>\\<a href=\"" . getlink("&d_op=viewdownload&cid={$cid}&orderby=hitsD") . "\">D</a>)" . "<br /><b>" . _RESSORTED . ": {$orderbyTrans}</b></font></center>"; echo "<hr noshade size=\"1\">"; $result = $db->sql_query("SELECT lid, title, url, description, date, hits, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage FROM " . $downloadsprefix . "_downloads WHERE cid={$cid} order by {$orderby} limit {$min},{$perpage} "); $fullcountresult = $db->sql_query("SELECT lid FROM " . $downloadsprefix . "_downloads WHERE cid={$cid}"); $totalselecteddownloads = $db->sql_numrows($fullcountresult); echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"10\" border=\"0\"><tr><td><font class=\"content\">"; $x = 0; $color = $bgcolor3; while (list($lid, $title, $url, $description, $time, $hits, $downloadratingsummary, $totalvotes, $totalcomments, $filesize, $version, $homepage) = $db->sql_fetchrow($result)) { $downloadratingsummary = number_format($downloadratingsummary, $mainvotedecimal); $color = $color == $bgcolor3 ? $bgcolor1 : $bgcolor3; echo "<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 WIDTH=100%><TR BGCOLOR=\"{$color}\"><TD>"; if (can_admin('downloads')) { if (eregi("http", $url)) { echo "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModDownload&lid={$lid}") . "\"><img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>"; } else { echo "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModDownload&lid={$lid}") . "\"><img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>"; } } else { if (eregi("http", $url)) { echo "<img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"\">"; } else { echo "<img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"\">"; } } echo "</td><td width=\"100%\" class=\"title\" valign=\"top\"><a href=\"" . getlink("&d_op=getit&lid={$lid}") . "\"><B>{$title}</b></a>"; $datetime = formatDateTime($time . ' 00:00:00', _DATESTRING3); newdownloadgraphic($datetime); popgraphic($hits); detecteditorial($lid, 1); echo "</td></tr><TR BGCOLOR=\"{$color}\"><TD COLSPAN=2>"; echo "<DIV ALIGN=\"JUSTIFY\"><b>" . _DESCRIPTION . ":</b> {$description}</td></tr><TR BGCOLOR=\"{$color}\"><TD COLSPAN=2>"; echo "<b>" . _VERSION . ":</b> {$version} <b>" . _FILESIZE . ":</b> " . CoolSize($filesize) . "<br />"; echo "<b>" . _ADDEDON . ":</b> {$datetime} <b>" . _UDOWNLOADS . ":</b> {$hits}"; $transfertitle = str_replace(" ", "_", $title); /* voting & comments stats */ if ($totalvotes == 1) { $votestring = _VOTE; } else { $votestring = _VOTES; } if ($downloadratingsummary != "0" || $downloadratingsummary != "0.0") { echo " <b>" . _RATING . ":</b> {$downloadratingsummary} ({$totalvotes} {$votestring})"; } if ($homepage == "") { echo '<br />'; } else { echo "<br /><a href=\"{$homepage}\" target=\"new\">" . _HOMEPAGE . "</a> | "; } echo "<a href=\"" . getlink("&d_op=ratedownload&lid={$lid}") . "\">" . _RATERESOURCE . "</a>"; if (is_user()) { echo " | <a href=\"" . getlink("&d_op=brokendownload&lid={$lid}") . "\">" . _REPORTBROKEN . "</a>"; } echo " | <a href=\"" . getlink("&d_op=viewdownloaddetails&lid={$lid}") . "\">" . _DETAILS . "</a>"; if ($totalcomments != 0) { echo " | <a href=\"" . getlink("&d_op=viewdownloadcomments&lid={$lid}") . "\">" . _SCOMMENTS . " ({$totalcomments})</a>"; } detecteditorial($lid, 0); echo "</div></td></tr></table><br />"; $x++; } echo "</font>"; $orderby = convertorderbyout($orderby); /* Calculates how many pages exist. Which page one should be on, etc... */ $downloadpagesint = $totalselecteddownloads / $perpage; $downloadpageremainder = $totalselecteddownloads % $perpage; if ($downloadpageremainder != 0) { $downloadpages = ceil($downloadpagesint); if ($totalselecteddownloads < $perpage) { $downloadpageremainder = 0; } } else { $downloadpages = $downloadpagesint; } /* Page Numbering */ if ($downloadpages != 1 && $downloadpages != 0) { echo "<br /><br />"; echo _SELECTPAGE . ": "; $prev = $min - $perpage; if ($prev >= 0) { echo " <b>[ <a href=\"" . getlink("&d_op=viewdownload&cid={$cid}&min={$prev}&orderby={$orderby}") . "\">"; echo " << " . _PREVIOUSPAGE . "</a> ]</b> "; } $counter = 1; $currentpage = $max / $perpage; while ($counter <= $downloadpages) { $cpage = $counter; $mintemp = $perpage * $counter - $perpage; if ($counter == $currentpage) { echo "<b>{$counter}</b> "; } else { echo "<a href=\"" . getlink("&d_op=viewdownload&cid={$cid}&min={$mintemp}&orderby={$orderby}") . "\">{$counter}</a> "; } $counter++; } $next = $min + $perpage; if ($x >= $perpage) { echo " <b>[ <a href=\"" . getlink("&d_op=viewdownload&cid={$cid}&min={$max}&orderby={$orderby}") . "\">" . _NEXTPAGE . " >></a> ]</b> "; } } echo "</td></tr></table>"; CloseTable(); include "footer.php"; }
function viewlinkeditorial($lid, $ttitle) { global $linksprefix, $db, $module_name; require_once 'header.php'; menu(1); $result = $db->sql_query("SELECT adminid, editorialtimestamp, editorialtext, editorialtitle FROM " . $linksprefix . "_editorials WHERE linkid = {$lid}"); $recordexist = $db->sql_numrows($result); $transfertitle = ereg_replace('_', ' ', $ttitle); $displaytitle = $transfertitle; echo '<br />'; OpenTable(); echo '<div style="text-align:center;"><span class="option"><b>' . _LINKPROFILE . ': ' . $displaytitle . '</b></span><br />'; linkinfomenu($lid, $ttitle); if ($recordexist != 0) { while (list($adminid, $editorialtimestamp, $editorialtext, $editorialtitle) = $db->sql_fetchrow($result)) { ereg('([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})', $editorialtimestamp, $editorialtime); $editorialtime = strftime('%F', mktime($editorialtime[4], $editorialtime[5], $editorialtime[6], $editorialtime[2], $editorialtime[3], $editorialtime[1])); $date_array = explode('-', $editorialtime); $timestamp = mktime(0, 0, 0, $date_array['1'], $date_array['2'], $date_array['0']); $formatted_date = date('F j, Y', $timestamp); echo '<br /><br />'; OpenTable2(); echo '<span class="option"><b>' . $editorialtitle . '</b></span><br />' . '<span class="tiny">' . _EDITORIALBY . ' ' . $adminid . ' - ' . $formatted_date . '</span><br /><br />' . $editorialtext; CloseTable2(); } } else { echo '<br /><br /><span class="option"><b>' . _NOEDITORIAL . '</b></span>'; } echo '<br /><br />'; linkfooter($lid, $ttitle); echo '</div>'; CloseTable(); }
function index() { global $prefix, $db, $module_name, $show_links_num, $show_links_info, $show_links_inum, $admin; include "header.php"; $maindownload = 0; menu($maindownload); echo "<br>"; OpenTable(); echo "<center><font class=\"title\"><b>" . _DOWNLOADSMAINCAT . "</b></font></center><br>"; echo "<table border=\"0\" cellspacing=\"10\" cellpadding=\"0\" align=\"center\"><tr>"; $sql = "SELECT cid, title, cdescription FROM " . $prefix . "_downloads_categories WHERE parentid='0' ORDER BY title"; $result = $db->sql_query($sql); $count = 0; while ($row = $db->sql_fetchrow($result)) { $cid = $row[cid]; $title = $row[title]; $cdescription = $row[cdescription]; if ($show_links_num == 1) { $cnumrows = $db->sql_numrows($db->sql_query("SELECT * FROM " . $prefix . "_downloads_downloads WHERE cid='{$cid}'")); $cnumm = " ({$cnumrows})"; } else { $cnumm = ""; } if ($cnumrows > 0) { $folder = "modules/Downloads/images/openfolder.gif"; } else { $folder = "modules/Downloads/images/closedfolder.gif"; } if (is_admin($admin)) { $folderImg = "<A HREF=\"admin.php?op=DownloadsModCat&cat={$cid}\"><IMG SRC=\"{$folder}\" BORDER=0 ALT=\"" . _EDIT . "\"></A>"; } else { $folderImg = "<IMG SRC=\"{$folder}\" BORDER=0 ALT=\"{$title}\">"; } echo "<td><font class=\"title\">{$folderImg} <a href=\"modules.php?name={$module_name}&d_op=viewdownload&cid={$cid}\"><b>{$title}</b></a></font>{$cnumm}"; categorynewdownloadgraphic($cid); if ($cdescription) { echo "<br><font class=\"content\">{$cdescription}</font><br>"; } else { echo "<br>"; } $sql2 = "SELECT cid, title FROM " . $prefix . "_downloads_categories WHERE parentid='{$cid}' ORDER BY title LIMIT 0,3"; $result2 = $db->sql_query($sql2); $space = 0; while ($row2 = $db->sql_fetchrow($result2)) { $cid = $row2[cid]; $stitle = $row2[title]; if ($space > 0) { echo ", "; } if ($show_links_num == 1) { $cnumrows2 = $db->sql_numrows($db->sql_query("SELECT * FROM " . $prefix . "_downloads_downloads WHERE cid='{$cid}'")); $cnum = " ({$cnumrows2})"; } else { $cnumrows2 = ""; } echo "<font class=\"content\"><a href=\"modules.php?name={$module_name}&d_op=viewdownload&cid={$cid}\">{$stitle}</a>{$cnum}</font>"; $space++; } if ($count < 1) { echo "</td><td> </td>"; $dum = 1; } $count++; if ($count == 2) { echo "</td></tr><tr>"; $count = 0; $dum = 0; } } if ($dum == 1) { echo "</tr></table>"; } elseif ($dum == 0) { echo "<td></td></tr></table>"; } $numrows = $db->sql_numrows($db->sql_query("SELECT * FROM " . $prefix . "_downloads_downloads")); $catnum = $db->sql_numrows($db->sql_query("SELECT * FROM " . $prefix . "_downloads_categories")); echo "<center><font class=\"content\">" . _THEREARE . " <b>{$numrows}</b> " . _DOWNLOADS . " " . _AND . " <b>{$catnum}</b> " . _CATEGORIES . " " . _INDB . "</font></center>"; CloseTable(); if ($show_links_info == 1) { echo "<BR>"; OpenTable(); echo "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=3 WIDTH=100%>" . "<TR><TD WIDTH=50% VALIGN=TOP ALIGN=CENTER>"; // OpenTable2(); echo "<DIV ALIGN=CENTER CLASS=\"title\">" . _NEWDOWNLOADS . "</DIV>"; // CloseTable2(); echo "</TD><TD WIDTH=50% VALIGN=TOP ALIGN=CENTER>"; // OpenTable2(); echo "<DIV ALIGN=CENTER CLASS=\"title\">" . _MOSTPOPULAR . " {$show_links_inum}</DIV>"; // CloseTable2(); echo "</TD></TR>" . "<TR><TD WIDTH=50% VALIGN=TOP ALIGN=CENTER>"; OpenTable2(); $content = ""; $content .= "<TABLE BORDER=0 WIDTH=\"100%\">"; $color = $bgcolor3; $sql = "SELECT lid, title, hits FROM " . $prefix . "_downloads_downloads ORDER BY date DESC LIMIT 0, {$show_links_inum}"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $title2 = ereg_replace("_", " ", $row[title]); $color = switchColor($color); $content .= "<TR><TD BGCOLOR=\"{$color}\" ALIGN=LEFT><a href=\"modules.php?name=Downloads&d_op=viewdownloaddetails&lid={$row['lid']}&title={$row['title']}\">{$title2}</a></TD>"; $content .= "<TD BGCOLOR=\"{$color}\" ALIGN=CENTER WIDTH=\"20\">{$row['hits']}</TD></TR>"; } echo "{$content}</TABLE>"; CloseTable2(); echo "|[ <A HREF=\"modules.php?name=Downloads&d_op=NewDownloads\">" . _NEWDOWNLOADS . "</A> ]|"; echo "</TD><TD WIDTH=50% VALIGN=TOP ALIGN=CENTER>"; OpenTable2(); $content = ""; $content .= "<TABLE BORDER=0 WIDTH=\"100%\">"; $color = $bgcolor3; $sql = "SELECT lid, title, hits FROM " . $prefix . "_downloads_downloads ORDER BY hits DESC LIMIT 0, {$show_links_inum}"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $title2 = ereg_replace("_", " ", $row[title]); $color = switchColor($color); $content .= "<TR><TD BGCOLOR=\"{$color}\" ALIGN=LEFT><a href=\"modules.php?name=Downloads&d_op=viewdownloaddetails&lid={$row['lid']}&title={$row['title']}\">{$title2}</a></TD>"; $content .= "<TD BGCOLOR=\"{$color}\" ALIGN=CENTER WIDTH=\"20\">{$row['hits']}</TD></TR>"; } echo "{$content}</TABLE>"; CloseTable2(); echo "|[ <A HREF=\"modules.php?name=Downloads&d_op=MostPopular\">" . _MOSTPOPULAR . " " . _DOWNLOADS . "</A> ]|"; echo "</TD></TR>" . "</TABLE>"; CloseTable(); } include "footer.php"; }