Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev
Reply
  #1  
Old 13th October 2019, 10:29
elvira's Avatar
elvira elvira is offline
Senior Member
 
Join Date: Jan 2008
Slovenia
Posts: 131
Default Update code
hello,


so I use code TS 2.5 its based TBDev 08 and works on php 5 so what i must change in my code, to works on php 7.


thnk you for answer
Reply With Quote
  #2  
Old 13th October 2019, 15:40
MicroMonkey's Avatar
MicroMonkey MicroMonkey is offline
Senior Member
 
Join Date: Jun 2016
Posts: 16
Default
all mysql_ will become mysqli_ and a host of other conversions are needed. Its not a hard thing to do, but will take some time figuring out if any of the old code was deprecated and convert it to php 7
Reply With Quote
  #3  
Old 13th October 2019, 19:12
elvira's Avatar
elvira elvira is offline
Senior Member
 
Join Date: Jan 2008
Slovenia
Posts: 131
Default
is here any coder to help me

ex:
Quote:
if (mysql_affected_rows() === 0) {
to this

Quote:
if (mysqli_affected_rows() === 0) {
or

Quote:
if (mysqli_affected_rows($GLOBALS["___mysqli_ston"]) === 0) {

Last edited by elvira; 13th October 2019 at 19:23.
Reply With Quote
  #4  
Old 13th October 2019, 22:05
MicroMonkey's Avatar
MicroMonkey MicroMonkey is offline
Senior Member
 
Join Date: Jun 2016
Posts: 16
Default
you need to connect the database. you have to create a database variable. You can use yakpro, but it wont fix deprecated code
I can only use TT as an example, but it should look like this, $GLOBALS is a php universal
Quote:
$GLOBALS["DBconnector"] = mysqli_connect($mysql_host, $mysql_user, $mysql_pass) or die('DATABASE: mysqli_connect: ' . mysqli_error($GLOBALS["DBconnector"]));
mysqli_select_db($GLOBALS["DBconnector"],$mysql_db) or die('DATABASE: mysqli_select_db: ' . mysqli_error($GLOBALS["DBconnector"]));
this is the original so you can see how I put it together, its simple
Quote:
mysql_connect($mysql_host, $mysql_user, $mysql_pass) or die('DATABASE: mysql_connect: ' . mysql_error());
mysql_select_db($mysql_db) or die('DATABASE: mysql_select_db: ' . mysql_error());
I created the DBconnector as a variable. You can name it what you want. Check for any deprecated functions by turning on display errors in your php config. You will be happier at the end of the day

each()
mysql_result()

the above are deprecated, emulate the function if you need to

Last edited by MicroMonkey; 13th October 2019 at 23:27.
Reply With Quote
  #5  
Old 14th October 2019, 18:45
elvira's Avatar
elvira elvira is offline
Senior Member
 
Join Date: Jan 2008
Slovenia
Posts: 131
Default
this is in config file to connect database
Reply With Quote
  #6  
Old 16th October 2019, 23:50
MicroMonkey's Avatar
MicroMonkey MicroMonkey is offline
Senior Member
 
Join Date: Jun 2016
Posts: 16
Default
post your config file, maybe someone can help

Last edited by MicroMonkey; 17th October 2019 at 03:07.
Reply With Quote
  #7  
Old 17th October 2019, 17:19
elvira's Avatar
elvira elvira is offline
Senior Member
 
Join Date: Jan 2008
Slovenia
Posts: 131
Default
Code:
<?php
# IMPORTANT: Do not edit below unless you know what you are doing!
if(!defined('IN_TRACKER'))
  die('Hacking attempt!');

readconfig ('MAIN');
$SITE_ONLINE			= $MAIN['site_online'];
$max_torrent_size		= $MAIN['max_torrent_size'];
$announce_interval		= $MAIN['announce_interval'];
$signup_timeout			= $MAIN['signup_timeout'];
$minvotes				= $MAIN['minvotes'];
$max_dead_torrent_time	= $MAIN['max_dead_torrent_time'];
$maxusers				= $MAIN['maxusers'];
$torrent_dir			= $MAIN['torrent_dir'];
$announce_urls			= array();
$announce_urls[]		= $MAIN['announce_urls'];
$BASEURL				= $MAIN['BASEURL'];
$DEFAULTBASEURL			= $MAIN['DEFAULTBASEURL'];
$MEMBERSONLY			= $MAIN['MEMBERSONLY'];
$PEERLIMIT				= $MAIN['PEERLIMIT'];
$SITEEMAIL				= $MAIN['SITEEMAIL'];
$SITENAME				= $MAIN['SITENAME'];
$autoclean_interval		= $MAIN['autoclean_interval'];
$pic_base_url			= $MAIN['pic_base_url'];
$table_cat				= $MAIN['table_cat'];
$REPORTMAIL				= $MAIN['reportemail'];
$invitesystem			= $MAIN['invitesystem'];
$registration			= $MAIN['registration'];
$showpolls				= $MAIN['showpolls'];
$showstats				= $MAIN['showstats'];
$showlastxforumposts	= $MAIN['showlastxforumposts'];
$showlastxtorrents		= $MAIN['showlastxtorrents'];
$showtrackerload		= $MAIN['showtrackerload'];
$showwhatsgoinon		= $MAIN['showwhatsgoinon'];
$showshoutbox			= $MAIN['showshoutbox'];
$waitsystem				= $MAIN['waitsystem'];
$maxdlsystem			= $MAIN['maxdlsystem'];
$bitbucket				= $MAIN['bitbucket'];
$cache					= $MAIN['cache'];
$showforumstats			= $MAIN['showforumstats'];
$verification			= $MAIN['verification'];
$invite_count			= $MAIN['invite_count'];
$invite_timeout			= $MAIN['invite_timeout'];
$forum_online			= $MAIN['forum_online'];
$attachment_dir			= $MAIN['attachment_dir'];
$maxchar				= $MAIN['maxchar'];

readconfig('DATABASE');
$mysql_host 			= $DATABASE['mysql_host'];
$mysql_user 			= $DATABASE['mysql_user'];
$mysql_pass 			= $DATABASE['mysql_pass'];
$mysql_db 				= $DATABASE['mysql_db'];

readconfig('SMTP');
$smtptype				= $SMTP['smtptype'];
$smtp_host				= $SMTP['smtp_host'];
$smtp_port				= $SMTP['smtp_port'];
if (strtoupper(substr(PHP_OS,0,3)=='WIN'))
	$smtp_from			= $SMTP['smtp_from'];
$smtpaddress			= $SMTP['smtpaddress'];
$smtpport				= $SMTP['smtpport'];
$accountname			= $SMTP['accountname'];
$accountpassword		= $SMTP['accountpassword'];

readconfig('SECURITY');
$securelogin			= $SECURITY['securelogin'];
$iv						= $SECURITY['iv'];
$maxip 					= $SECURITY['maxip'];
$maxloginattempts 		= $SECURITY['maxloginattempts'];
$disablerightclick		= $SECURITY['disablerightclick'];

readconfig('TWEAK');
$where					= $TWEAK['where'];
$iplog1					= $TWEAK['iplog1'];
$iplog2					= $TWEAK['iplog2'];
$ctracker 				= $TWEAK['ctracker'];
$autorefresh			= $TWEAK['autorefresh'];
$autorefreshtime		= $TWEAK['autorefreshtime'];
$leftmenu				= $TWEAK['leftmenu'];
$gzipcompress			= $TWEAK['gzipcompress'];
$shoutname	            = $TWEAK['shoutname'];
$shoutbot               = $TWEAK['shoutbot']; 
$shoutduty              = $TWEAK['shoutduty']; 

readconfig('EXTRA');
$nc						= $EXTRA['nc'];
$rqs					= $EXTRA['rqs'];
$split					= $EXTRA['split'];
$imageresizermode	    = !empty($EXTRA['imageresizermode']) ? $EXTRA['imageresizermode'] : 'enlarge'; 
$freeleech				= $EXTRA['freeleech'];
$imdbupload             = $EXTRA['imdbupload'];
$naziv                  = !empty($EXTRA['naziv']) ? $EXTRA['naziv'] : '48 sati free leech!';
$ai						= $EXTRA['ai'];
$pd						= $EXTRA['pd'];
$ref					= $EXTRA['ref'];

readconfig('PAYPAL');
$pmail					= $PAYPAL['pmail'];
$pcc					= $PAYPAL['pcc'];
$tn						= $PAYPAL['tn'];

readconfig('KPS');
$bonus					= $KPS['bonus'];
$kpsseed				= $KPS['kpsseed'];
$kpsupload				= $KPS['kpsupload'];
$kpscomment				= $KPS['kpscomment'];
$kpsthanks				= $KPS['kpsthanks'];
$kpsrate				= $KPS['kpsrate'];
$kpspoll				= $KPS['kpspoll'];
$kpstopic				= $KPS['kpstopic'];
$kpspost				= $KPS['kpspost'];

readconfig('REDIRECT');
$redirect				= $REDIRECT['redirect'];
$text					= $REDIRECT['text'];
$localaddresses			= $REDIRECT['localaddresses'];
$protocol				= $REDIRECT['protocol'];
$delay					= $REDIRECT['delay'];
$title					= $REDIRECT['title'];

ReadConfig( 'WORDCENSOR' ) ;
$wordlist                  = $WORDCENSOR['words'];

readconfig('SHOUTCAST');
$radio_online			        = $SHOUTCAST['radio_online'];
$SC_ENABLED					    = $SHOUTCAST['SC_ENABLED'];
$SC_HTTPTIMEOUT				    = $SHOUTCAST['SC_HTTPTIMEOUT'];
$SC_TITLE					    = $SHOUTCAST['SC_TITLE'];
$SC_HOSTNAME					= $SHOUTCAST['SC_HOSTNAME'];
$SC_PORT					    = $SHOUTCAST['SC_PORT'];
$SC_USERNAME					= $SHOUTCAST['SC_USERNAME'];
$SC_PASSWORD					= $SHOUTCAST['SC_PASSWORD'];

readconfig('TEMPLATE');
$charset = !empty($TEMPLATE['charset']) ? $TEMPLATE['charset'] : 'UTF-8';
$metakeywords = !empty($TEMPLATE['metakeywords']) ? $TEMPLATE['metakeywords'] : 'torrent, php, source, torrent source, free';
$metadesc = !empty($TEMPLATE['metadesc']) ? $TEMPLATE['metadesc'] : 'Best Torrent Source Ever ';
$slogan = !empty($TEMPLATE['slogan']) ? $TEMPLATE['slogan'] : 'Slogan!';

?>
Reply With Quote
  #8  
Old 19th October 2019, 09:24
Napon's Avatar
Napon Napon is offline
Senior Member
 
Join Date: Feb 2016
P2P
Posts: 431
Default
the above as nothing to do with if (mysql_affected_rows() === 0) {

Look at the files it call on

And the line your looking at must be as below

PHP Code:
if (mysqli_affected_rows($GLOBALS["___mysqli_ston"]) === 0) { 
Also what Platform you going to us it on and it may not work when you done it
it will need a few more functions for it too work
Ive done so many i know what im talking about
__________________
https://uploadfiles.io/lgekz
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 11:13. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2019, vBulletin Solutions Inc.