Re: [Extension release] Last post subject on index
Noted.
EDIT:
Nah I quite like the idea of an array storing all the data. Unless someone tells me otherwise.
Anyway have fixed problem.
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.3 extensions → [Extension release] Last post subject on index
Noted.
EDIT:
Nah I quite like the idea of an array storing all the data. Unless someone tells me otherwise.
Anyway have fixed problem.
Can you make the syntax like this?
REalllllyyyy long topic title ...
by orlandu63 on 2008-02-08 21:37:12
I find 3 lines to be redundant.
But then this issue comes up:
REalllllyyyy long topic title ...
by orlandu63 on Today 00:51:00
Hmmm I really hate the 3 lines though
Maybe like this?
REalllllyyyy long topic title ...
by orlandu63, Today 00:51:00
Use an ellipsis rather than three dots.
I prefer […] over … as well, but I guess that's up to you to change.
Also, while you're at it, why not linkify the author's profile in viewforum.php?
I will sort out the ellipsis no problem. I will look into adding link to the viewforum.php page as well.
But putting it on 2 lines might be a problem. The date can be very long... the length of the box in fact. So putting poster and date on one line will be very cramped.
My next release will be adding a few options to the admin menu. (Turning things on/off, Also changing the subject length)
EDIT:
Ok... Another release... lol
1.4 - Demo - Download
Changes...
* Changed ... to ellipsis
* Added admin switchs. You can now turn certain things on/off and change subject length.
* Added linkify to viewforum.php as well. So now posters on viewforum linked to profile.
Note: Link to profile is disabled when you install this mod. You need to turn it on at admin-features. This is because it adds another join to a query, so some people might not want that.
No doubt more fixes will need to be applied. So mention anything...
Change 'Customise' to 'Customize'.
Add a period to 'Show Last Post Subject on Forum Index'
When 'Show Last Post Subject on Forum Index' and 'Enable linkify on posters username' are enabled, in forum view, the usernames are the same in the Topic column and Last post column or there are 2 usernames in the Topic column.
In forum view, the username link is using the posting id and not the username id.
Can linkify be done to the search results page?
Nah not doing search page yet.
New version 1.5 is running on http://pundemo.org will release it on punres when I get home.
Also... It does not linkify the original poster on viewforum.php only the last poster.
Sorry about all the releases... But trial and error makes it perfect.
EDIT: Updated original post. 1.5 now at punres.
Suggestion: Make the second line as Date/Time by Username to match the same format as the forum view. Thanks.
If censoring is enabled, apply censoring to the subject.
If linkify is enabled, only hyperlink usernames if the user belongs to a group that has permission to view profiles.
If censoring is enabled, apply censoring to the subject.
If linkify is enabled, only hyperlink usernames if the user belongs to a group that has permission to view profiles.
Both will be fixed on next release.
Last post subject on Index (1.3) 1.5b
Fixes:
* If censoring is enabled, apply censoring to the subject. (Thanks qubertman)
* If linkify is enabled, only hyperlink usernames if the user belongs to a group that has permission to view profiles. (Thanks qubertman)
* Made the second line as Date/Time by Username to match the same format as the forum view. (Thanks qubertman)
Thank you so much. It is very much appreciated!
One last issue for linkify. If Guests posting is enabled, then the username of guest's posting should not be hyperlinked.
Doh!
Sorry for going a bit off topic but in case you haven't noticed the links at PunDemo aren't functional at the moment.
Nice extension though!
I will set up another demo this evening (until pundemo is fully operational). I forgot that I posted links to extension demos. Like I said will fix it this evening.
For moved topics, it is showing "Topics moved by" instead of "Topics moved".
I guess theres no way to use this on 1.2.x?
Only if you use the sub-forum mod 1.0.9.3 I added the code in there.
Hmm, ok.. Thanks, I´ll just see if I can find subforum mod 1.0.9.3
Sorry for going offtopic, but I would really like to see this mod on my 1.2.16 install, also, a sub-forum mod would be great as well, so I guess its win-win Now, its just a matter of finding the mod..
Hi,
is there a solution for RC 1.3?
Bump...
Quite an important extension IMO... an absolute staple in low-traffic or new forums that need to grab people's interest right off the bat.
Is there a way to make this work properly in 1.3?
edit: Ugh!! I'm trying to make it work, but everything seems to have changed between the "1.3" that this extension was designed for, and the "1.3" that actually made it out the door... it's so frustrating not having, really, any development tools to use with PunBB, like figuring out where data is coming from or going to, or how the extension and hook system works... or really anything at all... I keep having to uninstall and reinstall the extension to check how my changes work, and add "die(print_r($GLOBALS))" to the beginning of the installation script to figure out what the heck the variable names changed to... and then I find that the entire way the index page is generated has changed as well! *sigh*
It's worth it though. This is an absolutely essential extension that IMO should have been part of PunBB to begin with...
I got this error when installing
Notice: Undefined variable: db in /home/xxxxxx/public_html/forum/admin/extensions.php(176) : eval()'d code on line 7
Fatal error: Call to a member function query() on a non-object in /home/xxxxxx/public_html/forum/admin/extensions.php(176) : eval()'d code on line 7
Yeah, don't bother trying to install it, it's very broken. I tried my best to get it fixed, and there were a lot (a lot) of code changes that seemingly broke 1.3 Beta extensions. There's even an error that completely prevents it from being uninstalled without editing the database (as you solve each of the problems it presents, one of the errors is in the uninstaller, which is executed from the database).
Augh.
does that work with punbb 1.3.2
Chances are No.
SuperMAG, I was looking for an extension that did this as well but couldn't find one. Instead of writing an extension (which would be my first for this version of PunBB) I modified the code a bit in index.php (after line 204):
Replace this:
if ($cur_forum['last_post'] != '')
$forum_page['item_body']['info']['lastpost'] = '<li class="info-lastpost"><span class="label">'.$lang_index['Last post'].'</span> <strong><a href="'.forum_link($forum_url['post'], $cur_forum['last_post_id']).'">'.format_time($cur_forum['last_post']).'</a></strong> <cite>'.sprintf($lang_index['Last poster'], forum_htmlencode($cur_forum['last_poster'])).'</cite></li>';
else
$forum_page['item_body']['info']['lastpost'] = '<li class="info-lastpost"><strong>'.$lang_common['Never'].'</strong></li>';
With this:
$lpid = intval($cur_forum['last_post_id']);
$query2 = array(
'SELECT' => 't.subject',
'FROM' => 'topics AS t',
'WHERE' => 't.last_post_id='.$lpid
);
$result2 = $forum_db->query_build($query2) or error(__FILE__, __LINE__);
$cur_topic = $forum_db->fetch_assoc($result2);
if ($cur_forum['last_post'] != '')
$forum_page['item_body']['info']['lastpost'] = '<li class="info-lastpost"><span class="label">'.$lang_index['Last post'].'</span> <strong><a href="'.forum_link($forum_url['post'], $cur_forum['last_post_id']).'">'.$cur_topic['subject'].'</a></strong> <cite>'.sprintf($lang_index['Last poster'], forum_htmlencode($cur_forum['last_poster'])).' on '.format_time($cur_forum['last_post']).'</cite></li>';
else
$forum_page['item_body']['info']['lastpost'] = '<li class="info-lastpost"><strong>'.$lang_common['Never'].'</strong></li>';
It's a bit messy/not optimized as I haven't created/messed with SQL queries involving joins in quite some time (line 68 of index.php).
If someone wants to provide the code necessary to include the subject from the topics table into the SQL query on line 68 that would be great.
Or, if someone wants to write an extension for it, here's some starting info:
Since the hook below is on line 211 (which is right after where the info is put together for # of topics/posts, and last post):
($hook = get_hook('in_normal_row_pre_display')) ? eval($hook) : null;
It would be possible to modify the variable forum_page['item_body']['info']['lastpost'] and re-order the time to be after the person's name (eg. "topic by name on date") and put the subject title where the date was (default = "date by name").
PunBB Forums → PunBB 1.3 extensions → [Extension release] Last post subject on index
Powered by PunBB, supported by Informer Technologies, Inc.