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
User Posts

Go to Profile

"m-jay, post: 68910, member: 20288":

had a issue with the torrent table looks like a mod (torrent team), had to remove that but apart from that seems to be working  :D

just add peers controller then update code below

//////connectable yes or know////////
if ($CURUSER["view_torrents"]=="yes") {
   $activeseed = get_row_count("peers", "WHERE userid = '$CURUSER[id]' AND seeder = 'yes'");
   $activeleech = get_row_count("peers", "WHERE userid = '$CURUSER[id]' AND seeder = 'no'");
   $stmt = DB::run("SELECT connectable FROM peers WHERE userid=" . $CURUSER["id"] . " LIMIT 1");
   $connect = $stmt->fetchColumn();
   if($connect == 'yes') {
   $connectable = "<b><font face=\"Verdana\" style=\"font-size: 10px\" color=\"#00FF00\">YES</font></b>";
   } elseif($connect == 'no') {
   $connectable = "<b><font face=\"Verdana\" style=\"font-size: 10px\" color=\"FFCCFF\">NO</font></b>";
   } else {
       $connectable ="<b><font face=\"Verdana\" style=\"font-size: 10px\" color=\"99CCFF\">Check Settings</font></b>";
  }
}

print("&nbsp;(<font color=#C0C0C0><i>Seeding:</i></font> <a href=\"javascript:popout(0)\"onclick=\"window.open('" .$site_config["SITEURL"]. "/peers/seeding1?id=" . $CURUSER["id"] . "','Seeding','width=350,height=350,scrollbars=yes')\"><font color='#EB7F27'><b>".$activeseed."</b></font></a>&nbsp;");
print("<font color=#C0C0C0><i>Leeching:</i> </font><a href=\"javascript:popout(0)\"onclick=\"window.open('" .$site_config["SITEURL"]. "/peers/leeching?id=" . $CURUSER["id"] . "','Seeding','width=350,height=350,scrollbars=yes')\"><font color='#EB7F27'><b>".$activeleech."</b></font></a>&nbsp;");
print("<font color=#C0C0C0><i>Connected:</i></font> ".$connectable.")");
//////connectable yes or know end of mod////////



Implemented and working without error.
Did clean up the fonts a bit and it now looks like this on my site >>
                    //////connectable yes or know////////
                   if ($CURUSER["view_torrents"]=="yes") {
                       $activeseed = get_row_count("peers", "WHERE userid = '$CURUSER[id]' AND seeder = 'yes'");
                       $activeleech = get_row_count("peers", "WHERE userid = '$CURUSER[id]' AND seeder = 'no'");
                       $stmt = DB::run("SELECT connectable FROM peers WHERE userid=" . $CURUSER["id"] . " LIMIT 1");
                       $connect = $stmt->fetchColumn();
                       if($connect == 'yes') {
                       $connectable = "<b><font color=\"#00FF00\">YES</font></b>";
                       } elseif($connect == 'no') {
                       $connectable = "<b><font color=\"FFCCFF\">NO</font></b>";
                       } else {
                           $connectable ="<b><font color=\"99CCFF\">Check Settings</font></b>";
                      }
                   }

                   print("&nbsp;(&nbsp;Seeding:&nbsp;<a href=\"javascript:popout(0)\"onclick=\"window.open('" .$site_config["SITEURL"]. "/peers/seeding1?id=" . $CURUSER["id"] . "','Seeding','width=350,height=350,scrollbars=yes')\" title='You are Seeding'><font color='#EB7F27'><b>".$activeseed."</b></font></a>&nbsp;");
                   print("Leeching:&nbsp;<a href=\"javascript:popout(0)\"onclick=\"window.open('" .$site_config["SITEURL"]. "/peers/leeching?id=" . $CURUSER["id"] . "','Seeding','width=350,height=350,scrollbars=yes')\" title='You are Leeching'><font color='#EB7F27'><b>".$activeleech."</b></font></a>&nbsp;");
                   print("Connected:&nbsp;".$connectable."&nbsp;)");
                   //////connectable yes or know end of mod////////


Will look at the correct bootstrap classes to use at later moment.
When using the files from the above zip, no more error but also no page loaded.
I swapped the code lines below $res = $this->nalModel->getnals();  and all working ok.
Let me try and learn from this one. Going to have to add a couple more pages maybe in the future.

Thanks for jumping on this one! Again much appreciated.
"m-jay, post: 68925, member: 20288":

Is Controller called Nals.php


It is now, I renamed it from Nal.php to Nals.php.
Getting HTTP ERROR 500 at this moment.

The models file is still named Nal.php
When trying to import the SQL, the server prompted the following error >>

[color=rgb(250, 197, 28)]SQL query: Copy


CREATE TABLE `users_trophies` (
 `userid` int(10) unsigned NOT NULL DEFAULT 0,
 `trophie` text NOT NULL,
 `reason` text NOT NULL,
 `trophiepic` text NOT NULL,
 UNIQUE KEY `userfriend` (`userid`,`reason`) USING HASH
) ENGINE=MyISAM DEFAULT CHARSET=utf8
MySQL said: Documentation

#1170 - BLOB/TEXT column 'reason' used in key specification without a key length[/color]


[color=rgb(255, 255, 255)]Server version: 10.3.21-MariaDB - Source distribution [/color]
"m-jay, post: 68921, member: 20288":

quick look at controller and its called Nals so try added 's'  <?php echo TTURL; ?>/nals' , the files look fine

Ok changed the link to nals. When I click this the index refreshed - but page did not load.
[USER=20288]@m-jay[/USER] ,

I am trying to create a page for our so called "not allowed list" which will inform users what content can not be posted (commercial releases).
For this purposes I took the rules page, and duplicated the SQL table from rules to nals.
I have also created a models file and a controller file (both attached).
But when I try to open the file I am only seeing " Oops somwthing went wrong, Admin have been notified if this continues please contact a member of staff. Thank you "

My link is: <a href='<?php echo TTURL; ?>/nal' class="list-group-item"><i class="fa fa-chevron-right"></i> <?php echo T_("SITE_NAL"); ?></a>

From the exception file I note the following >>

[color=rgb(251, 160, 38)]Call Stack

[0] File: /volume1/web/u2sites.xyz/bootstrap.u2site.xyz/index.php Line: 5
Function: Router->__construct
Call parameters[/color]

[color=rgb(255, 255, 255)]I am sure I am missing something, can u push me in the right direction?[/color]
Dear [USER=20288]@m-jay[/USER] , I am showing you all those options we currently have. This does not mean that you should or have to include them in your code.
If you do, then great!! We found them useful in running our site. They also do not have to look the same...and if you have better solutions for old
problems - then even better.

I will give you input and helping you test and hope that the end result is satisfying first of all to you...and next to all that gonna use the code.
Me...me just a small part of this.
"m-jay, post: 68902, member: 20288":

Here you go mate, managed to slim it slightly i just place on home to test

//////connectable yes or know////////
if ($CURUSER["view_torrents"]=="yes") {
   $activeseed = get_row_count("peers", "WHERE userid = '$CURUSER[id]' AND seeder = 'yes'");
   $activeleech = get_row_count("peers", "WHERE userid = '$CURUSER[id]' AND seeder = 'no'");
   $stmt = DB::run("SELECT connectable FROM peers WHERE userid=" . $CURUSER["id"] . " LIMIT 1");
   $connect = $stmt->fetchColumn();
   if($connect == 'yes') {
   $connectable = "<b><font face=\"Verdana\" style=\"font-size: 10px\" color=\"#00FF00\">YES</font></b>";
   } elseif($connect == 'no') {
   $connectable = "<b><font face=\"Verdana\" style=\"font-size: 10px\" color=\"FFCCFF\">NO</font></b>";
   } else {
       $connectable ="<b><font face=\"Verdana\" style=\"font-size: 10px\" color=\"99CCFF\">Check Settings</font></b>";
  }  
}

print("&nbsp;(<font color=#C0C0C0><i>Seeding:</i></font> <a href=\"javascript:popout(0)\"onclick=\"window.open('" .$site_config["SITEURL"]. "/seeding.php?id=" . $CURUSER["id"] . "','Seeding','width=350,height=350,scrollbars=yes')\"><font color='#EB7F27'><b>".$activeseed."</b></font></a>&nbsp;");
print("<font color=#C0C0C0><i>Leeching:</i> </font><a href=\"javascript:popout(0)\"onclick=\"window.open('" .$site_config["SITEURL"]. "/leeching.php?id=" . $CURUSER["id"] . "','Seeding','width=350,height=350,scrollbars=yes')\"><font color='#EB7F27'><b>".$activeleech."</b></font></a>&nbsp;");
print("<font color=#C0C0C0><i>Connected:</i></font> ".$connectable.")");
//////connectable yes or know end of mod////////


Whats this ?   - $site_config["SITEURL"]. "/leeching.php?id=" . $CURUSER["id"] and the seeding.php one might be useful  :D

will be moving a lot of things around got 3 controllers left before i add all classes keep a note of any edits
if you use this will you post, if you post your recent theme ill check against mine


[ATTACH type="full"]5666[/ATTACH]

Here are the seeding and leeching files.
"m-jay, post: 68897, member: 20288":

here is rough copy of shoutbox at minute only staff can edit/delete

add sql (we just add staff column will not effect anything)
upload files

on home controller find
echo '<iframe name="shout_frame" src="'.TTURL.'/shoutbox"

change TTURL.'/shoutbox"  to TTURL.'/newshout"


This one could not test, it loads the whole home page into the shoutbox frame.

[ATTACH type="full"]5664[/ATTACH]
"m-jay, post: 68894, member: 20288":

Which TT is your main site 2.08 if you post account, accountdetails and adminmodtask and shoutbox I'll have a look at some of them options
Might be able to piece it together i assume theres a condition in shoutbox
if $CURUSER[shoutboxbanned] a lot of it looks straight forward


The site is run on a very heavily modified TT 2.05

I am attaching a print out of the complete profile page and the settings page we have currently on the site.
To show you the options available.
In the profiles page it currently also has a section showing the users activity in some more details - like his uploaded torrents (if any), his snatched torrents and his completed download torrents.
You may also notice the IP History, Peers reset (which can be helpful to reset a users downloads). IP history may be something [USER=20382]@STorrents2020[/USER] is interested in as well.

https://www.torrenttrader.xyz/index.php?threads/limit-1-account-per-ip.9891/#post-67426    << IP History
"m-jay, post: 68893, member: 20288":

for nfo in torrents controller find
print("<textarea class='nfo' style='width:98%;height:100%;' rows='20' cols='20' readonly='readonly'>" . stripslashes($nfo) . "</textarea>");
replce with
print("<div><textarea class='nfo' style='width:98%;height:100%;' rows='20' cols='20' readonly='readonly'>" . stripslashes($nfo) . "</textarea></div>");


so far all the controllers are independent (torrents is little tricky) but all user settings together, all torrents together  this makes extending easier


A good example is user controller & torrent controller both have comments
so on torrent detail panel we link comment controller method $gettorrentcommentbyid($id); which shows torrent comments
&
on user detail panel we link comment controller method $getusercommentbyid($id); which shows users comments

i moved the torrent comments but havent looked at comments yet just trying to start moving everything
warnings is another good example we have a warning controller


NFO, confirmed fixed. Now looks ok on both Mozilla and Chromium
Allow me to take some screenshots from our current site...see below

[ATTACH type="full"]5656[/ATTACH]

[ATTACH type="full"]5657[/ATTACH]
"m-jay, post: 68705, member: 20288":

I'll look at that, I kept usercp & accountdetails controllers separate but that is good idea.
I think maybe user class
Use?/userdetails then extend
User/torrents using view user group permission


Just to give some more thoughts what I have in mind, hope yours are the same:
- Have users control all their settings/privacy/torrent settings/ view settings/ reset pw/etc etc....in one place.
- For mods to have their overriding power where they should have (based on their level), and just view things at their level
- For admin same, just more power and view what he/she should be able to view
- For owner, he should have all power and be able to view all

Note, mods are mods admins are admins. I am not thinking of making any separation in this.

Further you should allow for additional functions to be added. Like:
- banning of comments
- banning of downloading
- warning for this or that
-
"m-jay, post: 68889, member: 20288":

been playing with torrent controller as well but cant post that by itself its linked to a few things but here is how torrentdetails looks


Looks good!!

For the torrent details, please check how the NFO field works for both Mozilla and Chrome browsers.
Current code shows NFO block ok on Mozilla (like Firefox), but on Chrome/Edge the NFO will overflow into the Torrents comments.
Will copy for you later this morning...so when you wake up you can see it in action on our test site where you have registered ;-)

[ATTACH type="full"]5645[/ATTACH]
[ATTACH type="full"]5646[/ATTACH]
[ATTACH type="full"]5647[/ATTACH]
[ATTACH type="full"]5648[/ATTACH]
[ATTACH type="full"]5649[/ATTACH]
[ATTACH type="full"]5650[/ATTACH]
[ATTACH type="full"]5651[/ATTACH]
[ATTACH type="full"]5652[/ATTACH]
[ATTACH type="full"]5653[/ATTACH]
[ATTACH type="full"]5654[/ATTACH]
— 2020-07-27 01:25:06 in
Will we loose all the information that has been shared here?
What is the timeline?
Would this work if you have another mail server running on the server that serves smtp?
Or does it only work with PEAR mail?
"STorrents2020, post: 68806, member: 20382":

That can be about 6-7 lines if I’m correct, and that query work can be LEFT JOINED in one line, binding all of it together with AS and such.

What are you looking for, mysqli or PDO?

Pdo
Ok, I have got the following code in the old site, which shows a connected member how many torrents seeding and how many leeching plus the info if connectable or not.
Connectable meaning if all his running torrents match peers in the peers table.

The current code is as follows, but I do believe this with current standard can be simplified.

//////connectable yes or know////////
   
   if ($CURUSER["view_torrents"]=="yes") {
       $res2 = mysql_query("SELECT COUNT(*) FROM peers WHERE userid=" . $CURUSER["id"] . " AND seeder='yes'") or print(mysql_error());
       $row = mysql_fetch_row($res2);

       $activeseed = $row[0];

       $res2 = mysql_query("SELECT COUNT(*) FROM peers WHERE userid=" . $CURUSER["id"] . " AND seeder='no'") or print(mysql_error());

           $row = mysql_fetch_row($res2);

           $activeleech = $row[0];

       $res3 = mysql_query("SELECT connectable FROM peers WHERE userid=" . sqlesc($CURUSER["id"]) . " LIMIT 1") or print(mysql_error());

           if($row = mysql_fetch_row($res3)){

       $connect = $row[0];

           if($connect == "yes"){

       $connectable = "<b><font face=\"Verdana\" style=\"font-size: 10px\" color=\"#00FF00\">YES</font></b>";

       }else{

       $connectable = "<b><font face=\"Verdana\" style=\"font-size: 10px\" color=\"FFCCFF\">NO</font></b>";

       }

       }else{

       $connectable ="<b><font face=\"Verdana\" style=\"font-size: 10px\" color=\"99CCFF\">Check Settings</font></b>";

       }              
}

print("&nbsp;(<font color=#C0C0C0><i>Seeding:</i></font> <a href=\"javascript:popout(0)\"onclick=\"window.open('" .$site_config["SITEURL"]. "/seeding.php?id=" . $CURUSER["id"] . "','Seeding','width=350,height=350,scrollbars=yes')\"><font color='#EB7F27'><b>".$activeseed."</b></font></a>&nbsp;");

print("<font color=#C0C0C0><i>Leeching:</i> </font><a href=\"javascript:popout(0)\"onclick=\"window.open('" .$site_config["SITEURL"]. "/leeching.php?id=" . $CURUSER["id"] . "','Seeding','width=350,height=350,scrollbars=yes')\"><font color='#EB7F27'><b>".$activeleech."</b></font></a>&nbsp;");

print("<font color=#C0C0C0><i>Connected:</i></font> ".$connectable.")");

//////connectable yes or know end of mod////////  
               


I am attaching my current topnavbar.php for reference
Wow! Amazed again. Compliments on your skill!

Found this site >> https://mdbootstrap.com/  

I am sure u long long know about this one! :cool:
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: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728