Hi folks,
Searched through forums and didn't find anything that would help.
Let me preface with "I am not a coder". I mess around a little with PHP for my website and phpbb forum which consists of installing add-ons and modifying to meet my needs. I can get into the code and usually "splice" stuff together to get it to do what I want. However, I do not have a fundamental understanding of writing code from scratch.
With that said, below is a piece of code from a phpbb forum add-on that is no longer supported the best I can tell and received no feedback from original author. Its a Like feature for the forum only, NOT to FB, etc. It works great as is but I want it to do one more thing if possible. The code below is a snippet from the much larger code but I believe it is the piece that effects the area/point of interest that I want to change/improve. Not sure why original coder wouldn't have included this feature because it just makes sense.
Basically when someone likes a post it displays the results list at the bottom of the post. After X number likes is reached it stops posting the liker name and adds a "and X more" like this post. Problem is there is no way to see the x more list. Not sure why the original coder didn't provide a way to see it. I would like the "and X more" to basically be a different color and on mouseover display the list of other users who like the post in a popup style box. Hope that all makes sense.
// Output likes list
public function get_likes($post_id)
{
$view = $this->request->variable('view', '');
$further_likes_text = $return = '';
$user_list = array();
$further_likes = $count = 0;
$maxcount = (isset($this->config['thanks_number_post']) ? $this->config['likes_number_post'] : false);
foreach ($this->likers as $liker)
{
if ($liker['post_id'] == $post_id)
{
if ($count >= $maxcount)
{
$further_likes++;
}
else
{
$user_list[] = get_username_string('full', $liker['user_id'], $liker['username'], $liker['user_colour']) .
(($this->config['likes_time_view'] && $liker['likes_time']) ? ' (' . $this->user->format_date($liker['likes_time'], false, ($view == 'print') ? true : false) . ')' : '');
$count++;
}
}
}
if (!empty($user_list))
{
$return = implode($user_list, ' • ');
}
if ($further_thanks > 0)
{
$further_likes_text = ($further_likes == 1) ? $this->user->lang['FURTHER_LIKES'] : sprintf($this->user->lang['FURTHER_LIKES_PL'], $further_likes);
}
$return = ($return == '') ? false : ($return . $further_likes_text);
return $return;
}
Associated HTML that displays result:
<dt>{postrow.LIKES}{postrow.LIKE_TEXT_2}{postrow.LIKE_TEXT}{postrow.POST_AUTHOR_FULL}</dt>
Result on bottom of posts:
membername and 2 other users (3 total) liked this post by: membername
My goal is for "2 other users" to be able to be a different color and on mousesover show the 2 other user names if possible in a popup style box.
Thanks for any help you folks can give.