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?
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.';
}
(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.
^ 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.
(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.
Any help with making that php file work?
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
Waiting for this plugin to be updated for 1.8.