Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Torrent Trader (http://www.bvlist.com/forumdisplay.php?f=29)
-   -   problem setup (http://www.bvlist.com/showthread.php?t=11196)

Zamachi 1st August 2017 03:18

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

Phogo 1st August 2017 11:23

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?

Chez 1st August 2017 12:30

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.

Zamachi 1st August 2017 13:45

thanks you ;)
i will check later your solution :)

If I use php 7, which version is recommended?

@Phogo i test several cms tracker

Thor 1st August 2017 20:43

U-232 v5 is coded to work with PHP7

l3on 1st August 2017 21:17

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;
}
?>

:welcome:

Chez 2nd August 2017 00:29

Quote:

Originally Posted by Thor (Post 50470)
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.

Zamachi 2nd August 2017 00:34

@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 ?

Chez 2nd August 2017 00:46

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.

l3on 2nd August 2017 21:30

chmod 777 permission on this file. /var/www/cache/blocks_middle.cache


All times are GMT +2. The time now is 19:00.

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