News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Like Posts

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

Previous topic - Next topic

Joker™

Quote from: Cblog on March 07, 2014, 12:31:09 PM
It would be great if Guests are also able to see 'Likes' recieved by a member. (Only members should be able to like/dislike though)
This will motivate members to make more Likeable posts and also add to their credibility.
Right now, guests doesnt even know/see that there is a post/topic like option
Nice..

Quote from: Kaerie on March 12, 2014, 01:12:07 PM

Hello!

I wanted, first of all, to say thanks.  I'm running a forum for a very small, close-knit community, and they have really appreciated the addition of a "Like" button.  However, the ladies on this forum don't like the "popularity contest" they perceive the "total likes of a user" in each post. 
Doable using permissions.


Quote from: someDev on April 01, 2014, 09:41:42 AM
Quote from: Joker™ on March 06, 2014, 10:14:27 AM
I started working on it a while back, but currently[...] why should I put more time into this mod?

becouse not all using smf 2,1
Correct


Quote from: redding99 on April 07, 2014, 05:12:39 PM
Hi, hope you can support me with getting this mod working on my forum.

It all seems OK but nothing happens when you click on the Like button on a post. Nothing updates and the button remains.

I installed the mod without any problem except for one file on a couple of my themes (index.template.php):

The installer was looking for this:

<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>';

To change to this

<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>';


But other mods had added to this line of code so I manually entered the change for this file. It all seems to work OK so I don't think the issue is related.

Any suggestion would be appreciated. I have disabled the mod at the moment but can enable for you to view it

Steve
Umm, attach the related file in your reply.

For people looking for a stats page, where should the button to access likes stats should be placed?
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

redding99

Thanks for the quick reply.

I have attached the file that I had to manually amend.

The forum address is hxxp:www.calis-beach.co.uk/forum [nonactive] and I have activated the mod on the site so you can see the problem

I will PM you a test username and password

Thanks again

redding99

Hopefully you have the revised username now and it is working ok.

I took a look at the individual files yesterday to make sure that all the files, including the .js, are sitting in the appropriate folders and the cmods are correct. All seems ok but it doesn't look like anything is firing when the button is clicked.

redding99

Just as an update we have upgraded the version of smf from 2.0.6 to 2.0.7 and also tried uninstalling some mods we thought might be causing a conflict. Unfortunately all without success. Any help you can provide would be appreciated.

Joker™

Quote from: redding99 on April 09, 2014, 06:27:20 PM
Just as an update we have upgraded the version of smf from 2.0.6 to 2.0.7 and also tried uninstalling some mods we thought might be causing a conflict. Unfortunately all without success. Any help you can provide would be appreciated.
It looks like the ajax url's are getting malformed due to some url re-writing sort of mod. Please post the list of the mods you are using on your forum.
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

redding99

Hi again

See below....

1.   Tapatalk SMF 2.0 Plugin   3.9.3   [ Uninstall ]
2.   Like Posts   1.3.1   [ Uninstall ]
3.   SMF 2.0.7 Update   1.0   [ Uninstall ]
4.   SMF 1.1.19 / 2.0.6 Update   1.0   [ Uninstall ]
5.   SMF 2.0.5 Update   1.0   [ Uninstall ]
6.   SMF 2.0.4 Update   1.0   [ Uninstall ]
7.   SMF 2.0.3 Update   1.0   [ Uninstall ]
8.   Disable 'last edit by...' for Administrators   1.9   [ Uninstall ]
9.   MessagePreviewOnHover   1.8   [ Uninstall ]
10.   SimpleAds   1.0.1   [ Uninstall ]
11.   Recent Topics by 1h 8h 24h Filter Steve Adaption   1.0   [ Uninstall ]
12.   Automanagement of attachments   0.1.12   [ Uninstall ]
13.   SimpleSEF   2.1   [ Uninstall ]
14.   Shiny Smiley Icons   1.0   [ Uninstall ]
15.   Animation Blue Smiley   2.1   [ Uninstall ]
16.   Popos Smiley   1.0   [ Uninstall ]
17.   Adk Warning to visitors   1.0   [ Uninstall ]
18.   BoardColor   V1   [ Uninstall ]
19.   CheckBeforePosting   0.3.3   [ Uninstall ]
20.   YouTube BBCode   2.6   [ Uninstall ]
21.   Social Bookmarks   2.0   [ Uninstall ]
22.   Google Translate for SMF 2.0   1.3   [ Uninstall ]
23.   Simple Image Upload   1.3.0   [ Uninstall ]
24.   Age And Location   1.0   [ Uninstall ]
25.   Google Member Map   2.6   [ Uninstall ]
26.   Additional Instant Messengers   1.0.1   [ Uninstall ]

I'm not sure why but the above is a list from the 'installed packages' from the admin area. The following is also a list from the 'Browse packages' area that includes some of the above and a few more

1.   Todays Birthday    1.2   [ List Files ] [ Delete ]
2.   Tapatalk SMF 2.0 Plugin    3.9.3     [ Uninstall ] [ List Files ] [ Delete ]
3.   SMF 2.0.5 Update    1.0     [ List Files ] [ Delete ]
4.   Google Member Map    2.6     [ Uninstall ] [ List Files ] [ Delete ]
5.   Disable 'last edit by...' for Administrators    1.9     [ Uninstall ] [ List Files ] [ Delete ]
6.   Age And Location    1.0     [ Uninstall ] [ List Files ] [ Delete ]
7.   Simple Image Upload    1.3.0     [ Uninstall ] [ List Files ] [ Delete ]
8.   Recent Topics by 1h 8h 24h Filter Steve Adaption    1.0     [ Uninstall ] [ List Files ] [ Delete ]
9.   SMF 2.0.7 Update    1.0     [ Uninstall ] [ List Files ] [ Delete ]
10.   SimpleAds    1.0.1     [ Uninstall ] [ List Files ] [ Delete ]
11.   Tapatalk SMF 2.0 RC5/Final Plugin    3.9.1   [ List Files ] [ Delete ]
12.   Tapatalk SMF 2.0 RC4/RC5/Final Plugin    3.0.2   [ List Files ] [ Delete ]
13.   Post Ratings    1.5   [ List Files ] [ Delete ]
14.   Google Translate for SMF 2.0    1.3     [ List Files ] [ Delete ]
15.   AjaxChat Integration    3.3c   [ Install Mod ] [ List Files ] [ Delete ]
16.   Like Posts    1.3.1     [ Uninstall ] [ List Files ] [ Delete ]
17.   Additional Instant Messengers    1.0.1     [ Uninstall ] [ List Files ] [ Delete ]
18.   SMF 2.0.4 Update    1.0     [ List Files ] [ Delete ]
19.   Tapatalk SMF 2.0 RC5/Final Plugin    3.9.0   [ List Files ] [ Delete ]
20.   Post Ratings    1.6   [ Install Mod ] [ List Files ] [ Delete ]
21.   Facebook_Like v.2.0    2.0   [ List Files ] [ Delete ]
22.   SMF 2.0.3 Update    1.0     [ List Files ] [ Delete ]
23.   SimpleSEF    2.1     [ List Files ] [ Delete ]
24.   Social Bookmarks    2.0     [ Uninstall ] [ List Files ] [ Delete ]
25.   Advanced image uploader    1.1.0   [ List Files ] [ Delete ]
26.   YouTube BBCode    2.6     [ Uninstall ] [ List Files ] [ Delete ]
27.   BoardColor    V1     [ Uninstall ] [ List Files ] [ Delete ]
28.   SMF 1.1.19 / 2.0.6 Update    1.0     [ List Files ] [ Delete ]
29.   Tapatalk SMF 2.0 RC5/Final Plugin    3.7.2   [ List Files ] [ Delete ]
30.   SEO Sitemap    2.2   [ Install Mod ] [ List Files ] [ Delete ]
31.   CheckBeforePosting    0.3.3     [ Uninstall ] [ List Files ] [ Delete ]
32.   MessagePreviewOnHover    1.8     [ List Files ] [ Delete ]

MechSpecs

Quote from: redding99 on April 10, 2014, 10:00:42 AM
23.   SimpleSEF    2.1     [ List Files ] [ Delete ]

I would start here first. Looks like this rewrites your URLs into search engine friendly ones, this might be affecting the likes mod.

redding99

Quote from: MechSpecs on April 10, 2014, 10:40:01 AM
Quote from: redding99 on April 10, 2014, 10:00:42 AM
23.   SimpleSEF    2.1     [ List Files ] [ Delete ]

I would start here first. Looks like this rewrites your URLs into search engine friendly ones, this might be affecting the likes mod.

Thanks for the pointer. I will hang on for Jokers comments as well and then make a start

redding99

Quote from: redding99 on April 10, 2014, 10:53:05 AM
Quote from: MechSpecs on April 10, 2014, 10:40:01 AM
Quote from: redding99 on April 10, 2014, 10:00:42 AM
23.   SimpleSEF    2.1     [ List Files ] [ Delete ]

I would start here first. Looks like this rewrites your URLs into search engine friendly ones, this might be affecting the likes mod.

Thanks for the pointer. I will hang on for Jokers comments as well and then make a start

Actually I found an option to disable the mod and you are right! We now have the Like function working

Thankyou VERY much!!!

Joker™

Quote from: redding99 on April 10, 2014, 11:13:56 AM
Actually I found an option to disable the mod and you are right! We now have the Like function working

Thankyou VERY much!!!
Glad you got it all sorted out, but I should try to avoid url rewrite conflicts with other mods.
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

someDev

Quote from: ryan_dwight on April 03, 2014, 05:09:40 PM
Quote from: someDev on April 01, 2014, 09:41:42 AM
so i made some simple addon which shows simple stats
http://www.borowicz.info/pub/smf/abStats4LikePosts.zip [nofollow]
where is the stat located?
on your stats page (?action=stats) before daily stats

ryan_dwight


someDev

Quote from: ryan_dwight on April 12, 2014, 03:08:23 PM
I can't find it.

if you are not using default template you should check/update it manually


ryan_dwight

Quote from: someDev on April 15, 2014, 03:33:59 AM
Quote from: ryan_dwight on April 12, 2014, 03:08:23 PM
I can't find it.

if you are not using default template you should check/update it manually

thank you for your reply but I can't find this
on file Stats.template.php
find line 321:
<br class="clear" />
<div class="flow_hidden">



someDev

Quote from: ryan_dwight on April 15, 2014, 03:55:36 AM
thank you for your reply but I can't find this
on file Stats.template.php
find line 321:
<br class="clear" />
<div class="flow_hidden">


this tag begins daily stats, but you can place it where ever you want on Stats.template.php
or send more details about your theme, or attach your file

ryan_dwight

attached the file.

when i tried to change the theme thru my profile using the default theme I found 4 new blocks in the stat page.
one of them has a list of topics with corresponding likes. but there is no titles on this 4 blocks like the default blocks like Top 10 Topics (by Replies) or Top 10 Topics (by Views)

the second block below this is empty but there are number of likes on the right hand part of the block.

the other 2 are totally empty.

all of them have no title.

I am using the black n black theme

someDev

all queries using {db_prefix}like_post table, can you check how many entries do you have in this table?

Quote from: ryan_dwight on April 15, 2014, 09:31:12 AM
when i tried to change the theme thru
[..]

the other 2 are totally empty.

all of them have no title.

I am using the black n black theme

i didnt make any special translation, just reusing existing strings

anyway
if you want to integrate into your template find line 181 with:

</tr><tr>
<td class="catbg" colspan="4"><strong>', $txt['forum_history'], '</strong></td>
</tr><tr>


and replace

</tr><tr>
<td class="catbg" colspan="4">';

global $sourcedir;
@require_once $sourcedir.'/ab/abstats4likeposts.php';
@abStats4LikePosts();

echo '
</td>
</tr><tr>
<td class="catbg" colspan="4"><strong>', $txt['forum_history'], '</strong></td>
</tr><tr>

ryan_dwight

Thank you for that, now I found the 4 blocks in the stats but with the same problem as 3 empty blocks with no titles

I have only one Table: smf_like_count with 76 pages by 25 rows.

I am not sure if i gave you what you need. where can i find that?


someDev

Quote from: ryan_dwight on April 15, 2014, 11:10:43 AM
Thank you for that, now I found the 4 blocks in the stats but with the same problem as 3 empty blocks with no titles

which language are you use?
you can add translation manualny on file abstat4likeposts.php
- most liked post
- last liked post
- top likes receiver (user)
- top likes gaver

Quote from: ryan_dwight on April 15, 2014, 11:10:43 AM
I have only one Table: smf_like_count with 76 pages by 25 rows.

that means you have data and its should work
you can try test sql queries manualy  abstat4likeposts.php
or for test change line 105 and 106
   $likes = abStats4LikePostsGet();
   echo '<pre>',print_r($likes),'</pre>';


ryan_dwight

I am using english


array()

);

while ($row = $smcFunc['db_fetch_assoc']($q))

{

$likes['r_likes'][] = array(

'link' => '<a href="'.$boardurl.'/index.php?action=profile;u='.$row['id_member'].'">'.$row['poster_name'].'</a>',

'cnt' => $row['cnt'],

);

what part here should i put the code?

Advertisement: