The following warnings occurred:
Warning [2] Undefined array key "pointsview" - Line: 1442 - File: inc/plugins/newpoints/core/hooks.php PHP 8.2.11 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/newpoints/core/hooks.php 1442 errorHandler->error_callback
/inc/class_plugins.php 142 newpoints_blockview
/showthread.php 471 pluginSystem->run_hooks



This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

How to display the average feedback for users in posts.
Files
#1
By default the variable `{$post['ougc_feedback_average']}` can be used to display the user feedback average stat in posts. This variable isn't inserted by default, thus is only present for custom usage.

You should be able to paste this variable inside the `ougcfeedback_postbit`, `postibt`, and `postbit_classic` templates.

If used inside the `ougcfeedback_postbit` template, then the average value should be appended to the `{$post['ougc_feedback']}` variable, this last variable in turn replaces `<!--OUGC_FEEDBACK-->` inside the `postbit_author_user` template and can be used in both the `postbit` and `postbit_classic` templates ( default ).

A recommended setup would be to use the `{$post['ougc_feedback_average']}` variable only inside the `ougcfeedback_postbit` template. *

To edit the output of the `{$post['ougc_feedback_average']}` variable you would need to edit the `ougcfeedback_postbit_average` template itself.

The `$stats` array variable can be used inside the `ougcfeedback_postbit_average` template to display additional or other data than the average stat. A list of all stats variables follow : **
  • `{$stats['total']}` to display the total amount of feedback,
  • `{$stats['positive']}` to display the amount of positive feedback,
  • `{$stats['neutral']}` to display the amount of neutral feedback,
  • `{$stats['negative']}` to display the amount of negative feedback,
  • `{$stats['positive_percent']}` to display the percentage of positive feedback relative to the total,
  • `{$stats['neutral_percent']}` to display the percentage of neutral feedback relative to the total,
  • `{$stats['negative_percent']}` to display the percentage of negative feedback relative to the total,
  • `{$stats['positive_users']}` to display the amount of unique users that gave positive feedback,
  • `{$stats['neutral_users']}` to display the amount of unique users that gave neutral feedback, and
  • `{$stats['negative_users']}` to display the amount of unique users that gave negative feedback.

* Please note that the value for the `{$post['ougc_feedback_average']}` variable will be updated by Ajax actions only if used inside the `ougcfeedback_postbit` template. Specifically only if inside the tag with class value of `ougcfeedback_info_{$post['uid']}`.
** Please note that the `{$class}` variable only matches the value of the `{$average}` variable.
*** Please note that the rendering of this feature is dependent on both the `Show In Posts` and `Show In Forums` settings.
Reply