1 (edited by Alux 2010-11-23 20:47)

Topic: Code not working - topic title on last post

Hi, i'm new to the PunBB code so bare with me.

I'm trying to show the title of a topic on the forum home page. This is my current code:

index.php

$queryr = array(
    'SELECT'    => 'subject',
    'FROM'        => 'topics',
    'WHERE'        => 'last_post_id != '.$cur_forum['last_post_id']
);

($hook = get_hook('in_stats_qr_get_user_count')) ? eval($hook) : null;
$resultr = $forum_db->query_build($queryr) or error(__FILE__, __LINE__);
$subtitle = $forum_db->result($resultr);

            $forum_page['item_body']['info']['lastpost'] = '<li class="info-lastpost"><span class="label">'.$lang_index['Last post'].'</span> <strong><a href="'.forum_link($forum_url['post'], $cur_forum['last_post_id']).'">'.$subtitle.'</a></strong> <cite>'.format_time($cur_forum['last_post']).' by '.sprintf($lang_index['Last poster'], forum_htmlencode($cur_forum['last_poster'])).'</cite></li>';
unset($subtitle);
unset($resultr);
unset($queryr);

all it seems to do is show the topic title from the first thread of the first forum for all of them. any help please anyone?

Re: Code not working - topic title on last post

why are you not using this extension?
http://punbb.informer.com/forums/topic/ … ndex-page/