Very simple Facebook "Like" button added on to every topic. Looking for testers ;)
I packed it below. Only for SMF RC3 default theme.
It will post the topic name, link and "Like" back to your Facebook "Recent Activity" wall.
It will work on any custom theme that does NOT have display.template.php.
NOTE*** Only works for logged in Facebook users.
Thanx,
Mick.
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.bluedevilcustoms.com%2Fdevsite%2Fimages%2Ffblike.png&hash=26e8647128fe2d7bba20e701508f894da0a13e91)
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.bluedevilcustoms.com%2Fdevsite%2Fimages%2Ffacebook_like.png&hash=6df29ffc2a5bd8e44f58319183e20f057352791a)
It appears to work correctly Mick.
Error log shows no entries.
http://www.ourfamilyforum.org/SMF2.0/index.php?topic=3.0 (http://www.ourfamilyforum.org/SMF2.0/index.php?topic=3.0)
Quote from: Ken. on April 22, 2010, 09:12:04 PM
It appears to work correctly Mick.
Error log shows no entries.
http://www.ourfamilyforum.org/SMF2.0/index.php?topic=3.0
Cool, i see it. I would think if i push it a little bit to the right would look better.
Quote from: bluedevil on April 22, 2010, 09:14:04 PM
Quote from: Ken. on April 22, 2010, 09:12:04 PM
It appears to work correctly Mick.
Error log shows no entries.
http://www.ourfamilyforum.org/SMF2.0/index.php?topic=3.0
Cool, i see it. I would think if i push it a little bit to the right would look better.
Yeah.
Sweet going to use this!
I guess i take that as a yes. Submitting this to the mod site. ;)
Added a quick "read-Me" file and submitted it to the mod site.
I got to thinking that languages should change automaticaly per FB users settings. Hmmm.....i guess we'll find out.
Very nice Mick. I'll take a look at the queue shortly.
Quote from: JBlaze on April 22, 2010, 10:25:34 PM
Very nice Mick. I'll take a look at the queue shortly.
Oh wow, thanx man. You rock!
Nice one :)
Any chance that there will be a mod for smf 1.1? I won't be able to upgrade for a while due to integration issues ::)
Quote from: Ken. on April 24, 2010, 08:52:01 PM
She's up to 11 posts... wonder how high she'll get before someone yanks the plug? ;)
Someone pulled it. lol
Quote from: trikos on April 24, 2010, 12:10:55 PM
Nice one :)
Any chance that there will be a mod for smf 1.1? I won't be able to upgrade for a while due to integration issues ::)
Sorry Trikos but no. I moved on to 2.0 series and never looked back. In fact, i don't even have 1.1.x installation for testing.
Sorry man.
Quote from: bluedevil on April 24, 2010, 08:52:55 PM
Quote from: Ken. on April 24, 2010, 08:52:01 PM
She's up to 11 posts... wonder how high she'll get before someone yanks the plug? ;)
Someone pulled it. lol
Yepp... I noticed that, so I deleted my post. :)
Quote from: bluedevil on April 24, 2010, 08:54:53 PM
Quote from: trikos on April 24, 2010, 12:10:55 PM
Nice one :)
Any chance that there will be a mod for smf 1.1? I won't be able to upgrade for a while due to integration issues ::)
Sorry Trikos but no. I moved on to 2.0 series and never looked back. In fact, i don't even have 1.1.x installation for testing.
Sorry man.
Well, I understand. I might code a module for 1.1 myself inspired by yours if you don't mind.
Simple to add to 1.1.x I added it to some of my forums.
I need a little help here with the code....
Dismal Shadow requested board permissions to this simple mod.
...and here's why..... Ken's pictures shows "like" to a hidden board.
(https://www.simplemachines.org/community/index.php?action=dlattach;topic=377784.0;attach=142826;image)
I took it upon myself to add the board permissions but so far i have 2 "parse errors".
1. Parse error: syntax error, unexpected ';', expecting ')' in ..../Sources/ManageBoards.php on line 421
2. Parse error: syntax error, unexpected $end in .../Themes/default/Display.template.php on line 880
I cannot locate the problem.
Here's the xml file:
Easiest thing to do is apply the mod and look at the resultant files - is all I'd do.
For Display.template.php error, remove the "{" at the end of 3rd line. But for the other one, I don't have any idea :)
Doh! i forgot to open and close the operation.
<file name="$sourcedir/ManageBoards.php">
<operation>
<search position="before"><![CDATA[
$boardOptions['posts_count'] = isset($_POST['count']);
]]></search>
<add><![CDATA[
$boardOptions['facebookLike_board_enable'] = isset($_POST['facebookLike_board_enable']); //Facebook Like
]]></add>
<search position="before"><![CDATA[
'theme' => 0,
'profile' => 1,
'override_theme' => 0,
]]></search>
<add><![CDATA[
'facebookLike_board_enable' => 0,
]]></add>
</operation>
</file>
I now have an issue that i cannot correct.
http://www.bluedevilcustoms.com/devsite/index.php?topic=1.msg9#new
If i remove this from the display.template.php the mod is visible. But if i leave it, it breaks the page.
//Facebook Like
if( !empty($modSettings['facebookLike_allow']) && !empty($context['facebookLike_board_enable']) && !$context['user']['is_guest'])
What's the code both before and after that?
Quote from: Arantor on April 25, 2010, 08:05:37 PM
What's the code both before and after that?
Oh hey man,... this is the updated xml. What im trying to do is, add board specific permissions.
Could someone please tell me what variable is used to pull the URL for SMF 1.1.x?
What do you mean by board specific permissions, exactly? Do you mean have it stored in the boards management (as an admin on/off option) or a board permission as managed in the permissions area?
Quote from: Arantor on April 25, 2010, 08:24:04 PM
What do you mean by board specific permissions, exactly? Do you mean have it stored in the boards management (as an admin on/off option) or a board permission as managed in the permissions area?
In admin--->forum---->modify boards, the admin can tick the box if he wants the "facebook Like" button visible.
Reason being is that the echo then carries on the next code, so if the expression fails it all goes haywire.
Try this:
<?xml version="1.0"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
<name>Facebook_Like v.1.2</name>
<id>BlueDevil:Facebook_LIke</id>
<version>1.2</version>
<file name="$sourcedir/Display.php">
<operation>
<search position="before"><![CDATA[ $context['is_approved'] = $topicinfo['approved'];]]></search>
<add><![CDATA[
//Facebook Like
$context['facebookLike_board_enable'] = $board_info['FacebookLike_board_enable'];
]]></add>
</operation>
</file>
<file name="$themedir/Display.template.php">
<operation>
<search position="replace"><![CDATA[ <span id="author">', $txt['author'], '</span>]]></search>
<add><![CDATA[
<span id="author">', $txt['author'], '</span>';
//Facebook Like
if( !empty($modSettings['facebookLike_allow']) && !empty($context['facebookLike_board_enable']) && !$context['user']['is_guest'])
echo '
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({appId: \'your app id\', status: true, cookie: true,
xfbml: true});
};
(function() {
var e = document.createElement(\'script\'); e.async = true;
e.src = document.location.protocol +
\'//connect.facebook.net/en_US/all.js\';
document.getElementById(\'fb-root\').appendChild(e);
}());
</script>
<!-- Facebook Like Button -->
<span style="float:right; margin-top:4px;">
<fb:like href=', $scripturl, '?topic=', $context['current_topic'], 'layout="standard" show_faces="false" width="450" action="like" colorscheme="light" />
</span>
<!-- End of Facebook Like Button -->';
echo '
]]></add>
</operation>
</file>
<file name="$themedir/ManageBoards.template.php">
<operation>
<search position="after"><![CDATA[
// Here the user can choose to force this board to use a theme other than the default theme for the forum.
]]></search>
<add><![CDATA[
// Add the Facebook LIke
echo '
<div id="board_theme_div">
<dl class="settings">
<dt>
<strong>', $txt['facebookLike_board_enable'], ':</strong><br />
<span class="smalltext">', $txt['facebookLike_board_enable_desc'], '</span><br />
</dt>
<dd>
<input type="checkbox" name="facebookLike_board_enable" ', $context['board']['facebookLike_board_enable'] ? ' checked="checked"' : '', ' class="check" />
</dd>
</dl>
</div>';
]]></add>
</operation>
</file>
<file name="$sourcedir/ManageSettings.php">
<operation>
<search position="before"><![CDATA[
// Mod authors, add any settings UNDER this line. Include a comma at the end of the line and don't remove this statement!!
]]></search>
<add><![CDATA[
array('check', 'facebookLike_allow'),
'',
]]></add>
</operation>
</file>
<file name="$sourcedir/ManageBoards.php">
<operation>
<search position="before"><![CDATA[
$boardOptions['posts_count'] = isset($_POST['count']);
]]></search>
<add><![CDATA[
$boardOptions['facebookLike_board_enable'] = isset($_POST['facebookLike_board_enable']); //Facebook Like
]]></add>
</operation>
<operation>
<search position="before"><![CDATA[
'theme' => 0,
'profile' => 1,
'override_theme' => 0,
]]></search>
<add><![CDATA[
'facebookLike_board_enable' => 0,
]]></add>
</operation>
</file>
<file name="$sourcedir/Subs-Boards.php">
<operation>
<search position="before"><![CDATA[ $boardOptions += array(
'posts_count' => true,]]></search>
<add><![CDATA[
'facebookLike_board_enable' => false,]]></add>
</operation>
<operation>
<search position="before"><![CDATA[ b.board_order, b.count_posts, b.member_groups, b.id_theme, b.override_theme, b.id_profile,]]></search>
<add><![CDATA[
b.facebookLike_board_enable,]]></add>
</operation>
<operation>
<search position="before"><![CDATA[ 'count_posts' => empty($row['count_posts']),]]></search>
<add><![CDATA[
'facebookLike_board_enable' => $row['facebookLike_board_enable'],]]></add>
</operation>
<operation>
<search position="after"><![CDATA[ // Set the theme for this board.]]></search>
<add><![CDATA[
// Enable or disable the Facebook Like mod in any board.
if (isset($boardOptions['facebookLike_board_enable']))
{
$boardUpdates[] = 'facebookLike_board_enable = {int:facebookLike_board_enable}';
$boardUpdateParameters['facebookLike_board_enable'] = (int)$boardOptions['facebookLike_board_enable'];
}]]></add>
</operation>
</file>
<file name="$sourcedir/Load.php">
<operation>
<search position="before"><![CDATA[ b.id_theme, b.override_theme, b.count_posts, b.id_profile,]]></search>
<add><![CDATA[
b.facebookLike_board_enable,]]></add>
</operation>
<operation>
<search position="before"><![CDATA[ 'posts_count' => empty($row['count_posts']),]]></search>
<add><![CDATA[
'facebookLike_board_enable' => $row['facebookLike_board_enable'],]]></add>
</operation>
</file>
<file name="$themedir/languages/Modifications.english.php">
<operation>
<search position="after"><![CDATA[?>]]></search>
<add><![CDATA[
//Begin mod Fecebook Like
$txt['facebookLike_allow'] = '[FacebookLike] Enable Topic Like in your forum?';
$txt['facebookLike_board_enable'] = 'Enable Facebook Like on topics [Facebook Like mod]';
$txt['facebookLike_board_enable_desc'] = 'This option allows people to Like the topics they are reading.';
//End mod Facebook Like
]]></add>
</operation>
</file>
<file name="$themedir/languages/Modifications.english-utf8.php" error="skip">
<operation>
<search position="after"><![CDATA[?>]]></search>
<add><![CDATA[
//Begin mod Fecebook Like
$txt['facebookLike_allow'] = '[FacebookLike] Enable Topic Like in your forum?';
$txt['facebookLike_board_enable'] = 'Enable Facebook Like on topics [Facebook Like mod]';
$txt['facebookLike_board_enable_desc'] = 'This option allows people to Like the topics they are reading.';
//End mod Facebook Like
]]></add>
</operation>
</file>
</modification>
As you can see I've ended the FB edits and added a new echo statement which won't be in the scope of the if expression.
OMG, i cant believe i missed that.
';
echo '
I need a break ive been working on it all day.
Thanx Arantor that worked.
Mod now repacked and sent to the mod site for approval.
Now uses board permissions. Thanx Arantor, Yagiz for the help. .......and also thanx to Dismal Shadow for the idea.
Could someone please port this mod over to SMF 1.1.11
I needs this mod - but I can not find where i can download it?
It's not yet approved.
Quote from: vbgamer45 on April 25, 2010, 10:47:28 AM
Simple to add to 1.1.x I added it to some of my forums.
Can you share how to add to 1.1.11
i will be interested on a 1.1.11 version.. thanks in advance
1.1.x please...
Ok i'll bite.
Im making progress..... :P
this would be awesome for 1.1.11!
How long to wait for the finished mod? When it is approved?
Rc3 is ready in the mod site waiting approval.
I started working for the 1.1.x but it may be a while as i have chores to do at home and i have a plumbing leak in my laundry room that needs fixed.
The 1.1.x will be added when finished in a separate package as i dont want it mixed with rc3.
....besides,...i dont know anything of 1.1.x so im also studying it to add board permissions and a database like the rc3 mod.
I'll be jumping for joy when it's ready for 1.1.x!
When will it be available? I'd use it for reasons for a few of my facebook friends...
Quote from: Kcmartz on April 30, 2010, 01:31:21 PM
When will it be available? I'd use it for reasons for a few of my facebook friends...
When it's ready.
Quote from: bluedevil on April 29, 2010, 11:43:23 AM
Rc3 is ready in the mod site waiting approval.
I started working for the 1.1.x but it may be a while as i have chores to do at home and i have a plumbing leak in my laundry room that needs fixed.
The 1.1.x will be added when finished in a separate package as i dont want it mixed with rc3.
....besides,...i dont know anything of 1.1.x so im also studying it to add board permissions and a database like the rc3 mod.
Post there if you need any help :)
It says you have packaged it below in your post, but I don't see it anywhere? I know it hasnt been an approved mod yet, but is there anyway I can get hold of the copy that a few others have installed here please? If not via the forum, would somebody be able to email it to me please?
[email protected]I would really really appreciate it :d
Quote from: swiftmed on May 03, 2010, 12:51:36 PM
It says you have packaged it below in your post, but I don't see it anywhere? I know it hasnt been an approved mod yet, but is there anyway I can get hold of the copy that a few others have installed here please? If not via the forum, would somebody be able to email it to me please? [email protected]
I would really really appreciate it :d
The one i had uploaded was for testing purposes. The final, is waiting approval.
Quote from: bluedevil on May 03, 2010, 01:56:49 PM
The one i had uploaded was for testing purposes. The final, is waiting approval.
Thank you for the reply sir. Any idea roughly how long approval takes? Or would it be possible for you to email me a copy of the one you uploaded for testing please?
I'll wait!
This would be cool, im waiting for mod to be appoved.
The SMF team dloaded the other day for their testing but no response yet. :o
Usually i get a response soon after they download it but its been 3 days since they did.
bluedevil, be patient, they will response after few days, after mod is tested... :)
Quote from: Dzonny on May 04, 2010, 01:26:44 PM
bluedevil, be patient, they will response after few days, after mod is tested... :)
Oh is no biggie. I already learned no to be ansy when submitting mods. I understand completely what's behind the curtain.
Any rough Idea on when this will go live anybody?
Quote from: swiftmed on May 12, 2010, 12:29:12 PM
Any rough Idea on when this will go live anybody?
Well...... they get reviewed and approved on a come first basis. If there's 20 mods in front, then we would have to wait until is our time.
Quote from: bluedevil on May 12, 2010, 12:35:57 PM
Quote from: swiftmed on May 12, 2010, 12:29:12 PM
Any rough Idea on when this will go live anybody?
Well...... they get reviewed and approved on a come first basis. If there's 20 mods in front, then we would have to wait until is our time.
I see. Is it possible for anybody send me a copy of the mod submitted for review please? Id be happy to pay for it, and will obviously take full responsibility of installing it etc.
Quote from: swiftmed on May 12, 2010, 12:55:31 PM
Quote from: bluedevil on May 12, 2010, 12:35:57 PM
Quote from: swiftmed on May 12, 2010, 12:29:12 PM
Any rough Idea on when this will go live anybody?
Well...... they get reviewed and approved on a come first basis. If there's 20 mods in front, then we would have to wait until is our time.
I see. Is it possible for anybody send me a copy of the mod submitted for review please? Id be happy to pay for it, and will obviously take full responsibility of installing it etc.
Geez, can't you wait? It's not approved yet.
Quote from: Dismal Shadow on May 12, 2010, 01:08:08 PM
Quote from: swiftmed on May 12, 2010, 12:55:31 PM
Quote from: bluedevil on May 12, 2010, 12:35:57 PM
Quote from: swiftmed on May 12, 2010, 12:29:12 PM
Any rough Idea on when this will go live anybody?
Well...... they get reviewed and approved on a come first basis. If there's 20 mods in front, then we would have to wait until is our time.
I see. Is it possible for anybody send me a copy of the mod submitted for review please? Id be happy to pay for it, and will obviously take full responsibility of installing it etc.
Geez, can't you wait? It's not approved yet.
Well obviously I know it's not been approved yet, didn't need you to tell me that. Im simply asking IF the author of the mod is willing to send it to me before approval, and for his troubles, am willing to reimburse him. What's the problem with that? If you don't ask, you don't get!
Geez. What a pointless comment.
Quote from: swiftmed on May 12, 2010, 01:10:43 PM
Quote from: Dismal Shadow on May 12, 2010, 01:08:08 PM
Quote from: swiftmed on May 12, 2010, 12:55:31 PM
Quote from: bluedevil on May 12, 2010, 12:35:57 PM
Quote from: swiftmed on May 12, 2010, 12:29:12 PM
Any rough Idea on when this will go live anybody?
Well...... they get reviewed and approved on a come first basis. If there's 20 mods in front, then we would have to wait until is our time.
I see. Is it possible for anybody send me a copy of the mod submitted for review please? Id be happy to pay for it, and will obviously take full responsibility of installing it etc.
Geez, can't you wait? It's not approved yet.
Well obviously I know it's not been approved yet, didn't need you to tell me that. Im simply asking IF the author of the mod is willing to send it to me before approval, and for his troubles, am willing to reimburse him. What's the problem with that? If you don't ask, you don't get!
Geez. What a pointless comment.
Oh really? Everyone is waiting and wanting this as well, why would you be any different from them? Most authors do not send mods to anyone before approval UNLESS he/she is a beta tester. If you really need that bad...why not PM the author? Patient is a virtue.
Look, Im not going to argue with you, or anybody for that matter.
It was a simple request to the author of this mod, nobody else needed to get involved or whatever. Its upto the author if he wants to accept my offer of payment or not.
I'll help you guys out.
You will just need to find a place you want to put the button in your Display.template.php file.
<iframe src="http://www.facebook.com/plugins/like.php?href=', $scripturl, '?topic=', $context['current_topic'], '&layout=button_count&show_faces=true&width=80&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:80px; height:21px"></iframe>
Quote from: Mayhem30 on May 12, 2010, 01:52:17 PM
I'll help you guys out.
You will just need to find a place you want to put the button in your Display.template.php file.
<iframe src="http://www.facebook.com/plugins/like.php?href=', $scripturl, '?topic=', $context['current_topic'], '&layout=button_count&show_faces=true&width=80&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:80px; height:21px"></iframe>
Aww your a legend, thank so much for this!!!
Edit: The code worked perfectly. Thank you very much sir!!
Quote from: swiftmed on May 12, 2010, 01:53:41 PM
Quote from: Mayhem30 on May 12, 2010, 01:52:17 PM
I'll help you guys out.
You will just need to find a place you want to put the button in your Display.template.php file.
<iframe src="http://www.facebook.com/plugins/like.php?href=', $scripturl, '?topic=', $context['current_topic'], '&layout=button_count&show_faces=true&width=80&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:80px; height:21px"></iframe>
Aww your a legend, thank so much for this!!!
Your welcome!
You will need to adjust the width and height if you want the "Show Faces" feature. It's enabled, but cutoff due to height and width restrictions.
Good luck with it.
http://developers.facebook.com/docs/reference/plugins/like
Any news to work on 1.1.13?
been trying to figure out where exactly to load the information into the display.template.php
I got it to load to where everyone posts then you click like and every post that someone responds to already has like marked with a number I think I loaded the iframe information in the wrong section where do I need to look into the display.template.php
This doesn't appear to work since I've installed Facebook Connect Mod :(
i anserd your question here
http://www.simplemachines.org/community/index.php?topic=365503.msg3048557#msg3048557
Quote from: SA™ on May 18, 2011, 12:54:00 PM
your on smf1 therefor the api in that version of the mod isnt compatable with the newer fb tags ie < fb:like>
if you want the like button that bad update to smf2 or sacrifise fb connect for the like button
Quote from: SA™ on May 25, 2011, 09:31:57 PM
i anserd your question here
http://www.simplemachines.org/community/index.php?topic=365503.msg3048557#msg3048557
Quote from: SA™ on May 18, 2011, 12:54:00 PM
your on smf1 therefor the api in that version of the mod isnt compatable with the newer fb tags ie < fb:like>
if you want the like button that bad update to smf2 or sacrifise fb connect for the like button
I know, but it's not the answer I wanted to read :( Seeing if there's a way around it.
there isnt a way around it im afraid