How to display the average feedback for users in posts.
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 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.
This post was last modified: 3 Sep, 2021, 12:49 pm by Omar G..
Files

There are currently no posts to display. Be the first one to leave a reply.

Current time: 26 Apr, 2024, 12:16 am