View Single Post
  #1  
Old 13th October 2010, 12:52
Fynnon's Avatar
Fynnon Fynnon is offline
xxx
 
Join Date: Nov 2007
P2P
Posts: 984
Default Split torrents by Days
This is for TBDev 2009

1.
run this sql:
PHP Code:
ALTER TABLE `usersADD split enum('yes','no'NOT NULL default 'yes'
2. open include torrenttable functions and find:
PHP Code:
while ($row mysql_fetch_assoc($res))      { 
directly bellow it add:
PHP Code:
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"; } 
3. open lang\en\lang_torrenttable_functions.php and add:

PHP Code:
'torrenttable_upped'         => 'Uploaded On '
4. open my.php and add wherever you want to show it:
PHP Code:
$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); 
5. open takeprofileedit.php and find:
PHP Code:
$acceptpms $_POST["acceptpms"]; 
above it add:
PHP Code:
$split = ($_POST["split"] == "yes" "yes" "no"); $updateset[] = "split = " sqlesc($split); 
6. open lang\en\lang_my.php and add
PHP Code:
'my_split' => 'Split Torrents by Days'
Click image for larger version

Name:	split.png
Views:	376
Size:	25.4 KB
ID:	2584

FreakyNutz@tbdev.net/index.php?showtopic=22153
Reply With Quote