"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(" (<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> ");
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> ");
print("<font color=#C0C0C0><i>Connected:</i></font> ".$connectable.")");
//////connectable yes or know end of mod////////
//////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(" ( Seeding: <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> ");
print("Leeching: <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> ");
print("Connected: ".$connectable." )");
//////connectable yes or know end of mod////////"m-jay, post: 68925, member: 20288":
Is Controller called Nals.php
"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
"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(" (<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> ");
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> ");
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
"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"
"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
"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
"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
"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
"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?
//////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(" (<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> ");
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> ");
print("<font color=#C0C0C0><i>Connected:</i></font> ".$connectable.")");
//////connectable yes or know end of mod////////