Self auth mod and no duplicate last post links

phpBB SEO Premod for phpBB3 support forum.
This premodded version of phpBB3 includes the three different type of URL rewriting for phpBB3 by phpBB SEO. It comes with several other Search Engine Optimization mods installed.

Moderator: Moderators

Self auth mod and no duplicate last post links

Postby jonli447 » Fri Dec 28, 2007 7:31 pm

Hello Guys,

I have sort a little dilemma that I'm trying to resolve. I have a forum, located at (forum [dot] rozzli [dot] com). and I'm utilized a mod called "thewizard's self auth" mod to make certain topics only viewable to the author, admin, and mods.

Unfortunately, the Last Post information appears in the board index (I do want the public to know I have a private forum available). It would not be a big deal, except I can't figure out why the Last Topic subject also displays (I think it's a phpbb-seo mod, not sure which one does this though).

Anyhow, do you guys have any ideas, how I could replace the information in the Last Post block with the word "Private" for my private forum? The post counts and views could remain, I just want to hide the last post info. Alternatively, I would also be happy if the Last Post block in the private forum would show only the Author's Last Post.


Kindest Regards,

Jon
jonli447
 
Posts: 17
Joined: Wed Oct 31, 2007 11:15 pm

Advertisement

Postby dcz » Sat Dec 29, 2007 12:20 pm

Are you using the premod ?

I'm asking because the mod that could generate these links is the no duplicate and the premod is using the updated version (unreleased yet) which is the only one to add the topic title above the regular last post link.

I need to know this before I can help.

++
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 jonli447 » Sat Dec 29, 2007 2:08 pm

Yes, I'm using premod version Gold. Thanks.
jonli447
 
Posts: 17
Joined: Wed Oct 31, 2007 11:15 pm

Postby dcz » Sat Dec 29, 2007 2:40 pm

Topic moved where it belonged ;)

Then, it's all done in includes/functions_display.php, the part that build the links is this one :

Code: Select all
         // www.phpBB-SEO.com SEO TOOLKIT BEGIN -> no dupe
         if ($phpbb_seo->seo_opt['no_dupe']['on'] && !$row['forum_password']) {
            $last_post_url =  append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&t=' . $row['topic_id'] . '&start=' . @intval($phpbb_seo->seo_opt['topic_last_page'][$row['topic_id']]) ) . '#p' . $row['forum_last_post_id'];
            // Limit in chars for the last post link text.
            $char_limit = 25;
            // Limit topic text link to $char_limit, without breacking words
            $topic_text_lilnk = $char_limit > 0 && ( ( $length = utf8_strlen($phpbb_seo->seo_censored[$row['topic_id']]) ) > $char_limit ) ? utf8_strlen($fragment = utf8_substr($phpbb_seo->seo_censored[$row['topic_id']], 0, $char_limit + 1 - 4)) < $length + 1 ? preg_replace('`\s*\S*$`', '', $fragment) . ' ...' : $phpbb_seo->seo_censored[$row['topic_id']] : $phpbb_seo->seo_censored[$row['topic_id']];
            $last_post_link = '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&amp;t=' . $row['topic_id']) . '" title="' . $phpbb_seo->seo_censored[$row['topic_id']] . ' : ' . $phpbb_seo->seo_opt['topic_forum_name'][$row['topic_id']] . '">' . $topic_text_lilnk . '</a>';
         } else {   
            $last_post_url =  append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&amp;p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id'];
            $last_post_link = '';
         }


You could just replace :
Code: Select all
         if ($phpbb_seo->seo_opt['no_dupe']['on'] && !$row['forum_password']) {


with :

Code: Select all
         if ($phpbb_seo->seo_opt['no_dupe']['on'] && !$row['forum_password'] && $auth->acl_get('f_read', $row['forum_id_last_post'])) {


To show the regular postxx.html link with no info about the topic.

If you want to get rid of the extra link, you can just comment / delete these two lines :

Code: Select all
            $topic_text_lilnk = $char_limit > 0 && ( ( $length = utf8_strlen($phpbb_seo->seo_censored[$row['topic_id']]) ) > $char_limit ) ? utf8_strlen($fragment = utf8_substr($phpbb_seo->seo_censored[$row['topic_id']], 0, $char_limit + 1 - 4)) < $length + 1 ? preg_replace('`\s*\S*$`', '', $fragment) . ' ...' : $phpbb_seo->seo_censored[$row['topic_id']] : $phpbb_seo->seo_censored[$row['topic_id']];
            $last_post_link = '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&amp;t=' . $row['topic_id']) . '" title="' . $phpbb_seo->seo_censored[$row['topic_id']] . ' : ' . $phpbb_seo->seo_opt['topic_forum_name'][$row['topic_id']] . '">' . $topic_text_lilnk . '</a>';


++
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 jonli447 » Sat Dec 29, 2007 2:54 pm

Thanks dcz! Sorry about posting in the wrong section ... I tried to post in the correct spot. :wink:

Do you know if it's possible to make it conditional? i.e. Keep the normal behavior for my public forum, and remove the extra link only for the private forum? The self auth mod does have an acl, so I thought maybe I could make it conditional up that?

Thanks again (FYI, to reciprocate you helpfulness, I'm recommending this community in forum promotion communities that I participate in).

--Jon
jonli447
 
Posts: 17
Joined: Wed Oct 31, 2007 11:15 pm

Postby dcz » Sat Dec 29, 2007 3:00 pm

Oh, yes, the mod, I only added the regular auth filtering here, which will show the postxx.html link for private forum and the nice one when you have enough right to read it.

It should be possible to add your mod type of auth too, could you post here a link to where it is officially released ?

And thanks for the recommendations ;)

++
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 jonli447 » Sat Dec 29, 2007 3:12 pm

Hi, the mod's page is here: http://www.phpbb.com/community/viewtopi ... &sk=t&sd=a

The download link is currently broken, but here's a direct link: http://www.mesarticles.fr/download/GR_S ... v0.1.0.rar
jonli447
 
Posts: 17
Joined: Wed Oct 31, 2007 11:15 pm

Postby dcz » Sun Dec 30, 2007 10:15 am

Given that :
This MOD is development quality. It is not recommended that you install it on a live forum.


Try replacing :

Code: Select all
         if ($phpbb_seo->seo_opt['no_dupe']['on'] && !$row['forum_password']) {


with :

Code: Select all
         if ($phpbb_seo->seo_opt['no_dupe']['on'] && !$row['forum_password'] && $auth->acl_get('f_read', $row['forum_id_last_post']) && $auth->acl_get('f_selfview', $row['forum_id_last_post'])) {


in includes/functions_display.php instaed ;)

++
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 jonli447 » Sun Dec 30, 2007 5:03 pm

Thanks dcz. Your code worked great, except it needed one minor tweak.

Code: Select all
         if ($phpbb_seo->seo_opt['no_dupe']['on'] && !$row['forum_password'] && $auth->acl_get('f_read', $row['forum_id_last_post']) && $auth->acl_get('f_selfview', $row['forum_id_last_post'])) {


should be:
Code: Select all
         if ($phpbb_seo->seo_opt['no_dupe']['on'] && !$row['forum_password'] && $auth->acl_get('f_read', $row['forum_id_last_post']) && !$auth->acl_get('f_selfview', $row['forum_id_last_post']))


f_selfview is set on restricted forums, so to make the condition correct, it would be when one has read permissions, and there's no selfview permission.

Thanks again, you're awesome. :)
jonli447
 
Posts: 17
Joined: Wed Oct 31, 2007 11:15 pm


Return to phpBB SEO Premod

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: bebu, Google Adsense [Bot] and 5 guests