News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Facebook like inside first post above the body

Started by aw06, January 30, 2011, 10:18:27 PM

Previous topic - Next topic

aw06

Quote from: Miss All Sunday on January 31, 2011, 01:07:40 PM
to be able to like an individual topic you need this variable:

$scripturl . '?topic=' . $topic . '.msg' . $message['ID_MSG'] . '#msg' . $message['ID_MSG']

the full code will look like this:

$facebook_url = $scripturl . '?topic=' . $topic . '.msg' . $message['ID_MSG'] . '#msg' . $message['ID_MSG'];
$facebook_share = '<iframe src="http://www.facebook.com/plugins/like.php?href=',$facebook_url,'&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe><br />';
if ($counter == 0)
$message['body'] = ($facebook_share.$message['body']);

 

Error  :-[

Parse error: syntax error, unexpected ','
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

aw06

Ok, i tested the code on a regular page ... when click it gives the error...


The page at http://&#039;,$facebook_url,&#039;/ could not be reached.
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

All Colours Sam

can you attach your Sources/Display.php file?
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

aw06

:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

All Colours Sam

try this one, always made a backup before you modify a file.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

aw06

#25
Quote from: Miss All Sunday on January 31, 2011, 06:28:00 PM
try this one, always made a backup before you modify a file.

Hmmm, that seems to be working  :) Will monitor it for a few minutes and report back ...

Possible to have it come after that message body ??? kinda got used to it in that location :P

Also how do i set the text back to verdana ??

Im adding it like

like&amp;font=verdana&amp;colorscheme=light

But it doesn't seem to be changing
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

aw06

#26
Hmmm .. this code not taking any changes  :-\ trying to turn off faces and no luck either ???

Even when i delete to show faces bit of code it still shows
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

aw06

OK, Blue devil ... been testing on your site .. seems you are getting an error .. when i click like facebook gives the error..

QuoteYou failed to provide a valid list of administators. You need to supply the administors using either a "fb:app_id" meta tag, or using a "fb:admins" meta tag to specify a comma-delimited list of Facebook users.

And it didn't push the feed to my profile
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Mick.

Quote from: aw06 on January 31, 2011, 07:32:20 PM
OK, Blue devil ... been testing on your site .. seems you are getting an error .. when i click like facebook gives the error..

QuoteYou failed to provide a valid list of administators. You need to supply the administors using either a "fb:app_id" meta tag, or using a "fb:admins" meta tag to specify a comma-delimited list of Facebook users.

And it didn't push the feed to my profile

Ugh.  Facebook making changes again.  I need to look into it.  Thanx for seeing that,

aw06

Yeah, the api really seems to be the problem ...

What i'm seeing is that the api see each url as different even if it's on the same page...

So if i click like on
http://www.simplemachines.org/community/index.php?action=post;topic=419777.20

Then look at it logged in or out of facebook it will show..... but if i use url say on the same page
http://www.simplemachines.org/community/index.php?action=post;topic=419777.20;last_msg=2935385

It will not show the likes .. you have to look back at the
http://www.simplemachines.org/community/index.php?action=post;topic=419777.20

Kinda crappy on facebook's end
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

aw06

So far now .. I'm pulling it directly into display.template... and showing it below post...

<td valign="bottom" class="smalltext" id="modified_', $message['id'], '">';

if ($message['id'] == $context['topic_first_message']) echo '<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like layout="standard" show_faces="false" width="450" action="like" font="verdana"></fb:like>';

// Show "�� Last Edit: Time by Person ��" if this post was edited.
if ($settings['show_modify'] && !empty($message['modified']['name']))


See more
http://shopinja.com/forum/index.php?board=15.0

Once we can get it to show likes on pages and not so much the url then will be good to go..
I'm going to try it with Miss All Sunday's code and see if it works any better, but with her code changing some of the values does not work.
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

aw06

<td valign="bottom" class="smalltext" id="modified_', $message['id'], '">';

if ($message['id'] == $context['topic_first_message']) echo '<iframe src="http://www.facebook.com/plugins/like.php?href='.$facebook_url.'&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>';

// Show "�� Last Edit: Time by Person ��" if this post was edited.
if ($settings['show_modify'] && !empty($message['modified']['name']))


OK that never work ... in smf error log
8: Undefined variable: facebook_url

Facebook Error
QuoteYou must specify a URL as part of this widget or API.
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

aw06

OK, more testing .. the one on Miss All Sunday's site works perfectly ... it shows the correct likes be in your logged in or out.. and no matter the reply you view it still shows the likes...

Only problem i want to turn off faces and change the font to verdana but it's not letting me  :-\  maybe Miss All Sunday's can tell me how to move it below the message body where it will take up less space...
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

aw06

Well now magically the code i was using stop working...

Quote from: aw06 on January 31, 2011, 08:10:10 PM
So far now .. I'm pulling it directly into display.template... and showing it below post...

<td valign="bottom" class="smalltext" id="modified_', $message['id'], '">';

if ($message['id'] == $context['topic_first_message']) echo '<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like layout="standard" show_faces="false" width="450" action="like" font="verdana"></fb:like>';

// Show "�� Last Edit: Time by Person ��" if this post was edited.
if ($settings['show_modify'] && !empty($message['modified']['name']))

The code basically just stopped showing the button ....  :o
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

aw06

Quote from: Miss All Sunday on January 31, 2011, 06:28:00 PM
try this one, always made a backup before you modify a file.

Using this code now .... like button is working correctly now ... but why can't i turn off faces and change the font ???  :-\
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

All Colours Sam

tha is up completly related to facebook, if facebook ignores its own code, theres nothing you can do.

Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

aw06

Quote from: Miss All Sunday on February 02, 2011, 01:19:16 PM
tha is up completly related to facebook, if facebook ignores its own code, theres nothing you can do.

yeah i realize ... i just made the height smaller to hide the faces.. all seems good to go now ..
Thanks again..
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Advertisement: