Link from Last Post Time w/Simple Subforums

To talk about mods and code.
Patches requests, solutions and SEO tweaks sharing.

Moderator: Moderators

Link from Last Post Time w/Simple Subforums

Postby coyote » Mon Sep 03, 2007 12:55 pm

My very first mod, ever.

I'm not sure if anyone else has already come up with this. I've searched all over the 'net for it, and I can't seem to find it anywhere else, so I'm posting it here first. :)

This mod is based on the same principle that A2K uses to link to the last post on index.php. This mod will do the same thing for Simple Subforums 1.0.2 (by pentapenguin) on viewforum.php.

If this is not an original mod, someone please tell me.

Code: Select all
##############################################################
## MOD Title: Link to posts by date on Simple Subforums
## MOD Author: FoxyLoxy http://www.foxymods-phpbb.com
## MOD Description: Fixes the last post display on Simple Subforums to link to
##          the last post instead of the last post author's profile.
## MOD Version: 1.0.0
##
## Installation Level: (Easy)
## Installation Time: 1 Minute
## Files To Edit: viewforum.php
## Included Files: n/a
#################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#################################################################

#
#----[ OPEN ]---------------------------------
#

viewforum.php

#
#----[ FIND ]---------------------------------
#

            $last_post_time = create_date($board_config

['default_dateformat'], $subforum_data[$j]['post_time'], $board_config['board_timezone']);


#
#----[ REPLACE WITH ]-------------------------
#

//            $last_post_time = create_date($board_config

['default_dateformat'], $subforum_data[$j]['post_time'], $board_config['board_timezone']);
$last_post_time = '<a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' .

$subforum_data[$j]['forum_last_post_id']) . '#' . $subforum_data[$j]['forum_last_post_id'] . '"

title="' . $lang['View_latest_post'] . '">' . create_date($board_config['default_dateformat'],

$subforum_data[$j]['post_time'], $board_config['board_timezone']) . '</a>';


#
#----[ FIND ]---------------------------------
#

            $last_post .= '<a href="' . append_sid("viewtopic.$phpEx?"  .

POST_POST_URL . '=' . $subforum_data[$j]['forum_last_post_id']) . '#' . $subforum_data[$j]

['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' .

$lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';

#
#----[ REPLACE WITH ]-------------------------
#

/*
            $last_post .= '<a href="' . append_sid("viewtopic.$phpEx?"  .

POST_POST_URL . '=' . $subforum_data[$j]['forum_last_post_id']) . '#' . $subforum_data[$j]

['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' .

$lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';
*/

#
#----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM



DEMO

Comments? Suggestions?
coyote
phpBB SEO Team
phpBB SEO Team
 
Posts: 257
Joined: Fri May 11, 2007 6:24 am

Advertisement

Postby Peter77 » Tue Sep 04, 2007 2:37 am

That's a nifty add on. I know about that little patch and actually have it on a test forum. what would be really sweet, if this does actually help to make the link more "interesting" to Search engines, is to have it work with Today-Yesterday Relative Time MOD. Example of what it does to the time is on the 4th post of that link. :)


:edit:

I took the Mouse hover over post MOD and did it so that the first "x" characters of the last post hovers over the date link :) . the MOD was developed to show the alt over the Topic title made in viewforum.php.

But Instead of adding

Code: Select all
class="topictitle">{topicrow.TOPIC_TITLE}


in viewforum_body.tpl

I added it in viewforum.php . I took out the tittle= attribute and moved it...

find
Code: Select all
'View_latest_post'] . '">'


and added the title to where you can fit in html.

Code: Select all
'View_latest_post'] . '" title={topicrow.LAST_POST_RESULT}>'


There is extra stuff in there that needs to come out, I know, but I can not figure how to get rid of it without messing it up.

So I have ...

$last_post_time = '<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $topic_rowset[$i]['topic_last_post_id']) . '#' . $topic_rowset[$i]['topic_last_post_id'] . '""' . $lang['View_latest_post'] . '"title={topicrow.LAST_POST_RESULT}>' . create_date($board_config['default_dateformat'], $topic_rowset[$i]['post_time'], $board_config['board_timezone']) . '</a>';

:edit: edit to add that I had to take out title= because other wise with Fire Fox I was getting {topicrow.LAST_POST_RESULT} in the preview and it looked ugly.

I have it showing the latest post thanks to this little fix
http://www.phpbb.com/community/viewtopi ... 0#p1805270

But probably better to show the first post's content...

Image

So it needs some cleaning. We should have a phpbb-seo.com version with these ideas :) . This forum has something similar.
Last edited by Peter77 on Thu Nov 01, 2007 12:19 am, edited 2 times in total.
Peter77
phpBB SEO Team
phpBB SEO Team
 
Posts: 520
Joined: Wed May 10, 2006 9:46 am
Location: Michigan

Postby dcz » Tue Sep 04, 2007 9:37 am

Thanks for sharing ;)

Displaying the last post date is for sure a bit more user and bot friendly. I don't think though that displaying all of the post content on mouse over these link is this wise. Because it makes the pages heavier and could be taken a spam indexing (too long title tags).

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21219
Joined: Fri Apr 28, 2006 9:03 pm

Postby coyote » Tue Sep 04, 2007 9:41 pm

Peter77 wrote:That's a nifty add on. I know about that little patch and actually have it on a test forum. what would be really sweet, if this does actually help to make the link more "interesting" to Search engines, is to have it work with Today-Yesterday Relative Time MOD.


YES, I agree! Alternatively, I would also like to figure out how to get topic titles to display on the simple subforums. Not as bot friendly, but more user friendly for sure. The supreme mod would be to figure out how to make all that configurable through the ACP. To be able to link via date or topic title per forum, whichever you choose.
coyote
phpBB SEO Team
phpBB SEO Team
 
Posts: 257
Joined: Fri May 11, 2007 6:24 am

Postby dcz » Wed Sep 05, 2007 10:46 am

That's pretty much what the today at yesterday at mod would do. It costs an extra join in index, but it's not that much in most cases.
If I recall well, there is an add on for the sub forum mod to work with the today at yesterday at mod as well.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21219
Joined: Fri Apr 28, 2006 9:03 pm


Return to phpBB2 Mods and Code

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 2 guests