phpBB SEO
Boards
Directory  
SEO  
Downloads
  phpBB SEO : Search Engine Optimization, Directory, Forums  
Index
Forums
Annuaire
Référencement
Télécharger
 
  Search Rechercher
    Register
Username :  Password :  Log me on automatically each visit  
S'enregistrer  
 
   
Question regarding stop vars

 
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB3 mod Rewrite  » Advanced SEO URL
::  
Author Message
IPB_Refugee
PR0
PR0


Joined: 24 Jul 2008
Posts: 53

Question regarding stop varsPosted: Sat Jul 26, 2008 6:33 pm    Post subject: Question regarding stop vars

Hello again,

I'm using a cool Highslide MOD (Highslide is similar to Lightbox) and therefore I have this in my phpbb_seo_class.php:

Code:
      // Stop vars
      $this->seo_stop_vars = array('view=', 'mark=', 'watch=', 'highslide=');


Unfortunately it doesn't work. I still have links like

example.com/member18.html&highslide=1

which gives me 404 errors. I thought adding 'highslide=' to the seo_stop_vars array would prevent these links from getting rewritten.

This works:

Code:
      // Stop files
      $this->seo_stop_files = array('posting' => 1, 'memberlist' => 1,'faq' => 1, 'ucp' => 1, 'swatch' => 1, 'mcp' => 1);


Then the mentioned links look like they did before and also work well. For example:

example.com/3_O/memberlist.php?mode=viewprofile&u=18&highslide=1

Kind regards
Wolfgang
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 15242

Question regarding stop varsPosted: Sun Jul 27, 2008 7:20 am    Post subject: Re: Question regarding stop vars

I think it's because the mod adds the &highslide=1 bit outside of append_sid() like many does, things like :

Code:
append_sid(blabla) . '&highslide=1';


or :

Code:
$veiwtopic_url . '&highslide=1';



You can do two things to fix that, you can either first test the first url part to see if it contains a question mark ("?") and if so use & as separator or a question mark in case there is none.

Or you can pass the extra variable in the append_sid() function and it will be handled in the url rewriting process.

If so, you can add it to the stop var array to prevent url rewriting of urls containing this var.


Once done, you'll most likely have to mod the zero duplicate a bit unless you do not run it in strict mode.

++

_________________
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
Visit poster's website
IPB_Refugee
PR0
PR0


Joined: 24 Jul 2008
Posts: 53

Question regarding stop varsPosted: Sun Jul 27, 2008 11:02 am    Post subject: Re: Question regarding stop vars

Hi dcz,

thank you for the quick response and the explanation! Smile Unfortunately it's a little bit difficult. If you have some time, could you please take a look at the following piece of code from functions_content.php?

Code:
      case 'no_profile':
      case 'full':
      default:

         $tpl = '';
         if ($user->data['user_id'] == ANONYMOUS || $user->data['is_bot'])
         {
            if (!$username_colour)
               $tpl = '{USERNAME}';
            else
               $tpl = '<span style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</span>';
         }
         else
         {
            if (!$profile_url && !$username_colour)
            {
               $tpl = '{USERNAME}';
            }
            else if (!$profile_url && $username_colour)
            {
               $tpl = '<span style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</span>';
            }
            else if ($profile_url && !$username_colour)
            {
               $tpl = '<a onclick="return hs.htmlExpand(this, { objectType: \'ajax\', width: 700 } )" href="{PROFILE_URL}&amp;highslide=1">{USERNAME}</a>';
            }
            else if ($profile_url && $username_colour)
            {
               $tpl = '<a onclick="return hs.htmlExpand(this, { objectType: \'ajax\', width: 700 })" href="{PROFILE_URL}&amp;highslide=1" style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</a>';
            }
         }

         return str_replace(array('{PROFILE_URL}', '{USERNAME_COLOUR}', '{USERNAME}'), array($profile_url, $username_colour, $username), $tpl);

      break;


I'm not sure how to add function append_sid to the link in this case. Embarassed (And that would be the method I preferred.) Especially I don't know how I should handle the onclick part of the link.

Regards
Wolfgang
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 15242

Question regarding stop varsPosted: Sun Jul 27, 2008 12:25 pm    Post subject: Re: Question regarding stop vars

So this mod is directly changing the get_username_string() function.

In such case, it would be better to add the extra param right when the url is built, even thoug I understand this would make one more replace for the mod, it should be the case.

So, just replace :
Code:
         $profile_url = ($custom_profile_url !== false) ? $custom_profile_url . '&amp;u=' . (int) $user_id : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . (int) $user_id);


with :
Code:
         $profile_url = ($custom_profile_url !== false) ? $custom_profile_url . '&amp;u=' . (int) $user_id : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . (int) $user_id . '&amp;highslide=1');



and delete the next two :
Quote:
&amp;highslide=1


within the same function.

I wonder why the mod needs the &amp;highslide=1 param since as is, it will add it to all profile links on the forum, there is no real reason to use it IMO, or I am missing something ?

++

_________________
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
Visit poster's website
IPB_Refugee
PR0
PR0


Joined: 24 Jul 2008
Posts: 53

Question regarding stop varsPosted: Sun Jul 27, 2008 2:10 pm    Post subject: Re: Question regarding stop vars

Thanks for your help, dcz!

dcz wrote:
I wonder why the mod needs the &amp;highslide=1 param since as is, it will add it to all profile links on the forum, there is no real reason to use it IMO, or I am missing something ?


I guess you are right. When I started playing around with Olympus a few months ago, I added the highslide=1 querystring thing to another MOD because back in those days I wanted to use the highslide script for some but not all profile links.
And I wanted to differentiate between the links (IF highslide THEN simple_header ELSE overall_header in memberlist_view.html). It's a little bit complicated and I don't exactly remember. Embarassed

To make a long story short: Now I completely deleted the highslide=1 querystring thing. The only problem now is, when someone has disabled Javascript and clicks on a profile link because in this case he will not see the header and menu of the board because of including simple_header in memberlist_view.html. (The whole board in a Highslide "popup" looks terrible.) But who cares? I'm the admin. Laughing

Regards
Wolfgang
Back to top
Display posts from previous:   
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB3 mod Rewrite  » Advanced SEO URL
Page 1 of 1

Navigation Similar Topics

Jump to: