Post: #1 [MyBB 1.6] prefixes on forum index [Last post]]
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: Post: #1 [MyBB 1.6] prefixes on forum index [Last post]]
I don't think a "prefixes" cache exists, you need to query the DB for that.
Not that I like the idea, along with the fact you're using get_thread() in there, because it means there's potentially two queries being run in a loop, but as far as getting it to work, it's not an issue.

Also, your logic seems to be a bit whacky here:

PHP Code:
$prefix = $prefix_cache[$thread['prefix']];
$forum['lastpost_prefix'] = "{$thread['prefix']}";


A few other things:

PHP Code:
$plugins->add_hook("thread_prefixes_start", "prefixesonindex_start");

Hook doesn't exist.  Closest thing I found was admin_config_thread_prefixes_start, which obviously won't work with the same processing function.

PHP Code:
$thread = get_thread($forum['lastposttid']);

lastposttid isn't guaranteed to be set (ie forum with no posts) - it might be a good idea to check that in your code.


Hope that helps.


My Blog
08-17-2010 06:56 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
RE: Post: #1 [MyBB 1.6] prefixes on forum index [Last post]] - ZiNgA BuRgA - 08-17-2010 06:56 PM

 Standard Tools
Forum Jump: