1
mparkins
Comments and Caching
  • 2005/6/9 11:18

  • mparkins

  • Just popping in

  • Posts: 5

  • Since: 2004/8/12


Hi,

Am having funny activity in the comments section when I enable caching on a particular module (AMS 2.41). When I log in as a user called 'testfriend' and look at the article page with the comments at the bottom I can edit my own comments of course. But if my brother goes to the site (he's 50 miles away) doesn't log in it the same page brings up the same comment links - ie: it shows links to edit 'testfriend's comments (though obviously if he clicks on the link it won't let him).

Any ideas? Is this normal behaviour?

Thanks in advance!

Matt



2
mparkins
Template fun
  • 2004/9/20 16:38

  • mparkins

  • Just popping in

  • Posts: 5

  • Since: 2004/8/12


My templates, lovely though they are, need to be dynamic (don't ask why - lets just go with it for now). Dynamic in the sense that an admin needs to be able to alter them. I've written all the editting code, etc., but now I'm having trouble replacing the old template with the new one.

I had guessed that I could simply change the template source in the tplsource table, and duly changed it, but to no effect (at all) - I assume the original has been compiled and is now held elsewhere.

So if that's the case how do I compile the new one and then replace the old with the new?

Thanks.



3
mparkins
Re: Undefined class name 'database'
  • 2004/9/20 14:40

  • mparkins

  • Just popping in

  • Posts: 5

  • Since: 2004/8/12


Sussed it.

It was a directory issue - I changed the includes to remove the constant XOOPS_ROOT_PATH - it's actually blatently obvious what the problem is but has only struck me now because it was v hard to pin down where it was actually going wrong - it doesn't seem to error properly if mainfile.php isn't included.

XOOPS_ROOT_PATH is actually set when mainfile.php is included (no I don't know how I thought it was some kind of global constant before either). Removed now and it works fine.

Phew, that only wasted 4 hours - at least I'll know for next time.



4
mparkins
Re: Undefined class name 'database'
  • 2004/9/20 12:47

  • mparkins

  • Just popping in

  • Posts: 5

  • Since: 2004/8/12


Thanks, but the error persists on the same line except now in the form of:

Fatal error: Undefined class name 'xoopsdatabasefactory'

I really think that it seems to be ignoring the include statement...



5
mparkins
Undefined class name 'database'
  • 2004/9/20 11:48

  • mparkins

  • Just popping in

  • Posts: 5

  • Since: 2004/8/12


I'm working on my first module and having got the admin section working fine am now working on the front end. A user does a search and finds data in my module, clicks on the link and is directed to a normal XOOPS page called viewrecord.php

The top part of this file is like this:

<?php

include XOOPS_ROOT_PATH.'/mainfile.php';
include XOOPS_ROOT_PATH.'/header.php';
include XOOPS_ROOT_PATH.'/class/database/database.php';

function getAnyRecordViewTemplateId($idtable)
{
$db = &Database::getInstance();

// BLAH BLAH BLAH - SNIPPED

return $data['id'];
}

$idtemplate = getAnyRecordViewTemplateId($_REQUEST['idtable']);


Really the problem is in the first few lines - it gets as far as setting $db, but returns the error: Fatal error: Undefined class name 'database' in C:\dev\tool\sokkit\site\xoops\modules\directory\viewrecord.php on line 9

Its almost like its ignoring the database.php include ? I've tried typing in junk in the include line there and it doesn't error either?!!?

Please help, confused

Matt




TopTop



Login

Who's Online

129 user(s) are online (88 user(s) are browsing Support Forums)


Members: 0


Guests: 129


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits