Clean blank downloads (Automatically)
Author Message
immu
Newbie


Posts: 6
Joined: Feb 2011
Post: #1
Clean blank downloads (Automatically)
0
0
Here's a small code for WCDDL that cleans out the blank downloads from the database.

If you're using WCDDL v1.45 then just make a new file in the "modules' directory and call it "wcddl_CleanDownloadsMOD.php".


<?php
/*BEGIN_INFO
This will clean out all of the blank downloads.
END_INFO*/

mysql_query("DELETE FROM wcddl_downloads WHERE title='' OR url='' OR sid=''");
mysql_query("DELETE FROM wcddl_queue WHERE title='' OR url='' OR sid=''");
?>



If you're not then add this to the bottom of "funcs.php" but before the "?>":
mysql_query("DELETE FROM wcddl_downloads WHERE title='' OR url='' OR sid=''");
mysql_query("DELETE FROM wcddl_queue WHERE title='' OR url='' OR sid=''");
02-03-2011 12:31 PM
jomasaco
Respected Member


Posts: 19
Joined: May 2010
Post: #2
Clean blank downloads (Automatically)
0
0
Is better add this in admin maintenance, in Optimize & Repair Tables
this way
in funcs find
Quote:if(isset($ort)) {
mysql_query("OPTIMIZE TABLE wcddl_downloads, wcddl_queue, wcddl_recents, wcddl_sites, wcddl_blacklist, wcddl_whitelist");
mysql_query("REPAIR TABLE wcddl_downloads, wcddl_queue, wcddl_recents, wcddl_sites, wcddl_blacklist, wcddl_whitelist");
echo '<div align="center" style="color:green;">Tables Optimized & Repaired</div>';
}

Replace by:
if(isset($ort)) {
        $alltables = mysql_query("SHOW TABLES");
while ($table = mysql_fetch_assoc($alltables))
{
   foreach ($table as $db => $tablename)
   {
       mysql_query("OPTIMIZE TABLE '".$tablename."'")
           or die(mysql_error());
           echo $tablename." Opmizide<br />";
   }
      foreach ($table as $db => $tablename)
   {
       mysql_query("REPAIR TABLE '".$tablename."'")
           or die(mysql_error());
           echo $tablename." Repaired<br />";
   }
  
}
    mysql_query("DELETE FROM wcddl_downloads WHERE title ='' or url='' or type='' or dat ='' ");
mysql_query("DELETE FROM wcddl_queue WHERE title='' OR url='' OR sid=''");
    echo '<div align="center" style="color:green;">Tables Optimized & Repaired</div>';
    }
02-05-2011 12:24 PM
c0rrupt
Administrator


Posts: 250
Joined: Mar 2010
Post: #3
Clean blank downloads (Automatically)
0
0
great piece of code guys... ++rep
Smile

Be sure to visit WCDDL.org Affiliates
02-05-2011 06:20 PM


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Show the downloads for a specific site (WCDDL v2) c0rrupt 0 36 07-26-2012 04:35 PM
Last Post: c0rrupt
  Show site Downloads/Rank [module] c0rrupt 9 508 12-25-2011 01:41 AM
Last Post: WJManiaC
  Amount of Downloads in Graph c0rrupt 9 298 11-15-2010 01:34 PM
Last Post: nYXem
  Show Top 10 Downloads by Views [module] c0rrupt 0 100 11-07-2010 02:19 PM
Last Post: c0rrupt
  Full Speed Downloads c0rrupt 0 99 11-07-2010 02:12 PM
Last Post: c0rrupt
  Strip all the slashes from downloads c0rrupt 0 71 11-07-2010 06:26 AM
Last Post: c0rrupt
  Accept All Downloads By Site c0rrupt 1 232 05-28-2010 07:41 AM
Last Post: nirav5300



User(s) browsing this thread: 1 Guest(s)

This forum uses Lukasz Tkacz MyBB addons.