Warning: The author of this contribution does not provide support for it anymore.

Share Topic

Setting a default facebook image? - Share Topic

Setting a default facebook image?

by kerble » Wed Jun 22, 2011 4:19 am

Hey Senky,

fantastic mod. thanks. your instructions were also really clear, and the two issues I had (adjusting icon alignment and editing the overall_header in a subsilver2 based theme) were answered thoroughly. cheers.

anyway, I was curious about setting a default image for the facebook post shares. currently, share topic will add the image of the avatar of the person who started the thread as the thumbnail associated with the forum thread, like so:
Image
that's my avatar as the image. If a user doesn't have an avatar, there's no image available.

that said, our site has a logo that I'd love to add it as the default thumbnail related to shared posts from our forum. Ideally, I'd love for it to override even the avatar of the thread starter. I think it'd make our facebook branding more consistent, if that makes sense.

I looked through the code and couldn't figure out where it was calling up the avatar image, and would love some advice on how to edit it, or what to edit so that this can happen. your help is greatly appreciated.


best,


Faiz
kerble
Registered User
Posts: 2
Joined: Wed Jun 22, 2011 3:57 am

Re: Setting a default facebook image?

by kerble » Tue Jun 28, 2011 4:12 pm

figured it out.

added a source code for the image in the header like this:

Code: Select all

<link rel="image_src" href="http://SITENAME.org/THUMBNAME.png" />


and dropped the related image into the root folder for the website. this bypasses the avatar of the thread starter and gives a default avatar for facebook. that said, in some of the threads I tested, facebook's cache is remembering the old avatar image. can't do much about that, but for all future threads, this will work.


ok!
kerble
Registered User
Posts: 2
Joined: Wed Jun 22, 2011 3:57 am

Re: Setting a default facebook image?

by acpoweradapter » Wed Jul 20, 2011 3:22 am

What file do I need to place that code in? the header file?
acpoweradapter
Registered User
Posts: 2
Joined: Tue Jul 19, 2011 5:44 pm

Re: Setting a default facebook image?

by D@ve » Sat Apr 28, 2012 4:27 pm

Any idea why this is not working?
I tried everything... Inserting a normal image at the top and hiding it via css, inserting an image via <link... facebook just recognizes the avatars...

thanks and regards
Dave


kerble wrote:figured it out.

added a source code for the image in the header like this:

Code: Select all

<link rel="image_src" href="http://SITENAME.org/THUMBNAME.png" />


and dropped the related image into the root folder for the website. this bypasses the avatar of the thread starter and gives a default avatar for facebook. that said, in some of the threads I tested, facebook's cache is remembering the old avatar image. can't do much about that, but for all future threads, this will work.


ok!
2jesus.de - (german community for bible & faith)
phpBB.de - the German support community for pbpBB
User avatar
D@ve
Registered User
Posts: 143
Joined: Sat Aug 28, 2004 12:49 am
Location: Germany, Bretzfeld D.C.
Name: Dave Remmel

Re: Setting a default facebook image?

by Senky » Sun Apr 29, 2012 8:40 am

@D@ve - is not this just because of facebook's cache? What about new topics, do they show avatar, too?
‎‏‏ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‎‏‎‏‏‎ ‎ ‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎🔔
Browser & Mobile Notifications Extension
Now with Safari (both macOS and iOS) support!
Senky
Former Team Member
Posts: 2300
Joined: Thu Apr 30, 2009 8:49 pm
Name: Jakub

Re: Setting a default facebook image?

by D@ve » Sun Apr 29, 2012 9:08 am

No was not the Cache... I found a debugger from facebook. The image was to small... You need at least 200x200 Pixel *sigh*.

Regards, Dave
2jesus.de - (german community for bible & faith)
phpBB.de - the German support community for pbpBB
User avatar
D@ve
Registered User
Posts: 143
Joined: Sat Aug 28, 2004 12:49 am
Location: Germany, Bretzfeld D.C.
Name: Dave Remmel

Re: Setting a default facebook image?

by CD130 » Wed May 18, 2016 7:57 am

Thanks for finding this useful topic with Google.

On the top of my forum I have a big random header image. I connect Twitter to Facebook, so when I add a forumlink in a Tweet, Facebook will add automatically an rondom header image of that page in that message. Facebook also crops that image automatically. I'm using phpbb 3.1 with the Basic style from Artodia at this moment.

What I did to make it work fine:
- I made an image (header.png) with 475x250 pixels
- Copied that image to this location: /images/header.png
- Added this line after {META} to /styles/%your style%/template/overall_header.html:

Code: Select all

<link rel="image_src" href="images/header.png" />

- Remove cache in ACP

Done :)
CD130
Registered User
Posts: 116
Joined: Thu Nov 13, 2014 2:09 pm