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

are you sure that the version of TT you are testing is the same as the one m-jay is testing on xblade? I remember your code had alot of differences in it. You had several versions so maybe im wrong
IMDb Mod [TTv3] — 2019-03-29 00:02:10 in v3 Mods Completed
unless you are MVP, you have no claim to jack shit. I never claimed anything. I post code that works for people, and if it dont, we work through it like civilized human beings. go read http://www.torrenttrader.org/viewtopic.php?f=14&t=122&start=10 and you will see that I figured out the API change back in sept of 2017, So I didnt copy and paste your code because I am taking credit, I did it because it was convenient
care to explain?
this line here has obviously been a mistake of copy/paste from your forum to this one. It has bbcode in it. Its no big deal. Or this forum did a wierd edit to your code. bbcode is different depending on the forum you use and it appears that it turned your edit into bbcode. I hope I made sense. Tell master xblade thanks for the help.........
$jquery = SQL_Query_exec("SELECT COUNT([ICODE]hnr[/ICODE]) FROM [ICODE]snatched[/ICODE] WHERE [ICODE]uid[/ICODE] = '".$CURUSER["id"]."' AND [ICODE]hnr[/ICODE] = 'yes'");

change to
$jquery = SQL_Query_exec("SELECT COUNT `hnr` FROM `snatched` WHERE `uid` = '".$CURUSER["id"]."' AND `hnr` = 'yes'");
IMDb Mod [TTv3] — 2019-03-27 22:50:39 in v3 Mods Completed
I never took credit for anything. The old imdb mod works just fine. I still have mvp's installed on my old TT
IMDb Mod [TTv3] — 2019-03-27 21:28:28 in v3 Mods Completed
I copied it from the 2.08 section so it makes sense for people who use 3.0 to look in this section for it. And mvp is the one who wrote the imdb originally. I still have the original IMDB api from 2012 on a drive. I keep lots of things on backup drives. Ever wonder why there is a username of TT and a pass of TT in the backend? Because it used a self hosted API, which I still have. I will post the install instructions just for fun
Quote:

@Package IMDb API
@Version v0.1
@Author  TorrentTrader.org

===============================================
Requirements
===============================================

PHP 5
Curl
Apache mod_rewrite

===============================================
Installation
===============================================

It is better to install the IMDb API to a subdomain something like: http://imdb.yoursite.com,
ensure the Sys/Store is chmodded to 777 so data can be written to that folder, if all works correctly you can test it by visiting a link like

[URL unfurl="true"]http://imdb.yoursite.com/tt1371111/[/url]

When you are requested for authentication use:

User: TT
Pass: TT

These default logins and the realm name can be both changed in the Router.php file.

Once all is setup in your IMDB class for torrenttrader you can modify the url to use your sites url.


===============================================
Support
===============================================

We only offer support on how to setup the API correctly, no support will be given free for extenstions to the API, if you require support please
contact the creator mostvotedplaya on torrenttrader.org
I think my old details page was pretty decent, maybe not the best, but not too bad. I can see about moving some of those edits into this copy. Would take me a bit of time to test it all, but I may be able to make it look a bit nicer, but I suck at anything graphics related, but maybe could do something with the layout. no promises. I know my limitations and they are plentiful lol. I remember wanting to shove the IMDB and details page together so they weren't so spread out on the page anyways. Maybe I will go back and revisit that idea. Since I dont run a site anymore, these ideas just kinda went away
IMDb Mod [TTv3] — 2019-03-27 02:35:04 in v3 Mods Completed
Originally written by MVP (mostvotedplaya)
Run this sql against your database using whatever tools you use (phpmyadmin, etc)
ALTER TABLE `torrents` ADD `imdb` varchar(80) DEFAULT NULL;   


Add to languages/english.php
$LANG["_IMDB_"] = "DB";
$LANG["IMDB"] = "Internet Movie Database:";
$LANG["IMDB_LINK"] = "Link";
$LANG["IMDB_INFO"] = "If a valid imdb is given we can autofill the description.";
$LANG["IMDB_RELEASED"] = "Released";
$LANG["IMDB_RATED"] = "Rated";
$LANG["IMDB_ALIAS"] = "Also Known As";
$LANG["IMDB_GENRE"] = "Genre";
$LANG["IMDB_DIRECTOR"] = "Director";
$LANG["IMDB_YEAR"] = "Year";
$LANG["IMDB_WRITER"] = "Writer";
$LANG["IMDB_RUNTIME"] = "Runtime";
$LANG["IMDB_VOTES"] = "Votes";
$LANG["IMDB_ACTORS"] = "Actors";
$LANG["IMDB_PLOT"] = "Plot";
$LANG["IMDB_SHORT"] = "IMDB";
$LANG["IMDB_LASTUPDATED"] = "Last Updated";




Search : torrents-upload.php

$shortfname = $torrent = $matches[1];
     if (!empty($_POST["name"]))
          $name = $_POST["name"];


Add After :

if (!empty($_POST['imdb']))
           $imdb = unesc($_POST['imdb']);


Search :

print ("<tr><td align='right'>" . T_("TORRENT_NAME") . ": </td><td align='left'><input type='text' name='name' size='60' value='" . $_POST['name'] . "' /><br />".T_("THIS_WILL_BE_TAKEN_TORRENT")." \n</td></tr>"); 


Add After :

print ("<tr><td align='right'>" . T_("IMDB") . ": </td><td align='left'> <input type='text' name='imdb' size='60' value='" . $_POST['imdb'] . "' /><br />(Link from IMDB. <b>Only for movie.</b>)<br /><font color=red><b>You Must include a Imdb at all times on Upload</b></font>\n</td></tr>");


Search :

    $ret = SQL_Query_exec("INSERT INTO torrents (filename, owner, name, descr, image1, image2, category, added, info_hash, size, numfiles, save_as, announce, external, nfo, torrentlang, anon, last_action) VALUES (".sqlesc($fname).", '".$CURUSER['id']."', ".sqlesc($name).", ".sqlesc($descr).", '".$inames[0]."', '".$inames[1]."', '".$catid."', '" . get_date_time() . "', '".$infohash."', '".$torrentsize."', '".$filecount."', ".sqlesc($fname).", '".$announce."', '".$external."', '".$nfo."', '".$langid."','$anon', '".get_date_time()."')");


Replace with:

    $ret = SQL_Query_exec("INSERT INTO torrents (filename, owner, name, descr, image1, image2, category, added, info_hash, size, numfiles, save_as, announce, external, nfo, torrentlang, anon, last_action, imdb) VALUES (".sqlesc($fname).", '".$CURUSER['id']."', ".sqlesc($name).", ".sqlesc($descr).", '".$inames[0]."', '".$inames[1]."', '".$catid."', '" . get_date_time() . "', '".$infohash."', '".$torrentsize."', '".$filecount."', ".sqlesc($fname).", '".$announce."', '".$external."', '".$nfo."', '".$langid."','$anon', '".get_date_time()."', '".$imdb."')"); 


torrents-details.php Search :
torrents.name,


Add After :

torrents.imdb,


Search :

//END DEFINE RATING VARIABLE
    echo "<br />";


Add After :

$TTIMDB = new TTIMDB;
if ((($_data = $TTCache->Get("imdb/$id", 900)) === false) && ($_data = $TTIMDB->Get($row['imdb']))){
               $_data->Poster = $TTIMDB->getImage($_data->Poster, $id);
        if ( ! isset( $_data->imdbTime ) ){
                $_data->imdbTime = time();
                $_data->Alias = 'N/A';
                $_data->imdbVideo = null;
                }
                $TTCache->Set("imdb/$id", $_data, 900);
}

if ( is_object($_data) ): ?>
        <fieldset class="download">
        <legend><b><?php echo T_("IMDB_SHORT"); ?> - <?php echo $_data->Title; ?></b></legend>
        <table border="0" cellpadding="3" cellspacing="2" width="100%">
    <tr>
        <td width="230"><img src="<?php echo $_data->Poster; ?>" alt="<?php echo $_data->Title; ?>" title="<?php echo $_data->Title; ?>" height="317px" width="214px" /></td>
        <td valign="top">
        <b><?php echo T_("IMDB_LINK"); ?></b><br /> <a href="<?php echo $row['imdb']; ?>" target="_blank"><?php echo htmlspecialchars($row['imdb']); ?></a><br /><br />
        <b><?php echo T_("IMDB_RATED"); ?></b><br /> <?php echo $TTIMDB->getRated( $_data->Rated ); ?><br /><br />
        <b><?php echo T_("IMDB_ALIAS"); ?></b><br /> <?php echo $_data->Alias; ?><br /><br />
        <b><?php echo T_("IMDB_RELEASED"); ?></b><br /> <?php echo $TTIMDB->getReleased($_data->Released); ?><br /><br />
        <b><?php echo T_("IMDB_YEAR"); ?></b><br /> <?php echo $_data->Year; ?><br /><br />
        <b><?php echo T_("IMDB_RUNTIME"); ?></b><br /> <?php echo $_data->Runtime; ?><br /><br />
        <b><?php echo T_("IMDB_GENRE"); ?></b><br /> <?php echo $_data->Genre; ?><br /><br />
        <b><?php echo T_("IMDB_DIRECTOR"); ?></b><br /> <?php echo $_data->Director; ?><br /><br />
        <b><?php echo T_("IMDB_WRITER"); ?></b><br /> <?php echo $_data->Writer; ?><br /><br />
        <b><?php echo T_("IMDB_ACTORS"); ?></b><br /> <?php echo $_data->Actors; ?><br /><br />
        <b><?php echo T_("IMDB_PLOT"); ?></b><br /> <?php echo $_data->Plot; ?>
        </td>
<?php if (($rating = $TTIMDB->getRating($_data->imdbRating)) !== null): ?>
        <td valign="top" align="center">
<?php echo $rating; ?><br /><br />
        <b><?php echo T_("IMDB_VOTES"); ?></b> <?php echo $_data->imdbVotes; ?>
    </td>
        <?php endif; ?>
    </tr>
     <tr>
        <td align="right" colspan="3">
        <b><?php echo T_("IMDB_LASTUPDATED"); ?></b> <i><?php echo $TTIMDB->getUpdated($_data->imdbTime); ?></i>
     </td>
     </tr>
     </table>
     </fieldset>
     <br />

<?php if ( strlen( $_data->imdbVideo ) > 3 ): ?>
        <center><iframe src="http://www.imdb.com/video/imdb/<?php echo $_data->imdbVideo; ?>/player?stop=1" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" height="480" width="643"></iframe></center><br />
<?php endif;
endif;


torrents-edit.php Search :


     if (@is_uploaded_file($nfofilename) && @filesize($nfofilename) > 0){
           @move_uploaded_file($nfofilename, "$nfo_dir/$id.nfo");
           $updateset[] = "nfo = 'yes'";
       }//success
   }


Add After :

if (!empty($_POST["name"]))
   $updateset[] = "name = " . sqlesc($_POST["name"]);
if ( $_POST['imdb'] != $row['imdb'] ){
    $updateset[] = "imdb = " . sqlesc($_POST["imdb"]);
    $TTCache->Delete("imdb/$id");
}


Search :

echo "<tr><td class='table_col1' align='right'><b>".T_("CATEGORIES").": </b></td><td class='table_col2'>".$catdropdown."</td></tr>";


Add After :

echo "<tr><td class='table_col1' align='right'><b>".T_("IMDB")."</b></td><td class='table_col2'><input type=\"text\" name=\"imdb\" value=\"" . htmlspecialchars($row["imdb"]) . "\" size=\"60\" /></td></tr>"; 



@backend/functions.php add

function __autoload($f){
require_once('backend/' . $f . '.php');
}



Add the contents of the cache folder to cache imdb and chmod 0777
Add the imdb folder to root and chmod 0777
Add the uploads folder and chmod 0777 (it will add a new folder inside of uploads called imdb that also needs chmodded to 777)
Add IMDB.php and TTIMDB.php to the backend folder

Go get your free api key to use the omdb database http://omdbapi.com/

Open backend/TTIMDB.php, add your key at the top as you see below (replace KEY_HERE with your key)
private $_nodes = array('https://omdbapi.com/?apikey=KEY_HERE&i=%s'); 





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

If for any reason you would like to add the image and plot description to the DB. Usually only useful if you have other mods that display these things, like site catalogs, torrent details page, the balloon mod, etc. It does no harm in adding these edits either way other than adding more info to your DB, so if a few kb of added DB size is a concern, well......... In torrents-details.php find

$TTIMDB = new TTIMDB;
if ((($_data = $TTCache->Get("imdb/$id", 900)) === false) && ($_data = $TTIMDB->Get($row['imdb']))){
               $_data->Poster = $TTIMDB->getImage($_data->Poster, $id);
        if ( ! isset( $_data->imdbTime ) ){
                $_data->imdbTime = time();
                $_data->Alias = 'N/A';
                $_data->imdbVideo = null;
                }

add below
/// add poster to image 1 in DB
         if (($imdb_image = $TTIMDB->getImage_1($_data->Poster, $site_config['torrent_dir'] . "/images/", $id))) {
         SQL_Query_exec("UPDATE `torrents` SET `image1` = '" . $imdb_image . "' WHERE `id` = $id");
         }
/// end add poster to image 1 in DB

/// add a description pulled from the IMDB plot and put it in mysql as the descr
        if ($row["descr"]=='No description given.'){
        SQL_Query_exec("UPDATE `torrents` SET `descr` = '".mysqli_real_escape_string($GLOBALS["DBconnector"],$_data->Plot). "' WHERE `id` = $id");
        }
/// end add description
If for any reason you would like to add the image and plot description to the DB. Usually only useful if you have other mods that display these things, like site catalogs, torrent details page, the balloon mod, etc. It does no harm in adding these edits either way other than adding more info to your DB, so if a few kb is a concern, well......... In torrents-details.php find

$TTIMDB = new TTIMDB;
if ((($_data = $TTCache->Get("imdb/$id", 900)) === false) && ($_data = $TTIMDB->Get($row['imdb']))){
               $_data->Poster = $TTIMDB->getImage($_data->Poster, $id);
        if ( ! isset( $_data->imdbTime ) ){
                $_data->imdbTime = time();
                $_data->Alias = 'N/A';
                $_data->imdbVideo = null;
                }

add below
/// add poster to image 1 in DB
         if (($imdb_image = $TTIMDB->getImage_1($_data->Poster, $site_config['torrent_dir'] . "/images/", $id))) {
         SQL_Query_exec("UPDATE `torrents` SET `image1` = '" . $imdb_image . "' WHERE `id` = $id");
         }
/// end add poster to image 1 in DB

/// add a description pulled from the IMDB plot and put it in mysql as the descr
if ($row['descr'] === DEFAULT_DESCRIPTION) {
 $stmt = $GLOBALS['DBconnector']->prepare('UPDATE `torrents` SET `descr` = ? WHERE `id` = ?');
 $stmt->bind_param('si', $_data->Plot, $id);
 $stmt->execute();
}
/// end add description

at the top of torrents-details find
require_once("backend/functions.php");

above put
const DEFAULT_DESCRIPTION = 'No description given.';
TorrentTrader 3.0 — 2019-03-25 21:21:47 in v3 Download
I have to redo the whole thing since im not yet very familiar with how to use it. Im learning lol
try for torrents-details
find
    print("<tr><td align='left'><b>" .T_("ADDED_BY"). ":</b></td><td><a href='account-details.php?id=" . $row["owner"] . "'>" . $row["username"] . "</a></td></tr>");

replace
print("<tr><td align='left'><b>" .T_("ADDED_BY"). ":</b></td><td><a href='account-details.php?id=" . $row["owner"] . "'>".class_user($row['username'])."</a></td></tr>");
it should work just fine. there is no reason for it not to work since it uses a class for the image resize which is in the themes css file. You have to add the css to each themes css that you are using. if not, you could try just adding it directly to the functions file like (adjust size as needed)
    // 
   $s = preg_replace("/\[img\]((http|https):\/\/[^\s'\"<>]+(\.gif|\.jpg|\.png|\.bmp|\.jpeg))\[\/img\]/i", "<img border='0' src=\"\\1\" width='190px' alt='' />", $s);
   
           // [img=http://www/image.gif]
   $s = preg_replace("/\[img=((http|https):\/\/[^\s'\"<>]+(\.gif|\.jpg|\.png|\.bmp|\.jpeg))\]/i", "<img border='0' src=\"\\1\" width='190px' alt='' />", $s);
updated and/or fixed the thread above. Post for issues. Also works on TT 3.0
TorrentTrader 3.0 — 2019-03-25 00:13:32 in v3 Download
oops, I missed that one haha. I updated the github. Thanks for reporting it
find
$id = mysqli_insert_id($GLOBALS["DBconnector"]);
I created this stupid thing, and Im sure it will work on TTv3
this is a simple mod and should give new users a 2GB upload and inf. ratio to get started (which you can change in the config) so new members dont get themselves in a ratio hole that they cant get out of. Your ratio is tracked normally, this just gives you a positive ratio to get started. I also added giving invites to new users. The default is ZERO, but feel free to do as you will. Edit the config as you please
in account-signup.php find
     SQL_Query_exec("INSERT INTO users (username, password, secret, email, status, added, last_access, age, country, gender, client, stylesheet, language, class, ip) VALUES (" .
    implode(",", array_map("sqlesc", array($wantusername, $wantpassword, $secret, $email, $status, get_date_time(), get_date_time(), $age, $country, $gender, $client, $site_config["default_theme"], $site_config["default_language"], $signupclass, getip()))).")");


Change to
     SQL_Query_exec("INSERT INTO users (username, password, secret, email, status, added, last_access, age, country, gender, client, stylesheet, uploaded, downloaded, language, invites, class, ip) VALUES (" .
    implode(",", array_map("sqlesc", array($wantusername, $wantpassword, $secret, $email, $status, get_date_time(), get_date_time(), $age, $country, $gender, $client, $site_config["default_theme"], $site_config["new_member_upload_ratio"], 0, $site_config["default_language"], $site_config["new_member_invites"], $signupclass, getip()))).")");


add to backend/config.php
$site_config['new_member_upload_ratio'] = 2147483648; //2147483648 = 2GB of upload and inf. ratio to help get started
$site_config['new_member_invites'] = 0 ;       // Every new user will get 0 invites to start with. Change this to whatever floats your boat. Does not affect the regular giving of invites set by you or the system

invite.php will look like this
	$secret = mksecret();
$username = "invite_".mksecret(20);
$ret = SQL_Query_exec("INSERT INTO users (username, secret, email, status, invited_by, added, stylesheet, uploaded, downloaded, language, invites) VALUES (".
implode(",", array_map("sqlesc", array($username, $secret, $email, 'pending', $CURUSER["id"]))) . ",'" . get_date_time() . "', $site_config[default_theme], $site_config[new_member_upload_ratio], 0, $site_config[default_language], $site_config[new_member_invites])");

if (!$ret) {
// If username is somehow taken, keep trying
while (mysqli_errno($GLOBALS["DBconnector"]) == 1062) {
$username = "invite_".mksecret(20);
$ret = SQL_Query_exec("INSERT INTO users (username, secret, email, status, invited_by, added, stylesheet, uploaded, downloaded, language, invites) VALUES (".
implode(",", array_map("sqlesc", array($username, $secret, $email, 'pending', $CURUSER["id"]))) . ",'" . get_date_time() . "', $site_config[default_theme], $site_config[new_member_upload_ratio], 0, $site_config[default_language], $site_config[new_member_invites])");
}
show_error_msg(T_("ERROR"), T_("DATABASE_ERROR"), 1);
}
Seed Bonus [TTv3] — 2019-03-17 20:30:30 in v3 Mods Completed
heres a simple image to use with it
This post assumes you are using TT v3.0 that uses a database connector that I named DBconnector. Its not named that for any particular reason, you can call it shittyshit if you like lol. I named it DBconnector so it would make sense as to what it is if you are reading the code.

These are functions that need to have the DBconnector added to them. if you can think of more, add them.
Example:
if (mysql_errno() == 1062)

becomes
if (mysqli_errno($GLOBALS["DBconnector"]) == 1062)


You can just copy/paste $GLOBALS["DBconnector"] into your new functions

mysqli_affected_rows
mysqli_insert_id
mysqli_errno
mysqli_error
mysqli_query
mysqli_close
mysqli_real_escape_string

Example:
$reason = mysql_real_escape_string($_POST["reason"]);

becomes
$reason = mysqli_real_escape_string($GLOBALS["DBconnector"], $_POST["reason"]);


mysqli_connect_error does NOT need it


For reference, This is what I added to the backend/functions.php file to emulate these functions listed below this stupid sentence.
each()
mysql_result()

I did this so that using old mods would be easier to integrate into php 7.  Those functions can be completely rewritten, but for the sake of trying the easy way, I did this

each()  uses a new function written into the backend/functions.php file near the top. All instance of each() should be changed to thisEach()
mysql_result is also emulated in the backend/functions.php near the top. Just change all mysql_result to mysqli_result and it will be emulated since there is no such function in php.

/// each() replacement for php 7+. Change all instances of each() to thisEach() in all TT files. each() deprecated as of 7.2
function thisEach(&$arr) {
   $key = key($arr);
   $result = ($key === null) ? false : [$key, current($arr), 'key' => $key, 'value' => current($arr)];
   next($arr);
   return $result;
}
///end each() replacement

///mysql_result replacement for php 7+. Change all mysql_result to mysqli_result in all TT files. mysql_result deprercated/removed, so emulate it. Should switch to data_seek
function mysqli_result($res,$row=0,$col=0){
   $numrows = mysqli_num_rows($res);
   if ($numrows && $row <= ($numrows-1) && $row >=0){
       mysqli_data_seek($res,$row);
       $resrow = (is_numeric($col)) ? mysqli_fetch_row($res) : mysqli_fetch_assoc($res);
       if (isset($resrow[$col])){
           return $resrow[$col];
       }
   }
   return false;
}
///end mysql_result replacement

function thisEach() has been removed and rewritten in TTv3. Thanks to M-Jay
Blackjack [TTv3] — 2019-03-16 20:17:49 in v3 Mods Completed
Blackjack game. Installation instructions are inside the rar file
[ATTACH type="full" alt="2593"]4987._xfImport[/ATTACH]
Tested on ubuntu 18.04 and php 7.2. Still works in case anyone needed to know.
sudo apt install php-pear
sudo pear install mail
sudo pear install Net_SMTP
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