Stop data retention! Click here & act! Are you a webmaster and want to participate? Here you can find all necessary material for your website - Willst du auch an der Aktion teilnehmen? Hier findest du alle relevanten Infos und Materialien:
Chris Karakas Online Forum Index Karakas Online
 FAQFAQ   Forum SearchForum Search   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
How to accelerate PHP-Nuke


Goto page Previous  1, 2, 3 ... 5, 6, 7 ... 17, 18, 19  Next
 
Post new topic   Reply to topic
   Chris Karakas Online Forum Index -> PHP-Nuke Forum RSS Feed of this Forum
Share this page: These icons link to social bookmarking sites where readers can share and discover new web pages.Digg  del.icio.us  tc.eserver.org  Blinklist  Furl  Reddit  Blogmarks  Magnolia  Sphere  Yahoo!  Google  Windows Live  Technorati  Blue Dot  Simpy  Newsvine  Stumble Upon  co.mments.com  Blinkbits  BlogMemes  Connotea  View previous topic :: View next topic  
Author Message
chris
Dark Lord of the Sith


Joined: 10 May 2003
Posts: 6257
Location: Outer Space

PostPosted: Sat Jan 10, 2004 4:19 pm    Post subject:
Reply with quote

Obviously, the $blockfile variable is empty, because the $content variable contains:

Code:

$content .= "\n[cached with ID=$fileid]";


and $fileid is a file ID that is formed by concatenating $blockfile and ".php", giving the filename as file ID to Cache-Lite:

Code:

$fileid = basename($blockfile,".php");


Remains to find out why $blockfile is empty.

$blockfile is a variable that is computed by PHP-Nuke in mainfile.php, in function blocks():

Code:

    $sql = "SELECT bid, bkey, title, content, url, blockfile, view FROM ".$prefix."_blocks
WHERE bposition='$pos' AND active='1' $querylang ORDER BY weight ASC";
    $result = $db->sql_query($sql);
    while($row = $db->sql_fetchrow($result)) {
        $bid = $row[bid];
        $title = $row[title];
        $content = $row[content];
        $url = $row[url];
        $blockfile = $row[blockfile];


But the value of $blockfile, in your situation, is not passed through up to the individual block. It is passed to render_blocks() (in mainfile.php again), which presumably renders the block using themecenterbox(() and themesidebox() for blocks that don't have a filename.

The short-term remedy is:

Set

Code:

$blockfile = "block-BugTraq";


The question is, however, why this block does not have a name. Didn't you save it as block-BugTraq.php in the blocks folder? Didn't you choose it from the "Filename" drop-down menu after that?
_________________
Regards

Chris Karakas
www.karakas-online.de
Back to top
View user's profile Send private message Send e-mail Visit poster's website
anthonyaykut
Staff Sergeant
Staff Sergeant


Joined: 07 Jan 2004
Posts: 45
Location: Europe

PostPosted: Sat Jan 10, 2004 4:23 pm    Post subject:
Reply with quote

Quote:
Open quoteThe question is, however, why this block does not have a name. Didn't you save it as block-BugTraq.php in the blocks folder? Didn't you choose it from the "Filename" drop-down menu after that? Close quote


Clever - indeed, the block is an inclusion in a module... if I go and make a block to test, it is OK ([cached with ID=block-Bugtraq]) - so I assume all is well now!

Thanks Chris (and thanx for putting up with me LOL)!
Regards
Anthony
Back to top
View user's profile Send private message Visit poster's website
anthonyaykut
Staff Sergeant
Staff Sergeant


Joined: 07 Jan 2004
Posts: 45
Location: Europe

PostPosted: Mon Jan 12, 2004 9:58 am    Post subject:
Reply with quote

One last question regarding jpcache - we included the file and set the timeout in the main index.php of nuke - is this enough for the whole site or does this need/can this be done in all module index.php files as well or is there no need?

Regards,
Anthony
Back to top
View user's profile Send private message Visit poster's website
anthonyaykut
Staff Sergeant
Staff Sergeant


Joined: 07 Jan 2004
Posts: 45
Location: Europe

PostPosted: Wed Jan 14, 2004 2:12 pm    Post subject:
Reply with quote

Any ideas on the last question Question
Back to top
View user's profile Send private message Visit poster's website
chris
Dark Lord of the Sith


Joined: 10 May 2003
Posts: 6257
Location: Outer Space

PostPosted: Wed Jan 14, 2004 4:49 pm    Post subject:
Reply with quote

I missed that one, sorry.

It all depends on your "caching strategy". Is your strategy to cache every individual module, or the whole result (the final page, made of the module, the blocks etc.)?

You could certainly cache individual modules. It is you who decides! If you say: "well, for me it is enough that the users see the version of the encyclopedia of the last hour, but I want the *current* news", then you can cache the Encyclopedia module with a cache intervall of 1 hour and leave News uncached *and* take out the caching of the main index.php (if you leave it, and the News module is the "Home" module, then it will be cached, although you didn't want it). Of course, in such a case, if you want some blocks to be cached, you will have to arrange it individually too.
_________________
Regards

Chris Karakas
www.karakas-online.de
Back to top
View user's profile Send private message Send e-mail Visit poster's website
anthonyaykut
Staff Sergeant
Staff Sergeant


Joined: 07 Jan 2004
Posts: 45
Location: Europe

PostPosted: Wed Jan 14, 2004 5:12 pm    Post subject:
Reply with quote

Thanks for the feedback Chris!
Back to top
View user's profile Send private message Visit poster's website
nukestud
Lance Corporal
Lance Corporal


Joined: 22 Jan 2004
Posts: 7

PostPosted: Thu Jan 22, 2004 12:43 pm    Post subject:
Reply with quote

Hi Chris, this jpcache thing is kind of useless especially when you site requires loging in to.

I mean the statement

if (!isset($user)) {
$cachetimeout=-1;

That will turn off caching completely for logged in users right or am I missing something?

Cheers Wink
Back to top
View user's profile Send private message
chris
Dark Lord of the Sith


Joined: 10 May 2003
Posts: 6257
Location: Outer Space

PostPosted: Thu Jan 22, 2004 10:14 pm    Post subject:
Reply with quote

Right, but you miss the point. The point is, you can use jpcache for caching, whenever you want. It just happens that I want to use it only for non registered users.

Why? Because I find caching the whole page (not jpcache, because jpcache can cache whatever you tell it to cache, even an individual block) less meaningful, when the user is logged in - in my versions of PHP-Nuke, with the modules that I have activated.

Your mileage may vary, but it does not have to do with jpcache, which is still very useful (although a bit superceded by Cache-Lite).
_________________
Regards

Chris Karakas
www.karakas-online.de
Back to top
View user's profile Send private message Send e-mail Visit poster's website
nukestud
Lance Corporal
Lance Corporal


Joined: 22 Jan 2004
Posts: 7

PostPosted: Fri Jan 23, 2004 6:41 am    Post subject:
Reply with quote

K I didn't really get a chance to try cache-lite cause I had all sorts or user login errors when I tried jpcache. I may give it a go shortly...

Cheers..
Back to top
View user's profile Send private message
chris
Dark Lord of the Sith


Joined: 10 May 2003
Posts: 6257
Location: Outer Space

PostPosted: Fri Jan 23, 2004 9:48 am    Post subject:
Reply with quote

What did you try to cache with jpcache?

If you tried to cache the whole index.php page even for registered users, you shouldn't be surprised of the errors and you shouldn't blame it on jpcache. jpcache just cached what you told it to, for the time intervall you told it to.

Now, if users get different output on your index.php page, depending on your settings as an administrator (blocks, modules etc.) and their settings as users, and jpcache caches it, then I can imagine that your user A did not get to see what he should see, but what user B was viewing a few minutes ago. In other words, all users will see user's B cached index.php page, with all the wrong links in it, like "Your Account" with user's B data in the link etc.

In such cases (i.e. for registered users), it makes more sense to cache only individual modules or blocks which

  • take much time to build their content and
  • their content is independent of the user viewing it.


Arrow You will get the same problems with any cache mechanism. You must know what you cache and why you cache it!
_________________
Regards

Chris Karakas
www.karakas-online.de
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Share this page: These icons link to social bookmarking sites where readers can share and discover new web pages.Digg  del.icio.us  tc.eserver.org  Blinklist  Furl  Reddit  Blogmarks  Magnolia  Sphere  Yahoo!  Google  Windows Live  Technorati  Blue Dot  Simpy  Newsvine  Stumble Upon  co.mments.com  Blinkbits  BlogMemes  Connotea 
Display posts from previous:   
Post new topic   Reply to topic
   Chris Karakas Online Forum Index -> PHP-Nuke Forum
Page 6 of 19
This page contains valid HTML 4.01 Transitional - click here to check it!
This page contains a valid CSS - click here to check it!

 

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group