Results 1 to 7 of 7

Bug in Acronym Expansion with URLs

This is a discussion on Bug in Acronym Expansion with URLs within the Bug Reporting forums, part of the vBSEO SEO Plugin category; While I appreciate the Acronym Expansion function and wanted to use it heavily to rewrite text with affiliate codes, I ...

  1. #1
    Member
    Real Name
    Vlad
    Join Date
    Feb 2006
    Location
    NYC
    Posts
    47
    Liked
    0 times

    Bug in Acronym Expansion with URLs

    While I appreciate the Acronym Expansion function and wanted to use it heavily to rewrite text with affiliate codes, I do not think it functions as intended.

    When I set

    'testtest' => 'http://www.blah.com/'

    and

    define('VBSEO_AUTOLINK_FORMAT', '<a href="%1" style="text-decoration: none; border-bottom: 1px dotted #666666;" target="_blank">%2</a>');


    in the config_vbseo.php and set

    define('VBSEO_REWRITE_KEYWORDS_IN_URLS', 0);
    define('VBSEO_REWRITE_KEYWORDS_IN_TEXT', 1);


    I find that thread links, as well as forum title links with 'testtest' in them get rewritten and break. Should the VBSEO_REWRITE_KEYWORDS_IN_URLS=0 flag not avoid this?

    Thanks!

  2. #2
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    168 times
    Hello,

    thank you for reporting!
    This issue will be corrected.

  3. #3
    Member
    Real Name
    Vlad
    Join Date
    Feb 2006
    Location
    NYC
    Posts
    47
    Liked
    0 times
    Thanks Oleg, the bug fix you provided did not work properly, I PMed you back.

  4. #4
    Senior Member
    Real Name
    TundraSoul
    Join Date
    Oct 2005
    Location
    Clovis, CA
    Posts
    174
    Liked
    1 times
    If you get this to work please post the fix.
    Lon (^SMM) @lonvennard @AvatarForums

  5. #5
    Member
    Real Name
    Vlad
    Join Date
    Feb 2006
    Location
    NYC
    Posts
    47
    Liked
    0 times
    In functions_vbseo_seo.php, find:

    PHP Code:
            $seo_replace_inurls['#\b' $sk '\b#i'] = 
            
    str_replace(' ''-'strtolower($sv)); 
            if (
    strstr($sv'http:')) 
                
    $sv str_replace('%1'$svstr_replace('%2'$skVBSEO_AUTOLINK_FORMAT)); 
    REPLACE WITH:

    PHP Code:
            if (strstr($sv'http:')) 
                
    $sv str_replace('%1'$svstr_replace('%2'$skVBSEO_AUTOLINK_FORMAT)); 
            else 
            { 
                if (
    VBSEO_REWRITE_KEYWORDS_IN_URLS
                
    $seo_replace_inurls['#\b' $sk '\b#i'] = str_replace(' ''-'strtolower($sv)); 
            } 
    FIND:

    PHP Code:
    $seo_preg_replace['#(<(?:[^s]|st|sp)[^<]*>)([^<]*?)\b(' $sk ')\b([^<]*)#ei'] = 'stripslashes(\'\\1\\2\'.(strstr(\'\\2\',"http:")||strstr(\'\\2\',"www.")?\'\\3\\4\':"' . ($sv) . '".preg_replace("#\b' $sk '\b#","' $sv '",\'\\4\')))'
    REPLACE WITH:

    PHP Code:
    $seo_preg_replace['#(<(?:[^sat]|sp)[^<]*>)([^<]*?)\b(' $sk ')\b([^<]*)#ei'] = 'stripslashes(\'\\1\\2\'.(strstr(\'\\2\',"http:")||strstr(\'\\2\',"www.")?\'\\3\\4\':"' . ($sv) . '".preg_replace("#\b' $sk '\b#","' $sv '",\'\\4\')))'
    Note that usernames that match the acronyms are still being rewritten, I suggest that you block users from signing up with the acronyms via the VB ACP.


    Thanks Oleg for the quick fix! It is working wonderfully for us.

  6. #6
    Junior Member
    Real Name
    Todd Allen
    Join Date
    Dec 2007
    Posts
    11
    Liked
    0 times
    This code fixed it for me as well however we have users that already exist with expansion words. Is there a way to exclude usernames from expansion as well?

  7. #7
    Member
    Real Name
    Vlad
    Join Date
    Feb 2006
    Location
    NYC
    Posts
    47
    Liked
    0 times
    Quote Originally Posted by Rogue View Post
    This code fixed it for me as well however we have users that already exist with expansion words. Is there a way to exclude usernames from expansion as well?
    You can, but not without breaking the functionality of the rewrites within the text. I'll look through the ticket to remember.

Similar Threads

  1. vBSEO 3.0.0 Gold is Here!
    By Juan Muriente in forum vBSEO Announcements
    Replies: 55
    Last Post: 04-23-2007, 08:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •