Post Ratings - taking likes to the next level [Deleted]

Does anyone know how to get the bar to showup without hovering? I'm not sure if I have it installed right as the only way I can see to add comments is if there was already a like on a post in the first place. Thanks!
 
Does anyone know how to get the bar to showup without hovering? I'm not sure if I have it installed right as the only way I can see to add comments is if there was already a like on a post in the first place. Thanks!

Set 'Input bar minimum opacity' to 1

If you additionally want the background/border always visible too, edit template dark_postrating and replace

Code:
<div class="dark_postrating {xen:if $postrating_has_ratings, 'likesSummary secondaryContent'}">

with:

Code:
<div class="dark_postrating likesSummary secondaryContent">
 
Set 'Input bar minimum opacity' to 1

If you additionally want the background/border always visible too, edit template dark_postrating and replace

Code:
<div class="dark_postrating {xen:if $postrating_has_ratings, 'likesSummary secondaryContent'}">

with:

Code:
<div class="dark_postrating likesSummary secondaryContent">

Thanks Luke!

D'oh the problem was user group permissions weren't set :(
 

Attachments

  • likes.webp
    likes.webp
    17.3 KB · Views: 8
Last edited:
...
  1. Run these queries:
    Code:
    update xf_user u set like_count = like_count - (select count(*) from xf_liked_content where content_user_id = u.user_id and content_type='post');
    delete from xf_liked_content where content_type='post';
  2. Recount ratings again

I've got the following error on that query

Code:
SQL-Befehl: 

update xf_user u set like_count = like_count - (select count(*) from xf_liked_content where content_user_id = u.user_id and content_type='post')

MySQL meldet:

#1690 - BIGINT UNSIGNED value is out of range in '(`relaunch`.`u`.`like_count` - (select count(0) from `relaunch`.`xf_liked_content` where ((`relaunch`.`xf_liked_content`.`content_type` = 'post') and (`relaunch`.`xf_liked_content`.`content_user_id` = `relaunch`.`u`.`user_id`))))'
 
Last edited:
I've got the following error on that query

Code:
SQL-Befehl: [IMG]http://www.planet-liebe.de/phpmyadmin/themes/dot.gif[/IMG]

update xf_user u set like_count = like_count - (select count(*) from xf_liked_content where content_user_id = u.user_id and content_type='post')

MySQL meldet: [IMG]http://www.planet-liebe.de/phpmyadmin/themes/dot.gif[/IMG]

#1690 - BIGINT UNSIGNED value is out of range in '(`relaunch`.`u`.`like_count` - (select count(0) from `relaunch`.`xf_liked_content` where ((`relaunch`.`xf_liked_content`.`content_type` = 'post') and (`relaunch`.`xf_liked_content`.`content_user_id` = `relaunch`.`u`.`user_id`))))'

Your like_count field and xf_liked_content table are out of sync

I'm not sure if XF offers a built in way to recount likes, but this query will likely do the trick:

Code:
update xf_user u set like_count = (select count(*) from xf_liked_content where content_user_id = u.user_id)

You would then need to run the previous two queries again after that
 
Hello Luke, I have a little suggestion.
This:
Request "reason" to negative ratings.
That reason can be show to everyone as a simple post in the same thread.
And in the list:
Screen Shot 2015-06-14 at 12.32.17 PM.webp
Just add a link next to the nickname, "view reason" and that link with show you the post that contain the reason.
This could be very useful in many scenarios.
If you like this suggestion, click in the like button :coffee:
 
I also would like to have certain ratings in the first post only and other ratings only in the comments.
Actually is possible show certain ratings in the first post but I can not exclude other ratings.
Scenario: Thread for sales.
There are only 3 ratings in the first post.

positive.webp Positive
negative.webp Negative
neutral.webp Neutral

And I would like to use the like thumb-up.webp only in the comments.
There are some way to do this, at least editing some template? Thanks!
 
In latest version of Post Ratings is it possibile to hide who gived a negative rating?
I want to +1 this one. My users really like the idea of being able to self police using the negative feedback feature to soft hide a post, but not if the user they are thumping sees who is thumping them.

I can see that with the permissions I can set it so that users can't see the list for the likes and therefore they can't see who gave what feedback rating for any rating, but in this case they still get the alert showing who did what real time.

Also, is there a way for an admin or mod to get notified when a post is hidden because of the negative ratings?
 
note that if you can't do anything to hide who gave a negative rating, would it be possible to get another permssion that turns off the alerts for negative ratings? That combined with permissions to turn off the list would do it effectively and then people can earn their way to being able to get the alerts and list after proving that they are not a troll. ;)

Thanks
 
Hello,

I'm having some trouble when I have this addon and the Sticky First Post addon installed. The following error start to appear in several threads on my forum:

Code:
json_decode() expects parameter 1 to be string, array given

[LIST=1]
[*]XenForo_Application::handlePhpError()
[*]json_decode() in Dark/PostRating/Model/Post.php at line 103
[*]Dark_PostRating_Model_Post->preparePost() in LiamW/StickyFirstPost/Extend/ControllerPublic/Thread.php at line 63
[*]LiamW_StickyFirstPost_Extend_ControllerPublic_Thread->actionIndex() in XenForo/FrontController.php at line 347
[*]XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
[*]XenForo_FrontController->run() in /data2/laneros/public_html/index.php at line 13
[/LIST]

Disabling the sticky first post addon solves the problem. Do you know if there's anything that I can do in order to fix this error?
 
any news on tapatalk integration? is there a way to submit tickets to them or support requests? If they entertain the idea would you be willing to work with them if required?
 
Hello,

I'm having some trouble when I have this addon and the Sticky First Post addon installed. The following error start to appear in several threads on my forum:

Code:
json_decode() expects parameter 1 to be string, array given

[LIST=1]
[*]XenForo_Application::handlePhpError()
[*]json_decode() in Dark/PostRating/Model/Post.php at line 103
[*]Dark_PostRating_Model_Post->preparePost() in LiamW/StickyFirstPost/Extend/ControllerPublic/Thread.php at line 63
[*]LiamW_StickyFirstPost_Extend_ControllerPublic_Thread->actionIndex() in XenForo/FrontController.php at line 347
[*]XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
[*]XenForo_FrontController->run() in /data2/laneros/public_html/index.php at line 13
[/LIST]

Disabling the sticky first post addon solves the problem. Do you know if there's anything that I can do in order to fix this error?
Could be an issue with the sticky first post as well. I would suggest contacting the developer of the add-on you installed and used last. I had a problem with Add-ons crashing and i contacted the developer of the last add-on installed. They had to come into my board and put on debug mode to find the issue, which is now solved.
 
Hello,

I'm having some trouble when I have this addon and the Sticky First Post addon installed. The following error start to appear in several threads on my forum:

Code:
json_decode() expects parameter 1 to be string, array given

[LIST=1]
[*]XenForo_Application::handlePhpError()
[*]json_decode() in Dark/PostRating/Model/Post.php at line 103
[*]Dark_PostRating_Model_Post->preparePost() in LiamW/StickyFirstPost/Extend/ControllerPublic/Thread.php at line 63
[*]LiamW_StickyFirstPost_Extend_ControllerPublic_Thread->actionIndex() in XenForo/FrontController.php at line 347
[*]XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
[*]XenForo_FrontController->run() in /data2/laneros/public_html/index.php at line 13
[/LIST]

Disabling the sticky first post addon solves the problem. Do you know if there's anything that I can do in order to fix this error?

PostRating/Model/Post.php has less than 103 lines and no call to json_decode, so your issue is probably from a modified or out of date version of post ratings.

any news on tapatalk integration? is there a way to submit tickets to them or support requests? If they entertain the idea would you be willing to work with them if required?

I'm not aware of any plans by tapatalk to add support. I would consider providing assistance to them if necessary
 
Hey Luke,

Is their anyway to sort thread posts by likes/dislikes received ?

It would be very interesting to have it :)
 
PostRating/Model/Post.php has less than 103 lines and no call to json_decode, so your issue is probably from a modified or out of date version of post ratings.

Edit: I figured out it may not be Sticky First Post's fautlt. So I went ahead and decided to implement a hack to fix this in my installation:

PHP:
$post['rating_cache'] = is_array($post['rating_cache']) ? json_encode($post['rating_cache']) : $post['rating_cache'];

I'm not sure if you want to do something about it in your code but anyway, thanks for your help!
 
Last edited:
@Luke Foreman

just purchased this, received this error (many of them)


Error Info
ErrorException: json_decode() expects parameter 1 to be string, array given - library/Dark/PostRating/Model/Post.php:86
Generated By: marclouie, 2 minutes ago

Stack Trace
#0 [internal function]: XenForo_Application::handlePhpError(2, 'json_decode() e...', '/home/hoopsph/p...', 86, Array)
#1 /home/hoopsph/public_html/forum/library/Dark/PostRating/Model/Post.php(86): json_decode(Array, true)
#2 /home/hoopsph/public_html/forum/library/LiamW/StickyFirstPost/Extend/ControllerPublic/Thread.php(63): Dark_PostRating_Model_Post->preparePost(Array, Array, Array, Array)
#3 /home/hoopsph/public_html/forum/library/XenForo/FrontController.php(347): LiamW_StickyFirstPost_Extend_ControllerPublic_Thread->actionIndex()
#4 /home/hoopsph/public_html/forum/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#5 /home/hoopsph/public_html/forum/index.php(13): XenForo_FrontController->run()
#6 {main}

Request State
array(3) {
["url"] => string(87) "Things to do this off-season for the Hotshots?"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}

is it in conflict with the Sticky First Post addon? I disabled it and error messages stopped, but i also need it. please HELP!
 
Last edited:
Top Bottom