Important: This page is using cookies (cookies). Using this website without turning off cookies in browser, means that you agree for using it.
Buy Now! Features Downloads

Earn with us!

If you would like to start earning money with vBET join to Affiliate Program.
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: VBET Doesn't rewrite Open graph descriptions

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Member
    Join Date
    Aug 2012
    Location
    Atlanta
    Posts
    39

    Default VBET Doesn't rewrite Open graph descriptions

    Hey Martin,

    Found another bug for you. It has to do with social sharing using this version. Whenever I share from a translated url the opengraph data uses the original content from the english version.

    For instance this url is in italian but the open graph tags pull the descriptyion and sharing url from the english version: Truffa Fittizio, Agente modellante Julia Rodi
    You have to view the source to see what I mean. Below is an extract:

    Code:
    <meta property="og:description" content="Hello my name is Julia Rhodes, and am a freelance modeling agent working for female first magazine in recruiting models.Female first Magazine" /><meta property="og:url" content="http://mymodeltalk.com/jobs/modeling-nigerian-419-industry-scams/330355-scam-ficticious-modeling-agent-julia-rhodes.html" /><meta property="og:type" content="article" /><meta property="og:image" content="http://mymodeltalk.com/file/style/mmt/newslettergraphic.jpg" /><meta property="og:title" content="Scam by Ficticious Modeling Agent  Julia Rhodes" />
    Everything except the "og:image content" should be in italian. So far this fails to translate or display the correct description, url location,and title.

    Do you have any code I could use to fix this? If some reads the thread in their native language i'm sure they want to share it on social media in their native language.

    I found this error through google webmaster tools. it reported duplicate descriptions and titles.

  2. #2
    Banned
    Join Date
    Aug 2012
    Posts
    481

    Default Integration vBET with Open Graph Description & Title

    Hi,
    I see that you are adding open graph tags using Open Graph Description & Title Fix on Threads/Blog. You must integrate this product with vBET.
    To integrate this product with full version of vBET:
    • Edit plugin AdminCP->Plugins & Products->Plugin Manager->Open Graph Description / Tile Override
    • Paste this code at the beginning:
      PHP Code:
      require_once(DIR'/includes/vbenterprisetranslator_functions.php');
      require_once(
      DIR'/includes/vbenterprisetranslator_functions_utils.php');
      global 
      $vbulletin;
      $forumLanguage $vbulletin->options['vbenterprisetranslator_forumlanguage'];
      $language $_REQUEST['language'];
      $serie microtime(true) * 10000
    • Find:
      PHP Code:
      $og_array['og:description'] = $thread['meta_description']; 
      $og_array['og:title'] = $thread['title']; 
    • REPLACE it with this code (For utf-8 characters):
      PHP Code:
      $og_array['og:description'] = vbet_translateText($thread['meta_description'], $forumLanguage$language$serie); 
      $og_array['og:title'] = vbet_translateText($thread['title'], $forumLanguage$language$serie); 
    • REPLACE it with this code (For not utf-8 characters):
      PHP Code:
      $og_array['og:description'] = vbet_translateText(vbet_encodeToSafeUTF8($thread['meta_description']), $forumLanguage$language$serie); 
      $og_array['og:title'] = vbet_translateText(vbet_encodeToSafeUTF8($thread['title']), $forumLanguage$language$serie); 
    • Find:
      PHP Code:
      $og_array['og:description'] = $ogdesc
      $og_array['og:title'] = $bloginfo['title'] . ' ' $vbphrase['posted_by'] . ' ' $bloginfo['username']; 
    • REPLACE it with this code (For utf-8 characters):
      PHP Code:
      $og_array['og:description'] = vbet_translateText($ogdesc$forumLanguage$language$serie); 
      $og_array['og:title'] = vbet_translateText($bloginfo['title'], $forumLanguage$language$serie); 
    • REPLACE it with this code (For not utf-8 characters):
      PHP Code:
      $og_array['og:description'] = vbet_translateText(vbet_encodeToSafeUTF8($ogdesc), $forumLanguage$language$serie); 
      $og_array['og:title'] = vbet_translateText(vbet_encodeToSafeUTF8($bloginfo['title']), $forumLanguage$language$serie) . ' ' $vbphrase['posted_by'] . ' ' $bloginfo['username'];; 
    • Save change.


    To integrate this product with free version of vBET:
    • Edit plugin AdminCP->Plugins & Products->Plugin Manager->Open Graph Description / Tile Override
    • Paste this code at the beginning:
      PHP Code:
      require_once(DIR'/includes/vbenterprisetranslator_functions.php');
      $language $_REQUEST['language'];
      $serie microtime(true) * 10000
    • Find:
      PHP Code:
      $og_array['og:description'] = $thread['meta_description']; 
      $og_array['og:title'] = $thread['title']; 
    • REPLACE it with this code (For utf-8 characters):
      PHP Code:
      $og_array['og:description'] = vbet_translateText($thread['meta_description'], $language$serie); 
      $og_array['og:title'] = vbet_translateText($thread['title'], $language$serie); 
    • REPLACE it with this code (For not utf-8 characters):
      PHP Code:
      $og_array['og:description'] = vbet_translateText(vbet_encodeToSafeUTF8($thread['meta_description']), $language$serie); 
      $og_array['og:title'] = vbet_translateText(vbet_encodeToSafeUTF8($thread['title']), $language$serie); 
    • Find:
      PHP Code:
      $og_array['og:description'] = $ogdesc
      $og_array['og:title'] = $bloginfo['title'] . ' ' $vbphrase['posted_by'] . ' ' $bloginfo['username']; 
    • REPLACE it with this code (For utf-8 characters):
      PHP Code:
      $og_array['og:description'] = vbet_translateText($ogdesc$language$serie); 
      $og_array['og:title'] = vbet_translateText($bloginfo['title'], $language$serie); 
    • REPLACE it with this code (For not utf-8 characters):
      PHP Code:
      $og_array['og:description'] = vbet_translateText(vbet_encodeToSafeUTF8($ogdesc), $language$serie); 
      $og_array['og:title'] = vbet_translateText(vbet_encodeToSafeUTF8($bloginfo['title']), $language$serie) . ' ' $vbphrase['posted_by'] . ' ' $bloginfo['username'];; 
    • Save change.

  3. #3
    Member
    Join Date
    Aug 2012
    Location
    Atlanta
    Posts
    39

    Default

    man you are awesome... thanks a bunch.

  4. #4

    Default

    Text automatically translated from: Portuguese to: English
    Translated text
    Marcin,

    Will have this adjustment in the next Release of vBET PRO?
    Original text

  5. #5
    Banned
    Join Date
    Aug 2012
    Posts
    481

    Default

    This integration does not require code change in vBET. This code changes functions of plugin to vBET translate tags added by him.

  6. #6

    Default

    Text automatically translated from: Russian to: English
    Translated text
    Good day!
    Original text


    vBET Translator 4.7.2
    vBulletin 4.2.3

    Open Graph Description & Title Fix on Threads/Blog 1.2.0


    Open Graph Description / Tile Override fb_opengraph_array:
    Code:
    if (THIS_SCRIPT == 'showthread') //For Threads
    {
      global $thread;
      $og_array['og:description'] = $thread['meta_description'];
      $og_array['og:title'] = $thread['title'];
    }
    
    if (THIS_SCRIPT == 'entry') //For Blog Entries
    {
      global $vbphrase, $bloginfo;
      $ogdesc = strip_bbcode($bloginfo['pagetext'], true, false, false, true);
      $ogdesc = htmlspecialchars ($ogdesc); 
      $ogdesc = preg_replace('!\s+!', ' ', $ogdesc);
      $ogdesc = (strlen($ogdesc) > 303) ? substr($ogdesc,0,300).'...' : $ogdesc;
      $og_array['og:description'] = $ogdesc;
      $og_array['og:title'] = $bloginfo['title'] . ' ' . $vbphrase['posted_by'] . ' ' . $bloginfo['username'];
    }

    Text automatically translated from: Russian to: English
    Translated text
    After integration changes:
    Original text


    Code:
    require_once(DIR. '/includes/vbenterprisetranslator_functions.php'); 
    require_once(DIR. '/includes/vbenterprisetranslator_functions_utils.php'); 
    global $vbulletin; 
    $forumLanguage = $vbulletin->options['vbenterprisetranslator_forumlanguage']; 
    $language = $_REQUEST['language']; 
    $serie = microtime(true) * 10000;  
    
    if (THIS_SCRIPT == 'showthread') //For Threads
    {
      global $thread;
      $og_array['og:description'] = vbet_translateText($thread['meta_description'], $forumLanguage, $language, $serie);
      $og_array['og:title'] = vbet_translateText($thread['title'], $forumLanguage, $language, $serie);
    }
    
    if (THIS_SCRIPT == 'entry') //For Blog Entries
    {
      global $vbphrase, $bloginfo;
      $ogdesc = strip_bbcode($bloginfo['pagetext'], true, false, false, true);
      $ogdesc = htmlspecialchars ($ogdesc); 
      $ogdesc = preg_replace('!\s+!', ' ', $ogdesc);
      $ogdesc = (strlen($ogdesc) > 303) ? substr($ogdesc,0,300).'...' : $ogdesc;
      $og_array['og:description'] = vbet_translateText($ogdesc, $forumLanguage, $language, $serie);
      $og_array['og:title'] = vbet_translateText($bloginfo['title'], $forumLanguage, $language, $serie);
    }
    Text automatically translated from: Russian to: English
    Translated text
    -- get the error:
    Original text


    Database error in vBulletin 4.2.3:

    Invalid SQL:
    SELECT cache.originaltext as originaltext, cache.translated as translated FROM vbenterprisetranslator_cache_ help, vbenterprisetranslator_cache_ cache WHERE help.originaltext='******************************************' AND cache.serie=help.serie;

    MySQL Error : Table 'vbenterprisetranslator_cache_' doesn't exist
    Error Number : 1146
    Last edited by Marcin Kalak; 03-02-17 at 20:34.

  7. #7
    Banned
    Join Date
    Aug 2012
    Posts
    481

    Default

    Please try to add after:
    PHP Code:
    $language $_REQUEST['language']; 
    following code:
    PHP Code:
    if(!$language) { 
    $language $forumLanguage;


  8. #8

    Default

    Text automatically translated from: Russian to: English
    Translated text
    Thanks for the reply.


    Module code
    Original text
    Open "Graph Description / Tile Override":


    HTML Code:
    require_once(DIR. '/includes/vbenterprisetranslator_functions.php'); require_once(DIR. '/includes/vbenterprisetranslator_functions_utils.php'); global $vbulletin; $forumLanguage = $vbulletin->options['vbenterprisetranslator_forumlanguage']; $language = $_REQUEST['language']; if(!$language) {  $language = $forumLanguage; }  $serie = microtime(true) * 10000;  
    if (THIS_SCRIPT == 'showthread') //For Threads{  global $thread;  $og_array['og:description'] = vbet_translateText($thread['meta_description'], $forumLanguage, $language, $serie);  $og_array['og:title'] = vbet_translateText($thread['title'], $forumLanguage, $language, $serie);}
    if (THIS_SCRIPT == 'entry') //For Blog Entries{  global $vbphrase, $bloginfo;  $ogdesc = strip_bbcode($bloginfo['pagetext'], true, false, false, true);  $ogdesc = htmlspecialchars ($ogdesc);   $ogdesc = preg_replace('!\s+!', ' ', $ogdesc);  $ogdesc = (strlen($ogdesc) > 303) ? substr($ogdesc,0,300).'...' : $ogdesc;  $og_array['og:description'] = vbet_translateText($ogdesc, $forumLanguage, $language, $serie);  $og_array['og:title'] = vbet_translateText($bloginfo['title'], $forumLanguage, $language, $serie);

    Text automatically translated from: Russian to: English
    Translated text
    MySQL errors -- no!
    -- no translation og:description no
    Original text
    Code:
    <meta property="og:description" content="*******
    Last edited by Marcin Kalak; 06-02-17 at 21:39. Reason: REPAIR BBCODE

  9. #9
    Banned
    Join Date
    Aug 2012
    Posts
    481

    Default

    Please send me a PM access details to Admin CP and FTP. I will check what is going on there

  10. #10

    Default

    Text automatically translated from: Russian to: English
    Translated text
    Marcin Kalak, sorry, everything works fine******
    Original text

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

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