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

seem to get on account/news-feed page
PHP:
Template Errors: news_feed_item_postrating_rate
htmlspecialchars() expects parameter 1 to be string, object given in /internal_data/templates/S.8,L.1,news_feed_item_postrating_rate.php, line 27
Template Errors: news_feed_item_postrating_rate
htmlspecialchars() expects parameter 1 to be string, object given in /internal_data/templates/S.8,L.1,news_feed_item_postrating_rate.php, line 27
Template Errors: news_feed_item_postrating_rate
htmlspecialchars() expects parameter 1 to be string, object given in /internal_data/templates/S.8,L.1,news_feed_item_postrating_rate.php, line 27
seems to only happen when cache user news feed is checked or if cached items is >5
upload_2016-11-7_18-46-11.webp
 
Last edited:
?
What does that have to do with the error @eva2000 is getting.
Sounds like you want to do a template modification to adjust the placement.

My bad, nothing at all, I thought he was saying he could get it in those two places.
My apologies.

Do you know of a template mod that puts the ranking under your user info in posts?
 
Hey Luke, love your addons!

I'm wary to post this, simply because I've never had interference with your addons before, but an I've had a custom addon made which interacts with your addon and they say that the issue is on your end so I can only do my part and get bounced back and forth.

The addon puts permissions on the post ratings, which restricts their use by group. The first issue, is that the 'take over' of the default like button does not happen. I end up with both like button and the post rating bar simultaneously. Luckily, it appears to not have any negative effects. The only other issue, is that two warnings are served in the ACP each time someone uses a post rating:

Code:
[TABLE][TBODY][TR][TD]ErrorException: Undefined index: postrating_likes - library/Dark/PostRating/EventListener.php:223
Generated By: doublespaces, A moment ago[/TD][/TR]
[TR][TH]Stack Trace[/TH][/TR]
[TR][TD]#0 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/Dark/PostRating/EventListener.php(223): XenForo_Application::handlePhpError(8, 'Undefined index...', '/home/spoolstr/...', 223, Array)
#1 [internal function]: Dark_PostRating_EventListener::TemplateCreate('dark_postrating', Array, Object(XenForo_Template_Public))
#2 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/CodeEvent.php(58): call_user_func_array(Array, Array)
#3 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/Template/Abstract.php(82): XenForo_CodeEvent::fire('template_create', Array, 'dark_postrating')
#4 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/Dependencies/Public.php(239): XenForo_Template_Abstract->__construct('dark_postrating', Array)
#5 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/ViewRenderer/Abstract.php(263): XenForo_Dependencies_Public->createTemplateObject('dark_postrating', Array)
#6 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/ViewRenderer/Json.php(234): XenForo_ViewRenderer_Abstract->createTemplateObject('dark_postrating', Array)
#7 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/ViewRenderer/Json.php(92): XenForo_ViewRenderer_Json->getDefaultOutputArray('Dark_ViewPublic...', Array, 'dark_postrating')
#8 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/FrontController.php(607): XenForo_ViewRenderer_Json->renderView('Dark_ViewPublic...', Array, 'dark_postrating', NULL)
#9 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/FrontController.php(158): XenForo_FrontController->renderView(Object(XenForo_ControllerResponse_View), Object(XenForo_ViewRenderer_Json), Array)
#10 /home/spoolstr/domains/spoolstreet.com/public_html/forums/index.php(13): XenForo_FrontController->run()
#11 {main}[/TD][/TR]
[TR][TH]Request State[/TH][/TR]
[TR][TD]array(3) {
  ["url"] => string(60) "https://www.spoolstreet.com/forums/posts/114/rate?rating=del"
  ["_GET"] => array(1) {
    ["rating"] => string(3) "del"
  }
  ["_POST"] => array(4) {
    ["_xfRequestUri"] => string(29) "/forums/threads/s63-build.81/"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
    ["_xfResponseType"] => string(4) "json"
  }
}[/TD][/TR][/TBODY][/TABLE]

And the other error is:

Code:
ErrorException: Undefined index: postrating_likes - library/Dark/PostRating/EventListener.php:214
Generated By: doublespaces, A moment ago
Stack Trace
#0 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/Dark/PostRating/EventListener.php(214): XenForo_Application::handlePhpError(8, 'Undefined index...', '/home/spoolstr/...', 214, Array)
#1 [internal function]: Dark_PostRating_EventListener::TemplateCreate('dark_postrating', Array, Object(XenForo_Template_Public))
#2 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/CodeEvent.php(58): call_user_func_array(Array, Array)
#3 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/Template/Abstract.php(82): XenForo_CodeEvent::fire('template_create', Array, 'dark_postrating')
#4 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/Dependencies/Public.php(239): XenForo_Template_Abstract->__construct('dark_postrating', Array)
#5 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/ViewRenderer/Abstract.php(263): XenForo_Dependencies_Public->createTemplateObject('dark_postrating', Array)
#6 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/ViewRenderer/Json.php(234): XenForo_ViewRenderer_Abstract->createTemplateObject('dark_postrating', Array)
#7 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/ViewRenderer/Json.php(92): XenForo_ViewRenderer_Json->getDefaultOutputArray('Dark_ViewPublic...', Array, 'dark_postrating')
#8 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/FrontController.php(607): XenForo_ViewRenderer_Json->renderView('Dark_ViewPublic...', Array, 'dark_postrating', NULL)
#9 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/FrontController.php(158): XenForo_FrontController->renderView(Object(XenForo_ControllerResponse_View), Object(XenForo_ViewRenderer_Json), Array)
#10 /home/spoolstr/domains/spoolstreet.com/public_html/forums/index.php(13): XenForo_FrontController->run()
#11 {main}
Request State
array(3) {
  ["url"] => string(60) "https://www.spoolstreet.com/forums/posts/114/rate?rating=del"
  ["_GET"] => array(1) {
    ["rating"] => string(3) "del"
  }
  ["_POST"] => array(4) {
    ["_xfRequestUri"] => string(29) "/forums/threads/s63-build.81/"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
    ["_xfResponseType"] => string(4) "json"
  }
}
 
What exactly are you wanting under there? If the statistics, it's simply a matter of moving the likes segment in the mesage_user_info template to below the avatar (or above the name).

The green bar, Post Ratings Received, would be nice.
 

Attachments

  • Screen Shot 2016-11-07 at 2.35.14 PM.webp
    Screen Shot 2016-11-07 at 2.35.14 PM.webp
    15.8 KB · Views: 8
The green bar, Post Ratings Received, would be nice.

There are options for this in Style Properties > Message Elements

Hey Luke, love your addons!

I'm wary to post this, simply because I've never had interference with your addons before, but an I've had a custom addon made which interacts with your addon and they say that the issue is on your end so I can only do my part and get bounced back and forth.

The addon puts permissions on the post ratings, which restricts their use by group. The first issue, is that the 'take over' of the default like button does not happen. I end up with both like button and the post rating bar simultaneously. Luckily, it appears to not have any negative effects. The only other issue, is that two warnings are served in the ACP each time someone uses a post rating:

Code:
[TABLE][TBODY][TR][TD]ErrorException: Undefined index: postrating_likes - library/Dark/PostRating/EventListener.php:223
Generated By: doublespaces, A moment ago[/TD][/TR]
[TR][TH]Stack Trace[/TH][/TR]
[TR][TD]#0 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/Dark/PostRating/EventListener.php(223): XenForo_Application::handlePhpError(8, 'Undefined index...', '/home/spoolstr/...', 223, Array)
#1 [internal function]: Dark_PostRating_EventListener::TemplateCreate('dark_postrating', Array, Object(XenForo_Template_Public))
#2 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/CodeEvent.php(58): call_user_func_array(Array, Array)
#3 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/Template/Abstract.php(82): XenForo_CodeEvent::fire('template_create', Array, 'dark_postrating')
#4 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/Dependencies/Public.php(239): XenForo_Template_Abstract->__construct('dark_postrating', Array)
#5 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/ViewRenderer/Abstract.php(263): XenForo_Dependencies_Public->createTemplateObject('dark_postrating', Array)
#6 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/ViewRenderer/Json.php(234): XenForo_ViewRenderer_Abstract->createTemplateObject('dark_postrating', Array)
#7 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/ViewRenderer/Json.php(92): XenForo_ViewRenderer_Json->getDefaultOutputArray('Dark_ViewPublic...', Array, 'dark_postrating')
#8 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/FrontController.php(607): XenForo_ViewRenderer_Json->renderView('Dark_ViewPublic...', Array, 'dark_postrating', NULL)
#9 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/FrontController.php(158): XenForo_FrontController->renderView(Object(XenForo_ControllerResponse_View), Object(XenForo_ViewRenderer_Json), Array)
#10 /home/spoolstr/domains/spoolstreet.com/public_html/forums/index.php(13): XenForo_FrontController->run()
#11 {main}[/TD][/TR]
[TR][TH]Request State[/TH][/TR]
[TR][TD]array(3) {
  ["url"] => string(60) "https://www.spoolstreet.com/forums/posts/114/rate?rating=del"
  ["_GET"] => array(1) {
    ["rating"] => string(3) "del"
  }
  ["_POST"] => array(4) {
    ["_xfRequestUri"] => string(29) "/forums/threads/s63-build.81/"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
    ["_xfResponseType"] => string(4) "json"
  }
}[/TD][/TR][/TBODY][/TABLE]

And the other error is:

Code:
ErrorException: Undefined index: postrating_likes - library/Dark/PostRating/EventListener.php:214
Generated By: doublespaces, A moment ago
Stack Trace
#0 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/Dark/PostRating/EventListener.php(214): XenForo_Application::handlePhpError(8, 'Undefined index...', '/home/spoolstr/...', 214, Array)
#1 [internal function]: Dark_PostRating_EventListener::TemplateCreate('dark_postrating', Array, Object(XenForo_Template_Public))
#2 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/CodeEvent.php(58): call_user_func_array(Array, Array)
#3 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/Template/Abstract.php(82): XenForo_CodeEvent::fire('template_create', Array, 'dark_postrating')
#4 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/Dependencies/Public.php(239): XenForo_Template_Abstract->__construct('dark_postrating', Array)
#5 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/ViewRenderer/Abstract.php(263): XenForo_Dependencies_Public->createTemplateObject('dark_postrating', Array)
#6 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/ViewRenderer/Json.php(234): XenForo_ViewRenderer_Abstract->createTemplateObject('dark_postrating', Array)
#7 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/ViewRenderer/Json.php(92): XenForo_ViewRenderer_Json->getDefaultOutputArray('Dark_ViewPublic...', Array, 'dark_postrating')
#8 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/FrontController.php(607): XenForo_ViewRenderer_Json->renderView('Dark_ViewPublic...', Array, 'dark_postrating', NULL)
#9 /home/spoolstr/domains/spoolstreet.com/public_html/forums/library/XenForo/FrontController.php(158): XenForo_FrontController->renderView(Object(XenForo_ControllerResponse_View), Object(XenForo_ViewRenderer_Json), Array)
#10 /home/spoolstr/domains/spoolstreet.com/public_html/forums/index.php(13): XenForo_FrontController->run()
#11 {main}
Request State
array(3) {
  ["url"] => string(60) "https://www.spoolstreet.com/forums/posts/114/rate?rating=del"
  ["_GET"] => array(1) {
    ["rating"] => string(3) "del"
  }
  ["_POST"] => array(4) {
    ["_xfRequestUri"] => string(29) "/forums/threads/s63-build.81/"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
    ["_xfResponseType"] => string(4) "json"
  }
}

Those errors seem to be connected with the behaviour you're seeing, ie the XF likes integration not working for some reason

Can you PM me the source of the custom addon to take a closer look?

Alternatively maybe the built in option for 'group whitelist' when editing a rating might meet your needs?
 
Not sure if this has been asked or not. But is it possible to customize the ratings? Like assign this rating to be +5, this rating to be -15.
 
There are options for this in Style Properties > Message Elements



Those errors seem to be connected with the behaviour you're seeing, ie the XF likes integration not working for some reason

Can you PM me the source of the custom addon to take a closer look?

Alternatively maybe the built in option for 'group whitelist' when editing a rating might meet your needs?

Thank you for getting back to me Luke. Highly appreciated. I've noticed some irregularities and I am going to talk to the custom developer first because I have a feeling that their work is causing the conflicts. I won't bother you further unless I'm more confident.
 
There are options for this in Style Properties > Message Elements



Those errors seem to be connected with the behaviour you're seeing, ie the XF likes integration not working for some reason

Can you PM me the source of the custom addon to take a closer look?

Alternatively maybe the built in option for 'group whitelist' when editing a rating might meet your needs?

Hello @Luke F,
Could you help me in changing a function in this addon. Currently we have the option to allow a rating to be only shown on the first post of a topic. Is it possible to do the opposite of this. I mean the rating will be shown on all posts except the first post of a topic.
 
Hello @Luke F,
Could you help me in changing a function in this addon. Currently we have the option to allow a rating to be only shown on the first post of a topic. Is it possible to do the opposite of this. I mean the rating will be shown on all posts except the first post of a topic.

You could swap the behaviour of that option by editing library/dark/postrating/model.php

Find:
$post['position'] != 0

Replace with:
$post['position'] == 0
 
does this work with png files to customize icons? how large can you scale the icons?

Are there settings to change the color bar?
 
Top Bottom