[solved] noarchive on topics without ID forum

Discussions about the phpBB3 Forum. How to get the best from this powerful script.
Note that there is no official support for phpBB3 here, a place to share more than to ask for.

Moderator: Moderators

[solved] noarchive on topics without ID forum

Postby alex13410 » Thu Jan 17, 2013 8:48 am

hello,
my url of forum are with ID (monsite.com/forum/forum-f1.html) so when I select à forum with the ACP to have the meta robots "noarchive" on this forum it works.
the problem is with my url of topics which are without forum ID because the option virtual folders is OF. my topics url are : monsite.com/forum/sujet-t1.html, so the topics of a noarchive forum are not noarchive.
is it possible, by adding something in phpbb_seo_meta.php :

Code: Select all
if (!empty($config['seo_meta_noarchive'])) {
         $forum_id = isset($_GET['f']) ? max(0, (int) request_var('f', 0)) : 0;
         if ($forum_id) {
            $forum_ids = @explode(',', preg_replace('`[\s]+`', '', trim($config['seo_meta_noarchive'], ', ')));
            if (in_array($forum_id, $forum_ids)) {
                 $this->meta['robots'] .= (!empty($this->meta['robots']) ? ',' : '') . 'noarchive';

to ensure that the topics in a noarchive forum but with a url without forum ID will be also in noarchive, or the only solution to have noarchive topics for topics in a noarchive forum is to have virtual folders ON so that my topics url are monsite.com/forum/forum-f1/sujet-t1.html ?
(I would perfer not activate virtual folders).
thank you for my answer, and excuse me for my bad english.
Last edited by alex13410 on Mon Jan 21, 2013 7:07 pm, edited 1 time in total.
mon forum sur le detecteur de metaux http://www.detecteur-de-metaux.com info sur les detecteurs de metaux
alex13410
PR1
PR1
 
Posts: 103
Joined: Mon Apr 12, 2010 5:28 pm

Advertisement

Re: Noarchive on topics without ID forum

Postby alex13410 » Mon Jan 21, 2013 7:07 pm

I received the answer from an other forum :
Code: Select all
if (!empty($config['seo_meta_noarchive'])) {
          // $forum_id = isset($_GET['f']) ? max(0, (int) request_var('f', 0)) : 0; remplace car pas possible sur forum sans id
         global $forum_id;
         if ($forum_id) {
            $forum_ids = @explode(',', preg_replace('`[\s]+`', '', trim($config['seo_meta_noarchive'], ', ')));
            if (in_array($forum_id, $forum_ids)) {
               $this->meta['robots'] .= (!empty($this->meta['robots']) ? ',' : '') . 'noarchive';
            }
         }
      }
mon forum sur le detecteur de metaux http://www.detecteur-de-metaux.com info sur les detecteurs de metaux
alex13410
PR1
PR1
 
Posts: 103
Joined: Mon Apr 12, 2010 5:28 pm


Return to phpBB Forum

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 10 guests