| :: |
| Author |
Message |
jonli447
Joined: 31 Oct 2007 Posts: 6
|
Posted: Fri Dec 28, 2007 7:31 pm Post subject: Self auth mod and no duplicate last post links |
|
|
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 |
|
|
| Back to top |
|
 |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
|
| Back to top |
|
 |
jonli447
Joined: 31 Oct 2007 Posts: 6
|
Posted: Sat Dec 29, 2007 2:08 pm Post subject: Re: Self auth mod and no duplicate last post links |
|
|
| Yes, I'm using premod version Gold. Thanks. |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
Posted: Sat Dec 29, 2007 2:40 pm Post subject: Re: Self auth mod and no duplicate last post links |
|
|
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: | // 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'] . '&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'] . '&p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id'];
$last_post_link = '';
} |
You could just replace :
| Code: | | if ($phpbb_seo->seo_opt['no_dupe']['on'] && !$row['forum_password']) { |
with :
| Code: | | 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: | $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'] . '&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 || SEO phpBB3 || Search
____________________
Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche |
|
| Back to top |
|
 |
jonli447
Joined: 31 Oct 2007 Posts: 6
|
Posted: Sat Dec 29, 2007 2:54 pm Post subject: Re: Self auth mod and no duplicate last post links |
|
|
Thanks dcz! Sorry about posting in the wrong section ... I tried to post in the correct spot.
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 |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
|
| Back to top |
|
 |
jonli447
Joined: 31 Oct 2007 Posts: 6
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
Posted: Sun Dec 30, 2007 10:15 am Post subject: Re: Self auth mod and no duplicate last post links |
|
|
Given that :
| Quote: | | This MOD is development quality. It is not recommended that you install it on a live forum. |
Try replacing :
| Code: | | if ($phpbb_seo->seo_opt['no_dupe']['on'] && !$row['forum_password']) { |
with :
| Code: | | 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 || SEO phpBB3 || Search
____________________
Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche |
|
| Back to top |
|
 |
jonli447
Joined: 31 Oct 2007 Posts: 6
|
Posted: Sun Dec 30, 2007 5:03 pm Post subject: Re: Self auth mod and no duplicate last post links |
|
|
Thanks dcz. Your code worked great, except it needed one minor tweak.
| Code: | | 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: | | 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.  |
|
|
| Back to top |
|
 |
|
|