vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Add-On Releases - [AJAX] Helpful Answers - Allow users to rate individual posts (https://vborg.vbsupport.ru/showthread.php?t=204139)

Ted S 02-07-2009 03:02 PM

Strange but glad it works.

You can use a conditional to highlight good posts. I'll put sample code up in a bit.

guvner 02-07-2009 06:22 PM

Hi Ted,

I'd like to add my voice to a couple of previous suggestions as well.

1. I think this mod would be perfect if it hooked into the rep. points system - but in a simple manner. I'd like to see it be able to award a point(s) for a good suggestion, but I couldn't use it to subtract points - IMHO that would be too harsh to penalize someone for providing an answer that didn't quite work out.

2. I also agree with a previous poster that the mod's options page needs to have a cell which allows us to add a comma separated listing of applicable forums (or the reverse - a list of excluded forums). In my particular setup, I have 78 forums and sub-forums - all but 6 of them needed the mod to be activated. It took me a long time last night to set them all up - granted that was mostly down to browser refresh speeds, but being able to deal with all forums in one go would be sweet.

3. I'm also hoping that your sample (or future) code will include the ability to add a line in the postbit somewhere under the avatar which lists how many helpful posts a member has made? A little like the current "thank you" mod does - i.e. "Thanked 396 times in 329 posts"

4. In helpfulanswers.php, when the link is clicked, I'd like to see it go to the post in question, but in full thread view (for context) instead of just the single post view.

Hope these suggestions are useful because for forums like mine, this is going to be a very popular mod - I've already nominated it for MOTM.

Thanks,
Mike :)

Ted S 02-07-2009 07:20 PM

Thanks mike. All good ideas that will all be making it into the addon (the first 3 sooner). That said the detail on how you want it to work is awesome. Thanks.

apiasto 02-07-2009 09:30 PM

thnx for the update,will it be the same process or just the xml with overwrite?

Ted S 02-07-2009 09:35 PM

For upgrades you should reupload the php file and install the new plugin. If an update is plugin only I'll generally announce it as such. Thanks for asking!

tpearl5 02-08-2009 09:30 PM

Quote:

Originally Posted by Ted S (Post 1736433)
How about a positive point (or points, you'd set the scale) for each vote they get [negative for a negative vote].

Reputation points? yeh, that would be great!

Quote:

Originally Posted by Ted S (Post 1736433)
I'm not sure the post should impact the thread rating... you could have a great post with a few bad ratings. We could however do a new column: average post and show the ratings of those?

Maybe just the first thread should impact the rating? If there's an individual post within a thread that is getting a lot of good ratings then it should probably be in its own thread anyway.
Quote:

Originally Posted by Ted S (Post 1736433)
I'm not familiar with this system; is this AND the rep both needed?

No - if you add the reputation feature then that alone will add to their vbplaza points.

Ted S 02-09-2009 11:13 PM

I'm pleased to announce the release of version 1.4.0 which contains several major feature updates and a few bug fixes. See the complete change log below:

- (Feature) Added optional integration with the reputation system
- (Feature) Added optional variable to identify the top rated thread in template conditionals
- (Feature) Added optional statistics to a user's profile
- (Admin) Added Bulk tool to enable system in forums
- (Admin) Option to disable automatic template plugin
- (System) Add overall rank variable for template conditionals
- (System) Auto add to templates for easier installs (no more templates to edit)
- (System) Added hook locations throughout addon
- (Bug) Fixes issue where non-ajax users weren't getting votes counted
- (Bug) Don't show HR line if no votes and user cant vote

This wraps up most of the requested features on my list. If there's something you would like to see added that was not put into 1.4.0 please let me know.

And of course as a new release please report any bugs or errors you find.

guvner 02-10-2009 02:54 AM

Great stuff Ted!

A couple of questions if I may:

1. Will the upgrade revert my current helful-answers templates and/or overwrite the current phrases? I have some formatting in there I want to keep so if they do revert I'll take a copy first.

2. You mentioned earlier about some conditional examples - i.e. I wanted to add some code to the postbit in addition to the usercp feature which you've now built in - did you get a chance to look at this yet?

My users love this hack - thank you again!

Mike :)

Ted S 02-10-2009 03:01 AM

Thanks Mike!

Quote:

Originally Posted by guvner (Post 1739331)
1. Will the upgrade revert my current helful-answers templates and/or overwrite the current phrases? I have some formatting in there I want to keep so if they do revert I'll take a copy first.

The old phrases shouldn't be overritten but the template might depending on the version you used (no changes in 1.4 but there were before) so back that up.

Quote:

2. You mentioned earlier about some conditional examples - i.e. I wanted to add some code to the postbit in addition to the usercp feature which you've now built in - did you get a chance to look at this yet?
I'm building some more examples tonight, if you tell me what you're trying to do I can start with that example...

guvner 02-10-2009 03:15 AM

Sounds good - I'd like to add a line to the postbit which is along the lines of what the "thank you" mod provides. similar to:

"Thanked 396 times in 329 posts"

I guess we could adjust the phrase ourselves in the conditional, but perhaps something like:

"Has provided xx helpful answers in the last yy days"

Maybe the "yy days" is a stretch and could add too many extra queries, but just a thought . . .

tpearl5 02-10-2009 03:25 AM

Quote:

Originally Posted by Ted S (Post 1739175)
I'm pleased to announce the release of version 1.4.0 which contains several major feature updates and a few bug fixes. See the complete change log below:

- (Feature) Added optional integration with the reputation system
- (Feature) Added optional variable to identify the top rated thread in template conditionals
- (Feature) Added optional statistics to a user's profile
- (Admin) Added Bulk tool to enable system in forums
- (Admin) Option to disable automatic template plugin
- (System) Add overall rank variable for template conditionals
- (System) Auto add to templates for easier installs (no more templates to edit)
- (System) Added hook locations throughout addon
- (Bug) Fixes issue where non-ajax users weren't getting votes counted
- (Bug) Don't show HR line if no votes and user cant vote

This wraps up most of the requested features on my list. If there's something you would like to see added that was not put into 1.4.0 please let me know.

And of course as a new release please report any bugs or errors you find.

When "Enable Profile Voting Stats" is turned on this warning is thrown in the user's profile:

Code:

Warning: Division by zero in /home/SITE/public_html/includes/class_profileblock.php(250) : eval()'d code on line 50
Also, the second option "Manual Template Placement" - I think that title is wrong (If enabled the user's profile will reflect total good, bad and total ratings of their posts. Adds a query each time a user's profile is viewed.)

Ted S 02-10-2009 03:27 AM

Edit, I appologize but I spoke too quickly on this...

What you're looking to do isn't difficult but it's also not native to addon... But that doesn't need to stop you. What is a concern is the number of queries added (one per post).

Votes are stored in a table and along side the post but not with the user so to fetch them you need separately from the big query that fetches threads. If you're interested in this (realize it's one query per post) let me know and I can write up the code.

Ted S 02-10-2009 03:28 AM

Quote:

Originally Posted by tpearl5 (Post 1739346)
When "Enable Profile Voting Stats" is turned on this warning is thrown in the user's profile:

Thanks. Are you using 1.4.1 which I posted a bit back or 1.4.0?

Quote:

Also, the second option "Manual Template Placement" - I think that title is wrong (If enabled the user's profile will reflect total good, bad and total ratings of their posts. Adds a query each time a user's profile is viewed.)
Thanks. Will fix...

Ted S 02-10-2009 03:31 AM

Version 1.4.2 posted which fixes a mess-up in the admin option phrases causing some confusion over a stats tool. Just a mislabeled field, upgrading is not necessary.

GigaSb 02-10-2009 06:10 AM

how do i make the text to be in the right side?

I added div align into postbit_legacy:

<div align="right">
$helpful_answers
</div>

it worked at first.. but when updated to last version its not effecting.

jlew24asu 02-10-2009 11:04 AM

installed. so is this supposed to only show up in the first post of the thread or all posts? (in a given forum)

Ted S 02-10-2009 02:38 PM

Quote:

Originally Posted by jlew24asu (Post 1739671)
installed. so is this supposed to only show up in the first post of the thread or all posts? (in a given forum)

This modification is for rating all posts in a thread.

Ted S 02-10-2009 02:39 PM

Quote:

Originally Posted by jlew24asu (Post 1739671)
installed. so is this supposed to only show up in the first post of the thread or all posts? (in a given forum)

You can either wrap the code in a table cell aligned right or edit the template helpful_answers to change the alignment of the DIV.

tpearl5 02-10-2009 05:47 PM

Quote:

Originally Posted by Ted S (Post 1739350)
Thanks. Are you using 1.4.1 which I posted a bit back or 1.4.0?



Thanks. Will fix...

I was using 1.4.0. Updated to 1.4.2 which fixed both problems. thanks!

jlew24asu 02-10-2009 06:23 PM

ok thanks Ted

torontonian 02-12-2009 06:11 PM

Hi,

Thanks for this excellent plugin. It was just what I've been looking for, although I have a few questions which may require a few mods:

1. How can I make the "Rating History and Editing" stats appear in the moderator's control panel? I can see this in the admin control panel, but I'd like moderators or at least super moderators to be able to see this info too.

2. Is there a way to adapt this to show the reputation of a user based on the ratings that their posts have received as opposed to the ratings that they have assigned to other posts. In other words, I'd like the admin and moderator to be able to see which users have received a large amount of positive and negative replies to their posts.

3. For the result display options, can you add a "negative ratings" column next to the "positive ratings" column. Currently, I have to look at the "total" and "positive" and see where there is a difference in numbers to know that there are some negatives. It would be much quicker to be able to spot the negative ones instantly and also to be able to sort by negative ratings.

The reason why I am asking for all of this is that I would like to use this to ensure that posts are always answered of the highest quality so I need to see who is answering incorrectly in order to improve the standard of replies.

Thanks again. I look forward to receiving your reply.

guvner 02-12-2009 06:18 PM

For a future revision, I'd like to request that if possible, all the mod's controls are consolidated into single page as currently they appears as 2 entries under VB options and again as a sidebar menu item in the adminCP.

Mike :)

Ted S 02-12-2009 07:39 PM

Quote:

Originally Posted by torontonian (Post 1742149)
1. How can I make the "Rating History and Editing" stats appear in the moderator's control panel? I can see this in the admin control panel, but I'd like moderators or at least super moderators to be able to see this info too.

You would need to copy the admincp file and possibly change it a bit to work with mod permissions as well as create a new bitfield xml file to get the link to show up.

Quote:

Originally Posted by torontonian (Post 1742149)
2. Is there a way to adapt this to show the reputation of a user based on the ratings that their posts have received as opposed to the ratings that they have assigned to other posts. In other words, I'd like the admin and moderator to be able to see which users have received a large amount of positive and negative replies to their posts.

Again this isn't native to the program but you could run a query to get it.

Something like "SELECT userid,sum(goodrank) as goodranks FROM postid ORDER BY goodranks DESC LIMIT 50" would show you the top 50 ranked members.

Quote:

3. For the result display options, can you add a "negative ratings" column next to the "positive ratings" column. Currently, I have to look at the "total" and "positive" and see where there is a difference in numbers to know that there are some negatives. It would be much quicker to be able to spot the negative ones instantly and also to be able to sort by negative ratings.
Are you referring to in the admin panel or on the user script?

Ted S 02-12-2009 07:41 PM

Quote:

Originally Posted by guvner (Post 1742157)
For a future revision, I'd like to request that if possible, all the mod's controls are consolidated into single page as currently they appears as 2 entries under VB options and again as a sidebar menu item in the adminCP.

Mike :)

Sorry Mike but neither will be consolidated in the official addon. I have two entries in the settings group because one is simply too long and the reputation features don't apply to all users.

As for the links in the sidebar, those are different features and would not make sense to combine (one does not bulk edit forums while reviewing ratings).

Of course you could always change things yourself if you want it more consolidated.

Ted S 02-13-2009 05:35 AM

Based on comments from a few members (and mainly biocyberman) I've added a second rating option to the script. This option allows for posts to be voted on from 1 to 10 rather than just being marked as "helpful or not helpful".

The ten point scale is an optional feature which is enabled globally (either you use one or the other). There are a few features that won't work with the ten point scale including the profile stats, the no negative option and others. However there are also some new features with the ten point scale.

I encourage you to try this out on a test site (or your live site if you're looking to switch over) and give me your feedback.

To remove all previous votes (required if changing methods) run the queries:
Code:

UPDATE post SET goodrank = '', totalrank = '';
DELETE FROM helpfulanswer;

If you use table prefixes be sure to include that as well.

Note: This is in beta and while it works fine on my system I'm leaving 1.4.2 as the official version until I get some feedback on how this works.

Second Note: To get this done I used numbers (1 2 3 4 5....) for rankings rather than stars. I will be looking into adding a simple star image in the future and encourage suggestions on that image.

Ted S 02-13-2009 05:37 AM

Changes in 1.5.0
- (Feature) Addition of ten-point rating scale (optional)
- (Feature) Addition of profile stats for ten-point rating scale
- (Feature) Modified display of top ratings page for ten-point ratings
- (Admin) Addition of negative ratings column for moderation
- (Bug) Rating's still show up in showpost template after user has voted
- (Bug) Individual user can't be banned

tpearl5 02-13-2009 06:55 PM

Quote:

Originally Posted by Ted S (Post 1742567)
Based on comments from a few members (and mainly biocyberman) I've added a second rating option to the script. This option allows for posts to be voted on from 1 to 10 rather than just being marked as "helpful or not helpful".

Why not just use the existing rating system for this?

GigaSb 02-13-2009 07:48 PM

Quote:

Originally Posted by GigaSb (Post 1739472)
how do i make the text to be in the right side?

I added div align into postbit_legacy:

<div align="right">
$helpful_answers
</div>


it worked at first.. but when updated to last version its not effecting.

can i get help here?

Ted S 02-13-2009 08:59 PM

Quote:

Originally Posted by GigaSb (Post 1743195)
can i get help here?

I responded to that several pages back... You may want to search for the answer but the general idea is that there is already a div controlling the reviews so you'll want to either edit that or wrap the div in a table.

Ted S 02-13-2009 08:59 PM

Quote:

Originally Posted by tpearl5 (Post 1743166)
Why not just use the existing rating system for this?

I'm not aware of a native post rating system in vBulletin...?

Ted S 02-13-2009 09:23 PM

Version 1.5.1 has been released.

This is a minor fix that adds a redundancy check to insure votes on the ten point scale option are not over 10 points.

This update also removes an extra > character in the options area.

Upgrading is optional.

guvner 02-16-2009 07:50 AM

Hi Ted :)

We've been discussing this your mod at my forum today, and one member asked if the cell under the post with the most votes could change color to help distinguish it from other posts in the thread.

I know this was mentioned last week and was wondering what would be involved in enabling a feature like that?

Mike

Ted S 02-16-2009 05:20 PM

Version 1.5.2 has been released to fix a small bug with the profile stats tool. This bug only impacted users with the ten-scale ratings feature enabled and an upgrade is not required if you did not use this feature.

To upgrade install the new plugin file. No changes were made to any of the other files.

Ted S 02-16-2009 05:26 PM

Quote:

Originally Posted by guvner (Post 1745699)
Hi Ted :)

We've been discussing this your mod at my forum today, and one member asked if the cell under the post with the most votes could change color to help distinguish it from other posts in the thread.

I know this was mentioned last week and was wondering what would be involved in enabling a feature like that?

Mike

Mike,

You can do this in two steps.

First go to your Helpful Answers System Settings and enable the top answer feature. This will give you acces to the top post via the variable $threadinfo[toppost]. But note, this will also add a query when a post is loaded.

Next you'll need to edit the template postbit or postbit_legacy to make use of this variable.

Depending on how you want the cell to look you'll want to modify the code appropriately.

Code:

<if condition="$threadinfo[toppost] = $post[postid]">  ... </if>

jGas 02-16-2009 11:53 PM

HI, if i try to use $helpful_answers (enabling Manual Template Placement) it simply doesn't work!
can you help me?
thanks!

Ted S 02-17-2009 12:02 AM

Quote:

Originally Posted by jGas (Post 1746381)
HI, if i try to use $helpful_answers (enabling Manual Template Placement) it simply doesn't work!
can you help me?
thanks!

Where are you trying to place the variable?

jGas 02-17-2009 08:38 AM

after <!-- / controls -->
(inside the postbit_legacy!)
i have to do the manual placement because i have also the post thank you hack, and in the image you can see what happens if they work together with the automatic placement:

https://vborg.vbsupport.ru/external/2009/02/56.jpg
(grazie = thanks)

alternatively, is there a way to move the automatic placement AFTER the thank you button?

SymbioteK 02-17-2009 09:17 AM

ok, i guess i'm just too dumb

all installed fine, followed instructions, its all there in admin.

just not there client side.....

tpearl5 02-17-2009 12:38 PM

Quote:

Originally Posted by Ted S (Post 1743262)
I'm not aware of a native post rating system in vBulletin...?

I was thinking of the thread rating system. nevermind.

Ted S 02-17-2009 05:15 PM

Quote:

Originally Posted by SymbioteK (Post 1746695)
ok, i guess i'm just too dumb

all installed fine, followed instructions, its all there in admin.

just not there client side.....

Don't be so hard on yourself!

Are you sure you've enabled it in the forum you're viewing?


All times are GMT. The time now is 06:45 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01551 seconds
  • Memory Usage 1,857KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (23)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete