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
MODS/HACKS By Category for @M-Jay
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / M-BiTsy / M-BiTsy Support

2020-08-14 13:12:38
"m-jay, post: 69027, member: 20288":

download ban, shoutbox ban, ip history, user ip log and check ip on signup all added  :D

Wow wow wow!!

- [MOD]Bann user from sending pms >> https://www.torrenttrader.xyz/index.php?threads/mod-bann-user-from-sending-pms.2288/    ;)
If It Ain't Dutch, It Ain't Much!!
2020-08-14 18:31:31
"m-jay, post: 68988, member: 20288":

users can now edit there own shouts within 2 minutes :D that can be knocked off
Word censor in shoutbox  thats already part of 2.08
client ban in db is done


The [E] should have been gone after 2 min.

[ATTACH type="full" alt="Shoutbox editing.PNG"]5726[/ATTACH]

Let me test again...I visit the page again, [E} is gone

Ahh, ok it is linked to the refresh of the iFrame!
So the 2min for the line no matter...5min it is at this moment. Mmmm
Shoutbox editing.PNG
Shoutbox editing.PNG

If It Ain't Dutch, It Ain't Much!!
2020-08-14 18:32:38
Maybe 3/4 minutes
2020-08-14 18:36:45
"m-jay, post: 69039, member: 20288":

Maybe 3/4 minutes

Would my thought be correct?

Please see the updated list above!
If It Ain't Dutch, It Ain't Much!!
2020-08-15 20:21:24
thanks for updating post, youtube in torrenttable / details, and them friend ones can be removed  :D
ive not added friend block yet but all rest is there just trying to make into one db table instead on two
i need more examples as well for style not keen on big blocks
Untitled.png
Untitled.png
Untitled1.png
Untitled1.png
2020-08-16 03:39:31
At our current site the youtube is also displayed as big block...

[ATTACH type="full" alt="1597549147551.png"]5752[/ATTACH]
1597549147551.png
1597549147551.png

If It Ain't Dutch, It Ain't Much!!
2020-08-21 15:16:58
"m-jay, post: 69131, member: 20288":

github updated  https://github.com/M-jay84/Torrent-Trader-MVC-PDO-OOP

to install edit siteurl & database details in config (config needs replacing its $config now, not $site_config) and transfer all

then run sql to edit style and language

ALTER TABLE users DROP stylesheet;
ALTER TABLE users DROP language;
ALTER TABLE users ADD stylesheet varchar(30) NOT NULL default 'default';
ALTER TABLE users ADD language varchar(30) NOT NULL default 'english';


here is a link to header & navbar edits https://github.com/M-jay84/Torrent-Trader-MVC-PDO-OOP/compare/25-full-sessions...master at bottom of page


I'd make sql backup first
If install does not work will you please try empty the session table, cookies may remember old way


Not wanting to loose any data I went through the last months changes for the database, and created the below sql update.
Looks to have worked ok, added without error.

ALTER TABLE users DROP stylesheet;

ALTER TABLE users DROP language;

ALTER TABLE users ADD stylesheet varchar(30) NOT NULL default 'default';

ALTER TABLE users ADD language varchar(30) NOT NULL default 'english';

ALTER TABLE users ADD shoutboxpos char(3) NOT NULL default 'no';

ALTER TABLE users ADD downloadbanned char(3) NOT NULL default 'no';

ALTER TABLE torrents ADD tube varchar(100) DEFAULT NULL;

ALTER TABLE torrents DROP image1;

ALTER TABLE torrents ADD image1 text default NULL;

ALTER TABLE torrents DROP image2;

ALTER TABLE torrents ADD image2 text default NULL;

DROP TABLE friends;
CREATE TABLE IF NOT EXISTS `friends` (
`id` int(10) unsigned NOT NULL auto_increment,
`userid` int(10) unsigned NOT NULL default '0',
`friendid` int(10) unsigned NOT NULL default '0',
`friend` varchar(6) NOT NULL DEFAULT 'maybe',
PRIMARY KEY (`id`),
UNIQUE KEY `userfriend` (`userid`,`friendid`)
) ENGINE=MyISAM;

DROP TABLE iplog;
CREATE TABLE `iplog` (
 `id` int(10) UNSIGNED NOT NULL,
 `ip` varchar(15) NOT NULL DEFAULT '',
 `userid` int(10) UNSIGNED NOT NULL DEFAULT '0',
 `added` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
 `lastused` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
 `timesused` int(10) NOT NULL DEFAULT '1'
) ENGINE=MyISAM;

DROP TABLE thanks;
CREATE TABLE `thanks` (
 `id` int(10) unsigned NOT NULL auto_increment,
 `user` int(10) unsigned NOT NULL default '0',
 `thanked` int(10) unsigned NOT NULL default '0',
 `added` datetime NOT NULL default '0000-00-00 00:00:00',
 `type` text NOT NULL,
 PRIMARY KEY  (`id`),
 KEY `user` (`user`),
 KEY `thanked` (`thanked`)
) ENGINE=MyISAM;

DROP TABLE staffmessages;
CREATE TABLE `staffmessages` (
 `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
 `sender` int(10) UNSIGNED NOT NULL DEFAULT 0,
 `added` datetime DEFAULT NULL,
 `msg` text DEFAULT NULL,
 `subject` varchar(100) NOT NULL DEFAULT '',
 `answeredby` int(10) UNSIGNED NOT NULL DEFAULT 0,
 `answered` tinyint(1) NOT NULL DEFAULT 0,
 `answer` text DEFAULT NULL,
 PRIMARY KEY (`id`)
) ENGINE=MyISAM;

DROP TABLE agents;
CREATE TABLE `agents` (
 `agent_id` int(10) unsigned NOT NULL auto_increment,
 `agent_name` varchar(255) NOT NULL DEFAULT '',
 `hits` int(10) UNSIGNED NOT NULL DEFAULT 0,
 `ins_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
 PRIMARY KEY (`agent_id`),
 UNIQUE KEY `agent_name` (`agent_name`) USING HASH
) ENGINE=MyISAM;

DROP TABLE sessions;
create table sessions(
 id serial,
 sess_id text not null,
 _access integer,
 data text,
 primary key (id)
);

If It Ain't Dutch, It Ain't Much!!
2020-08-21 17:06:59
"i added your sent theme straight into theme folder and works 100% "

Damn...let me try again!
"m-jay, post: 69139, member: 20288":

if you still have errors let me know and send exception error file and edit core/init at top and ill come on and debug
// Error Reporting
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
// error_reporting(E_ALL);



Loaded ok! :p:D

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

I have set the code for error reporting, so you will be able to iron them out as you go.
1598029570909.png
1598029570909.png

If It Ain't Dutch, It Ain't Much!!
2020-08-21 18:07:10
when switching getting following error:

Warning: require_once(languages/English.php): failed to open stream: No such file or directory in site/helpers/a_start_function.php on line 67 Call Stack: 0.0001 402520 1. {main}() site/index.php:0 0.0134 1146392 2. Router->__construct() site/index.php:5 0.0140 1172120 3. Home->index() site/core/Router.php:45 0.0140 1172120 4. dbconn() site/controllers/Home.php:9 Fatal error: require_once(): Failed opening required 'languages/English.php' (include_path='.:/usr/share/pear') in site/helpers/a_start_function.php on line 67 Call Stack: 0.0001 402520 1. {main}() site/index.php:0 0.0134 1146392 2. Router->__construct() site/index.php:5 0.0140 1172120 3. Home->index() site/core/Router.php:45 0.0140 1172120 4. dbconn() site/controllers/Home.php:9

If It Ain't Dutch, It Ain't Much!!
2020-08-27 11:02:28
github updated transfer all check bottom of config
empty block table (not drop) update with block.sql
add request sql

In your theme navbar request link needs changing to request

the request needs a good test the code was complex some of the notices are a bit off like this is number two this was just to help locate stuff think i got most of them
sql.zip
Download
2020-08-27 11:25:45
First draft of request controller
<?php
class Request extends Controller
{

   public function index()
   {
       dbconn(true);
       global $config;
       if ($config["MEMBERSONLY"]) {
           loggedinonly();
           if ($_SESSION["view_torrents"] == "no") {
               show_error_msg("Error!", "You do not have the proper rights to view requests!", 1);
           }
       }
       if ($config["REQUESTSON"]) {
           stdhead("Requests");
           begin_frame(T_('REQUESTS'));
           print("<a href=$config[SITEURL]/request/makereq><button  class='btn btn-sm btn-success'>Add New Request</button></a>&nbsp;
                  <a href=$config[SITEURL]/request?requestorid=$_SESSION[id]><button  class='btn btn-sm btn-success'>View my requests</button></a>");
           $categ = (int) $_GET["category"];
           $requestorid = (int) $_GET["requestorid"];
           $sort = $_GET["sort"];
           $search = $_GET["search"];
           $filter = $_GET["filter"];
           $search = " AND requests.request like '%$search%' ";
           if ($sort == "votes") {
               $sort = " order by hits desc ";
           } else if ($sort == "request") {
               $sort = " order by request ";
           } else {
               $sort = " order by filled asc ";
           }
           if ($filter == "true") {
               $filter = " AND requests.filledby = 0 ";
           } else {
               $filter = "";
           }
           if ($requestorid != null) {
               if (($categ != null) && ($categ != 0)) {
                   $categ = "WHERE requests.cat = " . $categ . " AND requests.userid = " . $requestorid;
               } else {
                   $categ = "WHERE requests.userid = " . $requestorid;
               }
           } else if ($categ == 0) {
               $categ = '';
           } else {
               $categ = "WHERE requests.cat = " . $categ;
           }
           $res = DB::run("SELECT count(requests.id) FROM requests inner join categories on requests.cat = categories.id inner join users on requests.userid = users.id  $categ $filter $search");
           $row = $res->fetch(PDO::FETCH_ASSOC);
           $count = $row[0];
           $perpage = 50;
           list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, $config['SITEURL'] . "/request?" . "category=" . $_GET["category"] . "&sort=" . $_GET["sort"] . "&");
           $res = DB::run("SELECT users.downloaded, users.uploaded, users.username, users.privacy, requests.filled, requests.comments,
           requests.filledby, requests.id, requests.userid, requests.request, requests.added, requests.hits, categories.name as cat,
            categories.parent_cat as parent_cat
            FROM requests inner join categories on requests.cat = categories.id inner join users on requests.userid = users.id  $categ
             $filter $search $sort $limit");
           $num = $res->rowCount();
           print("<br><br><CENTER><form method=get action=$config[SITEURL]/request>");
           print(T_('SEARCH') . ": <input type=text size=30 name=search>");
           print("<input type=submit align=center value=" . T_('SEARCH') . " style='height: 22px'>\n");
           print("</form></CENTER><br>");
           echo $pagertop;
           echo "<Table border=0 width=100% cellspacing=0 cellpadding=0><TR><TD width=50% align=left valign=bottom>";
           print("<p>" . T_('SORT_BY') . " <a href=" . $config['SITEURL'] . "/request?category=" . $_GET['category'] . "&filter=" . $_GET['filter'] . "&sort=votes>" . T_('VOTES') . "</a>,
                <a href=" . $config['SITEURL'] . "/request?category=" . $_GET['category'] . "&filter=" . $_GET['filter'] . "&sort=request>Request Name</a>, or
                <a href=" . $config['SITEURL'] . "/request?category=" . $_GET['category'] . "&filter=" . $_GET['filter'] . "&sort=added>" . T_('DATE_ADDED') . "</a>.</p>");
           print("<form method=get action=$config[SITEURL]/request>");
           ?>
            </td><td width=100% align=right valign=bottom>
            <select name="category">
             <option value="0"><?php print("" . T_('SHOW_ALL') . "\n");?></option>
           <?php
           $cats = genrelist();
           $catdropdown = "";
           foreach ($cats as $cat) {
               $catdropdown .= "<option value=\"" . $cat["id"] . "\"";
               $catdropdown .= ">" . htmlspecialchars($cat["parent_cat"]) . ": " . htmlspecialchars($cat["name"]) . "</option>\n";
           }
           ?>
              <?php $catdropdown?>
              </select>
           <?php
           print("<input type=submit align=center value=" . T_('DISPLAY') . " style='height: 22px'>\n");
           print("</form></td></tr></table>");
           print("<form method=post action=$config[SITEURL]/request/takedelreq>");
           print("<div class='table-responsive'> <table class='table table-striped'><thead><tr>");
           print("<th>" . T_('REQUESTS') . "</th>
                  <th>" . T_('TYPE') . "</th>
                  <th>" . T_('DATE_ADDED') . "</th>
                  <th>" . T_('ADDED_BY') . "</th>
                  <th>" . T_('FILLED') . "</th>
                  <th>" . T_('FILLED_BY') . "</th>
                  <th>" . T_('VOTES') . "</th>
                  <th>Comm</th>
                  <th>" . T_('DEL') . "</th></tr></thead>");
           for ($i = 0; $i < $num; ++$i) {
               $arr = $res->fetch(PDO::FETCH_ASSOC);
               $privacylevel = $arr["privacy"];
               if ($arr["downloaded"] > 0) {
                   $ratio = number_format($arr["uploaded"] / $arr["downloaded"], 2);
                   $ratio = "<font color=" . get_ratio_color($ratio) . "><b>$ratio</b></font>";
               } else if ($arr["uploaded"] > 0) {
                   $ratio = "Inf.";
               } else {
                   $ratio = "---";
               }
               $res2 = DB::run("SELECT username from users where id=" . $arr['filledby']);
               $arr2 = $res2->fetch(PDO::FETCH_ASSOC);
               if ($arr2['username']) {
                   $filledby = $arr2['username'];
               } else {
                   $filledby = " ";
               }

               if ($privacylevel == "strong") {
                   if (get_user_class() >= 5) {
                       $addedby = "<td class=table_col2 align=center><a href=$config[SITEURL]/users/profile?id=$arr[userid]><b>$arr[username] ($ratio)</b></a></td>";
                   } else {
                       $addedby = "<td class=table_col2 align=center><a href=$config[SITEURL]/users/profile?id=$arr[userid]><b>$arr[username] (----)</b></a></td>";
                   }
               } else {
                   $addedby = "<td class=table_col2 align=center><a href=$config[SITEURL]/users/profile?id=$arr[userid]><b>$arr[username] ($ratio)</b></a></td>";
               }
               $filled = $arr['filled'];
               if ($filled) {
                   $filled = "<a href=$filled><font color=green><b>Yes</b></font></a>";
                   $filledbydata = "<a href=$config[SITEURL]/users/profile?id=$arr[filledby]><b>$arr2[username]</b></a>";
               } else {
                   $filled = "<a href=$config[SITEURL]/request/reqdetails?id=$arr[id]><font color=red><b>No</b></font></a>";
                   $filledbydata = "<i>nobody</i>";
               }
               print("<tr><td class=table_col1 align=left><a href=$config[SITEURL]/request/reqdetails?id=$arr[id]><b>$arr[request]</b></a></td>" .
                     "<td class=table_col2 align=center>$arr[parent_cat]: $arr[cat]</td><td align=center
                     class=table_col1>$arr[added]</td>$addedby<td
                     class=table_col2>$filled</td>
                     <td class=table_col1>$filledbydata</td>
                     <td class=table_col2><a href=$config[SITEURL]/request/votesview?requestid=$arr[id]><b>$arr[hits]</b></a></td>
                     <td class=table_col1 align=center><a href=$config[SITEURL]/request/reqdetails?id=$arr[id]><b>" . $arr["comments"] . "");
               if ($_SESSION['id'] == $arr['userid'] || get_user_class() > 5) {
                   print("<td class=table_col1><input type=\"checkbox\" name=\"delreq[]\" value=\"" . $arr['id'] . "\" />&nbsp;<a href='$config[SITEURL]/request/takereqedit?id=$arr[id]'><img src='$config[SITEURL]/images/requests/edit.png' title=" . T_("EDIT") . " alt=" . T_("EDIT") . "></a></td>");
               } else {
                   print("<td class=table_col1>&nbsp;</td>");
               }
               print("</tr>\n");
           }
           print("</table></div>");
           print("<p align=right><input type=submit value=" . T_('DO_DELETE') . "></p>");
           print("</form>");
           echo $pagerbottom;
       
           end_frame();
           stdfoot();
       } else {
           autolink(TTURL . "/index.php", "Request are not available");
           stdhead();
           show_error_msg(T_("Request Off"), "Request are not available", 0);
           stdfoot();
           die;
       }
   }

   public function makereq()
   {
       dbconn();
       global $config;
       loggedinonly();
       stdhead("Requests Page");
       begin_frame("" . T_('MAKE_REQUEST') . "");
       print("<br>\n");
       if ($config["REQUESTSON"]) {
           print("<a href=$config[SITEURL]/request><button  class='btn btn-sm btn-success'>All Request</button></a>&nbsp;
                  <a href=$config[SITEURL]/request?requestorid=$_SESSION[id]><button  class='btn btn-sm btn-success'>View my requests</button></a>");
           $where = "WHERE userid = " . $_SESSION["id"] . "";
           $res2 = DB::run("SELECT * FROM requests $where");
           $num2 = $res2->rowCount();
           ?>
           <center><big><b><font color=red>If this is abused, it will be for VIP only!</font></b></big>
           <table border=0 width=100% cellspacing=0 cellpadding=3>
           <tr><td><li><b>Before posting a request, please make sure to search the site first to make sure it's not already posted.</li>
           <li><u>1 request per day per member</u>. Any more than that will be deleted by a moderator.</li></b>
           </td></tr>
           <tr><td class=colhead align=left><?php print("" . T_('SEARCH') . " " . T_('TORRENT') . "");?></td></tr>
           <tr><td align=left><form method="get" action=$config[SITEURL]/torrents/search>
           <input type="text" name="<?php print("" . T_('SEARCH') . "\n");?>" size="40" value="<?php htmlspecialchars($searchstr)?>" />
           in
           <select name="cat">
           <option value="0">(all types)</option>
           <?php
           $cats = genrelist();
           $catdropdown = "";
           foreach ($cats as $cat) {
               $catdropdown .= "<option value=\"" . $cat["id"] . "\"";
               if ($cat["id"] == (int) $_GET["cat"]) {
                   $catdropdown .= " selected=\"selected\"";
               }
               $catdropdown .= ">" . htmlspecialchars($cat["parent_cat"]) . ": " . htmlspecialchars($cat["name"]) . "</option>\n";
           }
           $deadchkbox = "<input type=\"checkbox\" name=\"incldead\" value=\"1\"";
           if ($_GET["incldead"]) {
               $deadchkbox .= " checked=\"checked\"";
           }
           $deadchkbox .= " /> " . T_('INC_DEAD') . "\n";
           $catdropdown ?>
           </select>
           <?php $deadchkbox?>
           <input type="submit" value="<?php print("" . T_('SEARCH') . "\n");?>"  />
           </form>
           </td></tr></table>
           <li><b>When possible, please provide a full scene release name.<br>
           You can check out <a href=pre.php>our pre database</a> (nobles+only) <br>
           or use public sites such as NFOrce or VCDQ for help with that.</b></li>
           <?php
           print("<form method=post action=$config[SITEURL]/request/confirmreq><a name=add id=add></a>\n");
           print("<CENTER><table border=0 width=600 cellspacing=0 cellpadding=3>\n");
           print("<tr><td class=colhead align=center><B>" . T_('MAKE_REQUEST') . "</B></a></td><tr>\n");
           print("<tr><td align=center><b>Title: </b><input type=text size=40 name=requesttitle>");
           ?>
           <select name="cat">
           <option value="0"><?php echo "(" . T_("ALL") . " " . T_("TYPES") . ")"; ?></option>
           <?php
           $cats = genrelist();
           $catdropdown = "";
           foreach ($cats as $cat) {
               $catdropdown .= "<option value=\"" . $cat["id"] . "\"";
               if ($cat["id"] == $_GET["cat"]) {
                   $catdropdown .= " selected=\"selected\"";
               }
               $catdropdown .= ">" . htmlspecialchars($cat["parent_cat"]) . ": " . htmlspecialchars($cat["name"]) . "</option>\n";
           }
           echo $catdropdown ?>
           </select>
           <?php
           print("<tr><td align=center>Additional Information <b>(Optional - but be generous!</b>)<br><textarea name=descr rows=7
           cols=60></textarea>\n");
           print("<tr><td align=center><button  class='btn btn-sm btn-success'>" . T_('SUBMIT') . "</button>\n");
           print("</form>\n");
           print("</table></CENTER>\n");
       } else {
           echo "<b><font color=red>Sorry, requests are currently disabled.";
       }
       end_frame();
       stdfoot();
   }

   public function addvote()
   {
       dbconn();
       global $config;
       stdhead("Vote");
       begin_frame("" . T_('VOTES') . "");
       $requestid = (int) $_GET["id"];
       $userid = (int) $_SESSION["id"];
       $res = DB::run("SELECT * FROM addedrequests WHERE requestid=$requestid and userid = $userid");
       $arr = $res->fetch(PDO::FETCH_ASSOC);
       $voted = $arr;
       if ($voted) {
       ?>
       <p>You've already voted for this request, only 1 vote for each request is allowed</p><p>Back to <a href=$config[SITEURL]/request><b>requests</b></a></p>
       <?php
       } else {
           DB::run("UPDATE requests SET hits = hits + 1 WHERE id=$requestid");
           DB::run("INSERT INTO addedrequests VALUES(0, $requestid, $userid)");
           print("<p>Successfully voted for request $requestid</p><p>Back to <a href=$config[SITEURL]/request><b>requests</b></a></p>");
       }
       end_frame();
       stdfoot();
   }

   public function votesview()
   {
       dbconn(false);
       global $config;
       loggedinonly();
       $requestid = (int) $_GET['requestid'];
       $res2 = DB::run("select count(addedrequests.id) from addedrequests inner join users on addedrequests.userid = users.id inner join requests on addedrequests.requestid = requests.id WHERE addedrequests.requestid =$requestid");
       $row = $res2->fetch(PDO::FETCH_ASSOC);
       $count = $row[0];
       $perpage = 50;
       list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, $_SERVER["PHP_SELF"] . "?");
       $res = DB::run("select users.id as userid,users.username, users.downloaded,users.uploaded, requests.id as requestid, requests.request from addedrequests inner join users on addedrequests.userid = users.id inner join requests on addedrequests.requestid = requests.id WHERE addedrequests.requestid =$requestid $limit");
       stdhead("Votes");
       $res2 = DB::run("select request from requests where id=$requestid");
       $arr2 = $res2->fetch(PDO::FETCH_ASSOC);
       begin_frame("" . T_('VOTES') . ": <a href=$config[SITEURL]/request/reqdetails?id=$requestid>$arr2[request]</a>");
       print("<a href=$config[SITEURL]/request><button  class='btn btn-sm btn-success'>All Request</button></a>&nbsp;
       <a href=$config[SITEURL]/request?requestorid=$_SESSION[id]><button  class='btn btn-sm btn-success'>View my requests</button></a>");
       print("<p><center><a href=$config[SITEURL]/request/addvote?id=$requestid><b>" . T_('VOTE_FOR_THIS') . " " . T_('REQUEST') . "</b></a></p>");
       if ($res->rowCount() == 0) {
           print("<p align=center><b>" . T_('NOTHING_FOUND') . "</b></p>\n");
       } else {
           print("<center><div class='table-responsive'> <table class='table table-striped' width='60%'><thead><tr>");
           print("<th>" . T_('USERNAME') . "</th><th>" . T_('UPLOADED') . "</td>
                  <th>" . T_('DOWNLOADED') . "</th><th>" . T_('RATIO') . "</th></tr></thead>");
           while ($arr = $res->fetch(PDO::FETCH_ASSOC)) {
               if ($arr["downloaded"] > 0) {
                   $ratio = number_format($arr["uploaded"] / $arr["downloaded"], 3);
                   $ratio = "<font color=" . get_ratio_color($ratio) . ">$ratio</font>";
               } else
               if ($arr["uploaded"] > 0) {
                   $ratio = "Inf.";
               } else {
                   $ratio = "---";
               }
               $uploaded = mksize($arr["uploaded"]);
               $joindate = "$arr[added] (" . get_elapsed_time(sql_timestamp_to_unix_timestamp($arr["added"])) . " ago)";
               $downloaded = mksize($arr["downloaded"]);
               if ($arr["enabled"] == 'no') {
                   $enabled = "<font color = red>No</font>";
               } else {
                   $enabled = "<font color = green>Yes</font>";
               }
               print("<tr><td class=table_col1><a href=$config[SITEURL]/users/profile?id=$arr[userid]><b>$arr[username]</b></a></td><td align=left class=table_col2>$uploaded</td><td align=left class=table_col1>$downloaded</td><td align=left class=table_col2>$ratio</td></tr>\n");
           }
           print("</table></center><BR><BR>\n");
       }
       end_frame();
       stdfoot();
   }

   public function confirmreq()
   {
       dbconn(true);
       global $config;
       $requesttitle = $_POST["requesttitle"];
       if (!$requesttitle) {
           show_error_msg("Error!", "You must enter a request!", 1);
       }
       $cat = $_POST["cat"];
       if ($cat == 0) {
           show_error_msg("Error!", "Category cannot be empty!", 1);
       }
       $descr = $_POST["descr"];
       DB::run("INSERT INTO requests (hits, userid, cat, request, descr, added) VALUES(?,?,?,?,?,?)", [1, $_SESSION['id'], $cat, $requesttitle, $descr, get_date_time()]);
       $id = DB::lastInsertId();
       DB::run("INSERT INTO addedrequests (requestid,userid) VALUES($id, $_SESSION[id])");
       DB::run("INSERT INTO shoutbox (user,message,date,userid) VALUES('System', '$_SESSION[username] has made a request for [url=" . $config['SITEURL'] . "/request/reqdetails?id=" . $id . "]" . $requesttitle . "[/url]', now(), '0')");
       write_log("$requesttitle was added to the Request section");
       header("Refresh: 0; url=$config[SITEURL]/request");
   }

   public function takereqedit()
   {
       dbconn(true);
       global $config;
       if (get_user_class() < 5) {
           show_error_msg("Error", "Access denied.", 1);
       }
       $id = (int) $_GET["id"];
       if (!is_valid_id($id)) {
           show_error_msg("Error", "You must select a category to put the request in!");
       }
       $descr = $_POST["desc"];
       $cat = $_POST["cat"];
       $filled = $_POST["filled"];
       $request = $_POST["request"];
       $filledby = $_POST["filledby"];
       if (!empty($_POST)) {
           if (!$filled) {
               DB::run("UPDATE requests SET cat=?, request=?, descr=?, filled =?, filled=? WHERE id = ?", [$cat, $request, $descr, 'yes', $filled, $id]);
           } else {
               DB::run("UPDATE requests SET cat=?, filledby =?, request=?, descr=?, filled =?  WHERE id =? ", [$cat, 0, $request, $descr, 'no', $id]);
           }
           header("Refresh: 0; url=$config[SITEURL]/request/reqdetails?id=$id");
       }
       $res = DB::run("SELECT * FROM requests WHERE id =$id");
       $arr = $res->fetch(PDO::FETCH_ASSOC);
       stdhead("Edit Request");
       begin_frame("Edit Request");
       print("<a href=$config[SITEURL]/request><button  class='btn btn-sm btn-success'>All Request</button></a>&nbsp;
       <a href=$config[SITEURL]/request?requestorid=$_SESSION[id]><button  class='btn btn-sm btn-success'>View my requests</button></a>");
       ?>
       <div><center>
       <form name="form" action="takereqedit&id=<?php echo $arr['id']; ?>" method="post">
       <input type="hidden" name="filledby" value="<?php echo $arr['filledby']; ?>" />
       <label for="cat">Change Cat id</label>
       <input type="text" name="cat" value="<?php echo $arr['id']; ?>" id="cat"><br>
       <label for="request">Request Tilte</label>
       <input type="text" name="request" value="<?php echo $arr['request']; ?>" id="request"><br>
       <label for="descr">Description</label>
       <input type="text" name="descr" value="<?php echo $arr['descr']; ?>" id="descr"><br>
       <label for="filled">Url To Torrent</label>
       <input type="text" name="filled" value="<?php echo $arr['filled']; ?>" id="filled"><br>
       <input type="submit" value="Update">
       </form>
       </center></div>
       <?php
       end_frame();
       stdfoot();
   }

   public function takedelreq()
   {
       dbconn(true);
       global $config;
       stdhead("Delete");
       begin_frame("Delete");
       if (get_user_class($_SESSION) > 5) {
           if (empty($_POST["delreq"])) {
               print("<CENTER>You must select at least one request to delete.</CENTER>");
               end_frame();
               stdfoot();
               die;
           }
           $do = "DELETE FROM requests WHERE id IN (" . implode(", ", $_POST['delreq']) . ")";
           $do2 = "DELETE FROM addedrequests WHERE requestid IN (" . implode(", ", $_POST['delreq']) . ")";
           $res2 = DB::run($do2);
           $res = DB::run($do);
           print("<CENTER>Request Deleted OK</CENTER>");
           echo "<BR><BR>";
       } else {
           foreach ($_POST['delreq'] as $del_req) {
               $query = DB::run("SELECT * FROM requests WHERE userid=$_SESSION[id] AND id = $del_req");
               $num = $query->rowCount();
               if ($num > 0) {
                   $res2 = DB::run("DELETE FROM requests WHERE id IN ($del_req)");
                   $res = DB::run("DELETE FROM addedrequests WHERE requestid IN ($del_req)");
                   print("<CENTER>Request ID $del_req Deleted</CENTER>");
               } else {
                   print("<CENTER>No Permission to delete Request ID $del_req</CENTER>");
               }
           }
       }
       end_frame();
       stdfoot();
   }

   public function reqreset()
   {
       dbconn();
       global $config;
       loggedinonly();
       stdhead("Reset Request");
       begin_frame("Reset");
       $requestid = (int) $_GET["requestid"];
       $res = DB::run("SELECT userid, filledby FROM requests WHERE id =$requestid");
       $arr = $res->fetch(PDO::FETCH_ASSOC);
       if (($_SESSION['id'] == $arr['userid']) || (get_user_class() >= 4) || ($_SESSION['id'] == $arr['filledby'])) {
           DB::run("UPDATE requests SET filled='', filledby=0 WHERE id =$requestid");
           print("Request $requestid successfully reset.");
       } else {
           print("Sorry, cannot reset a request when you are not the owner");
       }
       end_frame();
       stdfoot();
   }

   public function reqfilled()
   {
       dbconn();
       global $config;
       loggedinonly();
       stdhead("Fill Request");
       begin_frame("Request Filled");
       $filledurl = $_GET["filledurl"];
       $requestid = (int) $_GET["requestid"];
       $res = DB::run("SELECT users.username, requests.userid, requests.request FROM requests inner join users on requests.userid = users.id where requests.id = $requestid");
       $arr = $res->fetch(PDO::FETCH_ASSOC);
       $res2 = DB::run("SELECT username FROM users where id =" . $_SESSION['id']);
       $arr2 = $res2->fetch(PDO::FETCH_ASSOC);
       $msg = "Your request $requestid ";
       $msg2 = "Your Request Filled";
       DB::run("UPDATE requests SET filled = '$filledurl', filledby = $_SESSION[id] WHERE id = $requestid");
       DB::run("INSERT INTO messages (poster, sender, receiver, added, subject, msg) VALUES (?,?,?,?,?,?)", [0, 0, $arr['userid'], get_date_time(), $msg2, $msg]);
       print("<div align=left>Request $requestid was successfully filled with <a href=$filledurl>$filledurl</a>.  User <a href=$config[SITEURL]/users/profile?id=$arr[userid]><b>$arr[username]</b></a> automatically PMd.  <br>Filled that accidently? No worries, <a href=$config[SITEURL]/request/reqreset?requestid=$requestid>CLICK HERE</a> to mark the request as unfilled.  Do <b>NOT</b> follow this link unless you are sure there is a problem.<br></div>");
       print("Thank you for filling a request :)<br><a href=$config[SITEURL]/request>View More Requests</a>");
       end_frame();
       stdfoot();
   }

   public function reqdetails()
   {
       dbconn();
       global $config;
       loggedinonly();
       stdhead("Request Details");
       $id = (int) $_GET["id"];
       $res = DB::run("SELECT * FROM requests WHERE id = $id");
       if ($res->rowCount() != 1) {
           show_error_msg("ID NOT FOUND", "That request doesn't exist.", 1);
       }
       $num = $res->fetch(PDO::FETCH_ASSOC);
       $s = $num["request"];
       $filled = $num["filled"];
       $catid = $num["cat"];
       $catn = DB::run("SELECT parent_cat,name FROM categories WHERE id='$catid' ");
       $catname = $catn->fetch(PDO::FETCH_ASSOC);
       $pcat = $catname["parent_cat"];
       $ncat = $catname["name"];
       begin_frame("Request: $s");
       print("<a href=$config[SITEURL]/request><button  class='btn btn-sm btn-success'>All Request</button></a>&nbsp;
       <a href=$config[SITEURL]/request?requestorid=$_SESSION[id]><button  class='btn btn-sm btn-success'>View my requests</button></a>");
       print("<center><table width=600 border=0 cellspacing=0 cellpadding=3>\n");
       print("<tr><td align=left><B>" . T_('REQUEST') . ": </B></td><td width=70% align=left>$num[request]</td></tr>");
       print("<tr><td align=left><B>Category: </B></td><td width=70% align=left>$pcat: $ncat</td></tr>");
       if ($num["descr"]) {
           print("<tr><td align=left><B>" . T_('COMMENTS') . ": </B></td><td width=70% align=left>$num[descr]</td></tr>");
       }
       print("<tr><td align=left><B>" . T_('DATE_ADDED') . ": </B></td><td width=70% align=left>$num[added]</td></tr>");
       $cres = DB::run("SELECT username FROM users WHERE id=$num[userid]");
       if ($cres->rowCount() == 1) {
           $carr = $cres->fetch(PDO::FETCH_ASSOC);
           $username = "$carr[username]";
           $comment = "$carr[descr]";
       }
       print("<tr><td align=left><B>Requested by: </B></td><td width=70% align=left>$username</td></tr>");
       if ($num["filled"] == null) {
           print("<tr><td align=left><B>" . T_('VOTE_FOR_THIS') . ": </B></td><td width=50% align=left><a href=$config[SITEURL]/request/addvote?id=$id><b>" . T_('VOTES') . "</b></a></tr></tr>");
           print("<form method=get action=$config[SITEURL]/request/reqfilled>");
           print("<tr><td align=left><B>To Fill This Request:</B> </td><td>Enter the <b>full</b> direct URL of the torrent i.e. http://infamoustracker.org/torrents-details.php?id=134 (just copy/paste from another window/tab) or modify the existing URL to have the correct ID number</td></tr>");
           print("</table>");
           print("<input type=text size=80 name=filledurl value=TYPE-DIRECT-URL-HERE>\n");
           print("<input type=hidden value=$id name=requestid>");
           print("<button  class='btn btn-sm btn-success'>Fill Request</button></form>");
           print("<p><hr></p><form method=get action=$config[SITEURL]/request/makereq#add>Or <button  class='btn btn-sm btn-success'>Add A New Request</button></form></center>");
       } else {
           print("<tr><td align=left><B>URL: </B></td><td width=50% align=left><a href=$filled target=_new>$filled</a></td></tr>");
           print("</table>");
       }
       end_frame();
       begin_frame("comments");
       $commcount = DB::run("SELECT COUNT(*) FROM comments WHERE req = $id")->fetchColumn();
       if ($commcount) {
           //list($pagertop, $pagerbottom, $limit) = pager(10, $commcount, "comments/req?id=$id&amp;");
           $commquery =    "SELECT comments.id, text, user, comments.added, editedby, editedat, avatar, warned, username, title, class, donated FROM comments LEFT JOIN users ON comments.user = users.id WHERE req = $id ORDER BY comments.id";
           $commres = DB::run($commquery);
       } else {
           unset($commres);
       }
       if ($commcount) {
           //print($pagertop);
           reqcommenttable($commres, 'req');
           //print($pagerbottom);
       } else {
           print("<br /><b>" . T_("NOCOMMENTS") . "</b><br />\n");
       }
       end_frame();
       stdfoot();
   }

   public function reqcomment()
   {
       $action = $_GET["action"];
       dbconn(false);
       global $config;
       loggedinonly();
       require_once "helpers/bbcode_helper.php";
       if ($action == "add") {
           if ($_SERVER["REQUEST_METHOD"] == "POST") {
               $reqid = 0 + $_POST["tid"];
               if (!is_valid_id($reqid)) {
                   show_error_msg("Error", "Wrong ID $reqid.", 1);
               }
               $res = DB::run("SELECT request FROM requests WHERE id = $reqid");
               $arr = $res->fetch(PDO::FETCH_ASSOC);
               if (!$arr) {
                   show_error_msg("Error", "No request with ID $reqid.", 1);
               }
               $text = trim($_POST["msg"]);
               if (!$text) {
                   show_error_msg("Error", "Don't leave any fields blank!", 1);
               }
               DB::run("INSERT INTO comments (user, req, added, text, ori_text) VALUES (" . $_SESSION["id"] . ",$reqid, '" . get_date_time() . "', " . sqlesc($text) . "," . sqlesc($text) . ")");
               $reqid = DB::lastInsertId();
               DB::run("UPDATE requests SET comments = comments + 1 WHERE id = $reqid");
               header("Refresh: 0; url=$config[SITEURL]/request/reqdetails?id=$reqid");
               exit();
           }
           $reqid = 0 + $_GET["tid"];
           if (!is_valid_id($reqid)) {
               show_error_msg("Error", "Wrong ID $reqid.", 1);
           }
           $res = DB::run("SELECT request FROM requests WHERE id = $reqid");
           $arr = $res->fetch(PDO::FETCH_ASSOC);
           if (!$arr) {
               show_error_msg("Error", "Wrong ID $reqid.", 1);
           }
           stdhead("Add comment to \"" . $arr["request"] . "\"");
           begin_frame("Add a request comment");
           print("<a href=$config[SITEURL]/request><button  class='btn btn-sm btn-success'>All Request</button></a>&nbsp;
           <a href=$config[SITEURL]/request?requestorid=$_SESSION[id]><button  class='btn btn-sm btn-success'>View my requests</button></a>");  
           print("<b>Add comment to \"" . htmlspecialchars($arr["request"]) . "\"</b>\n");
           print("<p><form name=\"Form\" method=\"post\" action=\"$config[SITEURL]/request/reqcomment?action=add\">\n");
           print("<input type=\"hidden\" name=\"tid\" value=\"$reqid\"/>\n");
           print("" . textbbcode("Form", "msg") . "");
           print("<center><button  class='btn btn-sm btn-success'>Add</button></center></form>\n");
           $res = DB::run("SELECT comments.id, text, comments.added, username, users.id as user, users.avatar FROM comments LEFT JOIN users ON comments.user = users.id WHERE req = $reqid ORDER BY comments.id DESC LIMIT 5");
           $allrows = array();
           while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
               $row[] = $row;
           }
           if (count($allrows)) {
               print("<b>Last comments in reverse order.</b>\n");
               commenttable($row);
           }
           end_frame();
           stdfoot();
           die;
          } elseif ($action == "edit") {
           $commentid = 0 + $_GET["cid"];
           if (!is_valid_id($commentid)) {
               show_error_msg("Error", "Wrong ID $commentid.", 1);
           }
           $res = DB::run("SELECT c.*, o.request FROM comments AS c JOIN requests AS o ON c.req = o.id WHERE c.id=$commentid");
           $arr = $res->fetch(PDO::FETCH_ASSOC);
           if (!$arr) {
               show_error_msg("Error", "Wrong ID $commentid.", 1);
           }
           if ($arr["user"] != $_SESSION["id"] && get_user_class($_SESSION) < 5) {
               show_error_msg("Error", "Access denied.", 1);
           }
           if ($_SERVER["REQUEST_METHOD"] == "POST") {
               $text = $_POST["msg"];
               $returnto = $_POST["returnto"];
               if ($text == "") {
                   show_error_msg("Error", "Don't leave any fields blank!", 1);
               }
               $text = sqlesc($text);
               $editedat = sqlesc(get_date_time());
               DB::run("UPDATE comments SET text=$text, editedby=$_SESSION[id], editedat=$editedat WHERE id=$commentid");
               if ($returnto) {
                   header("Location: $returnto");
               } else {
                   header("Location: $config[SITEURL]/");
               }
               die;
           }
           stdhead("Edit comment for \"" . $arr["request"] . "\"");
           begin_frame("");
           print("<b>Edit comment for \"" . htmlspecialchars($arr["request"]) . "\"</b>\n");
           print("<form name=Form method=\"post\" action=\"$config[SITEURL]/request/reqcomment?action=edit&amp;cid=$commentid\">\n");
           print("<input type=\"hidden\" name=\"returnto\" value=\"" . $_SERVER["HTTP_REFERER"] . "\" />\n");
           print("<input type=\"hidden\" name=\"cid\" value=\"$commentid\" />\n");
           print("" . textbbcode("Form", "msg", $content = $arr["text"]) . "");
           print("<button class='btn btn-sm btn-success'>Edit></button></form>\n");
           end_frame();
           stdfoot();
           die;
       } elseif ($action == "delete") {
           if (get_user_class($_SESSION) < 5) {
               show_error_msg("Error", "Access denied.", 1);
           }
           $commentid = 0 + $_GET["cid"];
           if (!is_valid_id($commentid)) {
               show_error_msg("Error", "Invalid ID $commentid.", 1);
           }
           $sure = $_GET["sure"];
           if (!$sure) {
               $referer = $_SERVER["HTTP_REFERER"];
               show_error_msg("Delete comment", "You`re about to delete this comment. Click " . "<a href=?action=delete&cid=$commentid&sure=1" . ($referer ? "&returnto=" . urlencode($referer) : "") . ">here</a> if you're sure.", 1);
           }
           $res = DB::run("SELECT req FROM comments WHERE id=$commentid");
           $arr = $res->fetch(PDO::FETCH_ASSOC);
           if ($arr) {
               $reqid = $arr["req"];
           }
           $stmt = DB::run("DELETE FROM comments WHERE id=$commentid");
           if ($stmt > 0) {
               DB::run("UPDATE requests SET comments = comments - 1 WHERE id = $reqid");
           }
           $returnto = (int) $_GET["returnto"];
           if ($returnto) {
               header("Location: $returnto");
           } else {
               header("Location: $config[SITEURL]/request");
           }
           die;
       } else {
           show_error_msg("Error", "Unknown action $action", 1);
       }
       die;
   }
}
2020-08-29 06:41:47
all these are added, really need to work on pdo helper to add all details on these and the config settings (how to)
invitetree
ip bans, history stuff
shoutbox clear, new members, new users, staff
force thanks
seedbonus
sticky torrents
top10 (in navigation block)
torrent clients
friends
snatchlist
magnets
shoutbox bans
teams
censor
youtube in details
2020-09-02 12:13:53
Updated the first topic with the completed mods from pre-v2.08, v2.08 and v3.0

All mods have been sorted, and the ones that have been completed have been moved to the bottom of the topic (as far as I could determine)

I will next have a look at the mods/hacks in development (low priority...will do over the next week)
If It Ain't Dutch, It Ain't Much!!
2020-09-19 10:50:32
thread cleaned and slimmed, github updated https://github.com/M-jay84/Torrent-Trader-MVC-PDO-OOP
2020-09-19 22:56:24
YouTube is in that zip I sent you in torrent.php, just make the column
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