Bravo List
Register
Go Back   > Bravo List > Source Code > Active Trackers > Torrent Trader
Reply
  #1  
Old 1st August 2017, 03:18
Zamachi Zamachi is offline
Member
 
Join Date: Jul 2017
Posts: 13
Default problem setup
Hello :)

I i have install torrent trader 3 beta.
The install is ok but if i want change config with settings page (in admin cp)
When I validate a blank page is displayed and no changes are made

And I also have the error message display on the site :



Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; TTCache has a deprecated constructor in /var/www/backend/cache.php on line 14

Fatal error: Cannot redeclare breadcrumbs() (previously declared in /var/www/backend/functions.php:1705) in /var/www/functions.php on line 1705

Warning: array_keys() expects parameter 1 to be array, string given in /var/www/backend/functions.php on line 1730

thanks you for your help
Reply With Quote
  #2  
Old 1st August 2017, 11:23
Phogo's Avatar
Phogo Phogo is offline
VIP
 
Join Date: Jan 2008
United Kingdom
Posts: 902
Default
Sounds like the php version your using isn't right. I wouldn't recommend using this source. Why not use an actually well developed code such as Project U-232?
Reply With Quote
  #3  
Old 1st August 2017, 12:30
Chez's Avatar
Chez Chez is offline
Senior Member
 
Join Date: Sep 2011
P2P
Posts: 278
Default
First error is showing because you're using PHP7.

For example if you have this class:
PHP Code:
class something
{
    function 
something()
    {
        
//your code here
    
}

then it should look like this:

PHP Code:
class something
{
    function  
__construct()
    {
        
//your code here
    
}

Change the line: function something() to function __construct() or you can even define an empty __construct method within the class.

Second error is showing because you have declared a function twice.

And the last error is showing because that the function array_keys() only accept an array as its first argument.
__________________
http://www.bvlist.com/images/avatars/signaturepics/sigpic16443_2.gif
Reply With Quote
  #4  
Old 1st August 2017, 13:45
Zamachi Zamachi is offline
Member
 
Join Date: Jul 2017
Posts: 13
Default
thanks you ;)
i will check later your solution :)

If I use php 7, which version is recommended?

@Phogo i test several cms tracker
Reply With Quote
  #5  
Old 1st August 2017, 20:43
Thor Thor is offline
Administrator
 
Join Date: Jan 2017
United Kingdom
Posts: 33
Default
U-232 v5 is coded to work with PHP7
Reply With Quote
  #6  
Old 1st August 2017, 21:17
l3on l3on is offline
Coder
 
Join Date: Jul 2012
Posts: 154
Default cache.php
Replace code in cache.php with below
PHP Code:
<?php 
$GLOBALS
["TTCache"] = new TTCache;
class 
TTCache {
    function 
__construct() {
        GLOBAL 
$site_config;
        
$this->cachedir $site_config["cache_dir"];
        
$this->type strtolower(trim($site_config["cache_type"]));
        switch (
$this->type) {
            case 
"memcache":
                
$this->obj = new Memcache;
                if (!@
$this->obj->Connect($site_config["cache_memcache_host"], $site_config["cache_memcache_port"]))
                    
$this->type "disk";
            break;
            case 
"apc":
                if (
function_exists("apc_store"))
                    break;
            case 
"xcache":
                if (
function_exists("xcache_set"))
                    break;
            default:
                
$this->type "disk";
        }
    }
    function 
Set ($var$val$expire 0) {
    GLOBAL 
$site_config;
        if (
$expire == 0)
            return;
        switch (
$this->type) {
            case 
"memcache":
                return 
$this->obj->set($site_config['SITENAME']."_".$var$val0$expire);
            break;
            case 
"apc":
                return 
apc_store($var$val$expire);
            break;
            case 
"disk":
                
$fp fopen($this->cachedir."/$var.cache""w");
                
fwrite($fpserialize($val));
                
fclose($fp);
                return;
            break;
            case 
"xcache":
                return 
xcache_set($varserialize($val), $expire);
            break;
        }
    }
    function 
Delete ($var) {
        GLOBAL 
$site_config;
        switch (
$this->type) {
            case 
"memcache":
                return 
$this->obj->delete($site_config['SITENAME']."_".$var);
            break;
            case 
"apc":
                return 
apc_delete($var);
            break;
            case 
"disk":
                @
unlink($this->cachedir."/$var.cache");
            break;
            case 
"xcache":
                return 
xcache_unset($var);
            break;
        }
    }
    function 
Get ($var$expire 0) {
    GLOBAL 
$site_config;
        if (
$expire == 0)
            return 
false;
        switch (
$this->type) {
            case 
"memcache":
                return 
$this->obj->get($site_config['SITENAME']."_".$var);
            break;
            case 
"apc":
                return 
apc_fetch($var);
            break;
            case 
"disk":
                
$file $this->cachedir."/$var.cache";
                if (
file_exists($file) && (time() - filemtime($file)) < $expire)
                    return 
unserialize(file_get_contents($file));
                return 
false;
            break;
            case 
"xcache":
               if (
xcache_isset($var))
                   return 
unserialize(xcache_get($var));
               return 
false;
            break;
        }
    }
}
// Cached MySQL Functions 
function get_row_count_cached ($table$suffix "") {
    GLOBAL 
$TTCache;
    
$query "SELECT COUNT(*) FROM $table $suffix";
    
$cache "get_row_count/".sha1($query);
    if ((
$ret $TTCache->Get($cache300)) === false) {
        
$res SQL_Query_exec($query);
        
$row mysqli_fetch_row($res);
        
$ret $row[0];
        
$TTCache->Set($cache$ret300);
    }
    return 
$ret;
}
function 
SQL_Query_exec_cached ($query$cache_time 300$cache_blank 1) {
    GLOBAL 
$TTCache;
    
$cache "queries/".sha1($query);
    if ((
$rows $TTCache->Get($cache$cache_time)) === false) {
        
$res SQL_Query_exec($query);
        
$rows = array();
        while (
$row mysqli_fetch_assoc($res))
            
$rows[] = $row;
        if (
count($rows) || $cache_blank)
            
$TTCache->Set($cache$rows$cache_time);
    }
    return 
count($rows) ? $rows false;
}
?>
Reply With Quote
  #7  
Old 2nd August 2017, 00:29
Chez's Avatar
Chez Chez is offline
Senior Member
 
Join Date: Sep 2011
P2P
Posts: 278
Default
Quote:
Originally Posted by Thor View Post
U-232 v5 is coded to work with PHP7
It depends. PHP7 is continously updated. For example if it works on PHP 7.0.1 it doesn't mean that it will work on 7.2.0 too.
__________________
http://www.bvlist.com/images/avatars/signaturepics/sigpic16443_2.gif
Reply With Quote
  #8  
Old 2nd August 2017, 00:34
Zamachi Zamachi is offline
Member
 
Join Date: Jul 2017
Posts: 13
Default
@CHez if the problem is my php, where is the best php version for tt3?

thanks you for your help, @I3on, i have switch with your cache.php, i have a css problem after update cache.php : http://imgur.com/uOW0w3g

and the error code : Warning: fopen(/var/www/cache/blocks_middle.cache): failed to open stream: Permission denied in /var/www/backend/cache.php on line 36

Warning: fwrite() expects parameter 1 to be resource, boolean given in /var/www/backend/cache.php on line 37

Warning: fclose() expects parameter 1 to be resource, boolean given in /var/www/backend/cache.php on line 38

have you a idea for the black page problem ?

Last edited by Zamachi; 2nd August 2017 at 19:15.
Reply With Quote
  #9  
Old 2nd August 2017, 00:46
Chez's Avatar
Chez Chez is offline
Senior Member
 
Join Date: Sep 2011
P2P
Posts: 278
Default
PHP versions below 5 are almost another language entirely and they are deprecated and filled with more bugs and they are more vulnerable to exploits.
You can use PHP 5 but you should contact the sourcecode developer and ask him on which PHP version is the code built.
__________________
http://www.bvlist.com/images/avatars/signaturepics/sigpic16443_2.gif
Reply With Quote
  #10  
Old 2nd August 2017, 21:30
l3on l3on is offline
Coder
 
Join Date: Jul 2012
Posts: 154
Default
chmod 777 permission on this file. /var/www/cache/blocks_middle.cache
Reply With Quote
Reply

Tags
problem , setup

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 13:35. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.