MyBB Community Forums
[1.4.x/1.6.x] Thank You/Like System v1.5 (Updated: 10/26/2011) - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Plugins (https://community.mybb.com/forum-73.html)
+---- Forum: Plugin Releases (https://community.mybb.com/forum-102.html)
+---- Thread: [1.4.x/1.6.x] Thank You/Like System v1.5 (Updated: 10/26/2011) (/thread-59652.html)



RE: [1.4.x/1.6.x] Thank You/Like System v1.5 (Updated: 10/26/2011) - Gobee129 - 2014-08-10

Is there a way to see which POSTS have the most likes? It would be nice to see a list with the 10 most liked/thanked posts or something similar. Maybe a jquery check to start?


RE: [1.4.x/1.6.x] Thank You/Like System v1.5 (Updated: 10/26/2011) - Cameron:D - 2014-08-10

I threw together a quick script a while back to show the top 100 most liked posts. It isn't pretty but it should provide you with a starting point for something better.

<?php
define("IN_MYBB", 1);
define("NO_ONLINE", 1);

require_once "./global.php";

$query = $db->query("SELECT l.pid, count( * ) AS likes, p.subject, p.username, p.uid
							FROM `mybb_g33k_thankyoulike_thankyoulike` l
							LEFT JOIN `mybb_posts` p ON l.pid = p.pid
							GROUP BY l.pid
							ORDER BY likes DESC, l.pid ASC
							LIMIT 100");

while($data = $db->fetch_array($query))
{
	echo '<br />Post #<a href="/showthread.php?pid='.$data['pid'].'#post_'.$data['pid'].'">'.$data['pid'].': '.$data['subject'].'</a>
	by <a href="/member.php?action=profile&uid='.$data['uid'].'">'.$data['username'].'</a> with '.$data['likes'].' likes.';
}



RE: [1.4.x/1.6.x] Thank You/Like System v1.5 (Updated: 10/26/2011) - Gobee129 - 2014-08-10

(2014-08-10, 12:37 PM)Cameron:D Wrote: I threw together a quick script a while back to show the top 100 most liked posts. It isn't pretty but it should provide you with a starting point for something better.

<?php
define("IN_MYBB", 1);
define("NO_ONLINE", 1);

require_once "./global.php";

$query = $db->query("SELECT l.pid, count( * ) AS likes, p.subject, p.username, p.uid
							FROM `mybb_g33k_thankyoulike_thankyoulike` l
							LEFT JOIN `mybb_posts` p ON l.pid = p.pid
							GROUP BY l.pid
							ORDER BY likes DESC, l.pid ASC
							LIMIT 100");

while($data = $db->fetch_array($query))
{
	echo '<br />Post #<a href="/showthread.php?pid='.$data['pid'].'#post_'.$data['pid'].'">'.$data['pid'].': '.$data['subject'].'</a>
	by <a href="/member.php?action=profile&uid='.$data['uid'].'">'.$data['username'].'</a> with '.$data['likes'].' likes.';
}

Thanks for the effort, but how exactly would I use this? ^.^ I'm not really familiar with adding scripts or new php pages. I mean I get the idea behind the function you wrote, but how exactly would I get the output/ where would I see it? Sorry.


RE: [1.4.x/1.6.x] Thank You/Like System v1.5 (Updated: 10/26/2011) - .m. - 2014-08-10

^ well, you can add that content in a new file, save it as toplikes.php & upload it to the main folder of your forum.
if you visit yourforumurl/toplikes.php with web browser then the file should show the result.


RE: [1.4.x/1.6.x] Thank You/Like System v1.5 (Updated: 10/26/2011) - Gobee129 - 2014-08-10

(2014-08-10, 04:55 PM).m. Wrote: ^ well, you can add that content in a new file, save it as toplikes.php & upload it to the main folder of your forum.
if you visit yourforumurl/toplikes.php with web browser then the file should show the result.

I saved this file

<?php
define("IN_MYBB", 1);
define("NO_ONLINE", 1);

require_once "./global.php";

$query = $db->query("SELECT l.pid, count( * ) AS likes, p.subject, p.username, p.uid
                            FROM `mybb_g33k_thankyoulike_thankyoulike` l
                            LEFT JOIN `mybb_posts` p ON l.pid = p.pid
                            GROUP BY l.pid
                            ORDER BY likes DESC, l.pid ASC
                            LIMIT 100");

while($data = $db->fetch_array($query))
{
    echo '<br />Post #<a href="/showthread.php?pid='.$data['pid'].'#post_'.$data['pid'].'">'.$data['pid'].': '.$data['subject'].'</a>
    by <a href="/member.php?action=profile&uid='.$data['uid'].'">'.$data['username'].'</a> with '.$data['likes'].' likes.';
} 
output_page($html);
?>

But I get nothing but white screen.


RE: [1.4.x/1.6.x] Thank You/Like System v1.5 (Updated: 10/26/2011) - Gobee129 - 2014-08-13

Any help with making that php file work? Smile


RE: [1.4.x/1.6.x] Thank You/Like System v1.5 (Updated: 10/26/2011) - niere8 - 2014-09-02

I use a lot this plugin on 1.6 version..I'll can use it also on 1.8 version?
Or there is another plugin similar?
I would like to have an alert with: likes and thanks in the posts, @ mention


RE: [1.4.x/1.6.x] Thank You/Like System v1.5 (Updated: 10/26/2011) - HolyPhoenix - 2014-09-02

Euan T created one that I personally prefer better, and it has already been updated for 1.8.

http://community.mybb.com/mods.php?action=view&pid=24


RE: [1.4.x/1.6.x] Thank You/Like System v1.5 (Updated: 10/26/2011) - [email protected] - 2014-09-02

Waiting for this plugin to be updated for 1.8.


RE: [1.4.x/1.6.x] Thank You/Like System v1.5 (Updated: 10/26/2011) - niere8 - 2014-09-02

(2014-09-02, 08:08 PM)HolyPhoenix Wrote: Euan T created one that I personally prefer better, and it has already been updated for 1.8.

http://community.mybb.com/mods.php?action=view&pid=24

If I start to use this: http://community.mybb.com/mods.php?action=view&pid=24 all old thanks, likes etc will be eliminated? Undecided