home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 May / INTERNET103.ISO / pc / software / windows / building / php_nuke / html / admin / modules / links.php < prev    next >
Encoding:
PHP Script  |  2002-09-16  |  55.9 KB  |  1,209 lines

  1. <?php
  2.  
  3. /************************************************************************/
  4. /* PHP-NUKE: Web Portal System                                          */
  5. /* ===========================                                          */
  6. /*                                                                      */
  7. /* Copyright (c) 2002 by Francisco Burzi                                */
  8. /* http://phpnuke.org                                                   */
  9. /*                                                                      */
  10. /* Based on Journey Links Hack                                          */
  11. /* Copyright (c) 2000 by James Knickelbein                              */
  12. /* Journey Milwaukee (http://www.journeymilwaukee.com)                  */
  13. /*                                                                      */
  14. /* This program is free software. You can redistribute it and/or modify */
  15. /* it under the terms of the GNU General Public License as published by */
  16. /* the Free Software Foundation; either version 2 of the License.       */
  17. /************************************************************************/
  18.  
  19. if (!eregi("admin.php", $PHP_SELF)) { die ("Access Denied"); }
  20.  
  21. $result = sql_query("select radminlink, radminsuper from ".$prefix."_authors where aid='$aid'", $dbi);
  22. list($radminlink, $radminsuper) = sql_fetch_row($result, $dbi);
  23. if (($radminlink==1) OR ($radminsuper==1)) {
  24.  
  25. /*********************************************************/
  26. /* Links Modified Web Links                              */
  27. /*********************************************************/
  28.  
  29. function getparent($parentid,$title) {
  30.     global $prefix,$dbi;
  31.     $result=sql_query("select cid, title, parentid from ".$prefix."_links_categories where cid=$parentid", $dbi);
  32.     list($cid, $ptitle, $pparentid) = sql_fetch_row($result, $dbi);
  33.     mysql_free_result($result);
  34.     if ($ptitle!="") $title=$ptitle."/".$title;
  35.     if ($pparentid!=0) {
  36.     $title=getparent($pparentid,$title);
  37.     }
  38.     return $title;
  39. }
  40.  
  41. function links() {
  42.     global $prefix, $dbi;
  43.     include ("header.php");
  44.     GraphicAdmin();
  45.     OpenTable();
  46.     echo "<center><a href=\"modules.php?name=Web_Links\"><img src=\"modules/Web_Links/images/web.gif\" border=\"0\" alt=\"\"></a><br><br>";
  47.     $result=sql_query("select * from ".$prefix."_links_links", $dbi);
  48.     $numrows = sql_num_rows($result, $dbi);
  49.     echo "<font class=\"content\">"._THEREARE." <b>$numrows</b> "._LINKSINDB."</font></center>";
  50.     CloseTable();
  51.     echo "<br>";
  52.     
  53. /* Temporarily 'homeless' links functions (to be revised in admin.php breakup) */
  54.  
  55.     $result = sql_query("select requestid,lid,cid,title,url,description,modifysubmitter from ".$prefix."_links_modrequest where brokenlink=1", $dbi);
  56.     $totalbrokenlinks = sql_num_rows($result, $dbi);
  57.     $result2 = sql_query("select requestid,lid,cid,title,url,description,modifysubmitter from ".$prefix."_links_modrequest where brokenlink=0", $dbi);
  58.     $totalmodrequests = sql_num_rows($result2, $dbi);
  59.     OpenTable();
  60.     echo "<center><font class=\"content\">[ <a href=\"admin.php?op=LinksCleanVotes\">"._CLEANLINKSDB."</a> | "
  61.     ."<a href=\"admin.php?op=LinksListBrokenLinks\">"._BROKENLINKSREP." ($totalbrokenlinks)</a> | "
  62.     ."<a href=\"admin.php?op=LinksListModRequests\">"._LINKMODREQUEST." ($totalmodrequests)</a> | "
  63.     ."<a href=\"admin.php?op=LinksLinkCheck\">"._VALIDATELINKS."</a> ]</font></center>";
  64.     CloseTable();
  65.     echo "<br>";
  66.  
  67. /* List Links waiting for validation */
  68.  
  69.     $result = sql_query("select lid, cid, sid, title, url, description, name, email, submitter from ".$prefix."_links_newlink order by lid", $dbi);
  70.     $numrows = sql_num_rows($result, $dbi);
  71.     if ($numrows>0) {
  72.     OpenTable();
  73.     echo "<center><font class=\"option\"><b>"._LINKSWAITINGVAL."</b></font></center><br><br>";
  74.     while(list($lid, $cid, $sid, $title, $url, $description, $name, $email, $submitter) = sql_fetch_row($result, $dbi)) {
  75.         if ($submitter == "") {
  76.         $submitter = _NONE;
  77.         }
  78.             echo "<form action=\"admin.php\" method=\"post\">"
  79.         ."<b>"._LINKID.": $lid</b><br><br>"
  80.         .""._SUBMITTER.":  $submitter<br>"
  81.         .""._PAGETITLE.": <input type=\"text\" name=\"title\" value=\"$title\" size=\"50\" maxlength=\"100\"><br>"
  82.         .""._PAGEURL.": <input type=\"text\" name=\"url\" value=\"$url\" size=\"50\" maxlength=\"100\"> [ <a target=\"_blank\" href=\"$url\">"._VISIT."</a> ]<br>"
  83.         .""._DESCRIPTION.": <br><textarea name=\"description\" cols=\"60\" rows=\"10\">$description</textarea><br>"
  84.         .""._NAME.": <input type=\"text\" name=\"name\" size=\"20\" maxlength=\"100\" value=\"$name\">  "
  85.         .""._EMAIL.": <input type=\"text\" name=\"email\" size=\"20\" maxlength=\"100\" value=\"$email\"><br>";
  86.         echo "<input type=\"hidden\" name=\"new\" value=\"1\">";
  87.         echo "<input type=\"hidden\" name=\"lid\" value=\"$lid\">";
  88.         echo "<input type=\"hidden\" name=\"submitter\" value=\"$submitter\">";
  89.         echo ""._CATEGORY.": <select name=\"cat\">";
  90.     $result2=sql_query("select cid, title, parentid from ".$prefix."_links_categories order by title", $dbi);
  91.     while(list($cid2, $ctitle2, $parentid2) = sql_fetch_row($result2, $dbi)) {
  92.         if ($cid2==$cid) {
  93.             $sel = "selected";
  94.         } else {
  95.             $sel = "";
  96.         }
  97.         if ($parentid2!=0) $ctitle2=getparent($parentid2,$ctitle2);
  98.         echo "<option value=\"$cid2\" $sel>$ctitle2</option>";
  99.     }
  100.  
  101.         echo "<input type=\"hidden\" name=\"submitter\" value=\"$submitter\">";
  102.         echo "</select><input type=\"hidden\" name=\"op\" value=\"LinksAddLink\"><input type=\"submit\" value="._ADD."> [ <a href=\"admin.php?op=LinksDelNew&lid=$lid\">"._DELETE."</a> ]</form><br><hr noshade><br>";
  103.     }
  104.     CloseTable();
  105.     echo "<br>";
  106.     } else {
  107.     }
  108.  
  109. /* Add a New Main Category */
  110.  
  111.     OpenTable();
  112.     echo "<form method=\"post\" action=\"admin.php\">"
  113.     ."<font class=\"option\"><b>"._ADDMAINCATEGORY."</b></font><br><br>"
  114.     .""._NAME.": <input type=\"text\" name=\"title\" size=\"30\" maxlength=\"100\"><br>"
  115.     .""._DESCRIPTION.":<br><textarea name=\"cdescription\" cols=\"60\" rows=\"10\"></textarea><br>"
  116.     ."<input type=\"hidden\" name=\"op\" value=\"LinksAddCat\">"
  117.     ."<input type=\"submit\" value=\""._ADD."\"><br>"
  118.     ."</form>";
  119.     CloseTable();
  120.     echo "<br>";
  121.  
  122. // Add a New Sub-Category
  123.  
  124.     $result = sql_query("select * from ".$prefix."_links_categories", $dbi);
  125.     $numrows = sql_num_rows($result, $dbi);
  126.     if ($numrows>0) {
  127.     OpenTable();
  128.     echo "<form method=\"post\" action=\"admin.php\">"
  129.         ."<font class=\"option\"><b>"._ADDSUBCATEGORY."</b></font><br><br>"
  130.         .""._NAME.": <input type=\"text\" name=\"title\" size=\"30\" maxlength=\"100\"> "._IN." ";
  131.     $result2=sql_query("select cid, title, parentid from ".$prefix."_links_categories order by parentid,title", $dbi);
  132.     echo "<select name=\"cid\">";
  133.     while(list($cid2, $ctitle2, $parentid2) = sql_fetch_row($result2, $dbi)) {
  134.         if ($parentid2!=0) $ctitle2=getparent($parentid2,$ctitle2);
  135.         echo "<option value=\"$cid2\">$ctitle2</option>";
  136.     }
  137.     echo "</select><br>"
  138.     .""._DESCRIPTION.":<br><textarea name=\"cdescription\" cols=\"60\" rows=\"10\"></textarea><br>"
  139.         ."<input type=\"hidden\" name=\"op\" value=\"LinksAddSubCat\">"
  140.         ."<input type=\"submit\" value=\""._ADD."\"><br>"
  141.         ."</form>";
  142.     CloseTable();
  143.     echo "<br>";
  144.     } else {
  145.     }
  146.  
  147. // Add a New Link to Database
  148.  
  149.     $result = sql_query("select cid, title from ".$prefix."_links_categories", $dbi);
  150.     $numrows = sql_num_rows($result, $dbi);
  151.     if ($numrows>0) {
  152.     OpenTable();
  153.     echo "<form method=\"post\" action=\"admin.php\">"
  154.         ."<font class=\"option\"><b>"._ADDNEWLINK."</b></font><br><br>"
  155.         .""._PAGETITLE.": <input type=\"text\" name=\"title\" size=\"50\" maxlength=\"100\"><br>"
  156.         .""._PAGEURL.": <input type=\"text\" name=\"url\" size=\"50\" maxlength=\"100\" value=\"http://\"><br>";
  157.     $result2=sql_query("select cid, title, parentid from ".$prefix."_links_categories order by title", $dbi);
  158.     echo ""._CATEGORY.": <select name=\"cat\">";
  159.     while(list($cid2, $ctitle2, $parentid2) = sql_fetch_row($result2, $dbi)) {
  160.         if ($parentid2!=0) $ctitle2=getparent($parentid2,$ctitle2);
  161.         echo "<option value=\"$cid2\">$ctitle2</option>";
  162.     }
  163.     echo "</select><br><br><br>"
  164.         .""._DESCRIPTION255."<br><textarea name=\"description\" cols=\"60\" rows=\"5\"></textarea><br><br><br>"
  165.         .""._NAME.": <input type=\"text\" name=\"name\" size=\"30\" maxlength=\"60\"><br>"
  166.         .""._EMAIL.": <input type=\"text\" name=\"email\" size=\"30\" maxlength=\"60\"><br><br>"
  167.         ."<input type=\"hidden\" name=\"op\" value=\"LinksAddLink\">"
  168.             ."<input type=\"hidden\" name=\"new\" value=\"0\">"
  169.         ."<input type=\"hidden\" name=\"lid\" value=\"0\">"
  170.         ."<center><input type=\"submit\" value=\""._ADDURL."\"><br>"
  171.         ."</form>";
  172.     CloseTable();
  173.     echo "<br>";
  174.     } else {
  175.     }
  176.  
  177. // Modify Category
  178.  
  179.     $result = sql_query("select * from ".$prefix."_links_categories", $dbi);
  180.     $numrows = sql_num_rows($result, $dbi);
  181.     if ($numrows>0) {
  182.     OpenTable();
  183.     echo "<form method=\"post\" action=\"admin.php\">"
  184.         ."<font class=\"option\"><b>"._MODCATEGORY."</b></font><br><br>";
  185.     $result2=sql_query("select cid, title, parentid from ".$prefix."_links_categories order by title", $dbi);
  186.     echo ""._CATEGORY.": <select name=\"cat\">";
  187.     while(list($cid2, $ctitle2, $parentid2) = sql_fetch_row($result2, $dbi)) {
  188.         if ($parentid2!=0) $ctitle2=getparent($parentid2,$ctitle2);
  189.         echo "<option value=\"$cid2\">$ctitle2</option>";
  190.     }
  191.     echo "</select>"
  192.         ."<input type=\"hidden\" name=\"op\" value=\"LinksModCat\">"
  193.         ."<input type=\"submit\" value=\""._MODIFY."\">"
  194.         ."</form>";
  195.     CloseTable();
  196.     echo "<br>";
  197.     } else {
  198.     }
  199.  
  200. // Modify Links
  201.  
  202.     $result = sql_query("select * from ".$prefix."_links_links", $dbi);
  203.     $numrows = sql_num_rows($result, $dbi);
  204.     if ($numrows>0) {
  205.     OpenTable();
  206.     echo "<form method=\"post\" action=\"admin.php\">"
  207.     ."<font class=\"option\"><b>"._MODLINK."</b><br><br>"
  208.     .""._LINKID.": <input type=\"text\" name=\"lid\" size=\"12\" maxlength=\"11\">  "
  209.     ."<input type=\"hidden\" name=\"op\" value=\"LinksModLink\">"
  210.     ."<input type=\"submit\" value=\""._MODIFY."\">"
  211.     ."</form>";
  212.     CloseTable();
  213.     echo "<br>";
  214.     } else {
  215.     }
  216.  
  217. // Transfer Categories
  218.  
  219.     $result = sql_query("select * from ".$prefix."_links_links", $dbi);
  220.     $numrows = sql_num_rows($result, $dbi);
  221.     if ($numrows>0) {
  222.     OpenTable();
  223.     echo "<form method=\"post\" action=\"admin.php\">"
  224.         ."<font class=\"option\"><b>"._EZTRANSFERLINKS."</b></font><br><br>"
  225.         .""._CATEGORY.": "
  226.         ."<select name=\"cidfrom\">";
  227.     $result2=sql_query("select cid, title, parentid from ".$prefix."_links_categories order by parentid,title", $dbi);
  228.     while(list($cid2, $ctitle2, $parentid2) = sql_fetch_row($result2, $dbi)) {
  229.         if ($parentid2!=0) $ctitle2=getparent($parentid2,$ctitle2);
  230.         echo "<option value=\"$cid2\">$ctitle2</option>";
  231.     }
  232.     echo "</select><br>"
  233.         .""._IN." "._CATEGORY.": ";
  234.     
  235.     $result2=sql_query("select cid, title, parentid from ".$prefix."_links_categories order by parentid,title", $dbi);
  236.     echo "<select name=\"cidto\">";
  237.     while(list($cid2, $ctitle2, $parentid2) = sql_fetch_row($result2, $dbi)) {
  238.         if ($parentid2!=0) $ctitle2=getparent($parentid2,$ctitle2);
  239.         echo "<option value=\"$cid2\">$ctitle2</option>";
  240.     }
  241.     echo "</select><br>"
  242.         ."<input type=\"hidden\" name=\"op\" value=\"LinksTransfer\">"
  243.         ."<input type=\"submit\" value=\""._EZTRANSFER."\"><br>"
  244.         ."</form>";
  245.     CloseTable();
  246.     echo "<br>";
  247.     } else {
  248.     }
  249.  
  250.     include ("footer.php");
  251. }
  252.  
  253. function LinksTransfer($cidfrom,$cidto) {
  254.     global $prefix, $dbi;
  255.     
  256. // begin old categories
  257. // (uncomment lines to transfer existing datas)
  258. /*
  259.     $cat = explode("-", $cidfrom);
  260.     if ($cat[1]=="") {
  261.         $cat[1] = 0;
  262.     }
  263.     sql_query("update ".$prefix."_links_links set cid=$cidto, sid=0 where cid='$cat[0]' AND sid='$cat[1]'", $dbi);
  264. */
  265. // end old categories
  266.  
  267. // begin new categories
  268. // (comment lines to transfer existing datas)
  269.     sql_query("update ".$prefix."_links_links set cid=$cidto where cid=$cidfrom", $dbi);
  270. // end new categorie
  271.     Header("Location: admin.php?op=Links");
  272. }
  273.  
  274. function LinksModLink($lid) {
  275.     global $prefix, $dbi;
  276.     include ("header.php");
  277.     GraphicAdmin();
  278.     global $anonymous;
  279.     $result = sql_query("select cid, title, url, description, name, email, hits from ".$prefix."_links_links where lid=$lid", $dbi);
  280.     OpenTable();
  281.     echo "<center><font class=\"title\"><b>"._WEBLINKSADMIN."</b></font></center>";
  282.     CloseTable();
  283.     echo "<br>";
  284.     OpenTable();
  285.     echo "<center><font class=\"option\"><b>"._MODLINK."</b></font></center><br><br>";
  286.     while(list($cid, $title, $url, $description, $name, $email, $hits) = sql_fetch_row($result, $dbi)) {
  287.         $title = stripslashes($title); $description = stripslashes($description);
  288.         echo "<form action=admin.php method=post>"
  289.         .""._LINKID.": <b>$lid</b><br>"
  290.         .""._PAGETITLE.": <input type=\"text\" name=\"title\" value=\"$title\" size=\"50\" maxlength=\"100\"><br>"
  291.         .""._PAGEURL.": <input type=\"text\" name=\"url\" value=\"$url\" size=\"50\" maxlength=\"100\"> [ <a href=\"$url\">Visit</a> ]<br>"
  292.         .""._DESCRIPTION.":<br><textarea name=\"description\" cols=\"60\" rows=\"10\">$description</textarea><br>"
  293.         .""._NAME.": <input type=\"text\" name=\"name\" size=\"50\" maxlength=\"100\" value=\"$name\"><br>"
  294.         .""._EMAIL.": <input type=\"text\" name=\"email\" size=\"50\" maxlength=\"100\" value=\"$email\"><br>"
  295.         .""._HITS.": <input type=\"text\" name=\"hits\" value=\"$hits\" size=\"12\" maxlength=\"11\"><br>";
  296.     echo "<input type=\"hidden\" name=\"lid\" value=\"$lid\">"
  297.         .""._CATEGORY.": <select name=\"cat\">";
  298.     $result2=sql_query("select cid, title, parentid from ".$prefix."_links_categories order by title", $dbi);
  299.     while(list($cid2, $ctitle2, $parentid2) = sql_fetch_row($result2, $dbi)) {
  300.         if ($cid2==$cid) {
  301.             $sel = "selected";
  302.         } else {
  303.             $sel = "";
  304.         }
  305.         if ($parentid2!=0) $ctitle2=getparent($parentid2,$ctitle2);
  306.         echo "<option value=\"$cid2\" $sel>$ctitle2</option>";
  307.     }
  308.     
  309.     echo "</select>"
  310.     ."<input type=\"hidden\" name=\"op\" value=\"LinksModLinkS\">"
  311.     ."<input type=\"submit\" value=\""._MODIFY."\"> [ <a href=\"admin.php?op=LinksDelLink&lid=$lid\">"._DELETE."</a> ]</form><br>";
  312.     CloseTable();
  313.     echo "<br>";    
  314.     /* Modify or Add Editorial */
  315.         
  316.         $resulted2 = sql_query("select adminid, editorialtimestamp, editorialtext, editorialtitle from ".$prefix."_links_editorials where linkid=$lid", $dbi);
  317.         $recordexist = sql_num_rows($resulted2, $dbi);
  318.     OpenTable();
  319.     /* if returns 'bad query' status 0 (add editorial) */
  320.         if ($recordexist == 0) {
  321.             echo "<center><font class=\"option\"><b>"._ADDEDITORIAL."</b></font></center><br><br>"
  322.             ."<form action=\"admin.php\" method=\"post\">"
  323.             ."<input type=\"hidden\" name=\"linkid\" value=\"$lid\">"
  324.             .""._EDITORIALTITLE.":<br><input type=\"text\" name=\"editorialtitle\" value=\"$editorialtitle\" size=\"50\" maxlength=\"100\"><br>"
  325.             .""._EDITORIALTEXT.":<br><textarea name=\"editorialtext\" cols=\"60\" rows=\"10\">$editorialtext</textarea><br>"
  326.             ."</select><input type=\"hidden\" name=\"op\" value=\"LinksAddEditorial\"><input type=\"submit\" value=\"Add\">";
  327.         } else {
  328.     /* if returns 'cool' then status 1 (modify editorial) */
  329.             while(list($adminid, $editorialtimestamp, $editorialtext, $editorialtitle) = sql_fetch_row($resulted2, $dbi)) {
  330.             $editorialtitle = stripslashes($editorialtitle); $editorialtext = stripslashes($editorialtext);
  331.             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);
  332.         $editorialtime = strftime("%F",mktime($editorialtime[4],$editorialtime[5],$editorialtime[6],$editorialtime[2],$editorialtime[3],$editorialtime[1]));
  333.         $date_array = explode("-", $editorialtime); 
  334.         $timestamp = mktime(0, 0, 0, $date_array["1"], $date_array["2"], $date_array["0"]); 
  335.                $formatted_date = date("F j, Y", $timestamp);             
  336.             echo "<center><font class=\"option\"><b>Modify Editorial</b></font></center><br><br>"
  337.                 ."<form action=\"admin.php\" method=\"post\">"
  338.                 .""._AUTHOR.": $adminid<br>"
  339.                 .""._DATEWRITTEN.": $formatted_date<br><br>"
  340.                 ."<input type=\"hidden\" name=\"linkid\" value=\"$lid\">"
  341.                 .""._EDITORIALTITLE.":<br><input type=\"text\" name=\"editorialtitle\" value=\"$editorialtitle\" size=\"50\" maxlength=\"100\"><br>"
  342.                 .""._EDITORIALTEXT.":<br><textarea name=\"editorialtext\" cols=\"60\" rows=\"10\">$editorialtext</textarea><br>"
  343.                     ."</select><input type=\"hidden\" name=\"op\" value=\"LinksModEditorial\"><input type=\"submit\" value=\""._MODIFY."\"> [ <a href=\"admin.php?op=LinksDelEditorial&linkid=$lid\">"._DELETE."</a> ]";
  344.                 }
  345.         } 
  346.     CloseTable();
  347.     echo "<br>";
  348.     OpenTable();
  349.     /* Show Comments */
  350.     $result5=sql_query("SELECT ratingdbid, ratinguser, ratingcomments, ratingtimestamp FROM ".$prefix."_links_votedata WHERE ratinglid = $lid AND ratingcomments != '' ORDER BY ratingtimestamp DESC", $dbi);
  351.     $totalcomments = sql_num_rows($result5, $dbi);
  352.     echo "<table valign=top width=100%>";
  353.     echo "<tr><td colspan=7><b>Link Comments (total comments: $totalcomments)</b><br><br></td></tr>";    
  354.     echo "<tr><td width=20 colspan=1><b>User  </b></td><td colspan=5><b>Comment  </b></td><td><b><center>Delete</center></b></td><br></tr>";
  355.     if ($totalcomments == 0) echo "<tr><td colspan=7><center><font color=cccccc>No Comments<br></font></center></td></tr>";
  356.     $x=0;
  357.     $colorswitch="dddddd";
  358.     while(list($ratingdbid, $ratinguser, $ratingcomments, $ratingtimestamp)=sql_fetch_row($result5, $dbi)) {
  359.         $ratingcomments = stripslashes($ratingcomments);
  360.         ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $ratingtimestamp, $ratingtime);
  361.         $ratingtime = strftime("%F",mktime($ratingtime[4],$ratingtime[5],$ratingtime[6],$ratingtime[2],$ratingtime[3],$ratingtime[1]));
  362.         $date_array = explode("-", $ratingtime); 
  363.         $timestamp = mktime(0, 0, 0, $date_array["1"], $date_array["2"], $date_array["0"]); 
  364.             $formatted_date = date("F j, Y", $timestamp);
  365.             echo "<tr><td valign=top bgcolor=$colorswitch>$ratinguser</td><td valign=top colspan=5 bgcolor=$colorswitch>$ratingcomments</td><td bgcolor=$colorswitch><center><b><a href=admin.php?op=LinksDelComment&lid=$lid&rid=$ratingdbid>X</a></b></center></td><br></tr>";                       
  366.         $x++;
  367.         if ($colorswitch=="dddddd") $colorswitch="ffffff";
  368.             else $colorswitch="dddddd";        
  369.         }    
  370.  
  371.             
  372.     // Show Registered Users Votes
  373.     $result5=sql_query("SELECT ratingdbid, ratinguser, rating, ratinghostname, ratingtimestamp FROM ".$prefix."_links_votedata WHERE ratinglid = $lid AND ratinguser != 'outside' AND ratinguser != '$anonymous' ORDER BY ratingtimestamp DESC", $dbi);
  374.     $totalvotes = sql_num_rows($result5, $dbi);
  375.     echo "<tr><td colspan=7><br><br><b>Registered User Votes (total votes: $totalvotes)</b><br><br></td></tr>";
  376.     echo "<tr><td><b>User  </b></td><td><b>IP Address  </b></td><td><b>Rating  </b></td><td><b>User AVG Rating  </b></td><td><b>Total Ratings  </b></td><td><b>Date  </b></td></font></b><td><b><center>Delete</center></b></td><br></tr>";
  377.     if ($totalvotes == 0) echo "<tr><td colspan=7><center><font color=cccccc>No Registered User Votes<br></font></center></td></tr>";
  378.     $x=0;
  379.     $colorswitch="dddddd";
  380.     while(list($ratingdbid, $ratinguser, $rating, $ratinghostname, $ratingtimestamp)=sql_fetch_row($result5, $dbi)) {
  381.         ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $ratingtimestamp, $ratingtime);
  382.         $ratingtime = strftime("%F",mktime($ratingtime[4],$ratingtime[5],$ratingtime[6],$ratingtime[2],$ratingtime[3],$ratingtime[1]));
  383.         $date_array = explode("-", $ratingtime); 
  384.         $timestamp = mktime(0, 0, 0, $date_array["1"], $date_array["2"], $date_array["0"]); 
  385.             $formatted_date = date("F j, Y", $timestamp); 
  386.         
  387.         //Individual user information
  388.         $result2=sql_query("SELECT rating FROM ".$prefix."_links_votedata WHERE ratinguser = '$ratinguser'", $dbi);
  389.             $usertotalcomments = sql_num_rows($result2, $dbi);
  390.             $useravgrating = 0;
  391.             while(list($rating2)=sql_fetch_row($result2, $dbi))    $useravgrating = $useravgrating + $rating2;
  392.             $useravgrating = $useravgrating / $usertotalcomments;
  393.             $useravgrating = number_format($useravgrating, 1);
  394.             echo "<tr><td bgcolor=$colorswitch>$ratinguser</td><td bgcolor=$colorswitch>$ratinghostname</td><td bgcolor=$colorswitch>$rating</td><td bgcolor=$colorswitch>$useravgrating</td><td bgcolor=$colorswitch>$usertotalcomments</td><td bgcolor=$colorswitch>$formatted_date  </font></b></td><td bgcolor=$colorswitch><center><b><a href=admin.php?op=LinksDelVote&lid=$lid&rid=$ratingdbid>X</a></b></center></td></tr><br>";
  395.         $x++;
  396.         if ($colorswitch=="dddddd") $colorswitch="ffffff";
  397.             else $colorswitch="dddddd";        
  398.         }    
  399.         
  400.     // Show Unregistered Users Votes
  401.     $result5=sql_query("SELECT ratingdbid, rating, ratinghostname, ratingtimestamp FROM ".$prefix."_links_votedata WHERE ratinglid = $lid AND ratinguser = '$anonymous' ORDER BY ratingtimestamp DESC", $dbi);
  402.     $totalvotes = sql_num_rows($result5, $dbi);
  403.     echo "<tr><td colspan=7><b><br><br>Unregistered User Votes (total votes: $totalvotes)</b><br><br></td></tr>";
  404.     echo "<tr><td colspan=2><b>IP Address  </b></td><td colspan=3><b>Rating  </b></td><td><b>Date  </b></font></td><td><b><center>Delete</center></b></td><br></tr>";
  405.     if ($totalvotes == 0) echo "<tr><td colspan=7><center><font color=cccccc>No Unregistered User Votes<br></font></center></td></tr>";
  406.     $x=0;
  407.     $colorswitch="dddddd";
  408.     while(list($ratingdbid, $rating, $ratinghostname, $ratingtimestamp)=sql_fetch_row($result5, $dbi)) {
  409.         ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $ratingtimestamp, $ratingtime);
  410.         $ratingtime = strftime("%F",mktime($ratingtime[4],$ratingtime[5],$ratingtime[6],$ratingtime[2],$ratingtime[3],$ratingtime[1]));
  411.         $date_array = explode("-", $ratingtime); 
  412.         $timestamp = mktime(0, 0, 0, $date_array["1"], $date_array["2"], $date_array["0"]); 
  413.         $formatted_date = date("F j, Y", $timestamp); 
  414.         echo "<td colspan=2 bgcolor=$colorswitch>$ratinghostname</td><td colspan=3 bgcolor=$colorswitch>$rating</td><td bgcolor=$colorswitch>$formatted_date  </font></b></td><td bgcolor=$colorswitch><center><b><a href=admin.php?op=LinksDelVote&lid=$lid&rid=$ratingdbid>X</a></b></center></td></tr><br>";           
  415.         $x++;
  416.         if ($colorswitch=="dddddd") $colorswitch="ffffff";
  417.             else $colorswitch="dddddd";        
  418.         }  
  419.         
  420.     // Show Outside Users Votes
  421.     $result5=sql_query("SELECT ratingdbid, rating, ratinghostname, ratingtimestamp FROM ".$prefix."_links_votedata WHERE ratinglid = $lid AND ratinguser = 'outside' ORDER BY ratingtimestamp DESC", $dbi);
  422.     $totalvotes = sql_num_rows($result5, $dbi);
  423.     echo "<tr><td colspan=7><b><br><br>Outside User Votes (total votes: $totalvotes)</b><br><br></td></tr>";
  424.     echo "<tr><td colspan=2><b>IP Address  </b></td><td colspan=3><b>Rating  </b></td><td><b>Date  </b></td></font></b><td><b><center>Delete</center></b></td><br></tr>";
  425.     if ($totalvotes == 0) echo "<tr><td colspan=7><center><font color=cccccc>No Votes from Outside $sitename<br></font></center></td></tr>";
  426.     $x=0;
  427.     $colorswitch="dddddd"; 
  428.     while(list($ratingdbid, $rating, $ratinghostname, $ratingtimestamp)=sql_fetch_row($result5, $dbi)) {
  429.         ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $ratingtimestamp, $ratingtime);
  430.         $ratingtime = strftime("%F",mktime($ratingtime[4],$ratingtime[5],$ratingtime[6],$ratingtime[2],$ratingtime[3],$ratingtime[1]));
  431.         $date_array = explode("-", $ratingtime); 
  432.         $timestamp = mktime(0, 0, 0, $date_array["1"], $date_array["2"], $date_array["0"]); 
  433.         $formatted_date = date("F j, Y", $timestamp); 
  434.         echo "<tr><td colspan=2 bgcolor=$colorswitch>$ratinghostname</td><td colspan=3 bgcolor=$colorswitch>$rating</td><td bgcolor=$colorswitch>$formatted_date  </font></b></td><td bgcolor=$colorswitch><center><b><a href=admin.php?op=LinksDelVote&lid=$lid&rid=$ratingdbid>X</a></b></center></td></tr><br>";           
  435.         $x++;
  436.         if ($colorswitch=="dddddd") $colorswitch="ffffff";
  437.             else $colorswitch="dddddd";
  438.         }            
  439.  
  440.     echo "<tr><td colspan=6><br></td></tr>";        
  441.     echo "</table>";
  442.     
  443.     }
  444.     echo "</form>";
  445.     CloseTable();
  446.     echo "<br>";
  447.     include ("footer.php");
  448. }
  449.  
  450. function LinksDelComment($lid, $rid) {
  451.     global $prefix, $dbi;
  452.     sql_query("UPDATE ".$prefix."_links_votedata SET ratingcomments='' WHERE ratingdbid = $rid", $dbi);
  453.     sql_query("UPDATE ".$prefix."_links_links SET totalcomments = (totalcomments - 1) WHERE lid = $lid", $dbi);
  454.     Header("Location: admin.php?op=LinksModLink&lid=$lid");
  455.     
  456. }
  457.  
  458. function LinksDelVote($lid, $rid) {
  459.     global $prefix, $dbi;
  460.     sql_query("delete from ".$prefix."_links_votedata where ratingdbid=$rid", $dbi);
  461.     $voteresult = sql_query("select rating, ratinguser, ratingcomments FROM ".$prefix."_links_votedata WHERE ratinglid = $lid", $dbi);
  462.     $totalvotesDB = sql_num_rows($voteresult, $dbi);
  463.     include ("voteinclude.php");
  464.     sql_query("UPDATE ".$prefix."_links_links SET linkratingsummary=$finalrating,totalvotes=$totalvotesDB,totalcomments=$truecomments WHERE lid = $lid", $dbi);
  465.     Header("Location: admin.php?op=LinksModLink&lid=$lid");
  466. }
  467.  
  468. function LinksEditBrokenLinks($lid) {
  469.     global $prefix, $dbi;
  470.     include ("header.php");
  471.     GraphicAdmin();
  472.     OpenTable();
  473.     echo "<center><font class=\"option\"><b>"._EZBROKENLINKS."</b></font></center><br><br>";
  474.     $result = sql_query("select requestid, lid,cid,title,url,description, modifysubmitter from ".$prefix."_links_modrequest where brokenlink=1 order by requestid", $dbi);
  475.     list($requestid,$lid,$cid,$title,$url,$description,$modifysubmitter)= sql_fetch_row($result, $dbi);
  476.     $result4 = sql_query("select name,email,hits from ".$prefix."_links_links where lid=$lid", $dbi);
  477.     list($name,$email,$hits)= sql_fetch_row($result4, $dbi);    
  478.     echo "<form action=\"admin.php\" method=\"post\">"
  479.     ."<b>"._LINKID.": $lid</b><br><br>"
  480.     .""._SUBMITTER.":  $modifysubmitter<br>"
  481.     .""._PAGETITLE.": <input type=\"text\" name=\"title\" value=\"$title\" size=\"50\" maxlength=\"100\"><br>"
  482.     .""._PAGEURL.": <input type=\"text\" name=\"url\" value=\"$url\" size=\"50\" maxlength=\"100\"> [ <a target=\"_blank\" href=\"$url\">"._VISIT."</a> ]<br>"
  483.     .""._DESCRIPTION.": <br><textarea name=\"description\" cols=\"60\" rows=\"10\">$description</textarea><br>"
  484.     .""._NAME.": <input type=\"text\" name=\"name\" size=\"20\" maxlength=\"100\" value=\"$name\">  "
  485.     .""._EMAIL.": <input type=\"text\" name=\"email\" size=\"20\" maxlength=\"100\" value=\"$email\"><br>";
  486.     echo "<input type=\"hidden\" name=\"lid\" value=\"$lid\">";
  487.     echo "<input type=\"hidden\" name=\"hits\" value=\"$hits\">";
  488.     echo ""._CATEGORY.": <select name=\"cat\">";
  489.     $result2=sql_query("select cid, title, parentid from ".$prefix."_links_categories order by title", $dbi);
  490.     while(list($cid2, $ctitle2, $parentid2) = sql_fetch_row($result2, $dbi)) {
  491.         if ($cid2==$cid) {
  492.         $sel = "selected";
  493.     } else {
  494.         $sel = "";
  495.     }
  496.     if ($parentid2!=0) $ctitle2=getparent($parentid2,$ctitle2);
  497.         echo "<option value=\"$cid2\" $sel>$ctitle2</option>";
  498.     }
  499.     echo "</select><input type=\"hidden\" name=\"op\" value=\"LinksModLinkS\"><input type=\"submit\" value="._MODIFY."> [ <a href=\"admin.php?op=LinksDelNew&lid=$lid\">"._DELETE."</a> ]</form><br><hr noshade><br>";
  500.     CloseTable();
  501.     echo "<br>";
  502.     include("footer.php");
  503. }
  504.  
  505. function LinksListBrokenLinks() {
  506.     global $bgcolor1, $bgcolor2, $prefix, $dbi;
  507.     include ("header.php");
  508.     GraphicAdmin();
  509.     OpenTable();
  510.     echo "<center><font class=\"title\"><b>"._WEBLINKSADMIN."</b></font></center>";
  511.     CloseTable();
  512.     echo "<br>";
  513.     OpenTable();
  514.     $result = sql_query("select requestid, lid, modifysubmitter from ".$prefix."_links_modrequest where brokenlink=1 order by requestid", $dbi);
  515.     $totalbrokenlinks = sql_num_rows($result, $dbi);
  516.     echo "<center><font class=\"option\"><b>"._USERREPBROKEN." ($totalbrokenlinks)</b></font></center><br><br><center>"
  517.     .""._IGNOREINFO."<br>"
  518.     .""._DELETEINFO."</center><br><br><br>"
  519.     ."<table align=\"center\" width=\"450\">";
  520.     if ($totalbrokenlinks==0) {
  521.     echo "<center><font class=\"option\">"._NOREPORTEDBROKEN."</font></center><br><br><br>";
  522.     } else {
  523.         $colorswitch = $bgcolor2;
  524.         echo "<tr>"
  525.             ."<td><b>"._LINK."</b></td>"
  526.             ."<td><b>"._SUBMITTER."</b></td>"
  527.             ."<td><b>"._LINKOWNER."</b></td>"
  528.             ."<td><b>"._EDIT."</b></td>"
  529.             ."<td><b>"._IGNORE."</b></td>"
  530.             ."<td><b>"._DELETE."</b></td>"
  531.             ."</tr>";
  532.         while(list($requestid, $lid, $modifysubmitter)=sql_fetch_row($result, $dbi)) {
  533.         $result2 = sql_query("select title, url, submitter from ".$prefix."_links_links where lid=$lid", $dbi);
  534.         if ($modifysubmitter != '$anonymous') {
  535.         $result3 = sql_query("select email from ".$prefix."_users where uname='$modifysubmitter'", $dbi);
  536.         list($email)=sql_fetch_row($result3, $dbi);
  537.         }
  538.             list($title, $url, $owner)=sql_fetch_row($result2, $dbi);
  539.             $result4 = sql_query("select email from ".$prefix."_users where uname='$owner'", $dbi);
  540.             list($owneremail)=sql_fetch_row($result4, $dbi);
  541.             echo "<tr>"
  542.             ."<td bgcolor=\"$colorswitch\"><a href=\"$url\">$title</a>"
  543.             ."</td>";
  544.             if ($email=='') {
  545.         echo "<td bgcolor=\"$colorswitch\">$modifysubmitter";
  546.         } else {
  547.         echo "<td bgcolor=\"$colorswitch\"><a href=\"mailto:$email\">$modifysubmitter</a>";
  548.         }
  549.             echo "</td>";
  550.             if ($owneremail=='') {
  551.         echo "<td bgcolor=\"$colorswitch\">$owner";
  552.         } else {
  553.         echo "<td bgcolor=\"$colorswitch\"><a href=\"mailto:$owneremail\">$owner</a>";
  554.         }
  555.             echo "</td>"
  556.             ."<td bgcolor=\"$colorswitch\"><center><a href=\"admin.php?op=LinksEditBrokenLinks&lid=$lid\">X</a></center>"
  557.             ."<td bgcolor=\"$colorswitch\"><center><a href=\"admin.php?op=LinksIgnoreBrokenLinks&lid=$lid\">X</a></center>"
  558.             ."</td>"
  559.             ."<td bgcolor=\"$colorswitch\"><center><a href=\"admin.php?op=LinksDelBrokenLinks&lid=$lid\">X</a></center>"
  560.             ."</td>"
  561.             ."</tr>";
  562.             if ($colorswitch == $bgcolor2) {
  563.         $colorswitch = $bgcolor1;
  564.                } else {
  565.         $colorswitch = $bgcolor2;
  566.         }
  567.         }
  568.     }
  569.     echo "</table>";
  570.     CloseTable();
  571.     include ("footer.php");
  572. }
  573.  
  574. function LinksDelBrokenLinks($lid) {
  575.     global $prefix, $dbi;
  576.     sql_query("delete from ".$prefix."_links_modrequest where lid=$lid", $dbi);
  577.     sql_query("delete from ".$prefix."_links_links where lid=$lid", $dbi);
  578.     Header("Location: admin.php?op=LinksListBrokenLinks");
  579. }
  580.  
  581. function LinksIgnoreBrokenLinks($lid) {
  582.     global $prefix, $dbi;
  583.     sql_query("delete from ".$prefix."_links_modrequest where lid=$lid and brokenlink=1", $dbi);
  584.     Header("Location: admin.php?op=LinksListBrokenLinks");
  585. }
  586.  
  587. function LinksListModRequests() {
  588.     global $bgcolor2, $prefix, $dbi;
  589.     include ("header.php");
  590.     GraphicAdmin();
  591.     OpenTable();
  592.     echo "<center><font class=\"title\"><b>"._WEBLINKSADMIN."</b></font></center>";
  593.     CloseTable();
  594.     echo "<br>";
  595.     OpenTable();
  596.     $result = sql_query("select requestid, lid, cid, sid, title, url, description, modifysubmitter from ".$prefix."_links_modrequest where brokenlink=0 order by requestid", $dbi);
  597.     $totalmodrequests = sql_num_rows($result, $dbi);
  598.     echo "<center><font class=\"option\"><b>"._USERMODREQUEST." ($totalmodrequests)</b></font></center><br><br><br>";
  599.     echo "<table width=\"95%\"><tr><td>";
  600.     while(list($requestid, $lid, $cid, $sid, $title, $url, $description, $modifysubmitter)=sql_fetch_row($result, $dbi)) {
  601.     $result2 = sql_query("select cid, sid, title, url, description, submitter from ".$prefix."_links_links where lid=$lid", $dbi);
  602.     list($origcid, $origsid, $origtitle, $origurl, $origdescription, $owner)=sql_fetch_row($result2, $dbi);
  603.     $result3 = sql_query("select title from ".$prefix."_links_categories where cid=$cid", $dbi);
  604.     $result5 = sql_query("select title from ".$prefix."_links_categories where cid=$origcid", $dbi);
  605.     $result7 = sql_query("select email from ".$prefix."_users where uname='$modifysubmitter'", $dbi);
  606.     $result8 = sql_query("select email from ".$prefix."_users where uname='$owner'", $dbi);
  607.     list($cidtitle)=sql_fetch_row($result3, $dbi);
  608.     list($origcidtitle)=sql_fetch_row($result5, $dbi);
  609.     list($modifysubmitteremail)=sql_fetch_row($result7, $dbi);
  610.     list($owneremail)=sql_fetch_row($result8, $dbi);
  611.         $title = stripslashes($title);
  612.         $description = stripslashes($description);
  613.         if ($owner=="") {
  614.         $owner="administration";
  615.     }
  616.         if ($origsidtitle=="") {
  617.         $origsidtitle= "-----";
  618.     }
  619.         if ($sidtitle=="") {
  620.         $sidtitle= "-----";
  621.     }
  622.         echo "<table border=\"1\" bordercolor=\"black\" cellpadding=\"5\" cellspacing=\"0\" align=\"center\" width=\"450\">"
  623.             ."<tr>"
  624.             ."<td>"
  625.             ."<table width=\"100%\" bgcolor=\"$bgcolor2\">"
  626.             ."<tr>"
  627.             ."<td valign=\"top\" width=\"45%\"><b>"._ORIGINAL."</b></td>"
  628.             ."<td rowspan=\"5\" valign=\"top\" align=\"left\"><font class=\"tiny\"><br>"._DESCRIPTION.":<br>$origdescription</font></td>"
  629.             ."</tr>"
  630.             ."<tr><td valign=\"top\" width=\"45%\"><font class=\"tiny\">"._TITLE.": $origtitle</td></tr>"
  631.             ."<tr><td valign=\"top\" width=\"45%\"><font class=\"tiny\">"._URL.": <a href=\"$origurl\">$origurl</a></td></tr>"
  632.         ."<tr><td valign=\"top\" width=\"45%\"><font class=\"tiny\">"._CATEGORY.": $origcidtitle</td></tr>"
  633.         ."<tr><td valign=\"top\" width=\"45%\"><font class=\"tiny\">"._SUBCATEGORY.": $origsidtitle</td></tr>"
  634.             ."</table>"
  635.             ."</td>"
  636.             ."</tr>"
  637.             ."<tr>"
  638.             ."<td>"
  639.             ."<table width=\"100%\">"
  640.             ."<tr>"
  641.             ."<td valign=\"top\" width=\"45%\"><b>"._PROPOSED."</b></td>"
  642.             ."<td rowspan=\"5\" valign=\"top\" align=\"left\"><font class=\"tiny\"><br>"._DESCRIPTION.":<br>$description</font></td>"
  643.             ."</tr>"
  644.             ."<tr><td valign=\"top\" width=\"45%\"><font class=\"tiny\">"._TITLE.": $title</td></tr>"
  645.             ."<tr><td valign=\"top\" width=\"45%\"><font class=\"tiny\">"._URL.": <a href=\"$url\">$url</a></td></tr>"
  646.         ."<tr><td valign=\"top\" width=\"45%\"><font class=\"tiny\">"._CATEGORY.": $cidtitle</td></tr>"
  647.         ."<tr><td valign=\"top\" width=\"45%\"><font class=\"tiny\">"._SUBCATEGORY.": $sidtitle</td></tr>"
  648.             ."</table>"
  649.             ."</td>"
  650.             ."</tr>"
  651.             ."</table>"
  652.             ."<table align=\"center\" width=\"450\">"
  653.             ."<tr>";
  654.         if ($modifysubmitteremail=="") {
  655.         echo "<td align=\"left\"><font class=\"tiny\">"._SUBMITTER.":  $modifysubmitter</font></td>";
  656.     } else {
  657.         echo "<td align=\"left\"><font class=\"tiny\">"._SUBMITTER.":  <a href=\"mailto:$modifysubmitteremail\">$modifysubmitter</a></font></td>";
  658.     }
  659.         if ($owneremail=="") {
  660.         echo "<td align=\"center\"><font class=\"tiny\">"._OWNER.":  $owner</font></td>";
  661.     } else {
  662.         echo "<td align=\"center\"><font class=\"tiny\">"._OWNER.": <a href=\"mailto:$owneremail\">$owner</a></font></td>";
  663.     }
  664.         echo "<td align=\"right\"><font class=\"tiny\">( <a href=\"admin.php?op=LinksChangeModRequests&requestid=$requestid\">"._ACCEPT."</a> / <a href=\"admin.php?op=LinksChangeIgnoreRequests&requestid=$requestid\">"._IGNORE."</a> )</font></td></tr></table>";
  665.     }
  666.     if ($totalmodrequests == 0) {
  667.     echo "<center>"._NOMODREQUESTS."</center><br><br>";
  668.     }
  669.     echo "</td></tr></table>";
  670.     CloseTable();
  671.     include ("footer.php");
  672. }
  673.  
  674. function LinksChangeModRequests($requestid) {
  675.     global $prefix, $dbi;
  676.     $result = sql_query("select requestid, lid, cid, sid, title, url, description from ".$prefix."_links_modrequest where requestid=$requestid", $dbi);
  677.     while(list($requestid, $lid, $cid, $sid, $title, $url, $description)=sql_fetch_row($result, $dbi)) {
  678.     $title = stripslashes($title);
  679.         $description = stripslashes($description);
  680.         sql_query("UPDATE ".$prefix."_links_links SET cid=$cid, sid=$sid, title='$title', url='$url', description='$description' WHERE lid = $lid", $dbi);
  681.     }
  682.     sql_query("delete from ".$prefix."_links_modrequest where requestid=$requestid", $dbi);
  683.     Header("Location: admin.php?op=LinksListModRequests");
  684. }
  685.  
  686. function LinksChangeIgnoreRequests($requestid) {
  687.     global $prefix, $dbi;
  688.     sql_query("delete from ".$prefix."_links_modrequest where requestid=$requestid", $dbi);
  689.     Header("Location: admin.php?op=LinksListModRequests");
  690. }
  691.  
  692. function LinksCleanVotes() {
  693.     global $prefix, $dbi;
  694.     $totalvoteresult = sql_query("select distinct ratinglid FROM ".$prefix."_links_votedata", $dbi);
  695.     while(list($lid)=sql_fetch_row($totalvoteresult, $dbi)) {
  696.     $voteresult = sql_query("select rating, ratinguser, ratingcomments FROM ".$prefix."_links_votedata WHERE ratinglid = $lid", $dbi);
  697.     $totalvotesDB = sql_num_rows($voteresult, $dbi);
  698.     include ("voteinclude.php");
  699.         sql_query("UPDATE ".$prefix."_links_links SET linkratingsummary=$finalrating,totalvotes=$totalvotesDB,totalcomments=$truecomments WHERE lid = $lid", $dbi);
  700.     }
  701.     Header("Location: admin.php?op=Links");
  702. }
  703.  
  704. function LinksModLinkS($lid, $title, $url, $description, $name, $email, $hits, $cat) {
  705.     global $prefix, $dbi;
  706.     $cat = explode("-", $cat);
  707.     if ($cat[1]=="") {
  708.         $cat[1] = 0;
  709.     }
  710.     $title = stripslashes(FixQuotes($title));
  711.     $url = stripslashes(FixQuotes($url));
  712.     $description = stripslashes(FixQuotes($description));
  713.     $name = stripslashes(FixQuotes($name));
  714.     $email = stripslashes(FixQuotes($email));
  715.     sql_query("update ".$prefix."_links_links set cid='$cat[0]', sid='$cat[1]', title='$title', url='$url', description='$description', name='$name', email='$email', hits='$hits' where lid=$lid", $dbi);
  716.     //echo "update ".$prefix."_links_links set cid='$cat[0]', sid='$cat[1]', title='$title', url='$url', description='$description', name='$name', email='$email', hits='$hits' where lid=$lid"; exit;
  717.     Header("Location: admin.php?op=Links");
  718. }
  719.  
  720. function LinksDelLink($lid) {
  721.     global $prefix, $dbi;
  722.     sql_query("delete from ".$prefix."_links_links where lid=$lid", $dbi);
  723.     Header("Location: admin.php?op=Links");
  724. }
  725.  
  726. function LinksModCat($cat) {
  727.     global $prefix, $dbi;
  728.     include ("header.php");
  729.     GraphicAdmin();
  730.     OpenTable();
  731.     echo "<center><font class=\"title\"><b>"._WEBLINKSADMIN."</b></font></center>";
  732.     CloseTable();
  733.     echo "<br>";
  734.     $cat = explode("-", $cat);
  735.     if ($cat[1]=="") {
  736.         $cat[1] = 0;
  737.     }
  738.     OpenTable();
  739.     echo "<center><font class=\"option\"><b>"._MODCATEGORY."</b></font></center><br><br>";
  740.     if ($cat[1]==0) {
  741.     $result=sql_query("select title, cdescription from ".$prefix."_links_categories where cid=$cat[0]", $dbi);
  742.     list($title,$cdescription) = sql_fetch_row($result, $dbi);
  743.     $cdescription = stripslashes($cdescription);
  744.     echo "<form action=\"admin.php\" method=\"get\">"
  745.         .""._NAME.": <input type=\"text\" name=\"title\" value=\"$title\" size=\"51\" maxlength=\"50\"><br>"
  746.         .""._DESCRIPTION.":<br><textarea name=\"cdescription\" cols=\"60\" rows=\"10\">$cdescription</textarea><br>"
  747.         ."<input type=\"hidden\" name=\"sub\" value=\"0\">"
  748.         ."<input type=\"hidden\" name=\"cid\" value=\"$cat[0]\">"
  749.         ."<input type=\"hidden\" name=\"op\" value=\"LinksModCatS\">"
  750.         ."<table border=\"0\"><tr><td>"
  751.         ."<input type=\"submit\" value=\""._SAVECHANGES."\"></form></td><td>"
  752.         ."<form action=\"admin.php\" method=\"get\">"
  753.         ."<input type=\"hidden\" name=\"sub\" value=\"0\">"
  754.         ."<input type=\"hidden\" name=\"cid\" value=\"$cat[0]\">"
  755.         ."<input type=\"hidden\" name=\"op\" value=\"LinksDelCat\">"
  756.         ."<input type=\"submit\" value=\""._DELETE."\"></form></td></tr></table>";
  757.     } else {
  758.     $result=sql_query("select title from ".$prefix."_links_categories where cid=$cat[0]", $dbi);
  759.     list($ctitle) = sql_fetch_row($result, $dbi);
  760.     $result2=sql_query("select title from ".$prefix."_links_subcategories where sid=$cat[1]", $dbi);
  761.     list($stitle) = sql_fetch_row($result2, $dbi);
  762.     echo "<form action=\"admin.php\" method=\"get\">"
  763.         .""._CATEGORY.": $ctitle<br>"
  764.         .""._SUBCATEGORY.": <input type=\"text\" name=\"title\" value=\"$stitle\" size=\"51\" maxlength=\"50\"><br>"
  765.         ."<input type=\"hidden\" name=\"sub\" value=\"1\">"
  766.         ."<input type=\"hidden\" name=\"cid\" value=\"$cat[0]\">"
  767.         ."<input type=\"hidden\" name=\"sid\" value=\"$cat[1]\">"
  768.         ."<input type=\"hidden\" name=\"op\" value=\"LinksModCatS\">"
  769.         ."<table border=\"0\"><tr><td>"
  770.         ."<input type=\"submit\" value=\""._SAVECHANGES."\"></form></td><td>"
  771.         ."<form action=\"admin.php\" method=\"get\">"
  772.         ."<input type=\"hidden\" name=\"sub\" value=\"1\">"
  773.         ."<input type=\"hidden\" name=\"cid\" value=\"$cat[0]\">"
  774.         ."<input type=\"hidden\" name=\"sid\" value=\"$cat[1]\">"
  775.         ."<input type=\"hidden\" name=\"op\" value=\"LinksDelCat\">"
  776.         ."<input type=\"submit\" value=\""._DELETE."\"></form></td></tr></table>";
  777.     }
  778.     CloseTable();
  779.     include("footer.php");
  780. }
  781.  
  782. function LinksModCatS($cid, $sid, $sub, $title, $cdescription) {
  783.     global $prefix, $dbi;
  784.     if ($sub==0) {
  785.     sql_query("update ".$prefix."_links_categories set title='$title', cdescription='$cdescription' where cid=$cid", $dbi);
  786.     } else {
  787.     sql_query("update ".$prefix."_links_subcategories set title='$title' where sid=$sid", $dbi);
  788.     }
  789.     Header("Location: admin.php?op=Links");
  790. }
  791.  
  792. function LinksDelCat($cid, $sid, $sub, $ok=0) {
  793.     global $prefix, $dbi;
  794.     if($ok==1) {
  795.     if ($sub>0) {
  796.         sql_query("delete from ".$prefix."_links_categories where cid=$cid", $dbi);
  797.         sql_query("delete from ".$prefix."_links_links where cid=$cid", $dbi);
  798.     } else {
  799.         sql_query("delete from ".$prefix."_links_links where cid=$cid", $dbi);
  800.         // suppression des liens de catΘgories filles
  801.         $result2 = sql_query("select cid from ".$prefix."_links_categories where parentid=$cid", $dbi);
  802.         while(list($cid2) = sql_fetch_row($result2, $dbi)) {
  803.             sql_query("delete from ".$prefix."_links_links where cid=$cid2", $dbi);
  804.         }
  805.         sql_query("delete from ".$prefix."_links_categories where parentid=$cid", $dbi);
  806.         sql_query("delete from ".$prefix."_links_categories where cid=$cid", $dbi);
  807.     }
  808.     Header("Location: admin.php?op=Links");    
  809.     } else {
  810.     $result = sql_query("select * from ".$prefix."_links_categories where parentid=$cid", $dbi);
  811.     $nbsubcat = sql_num_rows($result, $dbi);
  812.  
  813.     $result2 = sql_query("select cid from ".$prefix."_links_categories where parentid=$cid", $dbi);
  814.     while(list($cid2) = sql_fetch_row($result2, $dbi)) {
  815.         $result3 = sql_query("select * from ".$prefix."_links_links where cid=$cid2", $dbi);
  816.         $nblink += sql_num_rows($result3, $dbi);
  817.     }
  818.  
  819.     include("header.php");
  820.     GraphicAdmin();
  821.     OpenTable();
  822.     echo "<br><center><font class=\"option\">";
  823.     echo "<b>"._EZTHEREIS." $nbsubcat "._EZSUBCAT." "._EZATTACHEDTOCAT."</b><br>";
  824.     echo "<b>"._EZTHEREIS." $nblink "._links." "._EZATTACHEDTOCAT."</b><br>";
  825.     echo "<b>"._DELEZLINKCATWARNING."</b><br><br>";
  826.     }
  827.     echo "[ <a href=\"admin.php?op=LinksDelCat&cid=$cid&sid=$sid&sub=$sub&ok=1\">"._YES."</a> | <a href=\"admin.php?op=Links\">"._NO."</a> ]<br><br>";
  828.     CloseTable();
  829.     include("footer.php");    
  830. }
  831.  
  832. function LinksDelNew($lid) {
  833.     global $prefix, $dbi;
  834.     sql_query("delete from ".$prefix."_links_newlink where lid=$lid", $dbi);
  835.     Header("Location: admin.php?op=Links");
  836. }
  837.  
  838. function LinksAddCat($title, $cdescription) {
  839.     global $prefix, $dbi;
  840.     $parentid=0;
  841.     $result = sql_query("select cid from ".$prefix."_links_categories where title='$title'", $dbi);
  842.     $numrows = sql_num_rows($result, $dbi);
  843.     if ($numrows>0) {
  844.     include("header.php");
  845.     GraphicAdmin();
  846.     OpenTable();
  847.     echo "<br><center><font class=\"option\">"
  848.         ."<b>"._ERRORTHECATEGORY." $title "._ALREADYEXIST."</b><br><br>"
  849.         .""._GOBACK."<br><br>";
  850.     CloseTable();
  851.     include("footer.php");
  852.     } else {
  853.     sql_query("insert into ".$prefix."_links_categories values (NULL, '$title', '$cdescription', $parentid)", $dbi);
  854.     Header("Location: admin.php?op=Links");
  855.     }
  856. }
  857.  
  858. function LinksAddSubCat($cid, $title, $cdescription) {
  859.     global $prefix, $dbi;
  860.     $result = sql_query("select cid from ".$prefix."_links_categories where title='$title' AND cid='$cid'", $dbi);
  861.     $numrows = sql_num_rows($result, $dbi);
  862.     if ($numrows>0) {
  863.     include("header.php");
  864.     GraphicAdmin();
  865.     OpenTable();
  866.     echo "<br><center>";
  867.     echo "<font class=\"option\">"
  868.         ."<b>"._ERRORTHESUBCATEGORY." $title "._ALREADYEXIST."</b><br><br>"
  869.         .""._GOBACK."<br><br>";
  870.     include("footer.php");
  871.     } else {
  872.     sql_query("insert into ".$prefix."_links_categories values (NULL, '$title', '$cdescription', '$cid')", $dbi);
  873.     Header("Location: admin.php?op=Links");
  874.     }
  875. }
  876.  
  877. function LinksAddEditorial($linkid, $editorialtitle, $editorialtext) {
  878.     global $aid, $prefix, $dbi;
  879.     $editorialtext = stripslashes(FixQuotes($editorialtext));
  880.     sql_query("insert into ".$prefix."_links_editorials values ($linkid, '$aid', now(), '$editorialtext', '$editorialtitle')", $dbi);
  881.     include("header.php");
  882.     GraphicAdmin();
  883.     OpenTable();
  884.     echo "<center><br>"
  885.     ."<font class=option>"
  886.     .""._EDITORIALADDED."<br><br>"
  887.     ."[ <a href=\"admin.php?op=Links\">"._WEBLINKSADMIN."</a> ]<br><br>";
  888.     echo "$linkid  $adminid, $editorialtitle, $editorialtext";
  889.     CloseTable();
  890.     include("footer.php");
  891. }
  892.  
  893. function LinksModEditorial($linkid, $editorialtitle, $editorialtext) {
  894.     global $prefix, $dbi;
  895.     $editorialtext = stripslashes(FixQuotes($editorialtext));
  896.     sql_query("update ".$prefix."_links_editorials set editorialtext='$editorialtext', editorialtitle='$editorialtitle' where linkid=$linkid", $dbi);
  897.     include("header.php");
  898.     GraphicAdmin();
  899.     OpenTable();
  900.     echo "<br><center>"
  901.     ."<font class=\"option\">"
  902.     .""._EDITORIALMODIFIED."<br><br>"
  903.     ."[ <a href=\"admin.php?op=Links\">"._WEBLINKSADMIN."</a> ]<br><br>";
  904.     CloseTable();
  905.     include("footer.php");    
  906. }
  907.  
  908. function LinksDelEditorial($linkid) {
  909.     global $prefix, $dbi;
  910.     sql_query("delete from ".$prefix."_links_editorials where linkid=$linkid", $dbi);
  911.     include("header.php");
  912.     GraphicAdmin();
  913.     OpenTable();
  914.     echo "<br><center>"
  915.     ."<font class=\"option\">"
  916.     .""._EDITORIALREMOVED."<br><br>"
  917.     ."[ <a href=\"admin.php?op=Links\">"._WEBLINKSADMIN."</a> ]<br><br>";
  918.     CloseTable();
  919.     include("footer.php");
  920. }
  921.  
  922. function LinksLinkCheck() {
  923.     global $prefix, $dbi;
  924.     include ("header.php");
  925.     GraphicAdmin();
  926.     OpenTable();
  927.     echo "<center><font class=\"title\"><b>"._WEBLINKSADMIN."</b></font></center>";
  928.     CloseTable();
  929.     echo "<br>";
  930.     OpenTable();
  931.     echo "<center><font class=\"option\"><b>"._LINKVALIDATION."</b></font></center><br>"
  932.     ."<table width=\"100%\" align=\"center\"><tr><td colspan=\"2\" align=\"center\">"
  933.     ."<a href=\"admin.php?op=LinksValidate&cid=0&sid=0\">"._CHECKALLLINKS."</a><br><br></td></tr>"
  934.     ."<tr><td valign=\"top\"><center><b>"._CHECKCATEGORIES."</b><br>"._INCLUDESUBCATEGORIES."<br><br><font class=\"tiny\">";
  935.     $result = sql_query("select cid, title from ".$prefix."_links_categories order by title", $dbi);
  936.     while(list($cid, $title) = sql_fetch_row($result, $dbi)) {
  937.         $transfertitle = str_replace (" ", "_", $title);
  938.         echo "<a href=\"admin.php?op=LinksValidate&cid=$cid&sid=0&ttitle=$transfertitle\">$title</a><br>";
  939.     }
  940.     echo "</font></center></td></tr></table>";
  941.     CloseTable();
  942.     include ("footer.php");
  943. }
  944.  
  945. function LinksValidate($cid, $sid, $ttitle) {
  946.     global $bgcolor2, $prefix, $dbi;
  947.     include ("header.php");
  948.     GraphicAdmin();
  949.     OpenTable();
  950.     echo "<center><font class=\"title\"><b>"._WEBLINKSADMIN."</b></font></center>";
  951.     CloseTable();
  952.     echo "<br>";
  953.     OpenTable();
  954.     $transfertitle = str_replace ("_", "", $ttitle);
  955.     /* Check ALL Links */
  956.     echo "<table width=100% border=0>";
  957.     if ($cid==0 && $sid==0) {
  958.     echo "<tr><td colspan=\"3\"><center><b>"._CHECKALLLINKS."</b><br>"._BEPATIENT."</center><br><br></td></tr>";
  959.     $result = sql_query("select lid, title, url, name, email, submitter from ".$prefix."_links_links order by title", $dbi);
  960.     }       
  961.     /* Check Categories & Subcategories */
  962.     if ($cid!=0 && $sid==0) {
  963.     echo "<tr><td colspan=\"3\"><center><b>"._VALIDATINGCAT.": $transfertitle</b><br>"._BEPATIENT."</center><br><br></td></tr>";
  964.     $result = sql_query("select lid, title, url, name, email, submitter from ".$prefix."_links_links where cid=$cid order by title", $dbi);
  965.     }
  966.     /* Check Only Subcategory */
  967.     if ($cid==0 && $sid!=0) {
  968.        echo "<tr><td colspan=\"3\"><center><b>"._VALIDATINGSUBCAT.": $transfertitle</b><br>"._BEPATIENT."</center><br><br></td></tr>";
  969.        $result = sql_query("select lid, title, url, name, email, submitter from ".$prefix."_links_links where sid=$sid order by title", $dbi);
  970.     }
  971.     echo "<tr><td bgcolor=\"$bgcolor2\" align=\"center\"><b>"._STATUS."</b></td><td bgcolor=\"$bgcolor2\" width=\"100%\"><b>"._LINKTITLE."</b></td><td bgcolor=\"$bgcolor2\" align=\"center\"><b>"._FUNCTIONS."</b></td></tr>";
  972.     while(list($lid, $title, $url, $name, $email, $submitter) = sql_fetch_row($result, $dbi)) {
  973.     $vurl = parse_url($url);
  974.     $fp = fsockopen($vurl['host'], 80, $errno, $errstr, 15);
  975.     if (!$fp){ 
  976.         echo "<tr><td align=\"center\"><b>  "._FAILED."  </b></td>"
  977.         ."<td>  <a href=\"$url\" target=\"new\">$title</a>  </td>"
  978.         ."<td align=\"center\"><font class=\"content\">  [ <a href=\"admin.php?op=LinksModLink&lid=$lid\">"._EDIT."</a> | <a href=\"admin.php?op=LinksDelLink&lid=$lid\">"._DELETE."</a> ]  </font>"
  979.         ."</td></tr>";
  980.     }        
  981.     if ($fp){ 
  982.         echo "<tr><td align=\"center\">  "._OK."  </td>"
  983.         ."<td>  <a href=\"$url\" target=\"new\">$title</a>  </td>"
  984.         ."<td align=\"center\"><font class=\"content\">  "._NONE."  </font>"
  985.         ."</td></tr>";
  986.     } 
  987.     }
  988.     echo "</table>";
  989.     CloseTable();       
  990.     include ("footer.php");
  991. }
  992.  
  993. function LinksAddLink($new, $lid, $title, $url, $cat, $description, $name, $email, $submitter) {
  994.     global $prefix, $dbi;
  995.     $result = sql_query("select url from ".$prefix."_links_links where url='$url'", $dbi);
  996.     $numrows = sql_num_rows($result, $dbi);
  997.     if ($numrows>0) {
  998.     include("header.php");
  999.     GraphicAdmin();
  1000.     OpenTable();
  1001.     echo "<center><font class=\"title\"><b>"._WEBLINKSADMIN."</b></font></center>";
  1002.     CloseTable();
  1003.     echo "<br>";
  1004.     OpenTable();
  1005.     echo "<br><center>"
  1006.         ."<font class=\"option\">"
  1007.         ."<b>"._ERRORURLEXIST."</b><br><br>"
  1008.         .""._GOBACK."<br><br>";
  1009.     CloseTable();
  1010.     include("footer.php");
  1011.     } else {
  1012. /* Check if Title exist */
  1013.     if ($title=="") {
  1014.     include("header.php");
  1015.     GraphicAdmin();
  1016.     OpenTable();
  1017.     echo "<center><font class=\"title\"><b>"._WEBLINKSADMIN."</b></font></center>";
  1018.     CloseTable();
  1019.     echo "<br>";
  1020.     OpenTable();
  1021.     echo "<br><center>"
  1022.         ."<font class=\"option\">"
  1023.         ."<b>"._ERRORNOTITLE."</b><br><br>"
  1024.         .""._GOBACK."<br><br>";
  1025.     CloseTable();
  1026.     include("footer.php");
  1027.     }
  1028. /* Check if URL exist */
  1029.     if ($url=="") {
  1030.     include("header.php");
  1031.     GraphicAdmin();
  1032.     OpenTable();
  1033.     echo "<center><font class=\"title\"><b>"._WEBLINKSADMIN."</b></font></center>";
  1034.     CloseTable();
  1035.     echo "<br>";
  1036.     OpenTable();
  1037.     echo "<br><center>"
  1038.         ."<font class=\"option\">"
  1039.         ."<b>"._ERRORNOURL."</b><br><br>"
  1040.         .""._GOBACK."<br><br>";
  1041.     CloseTable();
  1042.     include("footer.php");
  1043.     }
  1044. // Check if Description exist
  1045.     if ($description=="") {
  1046.     include("header.php");
  1047.     GraphicAdmin();
  1048.     OpenTable();
  1049.     echo "<center><font class=\"title\"><b>"._WEBLINKSADMIN."</b></font></center>";
  1050.     CloseTable();
  1051.     echo "<br>";
  1052.     OpenTable();
  1053.     echo "<br><center>"
  1054.         ."<font class=\"option\">"
  1055.         ."<b>"._ERRORNODESCRIPTION."</b><br><br>"
  1056.         .""._GOBACK."<br><br>";
  1057.     CloseTable();
  1058.     include("footer.php");
  1059.     }
  1060.     $cat = explode("-", $cat);
  1061.     if ($cat[1]=="") {
  1062.     $cat[1] = 0;
  1063.     }
  1064.     $title = stripslashes(FixQuotes($title));
  1065.     $url = stripslashes(FixQuotes($url));
  1066.     $description = stripslashes(FixQuotes($description));
  1067.     $name = stripslashes(FixQuotes($name));
  1068.     $email = stripslashes(FixQuotes($email));
  1069.     sql_query("insert into ".$prefix."_links_links values (NULL, '$cat[0]', '$cat[1]', '$title', '$url', '$description', now(), '$name', '$email', '0','$submitter',0,0,0)", $dbi);
  1070.     global $nukeurl, $sitename;
  1071.     include("header.php");
  1072.     GraphicAdmin();
  1073.     OpenTable();
  1074.     echo "<br><center>";
  1075.     echo "<font class=\"option\">";
  1076.     echo ""._NEWLINKADDED."<br><br>";
  1077.     echo "[ <a href=\"admin.php?op=Links\">"._WEBLINKSADMIN."</a> ]</center><br><br>";
  1078.     CloseTable();
  1079.     if ($new==1) {
  1080.     sql_query("delete from ".$prefix."_links_newlink where lid=$lid", $dbi);
  1081.     if ($email=="") {
  1082.     } else {
  1083.         $subject = ""._YOURLINKAT." $sitename";
  1084.         $message = ""._HELLO." $name:\n\n"._LINKAPPROVEDMSG."\n\n"._LINKTITLE.": $title\n"._URL.": $url\n"._DESCRIPTION.": $description\n\n\n"._YOUCANBROWSEUS." $nukeurl/modules.php?name=Web_Links\n\n"._THANKS4YOURSUBMISSION."\n\n$sitename "._TEAM."";
  1085.         $from = "$sitename";
  1086.         mail($email, $subject, $message, "From: $from\nX-Mailer: PHP/" . phpversion());
  1087.     }
  1088.     }
  1089.     include("footer.php");
  1090.     }
  1091. }
  1092.  
  1093. switch ($op) {
  1094.             
  1095.     case "Links":
  1096.     links();
  1097.     break;
  1098.  
  1099.     case "LinksDelNew":
  1100.     LinksDelNew($lid);
  1101.     break;
  1102.  
  1103.     case "LinksAddCat":
  1104.     LinksAddCat($title, $cdescription);
  1105.     break;
  1106.  
  1107.     case "LinksAddSubCat":
  1108.     LinksAddSubCat($cid, $title, $cdescription);
  1109.     break;
  1110.  
  1111.     case "LinksAddLink":
  1112.     LinksAddLink($new, $lid, $title, $url, $cat, $description, $name, $email, $submitter);
  1113.     break;
  1114.             
  1115.     case "LinksAddEditorial":
  1116.     LinksAddEditorial($linkid, $editorialtitle, $editorialtext);
  1117.     break;            
  1118.             
  1119.     case "LinksModEditorial":
  1120.     LinksModEditorial($linkid, $editorialtitle, $editorialtext);
  1121.     break;    
  1122.             
  1123.     case "LinksLinkCheck":
  1124.     LinksLinkCheck();
  1125.     break;    
  1126.         
  1127.     case "LinksValidate":
  1128.     LinksValidate($cid, $sid, $ttitle);
  1129.     break;
  1130.  
  1131.     case "LinksDelEditorial":
  1132.     LinksDelEditorial($linkid);
  1133.     break;                        
  1134.  
  1135.     case "LinksCleanVotes":
  1136.     LinksCleanVotes();
  1137.     break;    
  1138.         
  1139.     case "LinksListBrokenLinks":
  1140.     LinksListBrokenLinks();
  1141.     break;
  1142.  
  1143.     case "LinksEditBrokenLinks":
  1144.     LinksEditBrokenLinks($lid);
  1145.     break;
  1146.     
  1147.     case "LinksDelBrokenLinks":
  1148.     LinksDelBrokenLinks($lid);
  1149.     break;
  1150.             
  1151.     case "LinksIgnoreBrokenLinks":
  1152.     LinksIgnoreBrokenLinks($lid);
  1153.     break;            
  1154.             
  1155.     case "LinksListModRequests":
  1156.     LinksListModRequests();
  1157.     break;        
  1158.             
  1159.     case "LinksChangeModRequests":
  1160.     LinksChangeModRequests($requestid);
  1161.     break;    
  1162.             
  1163.     case "LinksChangeIgnoreRequests":
  1164.     LinksChangeIgnoreRequests($requestid);
  1165.     break;
  1166.             
  1167.     case "LinksDelCat":
  1168.     LinksDelCat($cid, $sid, $sub, $ok);
  1169.     break;
  1170.  
  1171.     case "LinksModCat":
  1172.     LinksModCat($cat);
  1173.     break;
  1174.  
  1175.     case "LinksModCatS":
  1176.     LinksModCatS($cid, $sid, $sub, $title, $cdescription);
  1177.     break;
  1178.  
  1179.     case "LinksModLink":
  1180.     LinksModLink($lid);
  1181.     break;
  1182.  
  1183.     case "LinksModLinkS":
  1184.     LinksModLinkS($lid, $title, $url, $description, $name, $email, $hits, $cat);
  1185.     break;
  1186.  
  1187.     case "LinksDelLink":
  1188.     LinksDelLink($lid);
  1189.     break;
  1190.  
  1191.     case "LinksDelVote":
  1192.     LinksDelVote($lid, $rid);
  1193.     break;            
  1194.  
  1195.     case "LinksDelComment":
  1196.     LinksDelComment($lid, $rid);
  1197.     break;
  1198.  
  1199.     case "LinksTransfer":
  1200.     LinksTransfer($cidfrom,$cidto);
  1201.     break;
  1202.  
  1203. }
  1204.  
  1205. } else {
  1206.     echo "Access Denied";
  1207. }
  1208.  
  1209. ?>