Results 1 to 12 of 12

Facebook Opengraph

This is a discussion on Facebook Opengraph within the Bug Reporting forums, part of the vBSEO SEO Plugin category; When vbulletin's facebook integration is turned on, the head is filled with meta property="og: tags for Facebooks opengraph. The og:url ...

  1. #1
    Senior Member
    Real Name
    kyrivalry
    Join Date
    Nov 2009
    Posts
    103
    Liked
    0 times

    Facebook Opengraph

    When vbulletin's facebook integration is turned on, the head is filled with meta property="og: tags for Facebooks opengraph. The og:url however is not being corrected to the vbseo set url rewrite.

  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,

    please modify functions_vbseo_vb.php file:
    find:
    Code:
    $headinclude = '<link rel="canonical" href="'.htmlspecialchars(vbseo_create_full_url($url)).'" />' . "\n" . $headinclude;
    and replace with:
    Code:
    {
    		$hfullurl = htmlspecialchars(vbseo_create_full_url($url));
    		$headinclude = '<link rel="canonical" href="'.$hfullurl.'" />' . "\n" . $headinclude;
    		$headinclude = preg_replace('#("og\:url" content=")[^"]*#', '$1'.$hfullurl, $headinclude);
    }

  3. #3
    Senior Member
    Real Name
    kyrivalry
    Join Date
    Nov 2009
    Posts
    103
    Liked
    0 times
    Oleg,

    No go. I received a parse error. Here is the code that I have:

    Code:
    if(VBSEO_CANONIC_LINK_TAG && $headinclude && $url)
    //$headinclude = '<link rel="canonical" href="'.htmlspecialchars(vbseo_create_full_url($url)).'" />' . "\n" . $headinclude;}
    {
             	$hfullurl = htmlspecialchars(vbseo_create_full_url($url));
    		$headinclude = '<link rel="canonical" href="'.$hfullurl.'" />' . "\n" . $headinclude;
    		$headinclude = preg_replace('#("og\:url" content=")[^"]*#', '$1'.$hfullurl, $headinclude);
    }
    Parse error: syntax error, unexpected $end in /vbseo/includes/functions_vbseo_vb.php on line 1405

  4. #4
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    168 times
    What do you have on line 1405?

  5. #5
    Senior Member
    Real Name
    kyrivalry
    Join Date
    Nov 2009
    Posts
    103
    Liked
    0 times
    Hey Oleg,

    1405 is a bit misleading as I had some comments in place as I applied the patch. Removing my comments and using the same code you listed the error is actually on line 1401, which is ?>.

  6. #6
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    168 times
    Make sure that you applied modification exactly as described above (and upload original file first), I just tried it and it works for me.

  7. #7
    Senior Member
    Real Name
    kyrivalry
    Join Date
    Nov 2009
    Posts
    103
    Liked
    0 times
    Hey Oleg,

    Ok, the patch has been applied again and I have no error, however it is ineffective for the tag:
    Code:
    if(VBSEO_CANONIC_LINK_TAG && $headinclude && $url)
    {
    		$hfullurl = htmlspecialchars(vbseo_create_full_url($url));
    		$headinclude = '<link rel="canonical" href="'.$hfullurl.'" />' . "\n" . $headinclude;
    		$headinclude = preg_replace('#("og\:url" content=")[^"]*#', '$1'.$hfullurl, $headinclude);
    }
    }
    Code:
    <meta property="og:url" content="http://www.nationofblue.com/content.php?r=1660-enes-kanter-new-big-man-campus" />
    Enes Kanter - The New Big Man on Campus

  8. #8
    Junior Member
    Real Name
    Matthew
    Join Date
    Apr 2008
    Posts
    13
    Liked
    0 times
    I'm having the same problem as well

  9. #9
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    168 times
    The modification above applies only to forum URLs. For CMS you should modify functions_vbseo.php file:
    find:
    PHP Code:
    $excpars = array('r'); 
    add below:
    PHP Code:
    $newtext preg_replace('#("og\:url" content=")[^"]*#''$1'.htmlspecialchars(vbseo_create_full_url($vbse_rurl)), $newtext); 
    Last edited by Oleg Ignatiuk; 06-29-2010 at 10:48 AM.

  10. #10
    Junior Member
    Real Name
    Matthew
    Join Date
    Apr 2008
    Posts
    13
    Liked
    0 times
    I've tried that but when searching in thefile for $excpars = array(vbseo_vbroute_var()); it says not found.

  11. #11
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    168 times
    Sorry, the line would be:
    PHP Code:
    $excpars = array('r'); 

  12. #12
    Senior Member
    Real Name
    kyrivalry
    Join Date
    Nov 2009
    Posts
    103
    Liked
    0 times
    Beautiful. Thanks Oleg!

Similar Threads

  1. Facebook Like Button
    By hcmagix in forum Deutsch
    Replies: 1
    Last Post: 05-18-2010, 12:26 PM
  2. FaceBook Like box Plugin
    By spj8082 in forum Template Modifications
    Replies: 5
    Last Post: 04-29-2010, 03:03 AM
  3. Are you utilizing Facebook?
    By iplay in forum Member Articles
    Replies: 19
    Last Post: 01-24-2010, 11:39 PM
  4. Facebook MOD
    By zems in forum General Discussion
    Replies: 4
    Last Post: 06-09-2009, 05:53 PM

Posting Permissions

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