memberprofile url in viewtopic how to fix?

phpBB3 SEO Advanced mod Rewrite support forum.
This mods performs URL rewriting for phpBB, injecting forums and topic titles in their URLs.

Moderator: Moderators

memberprofile url in viewtopic how to fix?

Postby Afr0man » Fri Jul 17, 2009 9:03 am

Hello

i have simple problem
when i go in memebrprofile i see nice url...but when i go in posting page or viewtopic and press memebrprofile i getting default url

I show my problem in attached image

so ill waiting ansver in my problem
Attachments
be pavadinimo2.JPG
My problem show in thi picture
Afr0man
 
Posts: 14
Joined: Tue Apr 21, 2009 1:16 pm

Advertisement

Re: memberprofile url in viewtopic how to fix?

Postby dcz » Fri Jul 17, 2009 9:22 am

Make sure that you modded includes/functions_content.php properly for the get_username_string() function.

++
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: 21407
Joined: Fri Apr 28, 2006 9:03 pm

Re: memberprofile url in viewtopic how to fix?

Postby Afr0man » Fri Jul 17, 2009 9:33 am

in file includes/functions_content.php old function i replace to new
before replacing code in url i see example:www.website.com/member/{NICKNAME}
after replace i gettint this simple bproblem

this is my new code in file includes/functions_content.php
Code: Select all
function get_username_string($mode, $user_id, $username, $username_colour = '', $guest_username = false, $custom_profile_url = false)
{
   static $_profile_cache;

   // We cache some common variables we need within this function
   if (empty($_profile_cache))
   {
      global $phpbb_root_path, $phpEx;

      $_profile_cache['base_url'] = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u={USER_ID}');
      $_profile_cache['tpl_noprofile'] = '{USERNAME}';
      $_profile_cache['tpl_noprofile_colour'] = '<span style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</span>';
      $_profile_cache['tpl_profile'] = '<a href="{PROFILE_URL}">{USERNAME}</a>';
      $_profile_cache['tpl_profile_colour'] = '<a href="{PROFILE_URL}" style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</a>';
   }

   global $user, $auth;

   // This switch makes sure we only run code required for the mode
   switch ($mode)
   {
      case 'full':
      case 'no_profile':
      case 'colour':

         // Build correct username colour
         $username_colour = ($username_colour) ? '#' . $username_colour : '';

         // Return colour
         if ($mode == 'colour')
         {
            return $username_colour;
         }

      // no break;

      case 'username':

         // Build correct username
         if ($guest_username === false)
         {
            $username = ($username) ? $username : $user->lang['GUEST'];
         }
         else
         {
            $username = ($user_id && $user_id != ANONYMOUS) ? $username : ((!empty($guest_username)) ? $guest_username : $user->lang['GUEST']);
         }

         // Return username
         if ($mode == 'username')
         {
            return $username;
         }

      // no break;

      case 'profile':

         // Build correct profile url - only show if not anonymous and permission to view profile if registered user
         // For anonymous the link leads to a login page.
         if ($user_id && $user_id != ANONYMOUS && ($user->data['user_id'] == ANONYMOUS || $auth->acl_get('u_viewprofile')))
         {
            // www.phpBB-SEO.com SEO TOOLKIT BEGIN
            // $profile_url = ($custom_profile_url !== false) ? $custom_profile_url . '&amp;u=' . (int) $user_id : str_replace(array('={USER_ID}', '=%7BUSER_ID%7D'), '=' . (int) $user_id, $_profile_cache['base_url']);
            global $phpbb_seo, $phpbb_root_path, $phpEx;
            $phpbb_seo->set_user_url( $username, $user_id );
            $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);
            // www.phpBB-SEO.com SEO TOOLKIT END
         }
         else
         {
            $profile_url = '';
         }

         // Return profile
         if ($mode == 'profile')
         {
            return $profile_url;
         }

      // no break;
   }

   if (($mode == 'full' && !$profile_url) || $mode == 'no_profile')
   {
      return str_replace(array('{USERNAME_COLOUR}', '{USERNAME}'), array($username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_noprofile'] : $_profile_cache['tpl_noprofile_colour']);
   }

   return str_replace(array('{PROFILE_URL}', '{USERNAME_COLOUR}', '{USERNAME}'), array($profile_url, $username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_profile'] : $_profile_cache['tpl_profile_colour']);
}

/**
* @package phpBB3
*/
class bitfield
{
   var $data;

   function bitfield($bitfield = '')
   {
      $this->data = base64_decode($bitfield);
   }

   /**
   */
   function get($n)
   {
      // Get the ($n / 8)th char
      $byte = $n >> 3;

      if (strlen($this->data) >= $byte + 1)
      {
         $c = $this->data[$byte];

         // Lookup the ($n % 8)th bit of the byte
         $bit = 7 - ($n & 7);
         return (bool) (ord($c) & (1 << $bit));
      }
      else
      {
         return false;
      }
   }

   function set($n)
   {
      $byte = $n >> 3;
      $bit = 7 - ($n & 7);

      if (strlen($this->data) >= $byte + 1)
      {
         $this->data[$byte] = $this->data[$byte] | chr(1 << $bit);
      }
      else
      {
         $this->data .= str_repeat("\0", $byte - strlen($this->data));
         $this->data .= chr(1 << $bit);
      }
   }

   function clear($n)
   {
      $byte = $n >> 3;

      if (strlen($this->data) >= $byte + 1)
      {
         $bit = 7 - ($n & 7);
         $this->data[$byte] = $this->data[$byte] &~ chr(1 << $bit);
      }
   }

   function get_blob()
   {
      return $this->data;
   }

   function get_base64()
   {
      return base64_encode($this->data);
   }

   function get_bin()
   {
      $bin = '';
      $len = strlen($this->data);

      for ($i = 0; $i < $len; ++$i)
      {
         $bin .= str_pad(decbin(ord($this->data[$i])), 8, '0', STR_PAD_LEFT);
      }

      return $bin;
   }

   function get_all_set()
   {
      return array_keys(array_filter(str_split($this->get_bin())));
   }

   function merge($bitfield)
   {
      $this->data = $this->data | $bitfield->get_blob();
   }
}
Afr0man
 
Posts: 14
Joined: Tue Apr 21, 2009 1:16 pm

Re: memberprofile url in viewtopic how to fix?

Postby dcz » Fri Jul 17, 2009 10:05 am

Dumb check, but is the profile url rewriting option turned on in acp ?
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: 21407
Joined: Fri Apr 28, 2006 9:03 pm

Re: memberprofile url in viewtopic how to fix?

Postby Afr0man » Fri Jul 17, 2009 10:12 am

sid removinw off

small words off

other all functions is ON
Afr0man
 
Posts: 14
Joined: Tue Apr 21, 2009 1:16 pm

Re: memberprofile url in viewtopic how to fix?

Postby dcz » Fri Jul 17, 2009 10:34 am

What version are you using ?
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: 21407
Joined: Fri Apr 28, 2006 9:03 pm

Re: memberprofile url in viewtopic how to fix?

Postby Afr0man » Fri Jul 17, 2009 2:54 pm

first i using 0.46 now i using newest version 0.60
Afr0man
 
Posts: 14
Joined: Tue Apr 21, 2009 1:16 pm

Re: memberprofile url in viewtopic how to fix?

Postby dcz » Sat Jul 18, 2009 9:30 am

Could you post or PM the url of your site ?
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: 21407
Joined: Fri Apr 28, 2006 9:03 pm

Re: memberprofile url in viewtopic how to fix?

Postby Afr0man » Sat Jul 18, 2009 6:21 pm

so lets see my forum... www.darkness.lt
Afr0man
 
Posts: 14
Joined: Tue Apr 21, 2009 1:16 pm

Re: memberprofile url in viewtopic how to fix?

Postby dcz » Sat Jul 25, 2009 9:05 am

But all profiles links are rewritten !
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: 21407
Joined: Fri Apr 28, 2006 9:03 pm


Return to Advanced SEO URL

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 6 guests