09 Split Torrents by Days

Started by Yupy., July 22, 2012, 12:05:22 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

denede

just noticed that when i search for a torrent, or i want to see all torrents, including dead, the split by days bar will dissapear and it will show them as normal :|

Yupy.

Credits to original creator...
First execute this sql command:

ALTER TABLE `users` ADD split enum('yes','no') NOT NULL default 'yes'; 

Now open include/torrenttable_functions.php and find:

while ($row = mysql_fetch_assoc($res)) {

Under it add:

if (($CURUSER['split'] == "yes") && ($_SERVER["REQUEST_URI"] == "/browse.php") && !isset($_GET["page"])) {
           
$day_added = $row['added'];     
$day_show = date($day_added);     
$thisdate = date('M d Y', $day_show);    /** If date already exist, disable $cleandate varible **/   
if (isset($prevdate) && $thisdate == $prevdate) {     
$cleandate = '';  /** If date does not exist, make some varibles **/
}else{ 
$day_added = "{$lang['torrenttable_upped']}" .date('l d M Y',$row['added']); // You can change this to something else
$cleandate = "<tr><td colspan='15'><b>$day_added</b></td></tr>\n"; // This also...
} /** Prevent that "torrents added..." wont appear again with the same date **/
$prevdate = $thisdate;  $man = array('Jan' => 'January',
'Feb' => 'February',   
'Mar' => 'March',     
'Apr' => 'April',     
'May' => 'May',     
'Jun' => 'June',     
'Jul' => 'July',     
'Aug' => 'August',     
'Sep' => 'September',     
'Oct' => 'October',     
'Nov' => 'November',     
'Dec' => 'December'); 
foreach($man as $eng => $ger){     
$cleandate = str_replace($eng, $ger,$cleandate); } 
$dag = array('Mon' => 'Monday',     
'Tues' => 'Tuesday',     
'Wednes' => 'Wednesday',     
'Thurs' => 'Thursday',     
'Fri' => 'Friday',     
'Satur' => 'Saturday',     
'Sun' => 'Sunday' ); 
foreach($dag as $eng => $ger){     
$cleandate = str_replace($eng.'day', $ger.'',$cleandate); } 
if ($row["sticky"] == "no") // delete this line if you dont have sticky torrents or you   
$htmlout .= $cleandate."\n"; }


Now open my.php and add where ever you want to show this:

$HTMLOUT .=tr($lang['my_split'], "<input type='radio' name='split'" . ($CURUSER["split"] == "yes" ? " checked='checked'" : "") . " value='yes' />yes <input type='radio' name='split'" . ($CURUSER["split"] == "no" ? " checked='checked'" : "") . " value='no' />no" ,1);

In takeprofileedit.php find:

$acceptpms = $_POST["acceptpms"];

Above add:

$split = ($_POST["split"] == "yes" ? "yes" : "no"); $updateset[] = "split = " . sqlesc($split); 

Now in lang\en\lang_torrenttable_functions.php add:

'torrenttable_upped' => 'Uploaded On ',

Now in lang\en\lang_my.php add:

'my_split' => 'Split Torrents by Days',