vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Mini Mods - RedInk Design - Smart OG Image Tag (https://vborg.vbsupport.ru/showthread.php?t=292850)

redinkdesign 12-09-2012 11:00 PM

RedInk Design - Smart OG Image Tag
 
1 Attachment(s)
Currently vBulletin's facebook open graph image tag uses what's entered in Options -> Facebook Options -> Image URL. If you leave this field blank, the <og:image> meta tag is omitted and Facebook's crawler will try to use any image found on the page.

This mod looks for the first [img] or [attach] tags in a post and uses that image for the <og:image> meta tag. This will tell facebook's crawler to use that image for the post.

This mod requires the Facebook Platform to be enabled on vBulletin (Options -> Facebook Options -> Enable Facebook Platform).

It will first look for an [img] tag is the post, if none is found, it will look for an [attach] tag. If neither is found, it will use the Image you entered in the facebook options (Options -> Facebook Options -> Image URL). If that field was left empty, it will omit the <og:image> tag which is default vBulletin behavior.

This was only tested on 4.2.0 (PL3).

Installation:
Admin -> Plugin & Products -> Manage Products -> Add/Import Product

Update 12/4/2013
Changed image priorities - avatar and site logo are not priority

Update 11/19/2013
Plugin updated to support multiple images

sweetpotato 12-11-2012 02:39 PM

Installed and work fine for me
Thanks,

Waiter 01-10-2013 06:08 PM

excuseme, I installed this product but when do you config the og:image tag??

redinkdesign 01-10-2013 06:11 PM

This mod looks for the first [img] or [attach] tags in a post and uses that image for the <og:image> meta tag. This will tell facebook's crawler to use that image for the post.

You don't explicitly set the og:image tag.

Waiter 01-10-2013 06:22 PM

I made the importation and left blank the FB Image URL, but When you create the page, the tag og: image is omitted, but there are images in the the page (article of CMS Content) :(

sweetpotato 01-11-2013 08:24 AM

This mod works fine for forum thread but not work for cms article

Waiter 01-11-2013 08:36 AM

If you want it to work with the CMS articles, what should I change in the XML? There I took a look and the only thing I've noticed is that these variables: $GLOBALS['threadinfo']['description']. There is a variable that identifies those items of CMS?

tpearl5 01-12-2013 06:27 PM

OMG, thank you I have been looking for this forever!

tpearl5 01-12-2013 06:44 PM

crap fb_opengraph_array isn't a hook in my version of vbulletin

tpearl5 01-12-2013 07:34 PM

Okay, I just inserted the plugin manually into functions_facebook.php since there isn't a comparable hook.

@Waiter - $vbulletin->options['description'] is the variable, but I don't believe it includes img and attach tags for the cms.


All times are GMT. The time now is 02:54 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01000 seconds
  • Memory Usage 1,726KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete