PDA

View Full Version : 'Like' post capability ?


edgeless
03-06-2013, 04:10 AM
What's the best/easiest way to add this feature to 4.2.0?

Ba'al
03-06-2013, 04:23 AM
There is a Mod called "Helpful Answers System" it can be used for this purpose and works very well.
https://vborg.vbsupport.ru/showthread.php?t=233296

edgeless
03-06-2013, 12:46 PM
That's a nice one, Ba'al. Thank you for suggesting it. But I think it's a bit more than what I have in mind. What I want is a simple Facebook-type 'Like' button that when pressed will result in indication on a post that someone has agreed with/endorsed the message. I see this feature being used on various vB forum sites, so I know it's available. It in fact even appears to be in use here. Can anyone please tell me how to get it for my own vB forum site?

Thanks in advance.

findingpeace
03-06-2013, 01:07 PM
Post Thank You + Recent Thanks (for Notifications)

https://vborg.vbsupport.ru/showthread.php?t=231666

https://vborg.vbsupport.ru/showthread.php?t=280109

After install, just do a phrase find/replace for all "Thanks" variants -> "Likes"

You can see what it looks like on any one of our threads, in case you want a demo before installing:

http://psychopathfree.com/showthread.php?645-How-are-you-feeling-today

We had to do something specific to get the total "Liked: # Times" under each username/avatar, post back if you want me to look at our template.

Also, you may want to check out these instant AJAX notifications which work out flawlessly with the two mods above:
https://vborg.vbsupport.ru/showthread.php?t=266914

This will put an instant notification of new "Likes" at the bottom of the screen, without refreshing the page or anything.

edgeless
03-06-2013, 02:15 PM
findingpeace: Thank you VERY much! And I would definitely be interested in the code to get the 'Like' total counts to appear under the member's information (at your convenience, of course).

Thanks again!

findingpeace
03-06-2013, 02:22 PM
No problem! I think it's included in the mod, I just remember it looked really messy on the default theme. It might be all fixed in the latest release or something, but if not, here is what we use:

Open up template: post_thanks_postbit_info

And just replace it all with this:

<vb:if condition="$post['userid']">
<vb:if condition="$post['post_thanks_thanked_times'] == 1">
<dt>Liked</dt> <dd>{vb:rawphrase post_thanks_time_post}</dd>
<vb:elseif condition="$post['post_thanks_thanked_posts'] == 1" />
<dt>Liked</dt> <dd>{vb:rawphrase post_thanks_times_post, {vb:raw post.post_thanks_thanked_times_formatted}}</dd>

<vb:else />
<dt>Liked</dt> <dd>{vb:rawphrase post_thanks_times_posts, {vb:raw post.post_thanks_thanked_times_formatted}, {vb:raw post.post_thanks_thanked_posts_formatted}}</dd>

</vb:if>
</vb:if>

Let me know if I can provide any more info :) These are definitely great modifications to include - increases user engagement a ton. You might also want to consider this one:

https://vborg.vbsupport.ru/showthread.php?t=267329

Which adds notifications for new replies in threads that the user has posted in or created. Also integrates perfectly with the instant AJAX mod.

edgeless
03-06-2013, 03:04 PM
Wow, thanks kindly!

--------------- Added 1362599861 at 1362599861 ---------------

Well, the 'Thanks' hack works fine and the stats for each member display in the posts and appear to update and track properly. But the 'Thanks' stats lines messed up a couple of member profile information fields that I've add to the posts in a plugin using the following code:
if ($post['field6'])
{
$template_hook['postbit_userinfo_right_after_posts'] .= "'<dt>My Field Name 1</dt> <dd>' . $post[field6] . '</dd>'";
}

if ($post['field5'])
{
$template_hook['postbit_userinfo_right_after_posts'] .= "'<dt><b>My Field Name 2</b></dt> <dd>' . $post[field5] . '</dd>'";
}


Does anyone know how to fix that or a better way to add those profile fields to the posts?