[Add-on] Enable last topic titles 1.0

Viewtopic, viewforum, posting related hacks and MODs.
Viewing topics, forums, or posting add-ons.

How would you rate this mod?

Excellent!
3
38%
Very Good
3
38%
Good
1
13%
Fair
0
No votes
Poor
1
13%
 
Total votes : 8

[Add-on] Enable last topic titles 1.0

Postby Handyman » 29 Dec 2006, 23:25

Classification: Add-on
phpBB Part: Forum

MOD Name: Enable last topic titles
MOD Version: 1.0
Author: Handyman
MOD Description: Enables phpBB3 default last topic titles

Works with:
  • phpBB 3.0 BETA => 4
  • Will not work with any version before Beta4

Features:
  • This tip adds the last topic titles using phpBB3s default functions... only one style change is needed

Language: N/A

Licence: N/A

Installation Level: Easy
Installation Time: 1 Minute
Format: Tip
Instructions: In spoiler below.
Spoiler:
Code: Select all
#
#-----[ OPEN ]-----------------------
#
styles/*/template/forumlist_body.html
#
#-----[ FIND ]------------------------
#
<p class="topicdetails">{forumrow.LAST_POST_TIME}</p>
#
#-----[ BEFORE, ADD ]----------------
#
<p class="topicdetails"><a href="{forumrow.U_LAST_POST}">{forumrow.LAST_POST_SUBJECT}</a></p>


Addition by Highway of Life to give a character limit.
Spoiler:
Open: /includes/functions_display.php
FIND:
Code: Select all
<?php $template->assign_block_vars('forumrow', array(
BEFORE, ADD:
Code: Select all
<?php         $last_post_subject censor_text($last_post_subject);
        
$last_post_subject_short str_split($last_post_subject25);


FIND:
Code: Select all
'LAST_POST_SUBJECT'        => censor_text($last_post_subject),
REPLACE, WITH:
Code: Select all
'LAST_POST_SUBJECT_SHORT'    => $last_post_subject_short[0],
            
'LAST_POST_SUBJECT'        => $last_post_subject,


Open: /styles/subSilver/template/forumlist_body.html
FIND:
Code: Select all
<class="topicdetails"><a href="{forumrow.U_LAST_POST}">{forumrow.LAST_POST_SUBJECT}</a></p>
REPLACE, WITH:
Code: Select all
<class="topicdetails"><a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_SUBJECT}">{forumrow.LAST_POST_SUBJECT_SHORT}</a></p>
Last edited by Handyman on 18 Mar 2007, 04:57, edited 4 times in total.
Reason: Added Character limit by Highway of Life.
Please contact me if you have any news to submit to SCOFF News.
SCOFFing at the candidates while you sleep.
My Mods || My Mod Queue
Image
User avatar
Handyman    
Rear Fleet Admiral
Rear Fleet Admiral
 
Posts: 7456
Joined: 08 May 2006, 04:45
Location: Where no man has gone before!
Favorite Team: Seattle Seahawks
Gender: Male




phpBB Academy at StarTrekGuide
Support STG
Using PayPal Donate

Re: [Add-on] Enable last topic titles 1.0

Postby Highway of Life » 30 Dec 2006, 01:10

Handy, you might want to revise that a bit...
All forum viewing is contained in one file now... forumlist_body.html
So it's just one file to edit.
Watch out! I might do a code wheelie!

User avatar
Highway of Life    
STG Jedi Master
STG Jedi Master
 
Posts: 10458
Joined: 08 May 2006, 05:23
Location: Beware of Programmers carrying screwdrivers
Gender: Male
phpBB Knowledge: 10

Re: [Add-on] Enable last topic titles 1.0

Postby LEW21 » 30 Dec 2006, 05:44

Last Posts Titles MOD 0.6.0 - better implementation of this function
phpBB3.PL - User-friendly Polish phpBB 3.0 support
LEW21    
Translator
Translator
 
Posts: 901
Joined: 01 Jun 2006, 03:51
Location: Warsaw, Poland
Gender: Male
phpBB Knowledge: 10

Re: [Add-on] Enable last topic titles 1.0

Postby Highway of Life » 01 Jan 2007, 16:07

I've done a minor edit that has improved the performance of this little feature, I'm going to report it as a bug report, because it was not limiting the number of characters shown, so it was able to display quite large, causing the template to look really strange.

Open: /includes/functions_display.php
FIND:
Code: Select all
<?php  $template->assign_block_vars('forumrow', array(
BEFORE, ADD:
Code: Select all
<?php          $last_post_subject = utf8_decode(censor_text($last_post_subject));
        
$last_post_subject_short = str_split($last_post_subject, 25);


FIND:
Code: Select all
'LAST_POST_SUBJECT'        => censor_text($last_post_subject),
REPLACE, WITH:
Code: Select all
'LAST_POST_SUBJECT_SHORT'    => $last_post_subject_short[0],
            
'LAST_POST_SUBJECT'        => $last_post_subject,


Open: /styles/subSilver/template/forumlist_body.html
FIND:
Code: Select all
<p class="topicdetails"><a href="{forumrow.U_LAST_POST}">{forumrow.LAST_POST_SUBJECT}</a></p>
REPLACE, WITH:
Code: Select all
<p class="topicdetails"><a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_SUBJECT}">{forumrow.LAST_POST_SUBJECT_SHORT}</a></p>
Last edited by Highway of Life on 02 Jan 2007, 04:52, edited 1 time in total.
Reason: Added UTF-8 Support
Watch out! I might do a code wheelie!

User avatar
Highway of Life    
STG Jedi Master
STG Jedi Master
 
Posts: 10458
Joined: 08 May 2006, 05:23
Location: Beware of Programmers carrying screwdrivers
Gender: Male
phpBB Knowledge: 10

Re: [Add-on] Enable last topic titles 1.0

Postby LEW21 » 02 Jan 2007, 02:05

Highway, and that's my 90% of "Last Posts Titles 0.6.0". Why are you rewriting it with all bugs that it had, but they are fixed? Your version does not work well with UTF8... and my does!

Ahh, now I know! Someone deleted link to newest version and uploaded 0.5.0 instead! I added new link, so you can download 0.6.0.
phpBB3.PL - User-friendly Polish phpBB 3.0 support
LEW21    
Translator
Translator
 
Posts: 901
Joined: 01 Jun 2006, 03:51
Location: Warsaw, Poland
Gender: Male
phpBB Knowledge: 10

Re: [Add-on] Enable last topic titles 1.0

Postby Highway of Life » 02 Jan 2007, 04:39

Actually, I'm not sure what yours has. Blush

I have not looked at it, I suppose I should now...

Edit: I just checked, I had downloaded your MOD a few weeks ago to whatever link Handy had put there, and it was indeed 0.6.0, so I know I had the right one.
Looking at it now...

Hmm... Okay, well, the only thing I missed was the utf8_decode();
Everything else is the same, or an alternate way of doing it. I'll update the bug.
Watch out! I might do a code wheelie!

User avatar
Highway of Life    
STG Jedi Master
STG Jedi Master
 
Posts: 10458
Joined: 08 May 2006, 05:23
Location: Beware of Programmers carrying screwdrivers
Gender: Male
phpBB Knowledge: 10

Re: [Add-on] Enable last topic titles 1.0

Postby Highway of Life » 02 Jan 2007, 07:35

Watch out! I might do a code wheelie!

User avatar
Highway of Life    
STG Jedi Master
STG Jedi Master
 
Posts: 10458
Joined: 08 May 2006, 05:23
Location: Beware of Programmers carrying screwdrivers
Gender: Male
phpBB Knowledge: 10

Re: [Add-on] Enable last topic titles 1.0

Postby A_Jelly_Doughnut » 11 Feb 2007, 08:26

This seems to be a bug in phpBB3 itself, but if you create a new topic, then edit the title of that topic while it is still the most recent post in the forum, you see the original topic title rather than the edited title.
A_Jelly_Doughnut
phpBB Team Member
phpBB Team Member
 
Posts: 543
Joined: 10 Feb 2007, 14:58
Location: 1- 800 - In - The - USA
Gender: Male

Re: [Add-on] Enable last topic titles 1.0

Postby A_Jelly_Doughnut » 11 Feb 2007, 21:00

I've reported the above as a bug in phpBB3: http://www.phpbb.com/bugs/viewreport.php?b=8046
A_Jelly_Doughnut
phpBB Team Member
phpBB Team Member
 
Posts: 543
Joined: 10 Feb 2007, 14:58
Location: 1- 800 - In - The - USA
Gender: Male

Re: [Add-on] Enable last topic titles 1.0

Postby Michaelo » 12 Feb 2007, 00:31

Just added this mod to site and noticed the stretch... so used
Code: Select all
$last_post_subject_short = truncate_string($row['forum_last_post_subject'],20,FALSE,'...');

and then I read the rest of the posts... Blush mind you as usual I prefer my fix as it add the dots '...' Smile
Stargate Portal (Dev Site) phpBB 3.0.9 version II 99%.
Kiss Portal Engine (Dev Site) phpBB 3.0.10 99%.
User avatar
Michaelo    
Supporter
Supporter
 
Posts: 342
Joined: 17 Sep 2006, 09:02
Location: Dublin, Ireland
Favorite Team: Miami Dolphins
Gender: Male
phpBB Knowledge: 9

Next

Return to Topic, Forum, Posting MOD Downloads

Who is online

Users browsing this forum: No registered users and 2 guests