View Full Version : Add-On Releases - [AJAX] Helpful Answers - Post Rating System (plus many sub-features)
Pages :
1
2
3
4
5
6
7
[
8]
Chris8
05-18-2012, 01:31 AM
Nice mod :)
I have a question, is it possible to sort posts within a thread accordingly to the post ranking? (Yup, I dig the whole thread but did not find it.)
And if yes then how?
I would be grateful for any pointers.
Ted S
05-18-2012, 02:08 AM
Nice mod :)
I have a question, is it possible to sort posts within a thread accordingly to the post ranking? (Yup, I dig the whole thread but did not find it.)
And if yes then how?
I would be grateful for any pointers.
Yes it's possible. No it's not a feature in the mod.
Basically you'd need to modify the query that pulls the posts up and change it to check on the votes for the post (they're stored as individual records and for the post overall).
There's already a query plugin used on that page so it's got a starting point if you're familiar with vB.
Chris8
05-18-2012, 06:20 PM
Well, I'm familiar with vb in some way, but I'm not a coder. As for modifying I would only like to execute sorting only on demand, not by default. I guess I need to edit showthread template and put there a link that will run the sorting query when user clicks it. To create the query I must add a plugin and place it somewhere within showthread perhaps showthread_start hook or maybe showthread_query_postids hook would be suitable.
But the question is how would look like the code executing this query. I've just thought that perhaps someone has done it before and wouldn't mind to share the code. I think that feature could be very powerful addition to this mod.
Ted S
05-18-2012, 08:51 PM
Well, I'm familiar with vb in some way, but I'm not a coder. As for modifying I would only like to execute sorting only on demand, not by default. I guess I need to edit showthread template and put there a link that will run the sorting query when user clicks it. To create the query I must add a plugin and place it somewhere within showthread perhaps showthread_start hook or maybe showthread_query_postids hook would be suitable.
But the question is how would look like the code executing this query. I've just thought that perhaps someone has done it before and wouldn't mind to share the code. I think that feature could be very powerful addition to this mod.
While there's plugin hooks you can use to setup the option, what you want to do requires an source change to the query -- people hate those which is the only reason why it's not a part of the mod.
Here's the basics of what you need to do:
1. Add a plugin hook for showthread_post_start along the lines of
// get the variable to see if the user wants to sort by votes
$vbulletin->input->clean_gpc('r', 'sortvotes', TYPE_STR);
// see if the user opted to sort by the post votes AND voting is enabled in this forum
if($vbulletin->GPC['sortvotes'] AND $forum['helpfulanswerbits']){
$sortquery = "ORDER BY helpfulpost.totalrank DESC";
echo "<!--sort by posts-->";
// either HA is not on or the user doesn't want to sort by it; back to default
} else {
$sortquery = "ORDER BY post.dateline ". $postorder;
echo "<!--sort normally-->";
}
2. In showthread.php find ORDER BY post.dateline $postorder and replace it with $sortquery
3. Repeat this for all 3 instances of the original code
4. Add a link to the post with the variable &sortvotes=1 to enable sorting by votes
5. To check that the plugin is getting called view source the page and look for "sort by posts" or "sort normally". You can remove this once the hack works.
Note: This isn't tested so while it won't destroy any data it may throw an error and may not work if you filter a post another way, click to the next page, etc.
Chris8
05-19-2012, 01:44 AM
It works :) but only partially. It executes the normal sorting and displays the posts, (<!--sort normally--> is displayed too)
but when trying to sort by helpfulpost.totalrank by accessing http://www.example.com/showthread.php?t=xxx&sortvotes=1 a db error occurs.
I'm trying to guess what might be wrong. Thank you anyway for taking your time to write such detailed instructions, that's for sure the good starting point and it would probably work but some detail is missing.
I will try to test it tomorrow on clean installation.
Ted S
05-19-2012, 02:26 AM
I'm trying to guess what might be wrong. Thank you anyway for taking your time to write such detailed instructions, that's for sure the good starting point and it would probably work but some detail is missing.
I will try to test it tomorrow on clean installation.
You can try adding back ORDER BY post.dateline $postorder to the first instance although I'm not sure how that will impact the ordering.
Alternatively you'd need to add the JOIN request to that query as well.
Chris8
05-19-2012, 06:04 PM
Yes! It works now like a charm! Thank you! :)
So simple though I wouldn't figure it myself.
Absolutely precious feature, at least for me.
eternal_
06-07-2012, 03:12 PM
Is there something like this for 4.x.x? I'm looking for a thumbs up option. It should be standard in vbulletin by now. It's a popular feature all over the web.
Simon Lloyd
06-07-2012, 03:17 PM
Is there something like this for 4.x.x? I'm looking for a thumbs up option. It should be standard in vbulletin by now. It's a popular feature all over the web.Yes of course there is, have you tried searching? or simply just clicking the coders name and view their profile?
Ted S
06-09-2012, 06:31 PM
Is there something like this for 4.x.x? I'm looking for a thumbs up option. It should be standard in vbulletin by now. It's a popular feature all over the web.
You mean like the 4.x version of this mod posted in the 4.x section of this forum?
Simon Lloyd
06-09-2012, 07:12 PM
You mean like the 4.x version of this mod posted in the 4.x section of this forum?Ted thats far too much of a clue!
Ted S
06-10-2012, 04:14 AM
Ted thats far too much of a clue!
:eek::eek::eek:
bbqchef33
07-19-2012, 06:14 AM
getting this error... any clue?
Warning: curl_setopt() [function.curl-setopt]: Invalid curl configuration option in [path]/helpfulanswers.php on line 434
Ted S
07-21-2012, 02:47 AM
getting this error... any clue?
Warning: curl_setopt() [function.curl-setopt]: Invalid curl configuration option in [path]/helpfulanswers.php on line 434
Disable the reporting option and you;ll be good to go.
bada_bing
02-19-2013, 08:42 PM
I am having an issue with this script. If no one rates the post and you click on the "Skip right to it!" it tries to take me here http://www.mywebsite.com/forums/showpost.php?p= and obviously get a white page because there is no rating. Now if someone does rate the post helpful and you click the "Skip right to it" link it will take you to the post..
How can I alter this so that either the "Skip right to it! link does not appear until someone rates a post or that you can have the link grayed our or something until a post has been rated?
Thanks
Ted S
02-20-2013, 05:48 AM
I am having an issue with this script. If no one rates the post and you click on the "Skip right to it!" it tries to take me here http://www.mywebsite.com/forums/showpost.php?p= and obviously get a white page because there is no rating. Now if someone does rate the post helpful and you click the "Skip right to it" link it will take you to the post..
How can I alter this so that either the "Skip right to it! link does not appear until someone rates a post or that you can have the link grayed our or something until a post has been rated?
Thanks
Edit the template helpful_answers_mosthelp_post and wrap the contents in a condition like:
<vb:if condition="$helpfulanswer['postid']">
...... ...... ......
</vb:if>
bada_bing
02-20-2013, 03:50 PM
Edit the template helpful_answers_mosthelp_post and wrap the contents in a condition like:
<vb:if condition="$helpfulanswer['postid']">
...... ...... ......
</vb:if>
Ted
That did not work when I tried to add the suggested code VB gave me an error when I tried to save it. This is what is currently in helpful_answers_mosthelp_post template.
Also I an running VB 3.87
<if condition="!$GLOBALS['FIRSTPOSTID'] AND $helpfulanswer[postid] != $GLOBALS['qrfirstpostid']">
<div style="padding:5px;">
<table class="tborder" cellpadding="4" cellspacing="0" border="0" width="100%" align="center">
<tr>
<td class="alt1" style="padding:15px;font-weight"bold;text-align:center;">
<phrase 1="$vboptions[bbtitle]" 2="$helpfulanswer[postid]">$vbphrase[helpfulanswer_mosthelp_post]</phrase>
</td>
</tr>
</table>
</div>
</if>
bada_bing
02-20-2013, 03:56 PM
Ted,
Got it working.. Thanks much I just changed your code to this and that did it...
Edit the template helpful_answers_mosthelp_post and wrap the contents in a condition like:
if condition="$helpfulanswer['postid']">
...... ...... ......
</if>
***************
Ted S
02-20-2013, 08:20 PM
Whoops... I wrote the condition for vB4. :D
bbqchef33
02-25-2013, 03:36 AM
Im on 3.8.7. Mod works.. with a small problem.
i have the icon settings to " images - Thumbs up/thumbs down"
but on most users its says 'yes/no' in text, and on others its empty boxes. any ideas? Im ok on IE and firefox, problem seems to be on safari/mac and also pc/chrome.
I have changed it to different settings and it wither disappears on all , or yes/no text as stated above.
Ted S
02-25-2013, 05:47 AM
Im on 3.8.7. Mod works.. with a small problem.
i have the icon settings to " images - Thumbs up/thumbs down"
but on most users its says 'yes/no' in text, and on others its empty boxes. any ideas? Im ok on IE and firefox, problem seems to be on safari/mac and also pc/chrome.
I have changed it to different settings and it wither disappears on all , or yes/no text as stated above.
When you view the image source for the broken bits is the path correct? Are the images then found?
bbqchef33
02-26-2013, 03:18 AM
When you view the image source for the broken bits is the path correct? Are the images then found?
good call.. thanks.. nope the images are missing. Thats the downside of working on these things at 3AM.. cant believe I missed it.
got any place I can swipe them from?
Edited: found the files! thanks!
bbqchef33
02-26-2013, 04:11 AM
Now that the graphics are there and my members are using it, they have one complaint. When you click on the options, it returns you to the first post in the thread. We have some really long threads and that can be frustrating. Is there a way to return them to where they were.
Simon Lloyd
02-26-2013, 08:18 AM
If you've installed it correctly it should take you to the actual thanked post.
Ted S
02-26-2013, 04:52 PM
Now that the graphics are there and my members are using it, they have one complaint. When you click on the options, it returns you to the first post in the thread. We have some really long threads and that can be frustrating. Is there a way to return them to where they were.
Use the ajax option and you'll never leave the page...
bbqchef33
02-26-2013, 06:53 PM
Use the ajax option and you'll never leave the page...
Reinstalled all from scratch just to make sure im running clean. Same results..
Where is the AJAX option? Went thru the menus, didnt see it.
Ted S
02-26-2013, 08:19 PM
Reinstalled all from scratch just to make sure im running clean. Same results..
Where is the AJAX option? Went thru the menus, didnt see it.
Ajax runs through your entire forum. The addon simply picks up your vB settings.
aciurczak
02-28-2013, 02:28 PM
Howdy -
Mod is working great, but I don't see where the "most helpful answers" page is being created. Is it supposed to put a link in one of the menus, or can someone share what the typical URL is for me to add it myself?
This is what I see in the mod description, but can't find on my site:
https://vborg.vbsupport.ru/attachment.php?attachmentid=94059&d=1233715795
Ted S
02-28-2013, 05:46 PM
Howdy -
Mod is working great, but I don't see where the "most helpful answers" page is being created. Is it supposed to put a link in one of the menus, or can someone share what the typical URL is for me to add it myself?
This is what I see in the mod description, but can't find on my site:
The page is located at yoursite.com/forumfolder/helpfulanswers.php
bada_bing
02-28-2013, 07:54 PM
The page is located at yoursite.com/forumfolder/helpfulanswers.php
Ted
Is a easier way to add this page/link somewhere members know how to access it? I would hate to create a link in my navbar just for this page?
aciurczak
02-28-2013, 07:54 PM
Thx!
Ted S
03-01-2013, 12:33 AM
Ted
Is a easier way to add this page/link somewhere members know how to access it? I would hate to create a link in my navbar just for this page?
It's just a link... You can include it wherever you want in your design, or not at all.
aciurczak
03-01-2013, 12:50 AM
Ted - up to you if you want me to leave this in the thread or remove it, but I wrote a dirt-simple plug-in to add a link to the Most Helpful Answers to the Quick Links menu.
To install, just go to add plugins in the admincp, load this file. To uninstall, remove plugin.
It uses one variable from the Top Posters mod, to help it work on a CMPS or portal page that also shows the navmenu. It should work fine without that mod installed, as long as it's not needed to work on a page other than the forums page.
Ted S
03-01-2013, 04:14 AM
Contributions are always encouraged... that is the point of mods after all, right? Thanks for sharing!
bbqchef33
03-01-2013, 04:48 AM
Ajax runs through your entire forum. The addon simply picks up your vB settings.
oh, that one is running 'all AJAX features enabled'.
Still same issue.. once you click on thumbs up or down, it jumps to the first post in the thread.
Ted S
03-01-2013, 05:20 AM
oh, that one is running 'all AJAX features enabled'.
Still same issue.. once you click on thumbs up or down, it jumps to the first post in the thread.
Sounds like it's not catching the ajax effects.
Which voting method are you using? There's nothing in the mod to return other modes back to a particular post.
bbqchef33
03-02-2013, 03:41 AM
using thumbs up/thumbs down
see it here if you want to check.
http://www.bbq-brethren.com/forum/forumdisplay.php?f=5
Ted S
03-02-2013, 05:37 AM
using thumbs up/thumbs down
see it here if you want to check.
http://www.bbq-brethren.com/forum/forumdisplay.php?f=5
Switch to the rollover option please and if that doesn't work I'll dig into some code...
It's been a long while since the last version of the mod so who knows what things look like :D
bbqchef33
03-04-2013, 06:02 AM
Switch to the rollover option please and if that doesn't work I'll dig into some code...
It's been a long while since the last version of the mod so who knows what things look like :D
same thing. Pops you up to the first post.
Simon Lloyd
03-04-2013, 04:08 PM
if you create a default style (with no parent) and use the link in that does it do the same thing?
usHealthy
04-05-2013, 07:43 PM
this is my only problem so far and it comes to the style used on the template that see the posts likes or dislikes.
If you take a look at my forum I changed the width to my needs making it fixed template. when I go here http://www.ushealthy.com/forums/profile.php?do=helpfulans
and click on the Post Name it will redirect me to that post but it change my entire template width to Fluid which it disorder my entire forum at the Wordpress page I have this forum triggered at or even the forum itself.
Please take a look at the images below
http://i1145.photobucket.com/albums/o520/ASolis11/post_name_zpsa0a5df54.jpg
This image is after I click on Post Name Link
http://i1145.photobucket.com/albums/o520/ASolis11/view_single_post_zps840fd4f1.jpg
My question to this is how can I adjust that to be the same as the forum width?
thanks Ted
Ted S
04-06-2013, 08:07 AM
My question to this is how can I adjust that to be the same as the forum width?
I'm not entirely sure what's happening here... The top posts page merely links to your standard showthread display which, aside from the rating bit, is unaltered. How does this page look when you view it directly (click on a post #)? Without the addon?
usHealthy
04-06-2013, 02:32 PM
Thanks for your answer Ted.
I followed on your suggestion and the showthread display the same width as your plugin (clicking the post #)
Now I know is nothing to do with your mod but can you please tell me how to make those changes to the showthread width please..
Thanks so much if you can and if not thanks so much too for this great mod mate.
god bless
Simon Lloyd
04-06-2013, 04:33 PM
You must have changed the width of the container in the SHOWTHREAD template, if you have "auto" in there or a size greater than the width of the outside container then that can happen.
usHealthy
04-06-2013, 07:56 PM
I fixed it placing a margin to it
<body style="margin:0px 300px 0px 300px" onload="self.focus()">
Thanks and God Bless
muscleandbrawn
07-31-2013, 02:09 PM
Out of the blue when members click on the link from their drop down menu to a specific helpful post, they are sent to a white page that says "page not found."
Anyone know why this happens? I'd pay for a fix if anyone can repair this.
EDIT: It's actually the pretty URLs that went down. Ignore.
Ted S
07-31-2013, 08:21 PM
Ignored :D
aciurczak
11-18-2013, 02:08 AM
One of my users let me know today that the helpful answers page:
yoursite.com/forumfolder/helpfulanswers.php
Is showing posts from protected areas in the site; the queries do not seem to be taking into account user permissions in what posts they show. Is this is a known problem, or is it something that I can fix?
- Alex
Simon Lloyd
11-18-2013, 03:31 AM
Hmmmm just checked, it does indeed show post titles and the helpful answer results for restricted areas but of course clicking the link takes you to the "No permissions" page, but it would be good to omit the results of forums that they are not allowed to see.
Ted S
11-18-2013, 05:55 PM
Hmmmm just checked, it does indeed show post titles and the helpful answer results for restricted areas but of course clicking the link takes you to the "No permissions" page, but it would be good to omit the results of forums that they are not allowed to see.
Voting (and this mod) was intended as something to enhance highly visible, conversational topics rather than be site-wide.
Thus that page is a very simplistic look at what's happening around the forum and left pretty "light" by design. Every feature and check introduces a tradeoff, permissions being a big one.
This may not be ideal for all sites of course but if you have voting going on for highly protected areas, that introduces a number of other potential issues as well (like the fact that admins can see votes), you'll want to turn off that page, profile stats and of course, vote tracking.
Ted S
11-18-2013, 05:56 PM
Is showing posts from protected areas in the site; the queries do not seem to be taking into account user permissions in what posts they show. Is this is a known problem, or is it something that I can fix?
It's a known decision in how the page was built. See my previous reply for more insights as there are other things to consider if you have votes on sensitive areas.
tevbas
05-02-2016, 07:34 AM
Thanks for share but i have one problem please help.
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in [path]/includes/class_bootstrap.php(1419) : eval()'d code on line 67
Warning: Cannot modify header information - headers already sent by (output started at [path]/includes/class_core.php:5615) in [path]/includes/functions.php on line 4513
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.