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
VIP torrent
Controls ·  Search New posts · Mark unread

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

2023-09-12 11:49:35
Hi guys, I need some "advice" to fix that problem (I'm not good on sql stuff and similar things)

To explain:
I have torrent which is VIP torrent (only VIP/or above class of users can download it) and I try to make it via functions part of code

in functions.php I put that part of code, and it WON'T work

function viponly() {
global $CURUSER;
if ($CURUSER["class"] <= 4 || $row["vip"]== yes)
show_error_msg("Sorry !!", "<img src='https://cdn0.iconfinder.com/data/icons/city-elements-flaticon/64/stop-stop_sign-traffic_sign-architecture_and_city-stopping-circulation-signaling-256.png' width='150'><h3 style='color:gold !important;'>Your account is temporarily unable to download this torrent.</h3><br /><div class='torrent-detail-2 shadow-2'> You must be a VIP user to download it!</div>", 1);
}


I have tried that too


function viponly() {
global $CURUSER;
if ($CURUSER["class"] <= "4" && $row["vip"] == "yes")
show_error_msg("Sorry !!", "<img src='https://cdn0.iconfinder.com/data/icons/city-elements-flaticon/64/stop-stop_sign-traffic_sign-architecture_and_city-stopping-circulation-signaling-256.png' width='150'><h3 style='color:gold !important;'>Your account is temporarily unable to download this torrent.</h3><br /><div class='torrent-detail-2 shadow-2'> You must be a VIP user to download it!</div>", 1);
}




userclass "4" is my VIP user
and row["vip"] (from torrents table) is VIP torrent

how to fix that damn problem, PLEASE so I have that result




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
Last edited by Botanicar on 2023-09-12 11:53:46
2023-09-12 15:33:02
whats $row["vip"] we need param to function
maybe vip == no as well

function viponly($vip) { 
global $CURUSER;
if ($CURUSER["class"] <= "4" && $vip == "no")
show_error_msg("Sorry !!", "<img src='https://cdn0.iconfinder.com/data/icons/city-elements-flaticon/64/stop-stop_sign-traffic_sign-architecture_and_city-stopping-circulation-signaling-256.png' width='150'><h3 style='color:gold !important;'>Your account is temporarily unable to download this torrent.</h3><br /><div class='torrent-detail-2 shadow-2'> You must be a VIP user to download it!</div>", 1);
}
Last edited by System on 2023-09-12 15:34:36
2023-09-12 18:27:36
Hi M-jay, and thanks for you help.

I have that error message when i do that:



Fatal error: Uncaught ArgumentCountError: Too few arguments to function viponly(), 0 passed in /home/exyusub/public_html/torrents-details.php on line 18 and exactly 1 expected in public_html/backend/functions.php:2180 Stack trace: #0 public_html/torrents-details.php(18): viponly() #1 {main} thrown in public_html/backend/functions.php on line 2180



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
2023-09-12 18:40:25
In details should be viponly($row['vip'])
2023-09-12 19:03:29
Thanks M-Jay, not even that working.

To be on the right track, I will try to explain which function I wanted so that only VIP members will read torrent details of VIP torrent

My VIP user class is 4
If in the torrent table VIP has value "yes"
do I want everyone under class 4 to receive a message that they cannot read details before they become in the VIP group

Hope I have explained it in a good way


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
2023-09-12 21:10:21
this works for me - i use > "4" for test so should be < "4"

place anywhere on torrent-details.php for test if it works we know we have to check $row['vip']

function viponly($vip) {
global $CURUSER;
if ($CURUSER["class"] > "4" && $vip == "yes")
show_error_msg("Sorry !!", "<img src='https://cdn0.iconfinder.com/data/icons/city-elements-flaticon/64/stop-stop_sign-traffic_sign-architecture_and_city-stopping-circulation-signaling-256.png' width='150'><h3 style='color:gold !important;'>Your account is temporarily unable to download this torrent.</h3><br /><div class='torrent-detail-2 shadow-2'> You must be a VIP user to download it!</div>", 1);
}
// is torrent vip yes/no or 1/0 or var_dump($row['vip']) to check
$vip = 'yes';
viponly($vip);
Last edited by M-jay warn on 2023-09-12 21:12:19
2023-09-12 21:23:36
Thanks mate, but not works on my script


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
Last edited by Botanicar on 2023-09-12 21:24:57
2023-09-14 18:31:08
Finally we have solved problem about VIP info for user under class VIP. This is instruction for it:

in torrent-details.php find


if ($row["banned"] == "yes")
{
print ("<center><b>" .T_("DOWNLOAD"). ": </b>".T_("BANNED")."!</center>");
}


and after that ADD


global $CURUSER;
if ($CURUSER["class"] <= "4" && $row["vip"] == "yes"){
show_error_msg("Sorry !!", "<img src='https://cdn0.iconfinder.com/data/icons/city-elements-flaticon/64/stop-stop_sign-traffic_sign-architecture_and_city-stopping-circulation-signaling-256.png' width='150'><h3 style='color:gold !important;'>Your account is temporarily unable to download this torrent.</h3><br /><div class='torrent-detail-2 shadow-2'> You must be a VIP user to download it!<br /><br /><button class='btn btn-dark' onclick='history.back()'>Go Back</button></div>", 1);
}




It was my fault for placing the MOD in the wrong place, I apologize to all of involved




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
2023-09-14 19:09:50

in torrent_detail.php and search

//DECIDE IF TORRENT EXISTS




add before

$mycats = $site_config['vip_cats'];
if ($CURUSER['class'] < 3 && in_array($row['category'], $mycats))

show_error_msg("Sorry !!", "<img src='https://cdn0.iconfinder.com/data/icons/city-elements-flaticon/64/stop-stop_sign-traffic_sign-architecture_and_city-stopping-circulation-signaling-256.png' width='150'><h3 style='color:gold !important;'>Your account is temporarily unable to download this torrent.</h3><br /><div class='torrent-detail-2 shadow-2'> You must be a VIP user to download it!</div>", 1);





in config.php add

$site_config['vip_cats'] = array('22', '28'); // category vip accees




change if ($CURUSER['class'] 3 with the number of your vip group


change array('22', '28') with your torrent category number which will be for vip members
you can put one or more categories of torrents which will be for VIP
2023-09-14 19:19:47
Thanks Niki,
this MOD works for torrent categories not for specific torrents...
If we have VIP marked no matter what category it is in, then this MOD will not work.
I don't want a separate VIP category, so the previous MOD was relevant for me

Thanks once again


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: 2
  • Members: 0
  • Guests online: 2
  • Comments: 3
  • Messages: 1,728