PunBB Resource

Your ultimate PunBB resource!

Keywords:

    (Extended)

You are not logged in.

#1 2005-10-05 04:41:02

neubrain
Guest

Add Topic Title Info to Last Post column 1

Code:

##
##
##        Mod title:  Add Topic Title Info to Last Post column on Main Page

##
##      Mod version:  1.1
##   Works on PunBB:  1.2.5, 1.2.6, 1.2.7
##     Release date:  2005-10-04
##           Author:  Neal Poole (smartys@gmail.com)
##
##      Description:  This mod allows displays topic title information on the 'Last Post' column on the main forum page.
##
##   Affected files:  index.php
##
##       Affects DB:  No
##
##            Notes:  none
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
##


#
#---------[ 4. OPEN ]---------------------------------------------------------
#

index.php


#
#---------[ 5. FIND ]---------------------------------------------------------
#

$last_post = '<a href="viewtopic.php?pid='.$cur_forum['last_post_id'].'#p'.$cur_forum['last_post_id'].'">'.format_time($cur_forum['last_post']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_forum['last_poster']).'</span>';


#
#---------[ 6. REPLACE, ADD ]---------------------------------------------------
#

$last_post = '<a href="viewtopic.php?pid='.$cur_forum['last_post_id'].'#p'.$cur_forum['last_post_id'].'">'.$cur_forum['subject'].'</a> <span class="byuser">'.format_time($cur_forum['last_post']).'  -  '.$lang_common['by'].' '.pun_htmlspecialchars($cur_forum['last_poster']).'</span>';


#
#---------[ 5. FIND ]---------------------------------------------------------
#

$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, 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());


#
#---------[ 6. REPLACE, ADD ]---------------------------------------------------
#

$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, f.last_post_id, f.last_poster, t.subject FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id 
LEFT JOIN '.$db->prefix.'topics AS t ON f.last_post_id=t.last_post_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());

Download here

 

#2 2005-10-05 11:39:18

Smartys
Member
Registered: 2005-03-18
Posts: 314
Website

Re: Add Topic Title Info to Last Post column 1

rofl, might want to correct the author, I didn't write it tongue
And the numbering on the bottom

Last edited by Smartys (2005-10-05 11:39:43)


Free PunBB Hosting - lots of mods, easy to customize

Offline

 

#3 2005-10-05 14:48:26

Connorhd
Member
Registered: 2005-01-15
Posts: 176

Re: Add Topic Title Info to Last Post column 1

isn't that this http://punres.net/doku.php?id=how-tos:s … t_on_index which has been there for ages tongue and was written by Ju

Offline

 

#4 2007-01-22 14:02:57

hcs
Member
From: Russia
Registered: 2006-02-11
Posts: 68
Website

Re: Add Topic Title Info to Last Post column 1

This mod has xss vulnerability.
This step:

Code:

#
#---------[ 6. REPLACE, ADD ]---------------------------------------------------
#

$last_post = '<a href="viewtopic.php?pid='.$cur_forum['last_post_id'].'#p'.$cur_forum['last_post_id'].'">'.$cur_forum['subject'].'</a> <span class="byuser">'.format_time($cur_forum['last_post']).'  -  '.$lang_common['by'].' '.pun_htmlspecialchars($cur_forum['last_poster']).'</span>';

Requires replacement:

Code:

#
#---------[ 6. REPLACE, ADD ]---------------------------------------------------
#

$last_post = '<a href="viewtopic.php?pid='.$cur_forum['last_post_id'].'#p'.$cur_forum['last_post_id'].'">'.pun_htmlspecialchars($cur_forum['subject']).'</a> <span class="byuser">'.format_time($cur_forum['last_post']).'  -  '.$lang_common['by'].' '.pun_htmlspecialchars($cur_forum['last_poster']).'</span>';

$cur_forum['subject'] instead
pun_htmlspecialchars($cur_forum['subject'])

exploit - yes

Offline

 

#5 2007-01-23 04:38:04

dollarbill
Member
Registered: 2006-07-17
Posts: 21

Re: Add Topic Title Info to Last Post column 1

Not to mention it's a very DB intensive process to scan for the last post of all the forums.

I used to use a method like this, I since added a column to the forum table which keeps track of the last post, much less stress to the server now.

Offline

 

#6 2007-03-22 22:08:15

Slorrin
New member
Registered: 2007-03-22
Posts: 1

Re: Add Topic Title Info to Last Post column 1

I tried this, and it didn't work.

Offline

 

#7 2007-05-21 00:55:56

ozaidum
New member
Registered: 2007-05-20
Posts: 1

Re: Add Topic Title Info to Last Post column 1

works great with the latest version big_smile

Offline

 

#8 2007-06-10 10:38:01

BUS
New member
Registered: 2007-06-03
Posts: 1

Re: Add Topic Title Info to Last Post column 1

does anyone tell me how can i make it works with this mod?
http://www.punres.net/viewtopic.php?id=594

Offline

 

#9 2008-08-02 19:50:16

asking
Member
From: Russia
Registered: 2008-07-31
Posts: 10

Re: Add Topic Title Info to Last Post column 1

I have the same problem like BUS...

This mod don't work correctly with SubForum mod...


Forum1
-------------------------------
Forum2
Subforum1
-------------------------------
Forum3
-------------------------------
Subforum1

Offline

 

#10 2011-02-03 04:25:59

luke
New member
Registered: 2011-02-01
Posts: 2

Re: Add Topic Title Info to Last Post column 1

It's a shame you can't download this anymore sad

Offline

 

#11 2011-03-21 16:56:29

Oliverk48
New member
Registered: 2011-01-02
Posts: 1

Re: Add Topic Title Info to Last Post column 1

Can't download, link is broken sad Copy and Paste here we go.


Oliver [at] hemorrhoid treatment X dot Org.

Offline

 

#12 2011-05-07 15:17:52

SuperUploader888
Banned
Registered: 2011-05-07
Posts: 5

Re: Add Topic Title Info to Last Post column 1

Link die sad, please reupload.

Offline

 

Board footer

Based on PunBB
© Copyright 2002–2005 Rickard Andersson

© Copyright 2004–2006 Kristoffer Jansson

User contributed files are property of their respective owners.