|
|
| Author |
Message |
chris Dark Lord of the Sith

Joined: 10 May 2003 Posts: 6257 Location: Outer Space
|
Posted: Sat Jan 10, 2004 4:19 pm Post subject: |
|
|
|
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 |
|
 |
anthonyaykut Staff Sergeant

Joined: 07 Jan 2004 Posts: 45 Location: Europe
|
Posted: Sat Jan 10, 2004 4:23 pm Post subject: |
|
|
|
| Quote: | 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?
 |
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 |
|
 |
anthonyaykut Staff Sergeant

Joined: 07 Jan 2004 Posts: 45 Location: Europe
|
Posted: Mon Jan 12, 2004 9:58 am Post subject: |
|
|
|
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 |
|
 |
anthonyaykut Staff Sergeant

Joined: 07 Jan 2004 Posts: 45 Location: Europe
|
Posted: Wed Jan 14, 2004 2:12 pm Post subject: |
|
|
|
Any ideas on the last question  |
|
| Back to top |
|
 |
chris Dark Lord of the Sith

Joined: 10 May 2003 Posts: 6257 Location: Outer Space
|
Posted: Wed Jan 14, 2004 4:49 pm Post subject: |
|
|
|
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 |
|
 |
anthonyaykut Staff Sergeant

Joined: 07 Jan 2004 Posts: 45 Location: Europe
|
Posted: Wed Jan 14, 2004 5:12 pm Post subject: |
|
|
|
| Thanks for the feedback Chris! |
|
| Back to top |
|
 |
nukestud Lance Corporal

Joined: 22 Jan 2004 Posts: 7
|
Posted: Thu Jan 22, 2004 12:43 pm Post subject: |
|
|
|
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  |
|
| Back to top |
|
 |
chris Dark Lord of the Sith

Joined: 10 May 2003 Posts: 6257 Location: Outer Space
|
Posted: Thu Jan 22, 2004 10:14 pm Post subject: |
|
|
|
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 |
|
 |
nukestud Lance Corporal

Joined: 22 Jan 2004 Posts: 7
|
Posted: Fri Jan 23, 2004 6:41 am Post subject: |
|
|
|
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 |
|
 |
chris Dark Lord of the Sith

Joined: 10 May 2003 Posts: 6257 Location: Outer Space
|
Posted: Fri Jan 23, 2004 9:48 am Post subject: |
|
|
|
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.
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 |
|
 |
|
|
 |
|
|