function DisplayGrepForm($s1 = "", $s2 = "", $stringnot = "", $scope, $RightLevel, $previousres = "") { global $countmatch; global $title; $title = "AdminGrep"; require_once "header.php"; Menu1("", $title); // Displays the top menu Menu2("admin/admingrep.php", $title); // Displays the second menu DisplayHeaderShortUserContent($title); ShowLeftColumn($MenuAction, VolMenu()); echo " <div id=\"col3\"> \n"; echo " <div id=\"col3_content\" class=\"clearfix\"> \n"; echo " <div class=\"info clearfix\">\n"; if ($previousres != "") { echo "<table bgcolor=gray width=100%>"; echo "<tr><th bgcolor=silver>Looking in (<b>{$repertoire}</b>{$scope}) for <b><font color=blue>", stripslashes($s1), "</font></b>"; if ($s2 != "") { echo " and for <b><font color=blue>", stripslashes($s2), "</font></b>"; } if ($stringnot != "") { echo " and NOT <b><font color=blue>", stripslashes($stringnot), "</font></b>"; } echo "</th>\n"; echo "<tr><td>"; echo $previousres; echo "</td>"; echo "<tr><td>match : "; echo $countmatch; echo "</td>"; echo "</table>"; } echo "\n<form method=post><center><table bgcolor=silver><tr bgcolor=gray><th colspan=2>parameters</th>"; // echo "\n<tr><td>directory (leave empty)</td><td><input type=text name=repertoire value=\"$repertoire\" size=30></td>"; if ($RightLevel >= 5) { echo "\n<tr><td>File Scope</td><td><input type=text name=scope value=\"{$scope}\" size=60></td>"; } else { echo "\n<tr><td>File Scope</td><td><input type=text readonly name=scope value=\"{$scope}\" size=60></td>"; } echo "\n<tr><td>string to find</td><td><input type=text name=s1 value=\"", stripslashes(htmlentities($s1)), "\" size=30></td>"; echo "\n<tr><td>and 2nd string to find</td><td><input type=text name=s2 value=\"", stripslashes(htmlentities($s2)), "\" size=30></td>"; echo "\n<tr><td>and string not to have</td><td><input type=text name=stringnot value=\"", stripslashes(htmlentities($stringnot)), "\" size=30></td>"; echo "<input type=hidden name=action value=\"grep\" >"; echo "\n<tr><td colspan=2 align=center><input type=submit id=submit name=submit value=\"find\" size=2></td>"; echo "\n</table></center></form>"; require_once "footer.php"; }
function DisplayAdminLogs($tData, $username, $type, $ip, $andS1, $andS2, $notAndS1, $notAndS2, $maxpos) { global $title; $rTime = LoadRow("select now() as ss"); $title = "Admin logs Server time: " . $rTime->ss; require_once "header.php"; Menu1("", "Admin Logs page"); // Displays the top menu Menu2("admin/adminlogs.php", ww('MainPage')); // Displays the second menu DisplayHeaderShortUserContent($title); ShowLeftColumn("", VolMenu()); // Show the Actions // middle column echo " <div id=\"col3\"> \n"; echo " <div id=\"col3_content\" class=\"clearfix\"> \n"; echo " <div class=\"info clearfix\">\n"; $max = count($tData); $infoStyles = array(0 => " <tr class=\"blank\" align=\"left\" valign=\"center\">\n", 1 => " <tr class=\"highlight\" align=\"left\" valign=\"center\">\n"); echo " <table cellspacing=\"10\" cellpadding=\"10\" style=\"font-size:11px;\">\n"; echo " <tr>\n"; if (empty($username)) { echo " <th>Username</th>\n"; echo " <th>Type</th>\n"; echo " <th>Str</th>\n"; echo " <th>created</th>\n"; echo " <th>ip</th>\n"; } else { echo " <th colspan=4 align=center> Logs for ", LinkWithUsername(fUsername($username)), "</th>\n"; } echo "</tr>\n"; for ($ii = 0; $ii < $max; $ii++) { $logs = $tData[$ii]; echo $infoStyles[$ii % 2]; // this displays the <tr> if (!empty($logs->Username)) { echo "<td>"; echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?Username="******"\">" . $logs->Username . "</a>"; echo "</td>"; } else { echo "<td>"; // To do according to ip addresses replace with Google, Yahoo .. etc - an external solution is to be find switch (long2ip($logs->IpAddress)) { case "66.249.72.206": echo "Googlebot/2.1"; break; case "74.6.23.107": echo "Yahoo slurp"; break; case "127.0.0.1": echo "<i>localhost</i>"; break; default: echo "<i>not logged</i>"; break; break; } echo "</td>"; } echo "<td>"; echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?Type=" . $logs->Type . "\">" . $logs->Type . "</a>"; // echo $logs->Type; echo "</td>"; echo "<td>"; echo $logs->Str; echo "</td>"; echo "<td>{$logs->created}</td><td> "; echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?ip=" . long2ip($logs->IpAddress) . "\">" . long2ip($logs->IpAddress) . "</a>"; echo " <a href=\"http://ws.arin.net/whois/?queryinput=+" . long2ip($logs->IpAddress) . " \" target=\"new\">arinc</a>"; echo " <a href=\"http://outils-rezo.info/cgi-bin/action.cgi?valeur=" . long2ip($logs->IpAddress) . "&cmd=Whois\" target=\"new\">whois</a>"; echo "</td>"; echo "</tr>\n"; } echo " </table>\n<br>"; if ($max > 0) { echo _Pagination($maxpos); } echo " <hr />\n"; echo " <table>\n"; echo " <form method='post' action='adminlogs.php'>\n"; if (HasRight("Logs") > 1) { echo " <tr>\n"; echo " <td>Username</td><td><input type=\"text\" name=\"Username\" value=\"" . (!empty($username) ? $username : '') . "\"></td>\n"; } else { echo " <tr>\n"; echo " <td>Username</td><td><input type=\"text\" readonly=\"readonly\" name=\"Username\" value=\"" . $username . "\"></td>"; } echo " <td>Type</td><td><input type=text name=Type value=\"" . $type . "\"></td>\n"; echo " <td>Ip</td><td><input type=text name=ip value=\"" . $ip . "\"></td>\n"; echo " </tr>\n"; echo " <tr><td> Having</td><td><input type=text name=andS1 value=\"" . $andS1 . "\"></td></tr>"; echo " <tr><td>and Having</td><td><input type=text name=andS2 value=\"" . $andS2 . "\"></td></tr>"; echo " <tr><td>and not Having</td><td><input type=text name=NotandS1 value=\"" . $notAndS1 . "\"></td></tr>"; echo " <tr><td>and not Having</td><td><input type=text name=NotandS2 value=\"" . $notAndS2 . "\"></td></tr>"; echo " <tr><td colspan=2 align=center>"; echo "<input type=submit id=submit>"; echo "</td>\n"; echo " </tr>\n"; echo " </form>\n"; echo " </table>\n"; echo " </div>\n"; require_once "footer.php"; }
function DisplayMyResults($_TResult, $_TTitle, $_TTsqry, $rQuery, $Message, $TList) { global $title; if (isset($rQuery->Name)) { // If the query was successfull and if it has a name $title = $rQuery->Name; } else { $title = "FailedQuery"; } require_once "header.php"; Menu1("", ww('MainPage')); // Displays the top menu Menu2("admin/adminquery.php", ww('MainPage')); // Displays the second menu if (HasRight("SqlForVolunteers") >= 10) { $MenuAction = " <li><a href=\"adminquery.php\">admin query</a></li>\n"; } // $MenuAction .= " <li><a href=\"admingroups.php?action=updategroupscounter\">Update group counters</a></li>\n"; DisplayHeaderShortUserContent($title); ShowLeftColumn($MenuAction, VolMenu()); echo " <div id=\"col3\"> \n"; echo " <div id=\"col3_content\" class=\"clearfix\"> \n"; echo " <div class=\"info\">\n"; if (!empty($Message)) { echo "<h2>{$Message}</h2>"; } for ($kk = 0; $kk < count($_TTsqry); $kk++) { $TResult = $_TResult[$kk]; $TTitle = $_TTitle[$kk]; $sqry = $_TTsqry[$kk]; $iCount = count($TTitle); $bgcolor[0] = "#ffffcc"; $bgcolor[1] = "#ffccff"; echo "<p><table>\n"; $max = count($TResult); echo "<tr bgcolor=\"#ff9966\"><th colspan=\"" . $iCount . "\">", $sqry, "</th></tr>"; echo "<tr bgcolor=\"#ff9966\">"; for ($ii = 0; $ii < $iCount; $ii++) { echo "<th>", $TTitle[$ii], "</th>"; } echo "</tr>"; for ($jj = 0; $jj < $max; $jj++) { $rr = $TResult[$jj]; echo "<tr align=left valign=center bgcolor=\"" . $bgcolor[$jj % 2] . "\">"; for ($ii = 0; $ii < $iCount; $ii++) { $FieldName = $TTitle[$ii]; echo "<td>", $rr[$ii], "</td>"; } echo "</tr>"; } echo "</table></p>\n"; } ShowAvailableQueries($TList); echo "</center>"; require_once "footer.php"; }
function DisplayFormCreateBroadcast($IdBroadCast = 0, $Name = "", $BroadCast_Title_, $BroadCast_Body_, $Description, $Type = "") { global $title; $title = "Create a new broadcast"; require_once "header.php"; Menu1("", ww('MainPage')); // Displays the top menu Menu2("admin/adminmassmails.php", ww('MainPage')); // Displays the second menu $MenuAction = " <li><a href=\"adminmassmails.php\">Admin Massmails</a></li>\n"; $MenuAction .= " <li><a href=\"adminmassmails.php?action=createbroadcast\">Create new broadcast</a></li>\n"; if (HasRight("MassMail", "Send")) { // if has right to trig $MenuAction .= " <li><a href=\"adminmassmails.php?action=ShowPendingTrigs\">Trigger mass mails</a></li>\n"; } DisplayHeaderShortUserContent("Admin Mails - Broadcast Messages", ""); ShowLeftColumn($MenuAction, VolMenu()); echo " <div id=\"col3\"> \n"; echo " <div id=\"col3_content\" class=\"clearfix\"> \n"; echo " <div class=\"info clearfix\">\n"; echo "<form method=\"post\" action=\"adminmassmails.php\" class=\"yform full\">\n"; echo "<input type=\"hidden\" name=\"IdBroadCast\" value=\"{$IdBroadCast}\">"; echo "<p class=\"note center\">Please write here in <strong>" . LanguageName($_SESSION['IdLanguage']) . "</strong></p>"; echo "<div class=\"type-text\">"; echo "<p>Give the code name of the broadcast as a word entry (must not exist in words table previously) like <b>NewsJuly2007</b> or <b>NewsAugust2007</b> without spaces!</p>"; echo "<label for=\"Name\">WordCode for the newsletter</label>"; echo "<input type=\"text\" "; if ($Name != "") { echo "readonly"; } // don't change a group name because it is connected to words echo " id=\"Name\" name=\"Name\" value=\"{$Name}\" />"; echo "</div>"; echo "<div class=\"type-text\">"; echo "<label for=\"BroadCast_Title_\">Subject for the newsletter (%username% will be replaced by the username at sending)</label>"; echo "<input type=\"text\" id=\"BroadCast_Title_\" name=\"BroadCast_Title_\" value=\"{$BroadCast_Title_}\" />"; echo "</div>"; echo "<div class=\"type-text\">"; echo "<label for=\"BroadCast_Body_\">Body of the newsletter (%username% will be replaced by the username at sending)</label>"; echo "<textarea id=\"BroadCast_Body_\" name=\"BroadCast_Body_\" rows=\"30\">", $BroadCast_Body_, "</textarea>"; echo "</div>"; echo "<div class=\"type-text\">"; echo "<label for=\"Description\">Description (as translators will see it in AdminWord) </label>"; echo "<textarea id=\"Description\" name=\"Description\" rows=\"8\">", $Description, "</textarea>"; echo "</div>"; echo "<div class=\"type-button\">"; if ($IdBroadCast != 0) { echo "<input type=\"submit\" name=\"submit\" value=\"update massmail\">"; } else { echo "<input type=\"submit\" name=\"submit\" value=\"create massmail\">"; } echo "<input type=\"hidden\" name=\"action\" value=\"createbroadcast\">"; echo "</div>"; echo "</form>"; require_once "footer.php"; }
function DisplayAdminComments($TData, $lastaction = "", $page = 0, $itemsperpage = 0, $count = 0, $urlpiece = "") { global $countmatch; global $title; $title = "Admin Comments"; global $AdminCommentsScope; require_once "header.php"; Menu1("", ww('MainPage')); // Displays the top menu Menu2("admincomments.php", ww('MainPage')); // Displays the second menu $MenuAction = ""; $MenuAction .= " <li><a href=\"" . bwlink("admin/admincomments.php") . "\">Negative comments</a></li>\n"; if (HasRight("Comments", "AdminAbuser")) { $MenuAction .= " <li><a href=\"" . bwlink("admin/admincomments.php?action=AdminAbuser") . "\">Abusive comments</a></li>\n"; } $MenuAction .= " <li><a href=\"" . bwlink("admin/admincomments.php?action=All") . "\">All comments</a></li>\n"; DisplayHeaderShortUserContent($title . ": " . $lastaction); ShowLeftColumn($MenuAction, VolMenu()); echo " <div id=\"col3\"> \n"; echo " <div id=\"col3_content\" class=\"clearfix\"> \n"; echo " <div class=\"info clearfix\">\n"; echo " <h2>Your scope:", $AdminCommentsScope, "</h2>\n"; if ($itemsperpage != 0) { $params = new StdClass(); $params->strategy = new HalfPagePager('right'); if (empty($urlpiece)) { $params->page_url = 'admincomments.php?action=All'; } else { $params->page_url = 'admincomments.php?action=' . $urlpiece; } $params->page_url_marker = 'page'; $params->page_method = 'get'; $params->items = $count; $params->active_page = $page; $params->items_per_page = $itemsperpage; $pager = new PagerWidget($params); $pager->render(); } if (!empty($TData)) { ShowList($TData, $page * $itemsperpage, $count); } if (isset($pager)) { $pager->render(); } require_once "footer.php"; }
function DisplayHeaderMainPage($TitleTopContent = "", $MessageBeforeColumnLow = "", $ActionList = "") { global $DisplayHeaderMainPageIsSet; echo " <div id=\"main\">\n"; echo " <div id=\"teaser_bg\">\n"; echo " <div id=\"teaser\" class=\"clearfix teaser_main\">\n"; if (IsLoggedIn()) { echo " <h2>", ww("HelloUsername", LinkWithUsername($_SESSION["Username"])), "</h2>\n"; } else { echo " <h2>", ww("YourAreNotLogged"), "</h2>\n"; } echo " <div id=\"teaser_l\">\n"; echo "\t\t\t\t<img src=\"" . MyPict() . "\" id=\"MainUserpic\" alt=\"ProfilePicture\"/>\n"; echo " </div>\n"; echo " <div id=\"teaser_r\">\n"; echo "\t\t\t<div class=\"subcolumns\">\n"; echo "\t\t\t\t<div class=\"c38l\">\n"; echo " \t\t\t\t<div class=\"subcl\">\n"; echo " \t<p><img src=\"images/icons1616/icon_contactmember.png\" alt=\"Messages\"/>", ww("MainPageNewMessages"), "</p>\n"; echo " \t<p><img src=\"images/icons1616/icon_addcomments.png\" alt=\"Comments\"/>", ww("MainPageNewComments"), "</p>\n"; echo " \t<p><img src=\"images/icons1616/icon_myvisitors.png\" alt=\"Visitors\"/>", ww("MainPageNewVisitors"), "</p>\n"; echo " \t\t\t</div>\n"; echo " \t\t</div>\n"; echo "\t\t\t\t<div class=\"c62r\">\n"; echo "\t\t\t\t\t<div class=\"subcr\">\n"; echo "\t\t\t\t\t\t<div id=\"mapsearch\">\n"; echo "\t\t\t\t\t\t<form>\n"; echo "\t\t\t\t\t <fieldset> \n"; // echo " <label for=\"searchtext\">Search the map</label><br />\n"; echo "\t\t\t\t\t <input type=\"text\" id=\"searchtext\" name=\"searchtext\" size=\"20\" maxlength=\"30\" id=\"text-field\" value=\"Search the map!\" onfocus=\"this.value='';\"/>\n"; echo "\t\t\t\t\t <input type=\"hidden\" name=\"action\" value=\"mapsearch\" />\n"; echo "\t\t\t\t\t <input type=\"image\" src=\"" . bwlink("images/icon_go.png") . "\" id=\"submit-button\" /><br />\n"; echo "\t\t\t\t\t </fieldset>\n"; echo "\t\t\t\t\t\t</form>\n"; echo "\t\t\t\t\t\t</div>\n"; echo "\t\t\t\t\t</div>\n"; echo "\t\t\t\t</div>\n"; echo "\t\t\t</div>\n"; echo " </div>\n"; echo " </div>\n"; // no tabs >> echo "\t <div id=\"middle_nav\" class=\"clearfix\">\n"; echo "\t\t <div id=\"nav_sub\" class=\"notabs\">\n"; echo "\t\t\t <ul>\n"; echo "\t\t\t </ul>\n"; echo "\t\t </div>\n"; echo "\t </div>\n"; echo " </div>\n"; //end teaser_bg ShowLeftColumn($ActionList, VolMenu()); // Show the Actions // middle column echo "\n"; echo " <div id=\"col3\"> \n"; echo " <div id=\"col3_content\" class=\"clearfix\"> \n"; $DisplayHeaderMainPageIsSet = true; // set this for footer function which will be in charge of calling the closing /div }
// Displays the top menu Menu2("main.php", "DB_MAINTENANCE"); // Displays the second menu if (!HasRight("Admin")) { echo "<p> this need Admin rights</p>"; require_once "layout/footer.php"; die(1); } $MenuAction = " <li><a href=\"" . bwlink("admin/dbmaintenance.php") . "\">db maintenance</a></li>\n"; $MenuAction .= " <li><a href=\"" . bwlink("admin/dbmaintenance.php?action=updateid") . "\">update new ids</a></li>\n"; $MenuAction .= " <li><a href=\"" . bwlink("admin/dbmaintenance.php?action=filltrads") . "\">fill the forum_trads</a></li>\n"; $MenuAction .= " <li><a href=\"" . bwlink("admin/dbmaintenance.php?action=filltag_threads") . "\">recreate tags_threads</a></li>\n"; $MenuAction .= " <li><a href=\"" . bwlink("admin/dbmaintenance.php?action=updatetagcounters") . "\">update tags counters</a></li>\n"; DisplayHeaderShortUserContent("Db Maintenance", $MenuAction, ""); // Display the header ShowLeftColumn($MenuAction, ""); $action = GetStrParam("action", ""); switch ($action) { case "updateid": sql_query("update forums_tags set id=tagid"); // dealing with redundant values sql_query("update forums_threads set id=threadid"); // dealing with redundant values sql_query("update forums_posts set id=postid"); // dealing with redundant values echo "<br />Id updated</p>"; break; case "updatetagcounters": echo "<p>updating tags counter according to new tags_threads<br />"; $str = " UPDATE forums_tags SET counter = (select count(*) from tags_threads where forums_tags.id=tags_threads.IdTag)"; echo "<br />" . $str . "<br />";