Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons

Reply
 
Thread Tools
More Open Graph Images (Free) by BOP5 Details »»
More Open Graph Images (Free) by BOP5
Version: 1.0.2, by BirdOPrey5 (Senior Member) BirdOPrey5 is offline
Developer Last Online: Aug 2023 Show Printable Version Email this Page

Category: Integration with vBulletin - Version: 4.x.x Rating:
Released: 07-17-2013 Last Update: Never Installs: 71
Supported Uses Plugins Auto-Templates
 

Brought to you by BirdOPrey5 / Qapla.com

If you don't know what Open Graph is, it is a standard which Facebook and other big social networking sites use to extract information from a web page being shared/posted on their site.

Open Graph meta tags tell Facebook the URL of the page to share, the title of the page, the type of content, and also one or more images to be used as the thumbnail when a page is shared.

A major limitation of vBulletin 4.x has always been the image. The only option vBulletin has is to enter the URL to 1 image in Facebook Options in the Admin CP, and the same image would be shared every time any page from your site was posted to Facebook. This would usually be your site's logo. While it was OK, it was really annoying you couldn't get a picture that had more to do with the exact thread being shared. For example if the thread was about Jeeps and had pictures of Jeeps in the thread it would be better to show one of those pictures instead of the site logo.

Now you can.

Live Demo: http://www.qapla.com/mods/showthread...e-images-tests (View the HTML source code)

This Free version will find-
  • All images included via the [IMG] BBCode in the entire thread page
  • All Embedded YouTube Video image thumbnails used on the thread page
  • All Image file attachments (full size or thumb nails) on the thread page*

And add ALL of these as possible og meta tags on your thread page.

The Pro Version available on Qapla.com works on Blog Entries and CMS Articles as well, but is otherwise the same.

Note: The "Pro" version is bundled with my More Share Options TNG Pro mod, a subscription to one gives access to both.

Important Notes - This mod only promises to add the images, youtube videos, and attachments (if enabled) to the list of available of meta tags and this can be confirmed working by viewing the HTML source of the page or using the Facebook Debugger to see all images and other content scraped form your page: https://developers.facebook.com/tools/debug

This mod cannot promise Facebook will actually use these images! It is important to understand that giving these pictures as an option to Facebook is as far as any modification can go. After that it is up to Facebook's scraping algorithm to determine which, if any, images will be presented to the users as an option when sharing the page. Facebook does not publish strict details on how they make these choices. Search on Google and you'll quickly find many answers to the question but each one different.

Facebook does say that images should be (not must but should be) at least 200 by 200 pixels but they prefer even more a 1500 x 1500 pixel image. They prefer images closer to square than very long or tall. They will auto resize or crop as needed.

*It appears Facebook will never use vBulletin attachments even though the Facebook Debugger does pick them up and show them. I suspect the reason is because attachments are not to actual jpg/gif/png images but instead are links to attachment.php. Nevertheless I included the attachment option because Facebook may change this behavior one day and other social networks may not have this limitation.

There does not seem to be any ham in presenting multiple images to Facebook, they will choose what they want.

I have had more luck getting the option to choose between different thumbnails when using the older "Facebook Share" button as opposed to the "Facebook Like" (or Recommend) button that is default in vBulletin. If you use the free or Pro version of my More Share Options TNG mod you can easily change to the Facebook Share button.

Finally this mod knows how to deal with both https and regular http images. The og meta tags are slightly different for each, the correct one will be used based on the image source found.

Also, this mod is designed to work with or without the Facebook Platform enabled.

For use on vBulletin 4.x.x only. Tested on 4.07, 4.2.0, and 4.2.1.

------------------------------------------------------

Please "Mark as Installed" if you use this.
Donations always appreciated. :up:
Nominate MOTM if you LOVE it!

Download Now

File Type: zip More Open Graph Images Free by BOP5 v102.zip (5.8 KB, 461 views)

Screenshots

File Type: jpg more_og_vb4_html_source.jpg (55.1 KB, 0 views)
File Type: jpg more_og_vb4_settings.jpg (110.4 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
7 благодарности(ей) от:
elsa23, eTiKeT?, mytreehouse, m_hady, RichieBoy67, tbworld, the one

Comments
  #12  
Old 07-27-2013, 12:57 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by hugh_ View Post
BOP5 the link to your home page in the description is broken...

http//www.qapla.com/mods/showthread.php/1037-More-Open-Graph-Images-ogimage-Pro-by-BOP5
Thanks. Very annoying in Opera Next browser it doesn't auto erase the existing http:// like it does in other browsers when inserting a link.

Quote:
Originally Posted by Budget101 View Post
This does actually add the image url, but unfortunately it displays is like so:

Code:
<meta property="og:type" content="article" /> <meta property="og:image" content="http://www.domainnamehere.com/attachment.php?attachmentid=7251" /> <meta property="og:image" content="http://www.domainnamehere.com/attachment.php?attachmentid=7252" /> <meta property="og:image" content="http://www.domainnamehere.com/attachment.php?attachmentid=7253" />
Which is not and cannot be parsed by Facebook. The only way to get this to work and display the image correctly is to link to an eternal image in order to get the url to resolve with an extension that Facebook will actually parse, example:

Code:
<meta property="og:image" content="http://www.domainnamehere.com/images/image.jpg" />
I use vbSEO and it will rewrite images to a readable URL, but unfortunately, it appears to rewrite them AFTER this mod executes, so they aren't displayed.

Currently the mod populates the og:image tag, but unfortunately it returns the code as

attachment.php?attachmentid=xx

I would like to alter it so that it displays the rewritten vbseo url into the og>:image tag (source code)

the code is:
Code:
$ogimages[] = $vbulletin->options['bburl'] . "/attachment.php?attachmentid=" . $thisattach['attachmentid'].
my attachment rewrite conditions are:

mydomain.com/ content/attachments/[attachment_id]-[original_filename]


I would like to rewrite the code so that it will publish the url in the same format as vbSEO does...

Could someone please help me with the correct syntax to use in this case??
That may be possible but before I waste time on it and find it doesn't work please post a link to an actual attached image from your forum so i can test it works.
Reply With Quote
  #13  
Old 07-27-2013, 01:22 PM
Budget101 Budget101 is offline
 
Join Date: Jul 2008
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BirdOPrey5 View Post
That may be possible but before I waste time on it and find it doesn't work please post a link to an actual attached image from your forum so i can test it works.
The following image is from my home page

Code:
 http://www.budget101.com/content/attachments/7251-strawberry-cheesecake-swirl.jpg



.
But the open graph mod displays that very same image in the source code as:
Code:
<meta property="og:image" content="http://www.budget101.com/attachment.php?attachmentid=7251" />
Reply With Quote
  #14  
Old 07-27-2013, 01:42 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Budget101 View Post
The following image is from my home page

Code:
 http://www.budget101.com/content/attachments/7251-strawberry-cheesecake-swirl.jpg



.
But the open graph mod displays that very same image in the source code as:
Code:
<meta property="og:image" content="http://www.budget101.com/attachment.php?attachmentid=7251" />
Thanks, but it seems what I was afraid of is still true- Facebook can tell it is a redirect and not a real image and it still does't work.

Check out -
http://www.qapla.com/mods/showthread...sting-Facebook

Click the Facebook Share button

Your image isn't a option even though it is correct in the og tags.
Reply With Quote
  #15  
Old 07-27-2013, 01:54 PM
Budget101 Budget101 is offline
 
Join Date: Jul 2008
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh Yeah, I see what you mean! Dang.
Reply With Quote
  #16  
Old 08-02-2013, 10:02 PM
cdoyle cdoyle is offline
 
Join Date: Oct 2004
Posts: 462
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just installed this, but not why it's not working.
Facebook always tries to use my banner image as the image on posts.

Here is a page, I've been testing with
http://www.caraudiocentral.net/forum...ro-Restoration

When I run it in the debugger, I get these errors.

Inferred Property: The 'og:title' property should be explicitly provided, even if a value can be inferred from other tags.
og:image should be larger: Provided og:image is not big enough. Please use an image that's at least 200x200 px. Image 'http://www.caraudiocentral.net/forums/images/misc/newbannerv4.png' will be used instead.
Mismatch og:url and canonical url: og:url tag in the header is not the same URL as rel='canonical' link in the html.

My images in the thread are over 200x200, so not sure why it's defaulting to the banner image. Any ideas?
Reply With Quote
  #17  
Old 08-06-2013, 02:06 PM
cdoyle cdoyle is offline
 
Join Date: Oct 2004
Posts: 462
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone know?
Reply With Quote
  #18  
Old 08-17-2013, 12:03 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Please "Mark as Instaled"

Try disabling using attachments in the mod settings, they don't work with Facebook anyway.

The wait a few days (week?) for the cache to clear or run it through the debugger again.
Reply With Quote
  #19  
Old 08-25-2013, 10:06 PM
dougdirac's Avatar
dougdirac dougdirac is offline
 
Join Date: Nov 2011
Posts: 208
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Haven't installed this mod yet, but it sounds useful. Too bad about attached images, though. The majority of my images are attached.

A couple off topic but related thoughts. Is it possible to set the description meta tag
HTML Code:
<meta property="og:description" content="blah blah blah.">
so that it contains the first couple sentences of the first post? That seems more useful than all Likes from the entire website having the same description.

Now the inverse:
I have a problem with members that like to "drive-by" link post. Basically they just drop a link to an article they think is interesting but don't bother to leave a description. Would be great to have a mod that would scrape that open graph info and place it in the post. There are already mods that will get the page title for posted a URL. So why not an image and a description too?
Reply With Quote
  #20  
Old 08-26-2013, 02:59 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The better descriptions is a good idea, will see if I can add it to this mod.

The links are also a good idea but that would be a different mod, an updated title includer. Something I've been meaning to work on.
Reply With Quote
  #21  
Old 08-26-2013, 05:57 PM
dougdirac's Avatar
dougdirac dougdirac is offline
 
Join Date: Nov 2011
Posts: 208
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BirdOPrey5 View Post
The links are also a good idea but that would be a different mod, an updated title includer. Something I've been meaning to work on.
Definitely a different mod. I'll just put the idea here so it's out there.

For example: http://www.nytimes.com/2013/08/24/bu...nted=all&_r=2&

Has these meta tags:
HTML Code:
<title>Getting Tesla From Here to There - NYTimes.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta itemprop="inLanguage" content="en-US">
<meta itemprop="description" name="description" content="Tesla Motors gets raves for its Model S, and Wall Street loves the company's soaring stock. But it remains to be seen whether Tesla can actually sell the cars.">
<meta name="keywords" content="Automobiles,Electric and Hybrid Vehicles,Stocks and Bonds,Musk  Elon,Tesla Motors Inc">
<meta name="news_keywords" content="Cars">
<meta name="ROBOTS" content="NOARCHIVE">
<meta name="DISPLAYDATE" content="August 23, 2013">
<meta itemprop="dateModified" content="2013-08-23">
<meta itemprop="datePublished" content="2013-08-23">
<meta name="hdl" content="Getting Tesla From Here to There">
<meta itemprop="alternativeHeadline" name="hdl_p" content="Getting Tesla From Here To There">
<meta name="byl" content="By JAMES B. STEWART">
<meta name="lp" content="Tesla Motors gets raves for its Model S, and Wall Street loves the company’s soaring stock. But it remains to be seen whether Tesla can actually sell the cars.">
<meta itemprop="usageTerms" content="http://www.nytimes.com/content/help/rights/sale/terms-of-sale.html">
<meta name="cre" content="The New York Times">
<meta name="edt" content="NewYork">
<meta name="pdate" content="20130823">
<meta name="ttl" content="">
<meta name="des" content="Automobiles;Electric and Hybrid Vehicles;Stocks and Bonds">
<meta name="per" content="Musk, Elon">
<meta name="org" content="Tesla Motors Inc">
<meta name="geo" content="">
<meta name="ticker" content="Google Inc|GOOG|NASDAQ;Apple Inc|AAPL|NASDAQ;Zipcar Inc|ZIP|NASDAQ;Tesla Motors Inc|TSLA|NASDAQ;Morgan Stanley|MS|NYSE">
<meta name="slug" content="24stewart">
<meta name="utime" content="20130826120201">
<meta name="ptime" content="20130823150002">
<meta name="author" content="JAMES B. STEWART">
<meta name="dat" content="August 23, 2013">
<meta itemprop="genre" name="tom" content="News">
<meta name="cat" content="">
<meta name="col" content="Common Sense">
<meta itemprop="articleSection" name="dsk" content="Business Day">
<meta itemprop="identifier" name="articleid" content="100000002402814">
<meta name="ARTICLE_TEMPLATE_VERSION" CONTENT="700">
<meta name="hdr_img" content="/images/article/header/sect_business.gif">
<meta itemprop="thumbnailUrl" name="thumbnail" content="http://www.nytimes.com/images/2013/08/24/business/Stewart/Stewart-thumbStandard.jpg">
<meta name="thumbnail_height" content="75">
<meta name="thumbnail_width" content="75">
<meta name="thumbnail_150" content="http://www.nytimes.com/images/2013/08/24/business/Stewart/Stewart-thumbLarge.jpg">
<meta name="thumbnail_150_height" content="150">
<meta name="thumbnail_150_width" content="150">
<meta name="xlarge" content="images/2013/08/24/business/Stewart/Stewart-articleLarge.jpg">
<meta name="xlarge_height" content="400">
<meta name="xlarge_width" content="600">
<meta name="sectionfront_jsonp" content="http://json8.nytimes.com/pages/business/index.jsonp">
<meta name="CG" content="business">
<meta name="SCG" content="">
<meta name="PT" content="Article">
<meta name="PST" content="News">
<meta name="msapplication-starturl" content="http://www.nytimes.com/">
<link rel="canonical" href="http://www.nytimes.com/2013/08/24/business/wondering-if-tesla-can-get-there-from-here.html?pagewanted=all">
<meta property="og:url" content="http://www.nytimes.com/2013/08/24/business/wondering-if-tesla-can-get-there-from-here.html?pagewanted=all"/>
<meta property="og:type" content="article"/>
<meta property="og:title" content="Getting Tesla From Here to There"/>
<meta property="og:description" content="Tesla Motors gets raves for its Model S, and Wall Street loves the company’s soaring stock. But it remains to be seen whether Tesla can actually sell the cars.">
<meta property="og:image" content="http://graphics8.nytimes.com/images/2013/08/24/business/Stewart/Stewart-superJumbo.jpg"/>
<meta property="fb:app_id" content="9869919170"/>
<meta name="twitter:card" value="summary">
<meta name="twitter:site" value="@nytimes">
<meta name="twitter:url" content="http://www.nytimes.com/2013/08/24/business/wondering-if-tesla-can-get-there-from-here.html?pagewanted=all"/>
<meta name="twitter:title" content="Getting Tesla From Here to There"/>
<meta name="twitter:description" content="Tesla Motors gets raves for its Model S, and Wall Street loves the company’s soaring stock. But it remains to be seen whether Tesla can actually sell the cars."/>
<meta name="twitter:image" content="http://graphics8.nytimes.com/images/2013/08/24/business/Stewart/Stewart-thumbLarge.jpg"/>
<link rel="alternate" href="http://mobile.nytimes.com/2013/08/24/business/wondering-if-tesla-can-get-there-from-here.html"/>

I'm thinking maybe a special BB code, perhaps [og].

So doing something like

[og]http://www.nytimes.com/2013/08/24/business/wondering-if-tesla-can-get-there-from-here.html?pagewanted=all&_r=2&[/og]

Would yield:
[URL=http://www.nytimes.com/2013/08/24/business/wondering-if-tesla-can-get-there-from-here.html?pagewanted=all&_r=2&]Getting Tesla From Here to There - NYTimes.com[/url]
[QUOTE=The New York Times][img]https://vborg.vbsupport.ru/external/2013/08/4.jpg[/img]
Tesla Motors gets raves for its Model S, and Wall Street loves the company’s soaring stock. But it remains to be seen whether Tesla can actually sell the cars.[/QUOTE]

And would show up like this:

Getting Tesla From Here to There - NYTimes.com
Quote:
Originally Posted by The New York Times

Tesla Motors gets raves for its Model S, and Wall Street loves the company’s soaring stock. But it remains to be seen whether Tesla can actually sell the cars.
There are probably better ways. I kinda like this since you can edit it after the fact and it's clear that the content belongs to the source. It really is just like a title includer.

Speaking of title includes, the one I'm using now screws up asian characters and spits out junk. Would be cool if it could deal with that properly. Also it doesn't work if someone posts a link while in WIYSIWYG mode, since the link already has URL data with it, unless they paste the link as plain text. Cheers!
Reply With Quote
Благодарность от:
BirdOPrey5
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05585 seconds
  • Memory Usage 2,398KB
  • Queries Executed 28 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (7)bbcode_code
  • (2)bbcode_html
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (8)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (3)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete