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.

Waiter 01-15-2013 02:48 PM

not work for CMS :(
Any idea for this? Thx :)

sticky 01-16-2013 06:22 AM

Finally! Been waiting for something like this.

As long as this works on the CMS I'm good :)

Testing.

sticky 01-16-2013 06:24 AM

Quote:

Originally Posted by redinkdesign (Post 2396032)
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.

Why does the facebook platform need to be enabled for this to work? Shouldn't it just work regardless?

Waiter 01-16-2013 02:24 PM

Quote:

Originally Posted by sticky (Post 2397224)
Finally! Been waiting for something like this.

As long as this works on the CMS I'm good :)

Testing.

but this don't work in CMS :(

abdobasha2004 01-16-2013 02:49 PM

I need this mod for vb 3.7 pleeeeeeeeeease......

sticky 01-16-2013 04:31 PM

Quote:

Originally Posted by Waiter (Post 2397288)
but this don't work in CMS :(

If you're promoting a forum post why not?

Waiter 01-18-2013 10:43 AM

because the article of CMS are automatic connect with the page of Facebook and Twitter, by RSS....if I use the forum post, I don't use the custom Meta Desciption and Key :(

LifesGreatestGift 01-18-2013 01:05 PM

Works great. Suggestion for future version.

A switch selection in admincp options that say

1) First Image
2) Provide Array

1) First Image is exactly as this mod acts.

2) Provide Array - would take all IMG and ATTACH in first post, and convert them all to

<meta property="og:image" content="http://example.com/image1.jpg" />
<meta property="og:image" content="http://example.com/image2.jpg" />

that way, when a thread is posted it will give you the option to choose the pic.

LifesGreatestGift 01-18-2013 01:13 PM

your mod doesn't account for if the site is http or https properly

had to change this line

Code:

$og_array['og:image'] = 'http://' . $img_str;
to

Code:

$og_array['og:image'] = 'https://' . $img_str;

sticky 01-19-2013 10:56 PM

Quote:

Originally Posted by Waiter (Post 2397694)
because the article of CMS are automatic connect with the page of Facebook and Twitter, by RSS....if I use the forum post, I don't use the custom Meta Desciption and Key :(

I'm not quite sure I understand as if this replaces the tags when you promote the post the new tags should be there and in RSS.

redinkdesign 01-21-2013 04:51 PM

Good catch, I will fix this in the next release.

Quote:

Originally Posted by LifesGreatestGift (Post 2397712)
your mod doesn't account for if the site is http or https properly

had to change this line

Code:

$og_array['og:image'] = 'http://' . $img_str;
to

Code:

$og_array['og:image'] = 'https://' . $img_str;


Bob_R 01-26-2013 09:10 PM

So this only works for posts?

What about threads, showdisplay and forumhome?

Thanks!

Bob_R 01-29-2013 05:26 PM

Doesn't work.

redinkdesign 01-29-2013 05:40 PM

Quote:

Originally Posted by Bob_R (Post 2399732)
So this only works for posts?

What about threads, showdisplay and forumhome?

Thanks!

This is just an extension of the default vBulletin behavior.


Quote:

Originally Posted by Bob_R (Post 2400323)
Doesn't work.

What doesn't?

Bob_R 02-01-2013 06:21 PM

Quote:

Originally Posted by redinkdesign (Post 2400325)
This is just an extension of the default vBulletin behavior.
What doesn't?

Doesn't post image. it's just a blurry green arrow. :confused:

sticky 02-04-2013 10:07 PM

Why does this require the facebook platform to be enabled?

tpearl5 02-05-2013 12:39 AM

Quote:

Originally Posted by sticky (Post 2401931)
Why does this require the facebook platform to be enabled?

Because og tags are not inserted on vbulletin without the fb platform enabled.

Bob_R 02-13-2013 07:42 PM

Why is everyone asking if the Facebook Platform has to be enabled? If you have Facebook Connect wouldn't you need it enabled anyway?

sweetpotato 02-14-2013 06:54 AM

I have a problem when using this Mod. When share a thread to Facebook, It does not show the thread tittle but the site name.

redinkdesign 02-14-2013 02:43 PM

This mod does not alter existing OG tags, only the <og:image> tag. The issue you're having is with the default vBulletin tags.

Quote:

Originally Posted by sweetpotato (Post 2404187)
I have a problem when using this Mod. When share a thread to Facebook, It does not show the thread tittle but the site name.


sweetpotato 02-14-2013 05:02 PM

Quote:

Originally Posted by redinkdesign (Post 2404239)
This mod does not alter existing OG tags, only the <og:image> tag. The issue you're having is with the default vBulletin tags.

I will double check with this. For the time being, when I share threads to Facebook, some show thread tittle and some show site name.
Thanks for the nice mod,

suko22 03-04-2013 10:43 AM

Any chance for 3.8??

Or any suggestion to make first pic in post to be og:image??

Thanks!!

redinkdesign 03-04-2013 01:49 PM

Sorry, I don't have a 3.8 installation to test, I would have to set one up.

By default this plugin grabs the first pic in the post and sets that as og:image. It will look for the first [img] tag.

Quote:

Originally Posted by suko22 (Post 2407766)
Any chance for 3.8??

Or any suggestion to make first pic in post to be og:image??

Thanks!!


suko22 03-04-2013 02:23 PM

Quote:

Originally Posted by redinkdesign (Post 2407799)
Sorry, I don't have a 3.8 installation to test, I would have to set one up.

By default this plugin grabs the first pic in the post and sets that as og:image. It will look for the first [img] tag.

Thanks, the problem is that facebook is not showing any thumbnails when I share a post from my forum (vb 3.8).

I'm trying to force the first image of the post (with [IMG] bbcode) to become og: image, but don?t know how.

Bye!

suko22 03-04-2013 02:25 PM

Any advice will be tremendously grateful, of course..

Bob_R 07-26-2013 04:53 PM

So let me get this straight. If you have an image entered in (Options -> Facebook Options -> Image URL) this mod is useless?

final kaoss 07-26-2013 06:33 PM

This mod is for VB4 NOT VB3.
Quote:

Originally Posted by suko22 (Post 2407809)
Thanks, the problem is that facebook is not showing any thumbnails when I share a post from my forum (vb 3.8).

I'm trying to force the first image of the post (with [IMG] bbcode) to become og: image, but don?t know how.

Bye!


cdoyle 08-13-2013 09:31 PM

This doesn't seem to be working for me, I have the plugin installed, and FB enabled.
But when you like a thread that has images, it posts to FB but no thumbnail is displayed.

Is there something else that I need to do?
I'm running VB Version 4.2

cdoyle 08-14-2013 10:52 PM

anyone have any ideas?

redinkdesign 11-19-2013 02:41 PM

It seems facebook now only supports images bigger than 200x200 for og:image tags.
Put your page url in https://developers.facebook.com/tools/debug and see what comes back.

Quote:

Originally Posted by cdoyle (Post 2438730)
This doesn't seem to be working for me, I have the plugin installed, and FB enabled.
But when you like a thread that has images, it posts to FB but no thumbnail is displayed.

Is there something else that I need to do?
I'm running VB Version 4.2



All times are GMT. The time now is 02:46 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.01424 seconds
  • Memory Usage 1,817KB
  • 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
  • (4)bbcode_code_printable
  • (15)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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