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