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