1 (edited by poupoul2 2007-06-02 16:38)

Topic: show_unanswered query trouble

Hi all

On the Ubuntu-fr forum, powered by PunBB, the show_unanswered query has been displaying this result for a few weeks: Your query did not send any result (instead of a possible "there is no answer to your query"). It seems that this result is due to a huge number of possible answers.

By now, the administrators of the forum limited the query to all hundred last unanswered posts. here are the questions:
- is there any PunBB configurable -or not- limit to a query, and especially this one?

Some tests were done by members:
querying "nvidia": about 8300 posts, on 278 pages
querying "ati": about 7500 posts, on 252 pages
querying "ubuntu": No hits (strange as it has been done on an Ubuntu forum)
querying "drivers": No hits (we all know there are no drivers issue on Linux wink

Here is the post on this subject (sorry, french post): http://forum.ubuntu-fr.org/viewtopic.ph … 10#p961010

EDIT: Is there any mean to force this query to return only the related posts of the last week, 2 weeks or month?

Thanks for any suggestion to help the admins

Re: show_unanswered query trouble

This isn't the first complaint I've heard about this, but I'd need to know more to be able to investigate.
Specifically, I'd need to see what queries these no hits pages are running

Re: show_unanswered query trouble

Thanks for your answer, Smartys.

I just requested the admins for additional information. I'll keep you updated

4 (edited by poupoul2 2007-06-02 17:31)

Re: show_unanswered query trouble

// Ugly hack:  limit 100 workaround for punbb internal limitation Ju 20070529 other hack since we're big  order by posted desc /o\
$result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t 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 t.num_replies=0 A
ND t.moved_to IS NULL and f.id!=7 and f.id!=43 and f.id!=8 and f.id!=4  order by posted desc limit 100') or error('Unable to fetch topic list', __FILE__, __LINE__,
$db->error());

Here is the code of the search.php action, the troubled query being search.php?action=show_unanswered

EDIT: the Ugly hack has recently been added by Ju (one of the admins).

Just ask if you need more information. thanks again for help

Re: show_unanswered query trouble

I think I would need to test this out more personally in order to attempt to figure out what's going wrong.
If anyone is willing to give me a database dump of a forum that's having this issue, send me an email (smartys@ this domain)