Topic: Unable to fetch

http://forum.creaturecorp.com/search.php

Search for anything, even a blank, and look what happens.

I don't even know where to start, since there seem to be multiple errors.

$result = $db->query('SELECT t.id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.id IN('.implode(',', $search_ids).')'.$forum_sql.' GROUP BY t.id', true) or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
I don't HAVE a signature, ok?

Re: Unable to fetch

turn on debug mode?

Re: Unable to fetch

I did

I don't HAVE a signature, ok?

Re: Unable to fetch

Blank Search Results With:

File: /home/xxx/domains/creaturecorp.com/public_html/forum/search.php
Line: 707

PunBB reported: Unable to fetch category/forum list

Real search Results with:

File: /home/xxx/domains/creaturecorp.com/public_html/forum/search.php
Line: 290

PunBB reported: Unable to fetch topic list

I don't HAVE a signature, ok?

5 (edited by Smartys 2005-06-03 20:36)

Re: Unable to fetch

Mmm, the database error is blank when I checked your site: did you mod search.php? I would try it with a clean copy first and then try modding it again

6 (edited by creaturecorp 2005-06-03 21:07)

Re: Unable to fetch

No, I haven't modded it at all. I did an update from 1.2 to 1.2.5... maybe I missed a database change somewhere.

*edit*

I also tried with a fresh copy of the search.php all the way back to 1.2, still same errors.

I also have errors all over the place, with the orange table saying the error. It was in the administrator panel under "check for upgrade"

This is really freaking me out.

I don't HAVE a signature, ok?

Re: Unable to fetch

If you haven't modded at all, then just overwrite all your php files and see if that magically fixes it wink

Re: Unable to fetch

My entire forum is screwed up... It's not even funny

I don't HAVE a signature, ok?

Re: Unable to fetch

Do you have backups you could restore?

Re: Unable to fetch

Wait, I found that eval()ing $tpl_main at the end of footer.php causes the problem. The problem is fixed when it is simply exit($tpl_main). I don't know why this occurs, but my site pretty much falls apart if I can't eval it, therefore this could be a problem.

I don't HAVE a signature, ok?

11 (edited by Smartys 2005-06-03 22:00)

Re: Unable to fetch

Wait, so what did you change?
Edit: I just took a look at your main.tpl and I don't think you're supposed to use PHP in it

Re: Unable to fetch

Could you get Rickard to look at this thread, because he remembers that one can eval the output of punBB and therefore parsing the code that's in the template. It was functioning fine in 1.2, but as soon as I upgraded to 1.2.5 I started having the errors. Removing the eval and replacing the default exit(); fixes the error, although it causes one to have raw PHP on the pages. I might consider downgrading to 1.2 if it's no longer possible to have code in templates.

I don't HAVE a signature, ok?

13 (edited by Smartys 2005-06-03 22:14)

Re: Unable to fetch

Since this change is the only one affecting footer.php I found, try undoing it (although I can't see how in the world it would affect you)
http://punbb.org/forums/viewtopic.php?id=6411

Re: Unable to fetch

As far as I know, I haven't changed anything that would effect your ability to eval() the template. Personally, I have never tried eval():ing it, so I can't say I have any experience with it. Try what Smartys suggested. I doubt it would affect this, but it's worth a try.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Unable to fetch

I tried Smartys suggestion, but there was still the same error. I have no idea what could be causing this, since it's been working in 1.2. Any more ideas?

I don't HAVE a signature, ok?

Re: Unable to fetch

The error occurs when:

Seeing if there is a new version
Searching
Logging in with an invalid password
etc.

I don't HAVE a signature, ok?

17 (edited by creaturecorp 2005-06-04 01:52)

Re: Unable to fetch

Any form of searching gives the error in 1.2.5 when eval()'ing code.

http://creaturecorp.com/forumold/

1.2 has no problems whatsoever; search and everything is perfectly functional. Wtf.

I don't HAVE a signature, ok?

Re: Unable to fetch

$tpl_main=eval(" ?>".$tpl_main."<?php ");
exit($tpl_main);

That fixed it. From now on, anyone wanting to eval code in templates must use this.

I don't HAVE a signature, ok?

Re: Unable to fetch

That would mean it probably has something to do with the message() function in include/functions.php. That function is called to display messages such as the one you mentioned.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Unable to fetch

Actually, it's because I'm an idiot and didn't add the exit clause.

I don't HAVE a signature, ok?

Re: Unable to fetch

big_smile

"Programming is like sex: one mistake and you have to support it for the rest of your life."