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)

penmai.com 06-25-2012 07:36 PM

Thank you for your immediate reply.

Can you tell me, whats the exact code i have to change, to get the feature?

Ted S 06-25-2012 11:31 PM

Quote:

Originally Posted by penmai.com (Post 2342851)
Thank you for your immediate reply.

Can you tell me, whats the exact code i have to change, to get the feature?

In the xml file there's an existing set of functions that check for a user's rights to vote in the hook postbit_display_complete. A very similar routine exists in the rate function of helpfulanswers.php. You'll want to change both so only approved users see the option to vote on the frontend and so that no one can trick a vote in on the backend.

Beyond that I can't teach you how to code but there are many great resources out there that will... Start hacking and searching, that's the best way to learn.

Impromptu 07-11-2012 11:49 PM

Quote:

Originally Posted by Eole (Post 2336297)
Hi,

When someone vote on a post, the thread appears as many time as there are posts that have been voted (+ or -). Who to avoid this duplicates ?

Thanks.

First of all thanks for the Mod.

I have the same problem as Eole in that while it works fine, it replicates the thread like three times. If I switch disable Helpful Answers the replicated threads are deleted.

I read the suggestions but really dont get it. :(

Ted S 07-12-2012 02:05 AM

Quote:

Originally Posted by Impromptu (Post 2347132)
First of all thanks for the Mod.

I have the same problem as Eole in that while it works fine, it replicates the thread like three times. If I switch disable Helpful Answers the replicated threads are deleted.

I read the suggestions but really dont get it. :(

He stopped responding [can't say I blame him] so we never sorted out the issue for his forum... Back to square one.

Take a look at the table helpfulpost and a post that shows up multiple times. There should be just one entry per postid.

I.E. SELECT COUNT(*) FROM helpfulpost WHERE postid = '12345';

Impromptu 07-12-2012 02:01 PM

Quote:

Originally Posted by Ted S (Post 2347154)
He stopped responding [can't say I blame him] so we never sorted out the issue for his forum... Back to square one.

Take a look at the table helpfulpost and a post that shows up multiple times. There should be just one entry per postid.

I.E. SELECT COUNT(*) FROM helpfulpost WHERE postid = '12345';

Hey Ted,

First of all thanks for the response.

Unfortunately, I'm a layman in I.T and have no idea what you mean in terms of table?

I might just try to find an easier Mod, which is ashame as I 'liked' this one

But thanks again for responding

Ted S 07-12-2012 04:14 PM

Gotcha... Well best of luck with your site!

Eole 07-22-2012 01:39 PM

Quote:

Originally Posted by Ted S (Post 2339116)
And when you disable just this mod that goes away, correct?

Hi Ted S,

Yes, when disabling the mod, everything looks right.

I found the options that generate duplicate entries in the forum page :
On your forum, when activating "Order By Helpful Answers Votes?" (set to yes), every thread that have multiple post with a note, the thraed appears multiple times in the thread page of the forum.

I have disable this option at this time (not useful for my forum).

I have an other question : did you think about sorting posts in a thread depending on the number of positive/negative vote. this could give users show rapidly the bests answers (when multiple) just below the question. I'm just working on it, but maybe not with the best way than you.

Bye.

faisaly.com 08-11-2012 04:42 PM

Hello all .
There is a nasty bug with this hack .
If someone tries to copy the link of a yes/no button which is used for rating while he is logged in , and then logs out and enters it in a browser, the rate gets accepted!!
(suppose the link to the yest button is like this : http://forum.ustmb.ir/helpfulanswers...id=5662&rank=1 , if you copy this to your address bar and press enter, the rate will be accepted! while you are not logged in at all!)
This causes mischievous users to abuse the system for giving positive or negative rates as they wish!
would someone please think about it ?

Ted S 08-11-2012 07:02 PM

1 Attachment(s)
Quote:

Originally Posted by faisaly.com (Post 2356244)
Hello all .
There is a nasty bug with this hack .
If someone tries to copy the link of a yes/no button which is used for rating while he is logged in , and then logs out and enters it in a browser, the rate gets accepted!!
(suppose the link to the yest button is like this : http://forum.ustmb.ir/helpfulanswers...id=5662&rank=1 , if you copy this to your address bar and press enter, the rate will be accepted! while you are not logged in at all!)
This causes mischievous users to abuse the system for giving positive or negative rates as they wish!
would someone please think about it ?

Interesting.... There's 5 of 6 different options that would stop this from happening like if you had a post minimum, votes per day, etc. but in the absence of those it looks like you are correct. And it's gone unnoticed for years too :D

Simple fix with the attached xml and voting script.

I'll test around more this evening and clean it up for a release.

Ted S 08-12-2012 12:03 AM

HA version 2.4.2 has been released this evening to fix two small but important bugs.

The first resolves issues where selected voting types should show strange characters in the ajax posted votes [i.e. %1$s voted...]. This changes phrases only.

The second and more devious issue was spotted by faisaly.com in which users could copy a vote link, logout and use it multiple times to game the system. Forums with minimum post counts and voting limits were not impacted but given the potential impact it's suggested all forums update.

Changes are made to the XML file and /upload/helpfulanswers.php only.

No templates were modified.


All times are GMT. The time now is 06:50 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.02548 seconds
  • Memory Usage 1,751KB
  • 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
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (4)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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