Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Free Torrent Source (http://www.bvlist.com/forumdisplay.php?f=25)
-   -   [FIX] Make cache settings usable (http://www.bvlist.com/showthread.php?t=4065)

benjaminbih 26th December 2009 19:54

[FIX] Make cache settings usable
 
Maybe someone of the FTS source users have noticed that cache is not really used. On every page call (index.php) the cache system caches content, instead of caching content after expired time period.

On youre page you see somthing like:
This content has been last updated 2009-12-26 18:30:21. Cached every 0:00:00
Which means there are no seconds for recaching setted.

The reason is as followed:
Example in factory.php the function stats(),
look at 'global'
PHP Code:

    public function stats() {
        
collapses('statsindex','<b>Tracker Statistics</b>');
     global 
$_c$maxusers

$_c = This var only calls a new instance of the cache function
$maxusers = This var only calls the string from maxusers settings

To make the cache system work right, you have to add a further var named $c. The var $c return the strings that in your database table named 'options' are saved .

The right use in a function for expample function stats() is:

PHP Code:

    public function stats() {
        
collapses('statsindex','<b>Tracker Statistics</b>');
     global 
$_c$c$maxusers

Now you can see this:
This content has been last updated 2009-12-26 18:55:06. Cached every 0:10:00

Phogo 9th January 2010 17:45

Where do you add the other var?

benjaminbih 9th January 2010 22:34

Quote:

Originally Posted by phogo (Post 19172)
Where do you add the other var?

What for other var?
This is an example, you have to search the functions that contains call of cache function and then add the global variable to it

Phogo 9th January 2010 22:38

MY mistake! Fixed thanks


All times are GMT +2. The time now is 09:56.

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