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-03-2009 10:00 PM

[AJAX] Helpful Answers - Allow users to rate individual posts
 
Every day your users contribute hundreds if not thousands of posts making it hard for new members and guests to separate out the best answers from those that are less helpful. The Helpful Answers System offers your members a quick way (AJAX) to rate individual posts as either helpful or not allowing future visitors to understand the benefits of each post.

Designed for maximum flexibility:



This addon is built to be flexible and offers several customization options including:
  • The ability to use image or text ratings.
  • The ability to offer yes/no or scaled 1-10 point ranking.
  • The ability to turn off negative ratings for a positive only system.
  • The ability to decide which forums are open for helpful answer ratings.
  • The ability to audit the system and identify top users and potential abusers.
  • The ability to ban specific members from using the system.
  • The ability to customize the AJAX message shown after a post is rated.
  • The ability to edit all text and messages through phrases.
  • The ability to show a page with the top helpful posts.
  • The ability to show rating stats on a user's profile.
  • Integration with the reputation system for ratings.
  • Template driven display that can easily be customized to your forum.
For advanced users template conditionals and variables let you further extend the functionality to color highlight good or bad posts, include ratings in user?s profiles and much more.

Modification Installation:
This addon requires uploading multiple files, installing a vBulletin product and enabling the feature in any forums you wish. No template modifications are required. Please see the included install file for detailed instructions.

If you are not seeing the rating bar double check that you have enabled the feature in the forum you are in and insure the Manual Template override option is not enabled.

Rating Review & Deletion:
To identify and remove abuse a reporting system is included with this addon and can be found in your vBulletin ACP under the Helpful Answers tab. Through this panel you will be able to view a user's overall rating history and individual ratings and can remove either if necessary. Users can also be explicitly banned from the system.

Reputation System Integration:
Helpful Answers can be extended to directly tie into your reputation system giving users positive or negative points based on the ratings of their posts. There are numerous options on how to handle ratings that can be found in a separate Helpful Answers Reputation part of your vBulletin Settings page.

Anonymous Stats Tracking (optional):
vBulletin forums reach millions of consumers around the world yet little is known about their habits and opinions. This addon was released to the public out of requests but also to further the research of forum user's behaviors and actions through collecting the most basic data on thousands of sites.

By default this addon will pass basic rating data (positive or negative) to a 3rd party site for statistical purposes. Only the most basic data is captured (the vote and your site name) and no user information or specific forum details are logged, not even an IP address.

While you may disable this feature through the administrative options I ask that you consider leaving it in place to help this research effort and insure the continued support of the addon.

The tracking feature uses the php library cURL on a 5 second timeout. If cURL is not installed this option is automatically disabled.

History of this addon:

This addon was originally developed for private use in 2006 for a site of mine but after getting several past clients requested requests and messages I decided to package it up for public release.

Ted S 02-03-2009 11:37 PM

Tips & Tricks Using Template Variables:

While the Helpful Answers section may appear to only add to a small part of your post it can be used much more extensively to change the color of an entire post, to add a special icon or just about anything else you like. Here are list of the variables available for your templates and a few sample conditions you can use with them:

Code:

$post[totalrank] - The total number of ratings
$post[goodrank] - The number of good ratings
$post[badrank] - The number of bad ratings
$post[helpfulgood] - True if the post is positive overall (more good than bad ratings)
$show[rate_helpfulanswer] - True if the user can rate the post (false if they are banned or have rated it).
$post[helpfulanswerid] - True if the user has already rated the post.

Future Updates:

I'm pleased with this addon so far but plan to extend it as feedback comes in so please share your comments and suggestions as they will be read and responded too.

Coming soon... A page showcasing your top 10 (or 20 or 30 or 100) posts.

Ted S 02-04-2009 12:52 AM

Thanks for the private feedback; I've added a simple page showing the Most Helpful Answers. This can be disabled through the options and the number of results to show can also be configured.

Spank 02-04-2009 01:18 AM

Brill, will download and install later. Thanks

Rickeo 02-04-2009 01:45 AM

Any chance of getting this to work on 3.8x?

Ted S 02-04-2009 01:58 AM

Quote:

Originally Posted by Rickeo (Post 1733697)
Any chance of getting this to work on 3.8x?

https://vborg.vbsupport.ru/showthread.php?t=204117

GigaSb 02-04-2009 06:31 AM

help here please, got errors:

Database error in vBulletin 3.7.0:

Invalid SQL:

SELECT
post.*, post.username AS postusername, post.ipaddress AS ip, IF(post.visible = 2, 1, 0) AS isdeleted,
user.*, userfield.*, usertextfield.*,
icon.title as icontitle, icon.iconpath,
avatar.avatarpath, NOT ISNULL(customavatar.userid) AS hascustomavatar, customavatar.dateline AS avatardateline,customavatar.width AS avwidth,customavatar.height AS avheight,
spamlog.postid AS spamlog_postid,
deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason,
editlog.userid AS edit_userid, editlog.username AS edit_username, editlog.dateline AS edit_dateline,
editlog.reason AS edit_reason, editlog.hashistory,
postparsed.pagetext_html, postparsed.hasimages,
sigparsed.signatureparsed, sigparsed.hasimages AS sighasimages,
sigpic.userid AS sigpic, sigpic.dateline AS sigpicdateline, sigpic.width AS sigpicwidth, sigpic.height AS sigpicheight,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid

,post.goodrank,post.totalrank,helpfulanswer.helpfu lanswerid
FROM post AS post
LEFT JOIN user AS user ON(user.userid = post.userid)
LEFT JOIN userfield AS userfield ON(userfield.userid = user.userid)
LEFT JOIN usertextfield AS usertextfield ON(usertextfield.userid = user.userid)
LEFT JOIN icon AS icon ON(icon.iconid = post.iconid)
LEFT JOIN avatar AS avatar ON(avatar.avatarid = user.avatarid) LEFT JOIN customavatar AS customavatar ON(customavatar.userid = user.userid)
LEFT JOIN spamlog AS spamlog ON(spamlog.postid = post.postid)
LEFT JOIN deletionlog AS deletionlog ON(post.postid = deletionlog.primaryid AND deletionlog.type = 'post')
LEFT JOIN editlog AS editlog ON(editlog.postid = post.postid)
LEFT JOIN postparsed AS postparsed ON(postparsed.postid = post.postid AND postparsed.styleid = 4 AND postparsed.languageid = 3)
LEFT JOIN sigparsed AS sigparsed ON(sigparsed.userid = user.userid AND sigparsed.styleid = 4 AND sigparsed.languageid = 3)
LEFT JOIN sigpic AS sigpic ON(sigpic.userid = post.userid)
LEFT JOIN helpfulanswer AS helpfulanswer ON(helpfulanswer.postid = post.postid and helpfulanswer.userid = 1)
WHERE post.postid IN (0,210,231)
ORDER BY post.dateline;

MySQL Error : Table 'mysite_fph.helpfulanswer' doesn't exist
Error Number : 1146
Request Date : Wednesday, February 4th 2009 @ 11:26:54 AM
Error Date : Wednesday, February 4th 2009 @ 11:26:54 AM
Script : http://www.mysite.co.il/showthread.php?t=188
Referrer : http://www.mysite.co.il/forumdisplay.php?f=3
IP Address : XX.XXX.XX.XXX
Username : PCTech
Classname : vB_Database
MySQL Version : 5.0.37-standard

6piston 02-04-2009 11:32 AM

Quote:

Originally Posted by GigaSb (Post 1733886)
help here please, got errors:

Database error in vBulletin 3.7.0:

try this:
https://vborg.vbsupport.ru/showpost....91&postcount=8

6piston 02-04-2009 11:40 AM

hi Ted

i've created the sql table manually using the link i posted above. but now, i get other sql errors. this time:

when i click Yes / No the AJAX effect doesn't work, instead, a window pops up and says:

Quote:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Zerotohundred.com Database Error</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="ROBOTS" content="NOINDEX,NOFOLLOW,NOARCHIVE" />
<style type="text/css">
<!--
body { background-color: white; color: black; }
#container { width: 400px; }
#message { width: 400px; color: black; background-color: #FFFFCC; }
#bodytitle { font: 13pt/15pt verdana, arial, sans-serif; height: 35px; vertical-align: top; }
.bodytext { font: 8pt/11pt verdana, arial, sans-serif; }
a:link { font: 8pt/11pt verdana, arial, sans-serif; color: red; }
a:visited { font: 8pt/11pt verdana, arial, sans-serif; color: #4e4e4e; }
-->
</style>
</head>
<body>
<table cellpadding="3" cellspacing="5" id="container">
<tr>
<td><img src="http://www.zerotohundred.com/newforums/image.php?type=dberror" alt="Database Error" width="48" height="48" /></td>
<td id="bodytitle" width="100%">Database error</td>
</tr>
<tr>
<td class="bodytext" colspan="2">The Zerotohundred.com database has encountered a problem.</td>
</tr>
<tr>
<td colspan="2"><hr /></td>
</tr>
<tr>
<td class="bodytext" colspan="2">
Please try the following:
<ul>
<li>Load the page again by clicking the <a href="#" onclick="window.location = window.location;">Refresh</a> button in your web browser.</li>
<li>Open the <a href="/">www.zerotohundred.com</a> home page, then try to open another page.</li>
<li>Click the <a href="javascript:history.back(1)">Back</a> button to try another link.</li>
</ul>
</td>
</tr>
<tr>
<td class="bodytext" colspan="2">The www.zerotohundred.com forum technical staff have been notified of the error, though you may <a href="mailto:">contact them</a> if the problem persists.</td>
</tr>
<tr>
<td class="bodytext" colspan="2">&nbsp;<br />We apologise for any inconvenience.</td>
</tr>
</table>

<form><textarea rows="15" cols="70" wrap="off" id="message">Database error in vBulletin 3.7.2:

Invalid SQL:



SELECT post.goodrank,post.totalrank

FROM vb3post

WHERE postid = 2661498;

MySQL Error : Unknown column 'post.goodrank' in 'field list'
Error Number : 1054
Request Date : Wednesday, February 4th 2009 @ 09:37:03 PM
Error Date : Wednesday, February 4th 2009 @ 09:37:04 PM
Script : http://www.zerotohundred.com/newforu...fulanswers.php
Referrer : http://www.zerotohundred.com/newforu...-sohc-bot.html
IP Address : 124.82.95.141
Username : Tom
Classname : vB_Database
MySQL Version : 5.0.51a-community-log</textarea></form>

</body>
</html>
so it's this:
MySQL Error : Unknown column 'post.goodrank' in 'field list'

please advise ted

GigaSb 02-04-2009 12:10 PM

i added the query that u advised me..
thank u very much!

apiasto 02-04-2009 12:13 PM

i am getting the same error.i will wait for stable hack

6piston 02-04-2009 12:13 PM

cool!. now you may face the next same prob as i am

tpearl5 02-04-2009 03:07 PM

hrm - I like this idea, although I've already modified the wording of the reputation system to resemble something similar.

Ted S 02-04-2009 07:07 PM

My appologies to those who have experienced bugs with the system. 3 issues were identified (2 with queries like the errors above show) and 1 in the creation of the table. An updated version has been released which solves all known issues.

Ted S 02-04-2009 07:08 PM

Note: Version 1.3.3 has been released which fixes several small issues related to creating the mySQL table for this addon and with two queries. With this update the current mysql query errors will go away and the table will be properly created.

All users are advised to upgrade while those who have experienced database errors should uninstall and then upgrade.

To upgrade simply upload the new version of helpfulanswer.php and install the new plugin file.

apiasto 02-05-2009 05:59 AM

awesome man working great ,i am putting this for MOTM,good work thanks.can you add 1 option like if i wanna allow it only for first post?and to show total amount of ranks a user recieved in postbit,thanks

6piston 02-05-2009 07:36 AM

yup now it works beautifully :)

please expand this mod as much as you can!! it's great

tpearl5 02-06-2009 12:06 AM

Ted - would you consider adding functionality to add to a users reputation and points for vbplaza?

Ted S 02-06-2009 02:52 AM

Quote:

Originally Posted by tpearl5 (Post 1735651)
Ted - would you consider adding functionality to add to a users reputation and points for vbplaza?

can you explain this a bit more?

Quantnet 02-06-2009 02:54 AM

suggestion:
Instead of manually enable forum by forum, consider having the options in setting control to enable a group of forums.
for example:
Enable (Forum ID) : 1,3,4,5
Disable: 2,6,8

Ted S 02-06-2009 04:06 AM

Quote:

Originally Posted by Quantnet.org (Post 1735744)
suggestion:
Instead of manually enable forum by forum, consider having the options in setting control to enable a group of forums.
for example:
Enable (Forum ID) : 1,3,4,5
Disable: 2,6,8


I'm not sure that's any more effective. Many sites have 50 or 100 or more forums and getting all their ids would not be fun. perhaps a bulk upload tool would make more sense.

tpearl5 02-06-2009 02:01 PM

Quote:

Originally Posted by Ted S (Post 1735743)
can you explain this a bit more?

Sure
  • Add option to allow this hack to also contribute to the user's reputation. (without comments) This way the user gets credit for posting the thread/post.
  • Add option to contribute to thread rating. "yes" is a 5, "no" is a 1. Thread rating is redundant with this hack, no?
  • Include setting for vbplaza to add points to user when they get a good rating, and subtract when they get a bad rating. (this will be done through reputation if that option is added)

Ted S 02-06-2009 07:40 PM

Version 1.3.4 has been releases which addresses several minor bugs and adds functionality. Here's a complete list of the changes:

- Bug Fix: Templates 'helpful_answers_top' and 'helpful_answers_top_bit' are now cached.
- Bug Fix: English text in topanswers routine now uses phrases
- Bug Fix: Users may not rate their own posts (see new feature)
- New template: 'helpful_answers_error' is used to show ajax errors
- New feature: Admins may require a minimum number of posts before a user can rate posts
- New feature: Admins may now enable self rating to let users rate their own posts
- New feature: User related errors now print back to ajax users (allows user to understand issue)

Updating is recommended but not required.

Ted S 02-06-2009 07:43 PM

Quote:

Originally Posted by tpearl5 (Post 1736107)
[*]Add option to allow this hack to also contribute to the user's reputation. (without comments) This way the user gets credit for posting the thread/post.

How about a positive point (or points, you'd set the scale) for each vote they get [negative for a negative vote].

Quote:

Originally Posted by tpearl5 (Post 1736107)
[*]Add option to contribute to thread rating. "yes" is a 5, "no" is a 1. Thread rating is redundant with this hack, no?

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?

Quote:

Originally Posted by tpearl5 (Post 1736107)
[*]Include setting for vbplaza to add points to user when they get a good rating, and subtract when they get a bad rating. (this will be done through reputation if that option is added)

I'm not familiar with this system; is this AND the rep both needed?

guvner 02-06-2009 09:30 PM

For my tech support forum this is ideal - many thanks Ted!

I'm testing this at the moment in a private forum - just one small problem though, I can't get the "Did you find this post helpful? Yes | No" box to show up when using the standard postbit template yet it shows just fine with postbit legacy.

In my case, my primary style is uses the standard postbit and I also offer a child style of the primary which uses the postbit legacy template as the default.

I can confirm that the template hook $template_hook[postbit_controls] appears in both templates.

To troubleshoot this, I next added the template code $helpful_answers to the default VB templates and the same thing happened - it showed up when the legacy template is used but not with the standard postbit template.

Any ideas? :confused:

Ted S 02-06-2009 10:29 PM

I just tried this myself; Try placing the variable before "<!-- message, attachments, sig -->".

If that doesn't work let me know.

guvner 02-06-2009 10:39 PM

Nope, sorry - same result - this is very puzzling - can't think of a logical reason for it.

Ted S 02-06-2009 10:43 PM

Interesting. Can you think of any Addons which may impact the postbit template? If you view source do you see the <hr ...> tag?

guvner 02-06-2009 10:47 PM

yes - just after the title as per:

Code:

                        <!-- icon and title -->
                        <div class="smallfont">
                               
                                <strong>Re: It's really starting to get annoying...</strong>
                        </div>
                        <hr size="1" style="color:#D1D1E1; background-color:#D1D1E1" />
                        <!-- / icon and title -->

I considered another hack being involved - but why would my stock VB templates be affected the same in the same way?

Should I post my posbit template code here?

Ted S 02-06-2009 10:51 PM

Well that's good progress. It doesn't sound like another addon conflict as the script is making it to rendering.

It looks like there's no vote to show and for some reason no rights for you to vote on that post. Are you sure the addon is (1) enabled for the forum with the postbit style and (2) not your own post?

guvner 02-06-2009 10:57 PM

Quote:

Originally Posted by Ted S (Post 1736567)
Are you sure the addon is (1) enabled for the forum with the postbit style and (2) not your own post?

Yes , quite.

I'm running it in my hidden management forum. When I select the style with postbit legacy it shows - when I switch styles to the one using standard postbit it disappears. This confirms that it's switched on and working just fine - just not with one of the templates.

Give me a few secs and I'll post 2 screenies of the same post in the same forum . . .

Ted S 02-06-2009 11:03 PM

Ok, I reviewed the code you posted before and this is strange. While you have the HR tag I don't see the DIV tag that wraps the entire element (it should be <div id="helpfulanswers_box_ ... >). Does that appear?

guvner 02-06-2009 11:04 PM

OK - 2 screenies - same post.

1. Postbit
2. Postbit legacy

I know that it won't provide any clues - just to confirm that the forum's been correctly selected and that the mod is working.

guvner 02-06-2009 11:08 PM

Quote:

Originally Posted by Ted S (Post 1736578)
Ok, I reviewed the code you posted before and this is strange. While you have the HR tag I don't see the DIV tag that wraps the entire element (it should be <div id="helpfulanswers_box_ ... >). Does that appear?

In the template that's working (legacy) yes it does:

Code:

                <div id="helpfulanswers_box_237366">
               
                        <br /><hr size="1" style="color:#D1D1E1" />
                                       
                       
                        1 out of 1 members found this post helpful.
                               
                       
                        </div>

But in the postbit template page source it doesn't appear. :confused:

Ted S 02-06-2009 11:14 PM

Well that makes even less sense. Revert the template helpful_answers in that style and be sure it starts with:

Code:

<if condition="$show['helpfulanswer']">
               
                <div id="helpfulanswers_box_$post[postid]">


guvner 02-06-2009 11:22 PM

Revert wasn't an option so I guess it's still original - and I confirm it starts as you describe.

guvner 02-06-2009 11:24 PM

I've just re-installed and overwritten (just in case) and no change. :(

Ted S 02-06-2009 11:28 PM

I'm sorry to keep making you work on this but I can't duplicate on any of my test sites.

Can you edit the template helpful_answers and change the <hr> line (add some random text) and see if that shows up when you view?

guvner 02-06-2009 11:41 PM

Think I'm getting somewhere - I'll get back to in a few ;)

Thanks for your patience :)

guvner 02-07-2009 08:34 AM

All fixed Ted - I can't really tell you what the problem was but I reverted the faulty template, added back my hacks and then re9nstalled your mod and all's well.

Thanks for your assistance.

One more question - once someone clicks that the post was helpful, is there an easy way to have the cell background change color to highlight it?

Mike :)


All times are GMT. The time now is 10:19 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.01433 seconds
  • Memory Usage 1,862KB
  • 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
  • (4)bbcode_code_printable
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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