Page Index Toggle Pages: 1 Print
Display Last Posts or Topics (Read 7664 times)
Captain John

Display Last Posts or Topics
Sep 26th, 2007 at 8:25pm
Print Post  
Changing 10 Most Recent Posts

At the bottom of the Forums main page, on the left side is a link, that can be used to display the 10 most recent posts. Some users having a large user base, prefer viewing the 20 most recent posts, instead of the default 10. To do this

The line to be edited can be found three places within this file.

Edit the file

1.) The first occurance is at Line 31 is valid when the function is changed to show xx number of most recent TOPICS (so even if the 10 most recent posts are all in the same topic), only the most recent one is showed).

2.)The second at Line 179 effects the xx most recent POSTS.

3.)The last one at Line 336 is for, which shows a plain ''List''' of recent topics with a subject and the poster.

find the line of the code below that you want to change (according to 1, 2 or 3 above)

Select All
my $display = $INFO{'display'} ||= 10; 

alter it to read

Select All
my $display = $INFO{'display'} ||= 20; 

This will allow the display of 20 recent posts or topics.

Edit the file boardindex.lng

find the line at line 50

Select All
'792'  => "10 most recent posts.", 

alter it to read

Select All
'792'  => "20 most recent posts.", 

This will change the displayed line to reflect the change to 20
Changing or Adding Topic / Post Display

Many users of large user forums would strongly prefer to bring up most recent TOPICS rather than most recent POSTS (It seems redundant to display multiple search results from a single thread when one can simply visit the thread to view all associated posts).

1) Make a backup of your forum 2) Look in /source/ for

Select All
$recentpostslink = qq~$boardindex_txt{'791'} <a href="$scripturl?action=recent">$boardindex_txt{'792'}</a>

You can do two things here - 1.)If you want to simply turn this into the last 10 Topics, replace the above code with this: Note: If you changed the quanities to be listed, as in the above chapter, be sure to change quanities.

Select All
$recentpostslink = qq~
$boardindex_txt{'791'} <a href="$scripturl?action=recentlist">10 most recent topics</a>

2.)Optionally, if you'd like both links to be displayed (Posts / Topics), insert this line after the above original unedited code:
Last Post Every Topic

To Change "View 10 most recent posts" into "View the last post on the 10 most recently updated threads". Many users much prefer that style (also changed quanity from 10 to 20). You should have the recent count set to 35 to counteract the effect of busy threads on the list. in Lines 227 to 235 Remove (commented out) the three lines as shown below and add the string. Instead of looping through each post in the selected thread, This removed the loop and directly get the last post out of the post array.

Select All
#$threadfrom = @mess > $display ? @mess - $display : 0;
 #    for ($ii = $threadfrom; $ii < @mess + 1; $ii++) {
					  $ii = $#mess;  #add this string
	  if ($mess[$ii]) {
	    ($msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip,
 $message, $mns) = split(/\|/, $mess[$ii]);
	    $mtime = $mdate;
	    $messages[$numfound] = "$mtime|$curboard|$tnum|$ii|$tusername
 #	} 

« Last Edit: Aug 27th, 2008 at 8:24pm by »  
Back to top
IP Logged
Page Index Toggle Pages: 1
  « Board Index ‹ Board  ^Top