News:

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

Main Menu

Like Posts

Started by vbgamer45, June 29, 2013, 09:29:03 AM

Previous topic - Next topic

Elizabeth II

There is a bug with this, when you like and unlike it within a second, it shows that you've liked that post twice.

megalukes

Hi there, guys. I'm trying to make the notification button appears on the navbar area. Would that be possible?
I was tying to use some of the parse code on the Subs.php code, but I'm not that good with Javascript commands.
I mean, I was trying to use some of that...
<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>
<li><a href="#" class="showLikeNotification" onclick="lpObj.showLikeNotification()">', $txt['like_show_notifications'], '</a></li>';


...in the Subs.php where you set navbar options like this.

'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => true,
'sub_buttons' => array(
),
),


Any help would be great. Thank you!

Joker™

Quote from: Britannia360 on June 12, 2014, 08:58:15 AM
There is a bug with this, when you like and unlike it within a second, it shows that you've liked that post twice.
Nice nice, this sounds a bug founded my workplace testing team ;D. Lol, will be rolling out a fix for the same in the next release.


Quote from: megalukes on June 12, 2014, 12:23:37 PM
Hi there, guys. I'm trying to make the notification button appears on the navbar area. Would that be possible?
I was tying to use some of the parse code on the Subs.php code, but I'm not that good with Javascript commands.
I mean, I was trying to use some of that...
<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>
<li><a href="#" class="showLikeNotification" onclick="lpObj.showLikeNotification()">', $txt['like_show_notifications'], '</a></li>';


...in the Subs.php where you set navbar options like this.

'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => true,
'sub_buttons' => array(
),
),


Any help would be great. Thank you!
Well to accomplish that one needs to edit subs.php and index.template.php. I'll posting some help out code by weekend :).
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

bdewong

This mod seems to want to try and load the JS 5 times. That doesn't seem normal. Is there a way to make it only load once?

Joker™

Quote from: bdewong on June 18, 2014, 09:14:59 PM
This mod seems to want to try and load the JS 5 times. That doesn't seem normal. Is there a way to make it only load once?
Really :o. BTW, which JS file is it loading multiple time? Will be looking into this one for sure.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Biology Forums

If a JS file is loaded twice, it doesn't load the second one because the first one is cached - so technically it doesn't matter.

Joker™

Quote from: Shuban on June 18, 2014, 09:48:07 PM
If a JS file is loaded twice, it doesn't load the second one because the first one is cached - so technically it doesn't matter.
Not all browsers are that smart :)
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Arantor

If the URLs are the same in each case they generally should be limiting what they have to do provided the server serving those URLs is relatively sane and If-Not-Modified and HTTP 304 are behaving. But that's still roundtrips that should be avoided if possibly.

bdewong

Quote from: Joker™ on June 18, 2014, 09:29:23 PM
Quote from: bdewong on June 18, 2014, 09:14:59 PM
This mod seems to want to try and load the JS 5 times. That doesn't seem normal. Is there a way to make it only load once?
Really :o. BTW, which JS file is it loading multiple time? Will be looking into this one for sure.

Maybe it's just my install, but this function is being called multiple times: LP_includeAssets()
That lays out all the javascript. I tried tracing the code to see where it was, but couldn't find it. It seems to be only on the actual topic page and not on any of the others.

Joker™

Tracked issues over here - https://github.com/siddhartha-gupta/SMF-Likes/issues

If anything is missing please do let me know :)
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Joker™

#311
And here's a teaser of most liked message stats ;D

Also the stats page has some magical things to it. Will be detailing them out later.

Edit - most liked topic tab also completed ;)
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Dblog

there used to be an option to disable topic likes and those likes being added to topic starter., but that seems to have disappeared in latest version

Joker™

Quote from: Cblog on June 22, 2014, 08:33:57 AM
there used to be an option to disable topic likes and those likes being added to topic starter., but that seems to have disappeared in latest version
Umm not sure about what you said above, as the permission system is only enhanced for guests in the latest version, and all previous permissions are still intact.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Dblog

ok got it.
now just the wording seems to have changed
its now 'Show like button on board index ' which if disabled will stop members from liking topics and those likes being added to topic starter.
i disabled it and now only inidividual posts can be liked

Stanyy

#315
This mod displays an error for my theme in /Themes/mytheme/index.template.php for the edit
Find:
<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>';

Replace:
<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>
<li><a href="#" class="showLikeNotification" onclick="lpObj.showLikeNotification()">', $txt['like_show_notifications'], '</a></li>';


The first code does not exist in my theme's index.template.php :(

EDIT: Ignore this. The mod works. Looks like my theme uses most of the default templates as basis.

Stanyy

Quote from: Britannia360 on June 12, 2014, 08:58:15 AM
There is a bug with this, when you like and unlike it within a second, it shows that you've liked that post twice.

or thrice.. depending on how many times you clicked the button. It seems to only max at three times though.
Yeah, this seems to be my only problem right now... You and 2 others have liked this... hey who's that? oh it's just me. It clears it all up with just one unlike though.

Also, when I do the reverse and unlike twice within a second, it shows an empty bracket beside the like button - Like ().

This is an excellent mod, something i have been looking for for a long time actually. Now I can ditch the sluggish facebook like buttons :)

bassbass

I want to upgrade from 1.2 to 1.4, do I need to uninstall 1.2 then install 1.4?  if so what happens to the data when I uninstall, does it get deleted from the database?  will "Recount Like stats"  set all to zero or sync the info from database? assuming database records stay in tact.  thanks!

Joker™

Quote from: Stanyy on June 25, 2014, 05:26:59 AM
Quote from: Britannia360 on June 12, 2014, 08:58:15 AM
There is a bug with this, when you like and unlike it within a second, it shows that you've liked that post twice.

or thrice.. depending on how many times you clicked the button. It seems to only max at three times though.
Yeah, this seems to be my only problem right now... You and 2 others have liked this... hey who's that? oh it's just me. It clears it all up with just one unlike though.

Also, when I do the reverse and unlike twice within a second, it shows an empty bracket beside the like button - Like ().

This is an excellent mod, something i have been looking for for a long time actually. Now I can ditch the sluggish facebook like buttons :)
Lol, lets kill this fast liking bug ;D. Well the mod is going through a major overhaul

- Cleaning out all the unused code - (Upcoming release)
- Separating out the code into different files for better understanding(PHP/JS) - (future release)
- Making AJAX calls more in sync with JS - (Upcoming release)
- Like posts stats feature in nearly complete, just need to add permission and text strings - (Upcoming release)
- Also trimming down the DB queries - (Upcoming release)


Quote from: bassbass on June 27, 2014, 03:16:50 PM
I want to upgrade from 1.2 to 1.4, do I need to uninstall 1.2 then install 1.4?  if so what happens to the data when I uninstall, does it get deleted from the database?  will "Recount Like stats"  set all to zero or sync the info from database? assuming database records stay in tact.  thanks!
Well you just need to remove the version 1.2 without removing the DB, as while uninstalling the mod there is an option

Remove all data associated with this modification (Make sure this is unchecked). Attached a screen shot for the same.

Now click on uninstall, and once its completed install the latest version. And don't forgot to run the recount like posts thinggy
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Steelio

very cool mod Joker! :) (cool username too lol!)

i was wondering when you're going to release the latest version of this? i was thinking of installing this new feature on my next forum maintenance task

also, is the design of the "Like button" still look like your screenshots here? ( Like in Post Like in Forum ) if they are, is there a way to tweak this? my current forum theme is green and i was wondering if theres a way to change how it looks

thanks!

~ Steeley


Advertisement: