there is a snippet to do just that by doyouspeakwak:Jay1318 wrote:I would love to add the ability for users on my forum to "like" a post, just as on Facebook. Don't need it to connect to FB or have anything to do with FB, just the same functionality on my boards. Then below the post or wherever it would say "4 people like this", maybe even the screen manes of the users who liked it.
Does this exist?
Code: Select all
// Send vars to template
$template->assign_vars(array(
Code: Select all
// BEGIN THE NEW FACEBOOK LIKE BUTTON MOD
// bots allowed to read the forum the topic is in?
// if not set the facebook link to hidden
// you need to replace the number 370 below with the group id of the BOTS group
$can_facebook = $auth->acl_group_raw_data(370, 'f_read', $forum_id);
$can_facebook = sizeof($can_facebook) ? true : false;
// END THE NEW FACEBOOK LIKE BUTTON MOD
Code: Select all
&g=
Code: Select all
'POST_IMG' => ($topic_data['forum_status']
Code: Select all
// BEGIN THE NEW FACEBOOK LIKE BUTTON MOD
'CAN_FACEBOOK' => $can_facebook,
// END THE NEW FACEBOOK LIKE BUTTON MOD
Code: Select all
<h2><a href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></h2>
Code: Select all
<!-- IF CAN_FACEBOOK -->
<iframe src="http://www.facebook.com/plugins/like.php?href={BOARD_URL}viewtopic.php%3Ff%3D{S_FORUM_ID}%26t%3D{S_TOPIC_ID}&t={TOPIC_ID}&layout=standard&show_faces=false&width=450&action=like&font=tahoma&colorscheme=light&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe>
<!-- ENDIF -->
Code: Select all
<!-- INCLUDE jumpbox.html -->
Code: Select all
<!-- IF CAN_FACEBOOK -->
<iframe src="http://www.facebook.com/plugins/like.php?href={BOARD_URL}viewtopic.php%3Ff%3D{S_FORUM_ID}%26t%3D{S_TOPIC_ID}&t={TOPIC_ID}&layout=standard&show_faces=false&width=450&action=like&font=tahoma&colorscheme=light&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe>
<!-- ENDIF -->
I can only speak for me, but I would appreciate it!benbejay wrote:So, would you like me to have a look at it to get it looking more like FB?
I'm currently working on another MOD, so this is at the bottom of my list. If I get time this weekend, I'll have a look at adding the image for you. I can't do the other bits sorry.Thyron wrote:I can only speak for me, but I would appreciate it!benbejay wrote:So, would you like me to have a look at it to get it looking more like FB?
Besides other buttons, it would be the list of users that needs a little modification. What is missing is the amount of users that thank/liked the post. Also I don't like that usernames are only visible when the "show me" link will be hit. For me the hide function is not needed at all. It could look like this:
2 Users like this post: Thyron, Jay1318.
To do it exactly like facebook would be more difficult and not really needed:
You, Thyron, Jay1318 and 2 other Users (as show me link) like that.
For me the like count is important and I have no idea how to get that information...