Show last topic title not post title in forum index

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Ideas Centre
Locked
sirus175
Registered User
Posts: 21
Joined: Mon Dec 03, 2007 5:02 pm

Show last topic title not post title in forum index

Post by sirus175 »

Hello,
i want to show last topic title in my forum index and make it linked to the main topic link
Example
this topic title is
Show last topic title not post title in forum index
and it linked to
http://www.phpbb.com/community/viewtopi ... &t=2093806

not

http://www.phpbb.com/community/viewtopi ... #p12730105 after users add posts

Thanks and wait for reply

Rudeman72
Registered User
Posts: 64
Joined: Fri Nov 16, 2007 6:28 am
Contact:

Re: Show last topic title not post title in forum index

Post by Rudeman72 »

If I understood your post correctly, 2 screen shots at the bottom. Make sure to backup files in case of an error.

------------------------------------------------------------------

First:
Open includes/functions_display.php

------------------------------------------------------------------

Look for

Code: Select all

if ($show_active)
Replace it with:

Code: Select all

$sql_array['LEFT_JOIN'][] = array('FROM' => array(TOPICS_TABLE => 't'), 
          'ON' => 'f.forum_last_post_id = t.topic_last_post_id'); 
          $sql_array['SELECT'] .= ', t.topic_id, t.topic_title'; 
           
	if ($show_active)
------------------------------------------------------------------

then look for:

Code: Select all

$forum_rows[$parent_id]['forum_id_last_post'] = $row['forum_id'];
replace it with:

Code: Select all

$forum_rows[$parent_id]['forum_id_last_post'] = $row['forum_id'];
                        $forum_rows[$parent_id]['topic_id'] = $row['topic_id']; 
                        $forum_rows[$parent_id]['topic_title'] = $row['topic_title'];
------------------------------------------------------------------

then look for

Code: Select all

$forum_rows[$parent_id]['forum_id_last_post'] = $row['forum_id'];
replace it with:

Code: Select all

$forum_rows[$parent_id]['forum_id_last_post'] = $forum_id;
                                $forum_rows[$parent_id]['topic_id'] = $row['topic_id']; 
                                $forum_rows[$parent_id]['topic_title'] = $row['topic_title'];
------------------------------------------------------------------

then look for:

Code: Select all

'SUBFORUMS' => $s_subforums_list,
replace it with:

Code: Select all

'SUBFORUMS'				=> $s_subforums_list,
                        'LATEST_TOPIC_TITLE_SHORT' => (utf8_strlen($row['topic_title'])> 16) ? truncate_string($row['topic_title'], 15) . "\xE2\x80\xA6" : ($row['topic_title']), 
                        'LATEST_TOPIC_TITLE_FULL' => censor_text($row['topic_title']), 
                        'U_FIRST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id']),
------------------------------------------------------------------

then look for:

Code: Select all

if ($return_moderators)
and replace it with:

Code: Select all

 $template->assign_vars(array('S_LTT' => $config['ltt_url']));
	if ($return_moderators)
After that save the file.

------------------------------------------------------------------
****If you're using prosilver****

Then open stlyes/prosilver/template/forumlist_body.html

Find:

Code: Select all

<!-- IF forumrow.LAST_POST_TIME --><dfn>{L_LAST_POST}</dfn>
after add:

Code: Select all

<a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_SUBJECT}">{forumrow.LATEST_TOPIC_TITLE_SHORT}</a><br />
Then save.
------------------------------------------------------------------
****If you're using subsilver2****

Then open stlyes/subsilver2/template/forumlist_body.html

Find:

Code: Select all

<p class="topicdetails">{forumrow.LAST_POSTER_FULL}
before add:

Code: Select all

<p class="topicdetails"><a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_SUBJECT}">{forumrow.LATEST_TOPIC_TITLE_SHORT}</a></p>
then save.
------------------------------------------------------------------

That should work.

Here's a screen shot of Subsilver:
Image

Here's a screen shot of prosilver:
Image

Hope that helps.

Locked

Return to “[3.0.x] MOD Requests”