vb.org Archive

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

juzz86 02-26-2014 07:30 AM

Quote:

Originally Posted by systutorials (Post 2288448)
All good found it under postbit_legacy. Using the {vb:raw post.goodrank} variable works well. Thanks again

Quote:

Originally Posted by systutorials (Post 2288502)
found it, I used {vb:raw post.hagoodrank}
sorry for all the posts :)

Quote:

Originally Posted by Ted S (Post 2317871)
post.totalrank is a post variable so it's not strange that it only shows what that post got :D

If you scroll back to the first page of the mod there's a list of accessible variables with brief descriptions. I don't recall them all off hand but if I had any common sense when making this version it would have been post.hatotalrank

Ted, hi from Australia.

Mate I have been using your plugin for a while now, with great results. I scoured the thread time and time again going over the posts of those who've tried to do this before me, as I'm having the same trouble.

I am attempting to add a 'good' tally to the postbit. Getting it into place and stuff is fine, but I cannot for the life of me seem to find the correct variable to put here.

Here's the postbit:

https://vborg.vbsupport.ru/external/2014/02/6.png

And here's the template source (I have this stacked under the 'thanks' hack postbit template):

Code:

<vb:if condition="$post['userid']">
    <vb:if condition="$post['post_thanks_thanked_times'] == 1">
        <dd style="white-space:nowrap; display:inline; float: {vb:stylevar left};">{vb:rawphrase post_thanks_time_post}</dd>
    <vb:elseif condition="$post['post_thanks_thanked_posts'] == 1" />
        <dd style="white-space:nowrap; display:inline; float: {vb:stylevar left};">{vb:rawphrase post_thanks_times_post, {vb:raw post.post_thanks_thanked_times_formatted}}</dd>
    <vb:else />
        <dd style="white-space:nowrap; display:inline; float: {vb:stylevar left};">{vb:rawphrase post_thanks_times_posts, {vb:raw post.post_thanks_thanked_times_formatted}}</dd><br>
        <dd style="white-space:nowrap; display:inline; float: {vb:stylevar left};">Helped {vb:raw post.hagoodrank} Times</dd>
    </vb:if>
</vb:if>

Doesn't seem to matter which variable I use, 'hagoodrank', 'hatotalrank', 'totalrank', 'goodrank', you name it - I just can't seem to find the user's global tally of 'good' votes.

I didn't really want to trouble you with it, especially as it's technically an unsupported mod, but mate I am just about out of options. I quoted the bloke above who got it working with post.hagoodrank - that isn't working for me.

Any help greatly appreciated!

Justin

Ted S 02-26-2014 09:04 PM

1 Attachment(s)
Quote:

Originally Posted by juzz86 (Post 2483792)
Mate I have been using your plugin for a while now, with great results. I scoured the thread time and time again going over the posts of those who've tried to do this before me, as I'm having the same trouble.

I am attempting to add a 'good' tally to the postbit. Getting it into place and stuff is fine, but I cannot for the life of me seem to find the correct variable to put here.

You just had to go there and open Pandora's box... :D

So it looks like the variables were setup right (post.hagoodrank & post.hatotalrank), but the routine for updating votes was completed bugged up... results were always 0 because results were never properly saved.

I've fixed that, updating upload/helpfulanswers.php

Also found another bug in switching back & forth in voting types and templates, fixed that in the xml file.

And finally added a resync routine to get all the old votes from members updated, so you don't have zeros on people with vote history, also the xml file.

Note: This is a lightly tried update from my working-version code with whatever else I've done since 2.4.2 so please proceed with caution.

juzz86 02-26-2014 10:11 PM

Quote:

Originally Posted by Ted S (Post 2483943)
You just had to go there and open Pandora's box... :D

So it looks like the variables were setup right (post.hagoodrank & post.hatotalrank), but the routine for updating votes was completed bugged up... results were always 0 because results were never properly saved.

I've fixed that, updating upload/helpfulanswers.php

Also found another bug in switching back & forth in voting types and templates, fixed that in the xml file.

And finally added a resync routine to get all the old votes from members updated, so you don't have zeros on people with vote history, also the xml file.

Note: This is a lightly tried update from my working-version code with whatever else I've done since 2.4.2 so please proceed with caution.

You Sir, are a champion. If you could see the parallels with 'opening Pandora's box' and my life yesterday, you would be laughing about as much as I am now :up:

Truly appreciative of your efforts and quick fix mate - thankyou. I will have a go at this tonight after work and report back my findings. Many thanks again for all your efforts :) If you ever find yourself in my neck of the woods, your first beers are on me :up:

Ted S 02-27-2014 01:05 AM

Now that's a damn good offer. Should I ever make it to yourside of the world, expect a PM...

Let me know how the update goes.

juzz86 03-01-2014 05:51 AM

Quote:

Originally Posted by Ted S (Post 2483974)
Now that's a damn good offer. Should I ever make it to yourside of the world, expect a PM...

Let me know how the update goes.

You're on!

Just reporting back mate, 2.5.0 takes care of that and sorts it beautifully. Tally now reflects the helpfulanswers.php page, and is updating on refresh.

Thanks again mate.

Ted S 03-01-2014 11:06 PM

Quote:

Originally Posted by juzz86 (Post 2484392)
You're on!

Just reporting back mate, 2.5.0 takes care of that and sorts it beautifully. Tally now reflects the helpfulanswers.php page, and is updating on refresh.

Thanks again mate.

Fantastic!

yukirina 06-15-2014 10:01 AM

This mod is absolutely fantastic, but is there still no way to undo a vote that you've done on a post?

Ted S 06-15-2014 07:05 PM

Quote:

Originally Posted by yukirina (Post 2502029)
This mod is absolutely fantastic, but is there still no way to undo a vote that you've done on a post?

Nope.

m7sen 06-29-2014 10:15 AM

hello
any upgrade ?

we are in 2014 !

Randhal007 06-29-2014 05:47 PM

Quote:

Originally Posted by m7sen (Post 2504421)
hello
any upgrade ?

we are in 2014 !

i will wait for that too :)

Ted S 06-30-2014 05:21 AM

Quote:

Originally Posted by idnews (Post 2504471)
i will wait for that too :)

Why?

Ted S 06-30-2014 05:23 AM

Quote:

Originally Posted by m7sen (Post 2504421)
hello
any upgrade ?

we are in 2014 !

Upgrade to change / do / add what?

yukirina 07-03-2014 12:30 AM

I'm pretty sure it's not much help posting this, but I'm going to try it anyway by the smallest chance that it's possible.

There's a mod called vBActivity by DragonByte that our forum uses. This module increases activity points of the user rep'ing a post. I tried rep'ing someone's post without a mod and the points increased as expected. But when I used your mod to rep someone's post (helpful answer upvote/downvote), nothing happened. Do you possibly know any solution to this?

Ted S 07-03-2014 01:01 AM

There's no connection between the two mods from this end so voting up a post here won't impact the reputation system there. The solution would be to extend your reputation system to add points by votes which can be done with the included hooks.

yukirina 07-03-2014 01:10 AM

Quote:

Originally Posted by Ted S (Post 2504960)
There's no connection between the two mods from this end so voting up a post here won't impact the reputation system there. The solution would be to extend your reputation system to add points by votes which can be done with the included hooks.

But using a reputation system by vBulletin does affect it, that's why I think there's something that can be tweaked to make it work.

Ted S 07-03-2014 01:47 AM

Quote:

Originally Posted by yukirina (Post 2504961)
But using a reputation system by vBulletin does affect it, that's why I think there's something that can be tweaked to make it work.

Right, like I said, it can almost certainly be done if you so chose to do it.

Conehead555 07-07-2014 05:41 AM

When I use this option:

Enable User Points
If enabled, users will have votes on their posts counted to display in the postbit template, their profile, etc.

What is the variable for using this in the postbit, etc.?

Ted S 07-07-2014 05:53 PM

Quote:

Originally Posted by Conehead555 (Post 2505657)
When I use this option:

Enable User Points
If enabled, users will have votes on their posts counted to display in the postbit template, their profile, etc.

What is the variable for using this in the postbit, etc.?

Yikes, that's really not well labeled, my bad :D

Here's the variables generated, play around to see which paint the right picture you want.

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

GCC LLC 08-24-2014 11:27 PM

Skimmed through but couldn't fine it.

Is there a variable that you can put in postbit that lists the number of votes received by others?

Looking to create a nice list of "most useful members"

QFIT 10-27-2014 05:56 PM

I came to post pretty much the same as the last poster. How do I get a list of the most helpful posters? I think this is more useful than the posters that used the function the most.

Ted S 10-28-2014 03:58 AM

Quote:

Originally Posted by QFIT (Post 2520255)
I came to post pretty much the same as the last poster. How do I get a list of the most helpful posters? I think this is more useful than the posters that used the function the most.

This is not something included but the data is all there (in the user table) waiting for you to build whatever display you want.

QFIT 11-03-2014 01:32 PM

Can you give me the SQL query?

Ted S 11-03-2014 06:01 PM

Quote:

Originally Posted by QFIT (Post 2521106)
Can you give me the SQL query?

There's two columns in the usertable to use:

hagoodrank - which is the number of good rankings
hatotalrank - which is the total votes on threads

You can use either / both to sort as you see fit.

Meestor_X 11-03-2014 06:12 PM

Sorry if this question has already been answered... (TL;DR and I did do a search on this thread and didn't get any relevant hits)

Can a thread be sorted by # of upvotes? That is to say, can the posts with the highest "good" rating be shown first? Are there other sort options too?

Ted S 11-03-2014 07:00 PM

Quote:

Originally Posted by Meestor_X (Post 2521145)
Sorry if this question has already been answered... (TL;DR and I did do a search on this thread and didn't get any relevant hits)

Can a thread be sorted by # of upvotes? That is to say, can the posts with the highest "good" rating be shown first? Are there other sort options too?

Not as a default option.

Thread sorting is assumed to be by date and us hardcoded into the system so while it's very much possible, it requires some manual hacking to accomplish.

Look at line 881 / 919 / 1002 of showthread.php

Meestor_X 11-03-2014 07:27 PM

Thank you for your quick reply!
Alternately, a link to the highest rated answer shown in the first post would be good.
I'm looking to see if there's a substitute for Stack Exchange-type question/answer threads that can be done within VB, and it seems like your Mod might be a workable solution.

Ted S 11-03-2014 07:49 PM

Quote:

Originally Posted by Meestor_X (Post 2521150)
Thank you for your quick reply!
Alternately, a link to the highest rated answer shown in the first post would be good.
I'm looking to see if there's a substitute for Stack Exchange-type question/answer threads that can be done within VB, and it seems like your Mod might be a workable solution.

There is a feature to enable a link to the top post though if you want a true q/a system I'd suggest the hack which will require a couple joins and a few conditionals. Shouldn't be crazy.

Meestor_X 11-03-2014 09:04 PM

Quote:

Originally Posted by Ted S (Post 2521152)
There is a feature to enable a link to the top post though if you want a true q/a system I'd suggest the hack which will require a couple joins and a few conditionals. Shouldn't be crazy.

Very cool! Would you be able to point me to information on that hack?

Ted S 11-04-2014 12:27 AM

Quote:

Originally Posted by Meestor_X (Post 2521164)
Very cool! Would you be able to point me to information on that hack?

Sorry, "it" being a concept. Don't know that it's been actually done.

Cyclist 11-27-2014 08:47 PM

Everything works fine. Thanks!

Is is possible to translate the phrases that appear on the users and the posts? How would that be possible?

ozzy47 11-27-2014 08:53 PM

If the mod is coded to use phrases, you can do it in the Phrase Manager. :)

Ted S 11-28-2014 10:18 PM

Quote:

Originally Posted by ozzy47 (Post 2524549)
If the mod is coded to use phrases, you can do it in the Phrase Manager. :)

And everything in the mod should be set to phrases :D

Shill360 01-13-2015 06:32 AM

Hey Ted,

I've just started using the vBulletin Default Mobile Style on my Forums. Is there an easy way to integrate the helpful_answers into the postbit and postbit_legacy? I just placed {vb:raw helpful_answers} in there, but it doesn't seem to work.

It works perfectly for the desktop theme: http://www.onlinearsenal.com

PJRC 06-12-2015 06:50 AM

Is there any way to use the helpful answers ratings to sort/rank forum search results (search.php)?

ninthbit 06-21-2015 02:23 AM

Quote:

Originally Posted by Ted S (Post 2502090)
Quote:

Originally Posted by yukirina (Post 2502029)
This mod is absolutely fantastic, but is there still no way to undo a vote that you've done on a post?

Nope.

Can that feature be added? With smartphones its real easy to click the wrong vote.

SilverBoy 07-29-2015 08:38 PM

Hi

I want to use this great add-on to maintain this objective.

I have one forum for my correspondents to give me the last news from their places, I want to be able as administrator or any specific group to give point (1 to 10) for every thread one of them makes in that forum.

The point that I don't recognize how to do it until now (I don't make deep research in this big thread), I want the average of points every correspondent get from our votes on his thread depending on the stories that he wrote and if it was fake, rumor or real, then I can filter my huge correspondents team and give real job to those which make good job.

Any Ideas?

sixpackspeak 05-31-2016 05:17 PM

Quote:

Originally Posted by Shill360 (Post 2532202)
Hey Ted,

I've just started using the vBulletin Default Mobile Style on my Forums. Is there an easy way to integrate the helpful_answers into the postbit and postbit_legacy? I just placed {vb:raw helpful_answers} in there, but it doesn't seem to work.

It works perfectly for the desktop theme: http://www.onlinearsenal.com

I would love this as well.

Ted S 05-31-2016 05:33 PM

Quote:

Originally Posted by sixpackspeak (Post 2571503)
I would love this as well.

Do you see the same "helpfulanswers_" templates appearing in your mobile style as the desktop themes?

If so, open up the template for your rating style (topten, etc) and add some characters to the very top, refresh and see if they appear (to see if the template is getting called up at all).

sixpackspeak 05-31-2016 05:44 PM

It is not in the mobile templates. Thanks for replying. I appreciate it.

Ted S 05-31-2016 05:53 PM

Quote:

Originally Posted by sixpackspeak (Post 2571506)
It is not in the mobile templates. Thanks for replying. I appreciate it.

Try copying those templates over to the mobile style. Odds are the script is running fine, it just doesn't have the templates to pull up


All times are GMT. The time now is 04:27 PM.

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.02450 seconds
  • Memory Usage 1,849KB
  • 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
  • (1)bbcode_code_printable
  • (26)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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