Copied from Uffeno1 post (all credit to authors)
SQL
torrents.php, torrents-search.php or where you want to your sticky torrents shown.
change:
to:
in the big query
after:
insert:
index.php
in the big query
after:
insert:
and at the end.
change:
to:
torrent-edit.php
after:
insert:
after:
add:
backend / function.php
after:
insert:
Put the sticky.gif image in the images folder
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
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)
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)
