Code: Select all
'LOGIN_VIEWTOPIC' => 'The board requires you to be registered and logged in to view this topic.',
Code: Select all
// Do we have a topic or post id?
if (!$topic_id && !$post_id)
{
trigger_error('NO_TOPIC');
}
Code: Select all
// require guests to login to view topic.
if ($user->data['user_id'] == ANONYMOUS && !$user->data['is_bot'])
{
$user->setup('viewtopic');
login_box($_SERVER['REQUEST_URI'], $user->lang['LOGIN_VIEWTOPIC']);
}
Updating an old assist, as you can request that google does not cache your pages content with:Skinny Vinny wrote:If we're letting bots index the topics, a user can still read the topic without login through a spoofed user agent, or through search engine caches. I don't imagine this is an issue though, as 99.9% of your visitors simply won't know to do that.
Code: Select all
<meta name="googlebot" content="noarchive" />
GREAT WORK MY BROTHER BUTSkinny Vinny wrote:Looking at permissions, I don't see that you can display topic lists to guests, but not the topic itself. digging deeper... the option may be gone, but the text still exists in the language file! Found in the en viewtopic file:
Correct me if I'm wrong, but at no place in phpbb3 base code does this value ever get used. Suppose it's just there for memories.Code: Select all
'LOGIN_VIEWTOPIC' => 'The board requires you to be registered and logged in to view this topic.',
This edit will affect all forums/topics; to narrow it to specific forums would require additional code. Since your post indicates you want a general all-guests-must-login solution, well here it is.
We could have skipped calling user->setup in this by placing it further down viewtopic script after its natural call, but I really don't see the need to wait and run all the extra code to that point. So, this can be added much earlier. Find (at or around line 53):
Code: Select all
// Do we have a topic or post id? if (!$topic_id && !$post_id) { trigger_error('NO_TOPIC'); }
After, add the following:
And that's it. ALL topics will now require a login from guests but allows bots to still index your topics content. If you don't want bots to index, remove the && !$user->data['is_bot'] part of the mod.Code: Select all
// require guests to login to view topic. if ($user->data['user_id'] == ANONYMOUS && !$user->data['is_bot']) { $user->setup('viewtopic'); login_box($_SERVER['REQUEST_URI'], $user->lang['LOGIN_VIEWTOPIC']); }
If we're letting bots index the topics, a user can still read the topic without login through a spoofed user agent, or through search engine caches. I don't imagine this is an issue though, as 99.9% of your visitors simply won't know to do that.
Check your en/viewtopic language files to make sure the 'LOGIN_VIEWTOPIC' value exists. If not you can add it there or to common language file, but it's not that important. without it, it simply gives a generic login text.
Very simple version.
Hope this helps.
Code: Select all
ROOT EDIT VIEWTOPIC.PHP
Thank you , working.paracha555 wrote:GREAT WORK MY BROTHER BUTSkinny Vinny wrote:Looking at permissions, I don't see that you can display topic lists to guests, but not the topic itself. digging deeper... the option may be gone, but the text still exists in the language file! Found in the en viewtopic file:
Correct me if I'm wrong, but at no place in phpbb3 base code does this value ever get used. Suppose it's just there for memories.Code: Select all
'LOGIN_VIEWTOPIC' => 'The board requires you to be registered and logged in to view this topic.',
This edit will affect all forums/topics; to narrow it to specific forums would require additional code. Since your post indicates you want a general all-guests-must-login solution, well here it is.
We could have skipped calling user->setup in this by placing it further down viewtopic script after its natural call, but I really don't see the need to wait and run all the extra code to that point. So, this can be added much earlier. Find (at or around line 53):
Code: Select all
// Do we have a topic or post id? if (!$topic_id && !$post_id) { trigger_error('NO_TOPIC'); }
After, add the following:
And that's it. ALL topics will now require a login from guests but allows bots to still index your topics content. If you don't want bots to index, remove the && !$user->data['is_bot'] part of the mod.Code: Select all
// require guests to login to view topic. if ($user->data['user_id'] == ANONYMOUS && !$user->data['is_bot']) { $user->setup('viewtopic'); login_box($_SERVER['REQUEST_URI'], $user->lang['LOGIN_VIEWTOPIC']); }
If we're letting bots index the topics, a user can still read the topic without login through a spoofed user agent, or through search engine caches. I don't imagine this is an issue though, as 99.9% of your visitors simply won't know to do that.
Check your en/viewtopic language files to make sure the 'LOGIN_VIEWTOPIC' value exists. If not you can add it there or to common language file, but it's not that important. without it, it simply gives a generic login text.
Very simple version.
Hope this helps.Code: Select all
ROOT EDIT VIEWTOPIC.PHP