Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   TBDev (http://www.bvlist.com/forumdisplay.php?f=20)
-   -   Update code (http://www.bvlist.com/showthread.php?t=12167)

elvira 13th October 2019 10:29

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

MicroMonkey 13th October 2019 15:40

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

elvira 13th October 2019 19:12

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) {

MicroMonkey 13th October 2019 22:05

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

elvira 14th October 2019 18:45

this is in config file to connect database

MicroMonkey 16th October 2019 23:50

post your config file, maybe someone can help

elvira 17th October 2019 17:19

Code:

# 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!';

?>


Napon 19th October 2019 09:24

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


All times are GMT +2. The time now is 02:36.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.