Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
Sticky Torrents [TTv3]
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Mods Completed

2019-06-01 05:22:36
Copied from Uffeno1 post (all credit to authors)
SQL

ALTER TABLE torrents ADD `sticky` enum('yes','no') NOT NULL default 'no';


torrents.php, torrents-search.php or where you want to your sticky torrents shown.

change:

$orderby = "ORDER BY torrents.id DESC";

to:

$orderby = "ORDER BY torrents.sticky ASC, torrents.id DESC";


in the big query

after:

torrents.category,

insert:

torrents.sticky,


index.php

in the big query

after:

torrents.category,

insert:

torrents.sticky,

and at the end.

change:

ORDER BY id DESC LIMIT 25";

to:

ORDER BY sticky ASC, id DESC LIMIT 25";


torrent-edit.php

after:

$updateset[] = "category = " . (int) $_POST["type"];

insert:

if(get_user_class() >= 5){   // lowest class to make torrent sticky.
   if ($_POST["sticky"] == "yes")
             $updateset[] = "sticky = 'yes'";
      else
             $updateset[] = "sticky = 'no'";
   }

after:

echo "<tr><td class='table_col1' align='right'><b>".T_("CATEGORIES").": </b></td><td class='table_col2'>".$catdropdown."</td></tr>";

add:

if(get_user_class() >= 5)  // lowest class to make torrent sticky.
              echo "<tr><td class='table_col1' align='right'><b>".T_("STICKY").": </b></td><td class='table_col2'><input type='checkbox' name='sticky'" . (($row["sticky"] == "yes") ? " checked='checked'" : "" ) . " value='yes' />Set sticky this torrent!</td></tr>";


backend / function.php

after:

if ($row["freeleech"] == 1)
                                           $dispname .= " <img src='images/free.gif' border='0' alt='' />";

insert:

if ($row["sticky"] == "yes")
                                           $dispname .= " <img src='images/sticky.gif' bored='0' alt='sticky' title='sticky'>";

Put the sticky.gif image in the images folder
sticky.gif
sticky.gif

TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
2020-11-08 14:59:02
thanks !  (y)

...there is nothing for upload?
2025-11-27 19:53:09
After freeleech part add this:

		//==| sticky
if(get_user_class() >= 5){   // lowest class to make torrent sticky.

$sty = $_POST["sty"];
if ($sty == "yes") {
$sticky = "yes";
} else {
$sticky = "no";
}
}


In $ret = SQL_Query_exec("INSERT INTO torrents ....
after $freeleech,
add
$sticky,

after
after '".$freeleech."',

add
'".$sticky."',,

after <?php echo T_("FREE_LEECH_MSG");?> </td></tr>

add

//==| Sticky
?><tr><td align='left' class='css' valign='top'><?php echo T_("T_STICKY"); ?>:</td>
<td align='left' class='css-right' valign='top'><?php printf("<input name='sty' value='yes' type='radio' ".($sty ? " checked='checked'" : "")." /> ".T_("YES")."&nbsp;&nbsp;
<input name='sty' value='no' type='radio' ".(!$sty ? " checked='checked'" : "")." /> ".T_("NO").""); ?> &nbsp; &nbsp;<i><?php echo T_("STICKY_MSG");?></i></td></tr><?php







www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728