You are not logged in. Please login or register.
Active topics Unanswered topics
Search options
I had an idea. Instead of changing much in index.php why not change post.php. I added this
$db->query("UPDATE ".$db->prefix."forums SET last_post_subject='".$subject."' WHERE last_post_id='$now'") or error('Unable to update topic', __FILE__, __LINE__, $db->error());
on line 286 and my select statement on my index php file looks like thos
$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post_subject, f.last_post, f.last_post_id, f.last_poster FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_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 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());
Now everything works well but this. When I make a post it redirects me all the time to http://url.com/viewtopic.php?pid=0#p0
I would really appreciate it if someone can help me get this working.
Smartys wrote:I tried it on my local forum: only the first topic loads
So it is the while loop? I don't understand richard didn't put the post subject in with the post itself in the database.
Smartys wrote:No, the point is the word by won't appear if it's not there
Oww, my mistake it is
*smacks himself, thinking of 1.1.5*
Missing <span class="byuser> as well
Yeah w/e can you help me with the original code?
Smartys wrote:Well, for one thing, I don't think by is in lang_common
I don't care about that... It's an all English fourm.
Why isn't this working?
// If there is a last_post/last_poster.
if ($cur_forum['last_post'] != ''){
$tmp = $db->query('SELECT subject FROM '.$db->prefix.'topics WHERE last_post_id="'.$cur_forum['last_post_id'].'"');
$topic_subject = $db->fetch_assoc($tmp);
$last_post = '<a href="viewtopic.php?pid='.$cur_forum['last_post_id'].'#p'.$cur_forum['last_post_id'].'">'.$topic_subject['subject'].'</a><br />'.$lang_common['by'].' '.pun_htmlspecialchars($cur_forum['last_poster']);
}
else
$last_post = ' ';
That's from index.php. I'm trying to make it so it shows the topic subject instead of the date.
Posts found: 6