vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Add-On Releases - [AJAX] Helpful Answers - Post Rating System (plus many sub-features) (https://vborg.vbsupport.ru/showthread.php?t=204117)

kawe 08-17-2009 12:15 AM

Quote:

Originally Posted by Ted S (Post 1868801)
Having a query on every post of a thread is a terrible idea that would add huge load to servers.

In 2.0 I will address this issue with some additional updates to the data structure but won't be releasing that version until I get enough new features to warrant it.

i have forum using Post Thank You Hack
and is okay not make my forum slowly :D


Teds U the best

hubie 08-17-2009 01:35 AM

Quote:

Originally Posted by Ted S (Post 1868799)
Yes but it will require a code edit to product-helpful_answers.xml as follows:

Find:

Code:

if($this->registry->options['helpans_hidefirst'] AND $this->post['postid'] == $this->thread['firstpostid']){
      $show['helpfulanswer'] = false;
      $show['rate_helpfulanswer'] = false;
    }

Change to:

Code:

if($this->post['postid'] != $this->thread['firstpostid']){
      $show['helpfulanswer'] = false;
      $show['rate_helpfulanswer'] = false;
    }


I will try that. Thanks for the fast reply and support :up:

sockwater 08-18-2009 11:37 PM

Quote:

Originally Posted by Ted S (Post 1868801)
Having a query on every post of a thread is a terrible idea that would add huge load to servers.

Should be able to do it with one query per page view. Once you have all the postids for the posts that will be displayed on the page, then pull all votes for all posts at once and sort them out in php. (If you're interested in implementing it :))

Something along these lines. (Code untested, likely has typos)
PHP Code:

// an array of postids for all posts shown on this page of thread
$postids;

$votes $db->query_read("
    SELECT pv_vote.*, user.username
    FROM " 
TABLE_PREFIX "pv_vote AS pv_vote
    LEFT JOIN " 
TABLE_PREFIX "user AS user ON (user.userid = pv_vote.userid)
    WHERE pv_vote.postid IN (" 
implode(','$postids) . ")
"
);
$postvotes = array();
while (
$vote $db->fetch_array($votes))
{
    if (!isset(
$postvotes["$vote[postid]"]))
    {
        
$postvotes["$vote[postid]"] = array(
            
'totalscore' => 0,
            
'votecount'  => 0,
            
'votes'      => array(),
        );
    }
    
$postvotes["$vote[postid]"]['totalscore'] += $vote['vote'];
    ++
$postvotes["$vote[postid]"]['votecount'];
    
$postvotes["$vote[postid]"]['votes'][] = array(
        
'username' => $vote['username'],
        
'userid'   => $vote['userid'],
        
'vote'     => $vote['vote'],
    );



Ted S 08-19-2009 12:35 AM

Thanks sockwater however I don't need the IDs of the posts in the thread but rather of each post from each user who has posted. There is a pretty simple query for this but it involves restructing the vote data which is why I am holding off on it until a bigger update.

But I am very amped about adding this... think it will be a great data point for people's postbit block.

kawe 08-19-2009 04:44 AM

Quote:

Originally Posted by Ted S (Post 1870179)
Thanks sockwater however I don't need the IDs of the posts in the thread but rather of each post from each user who has posted. There is a pretty simple query for this but it involves restructing the vote data which is why I am holding off on it until a bigger update.

But I am very amped about adding this... think it will be a great data point for people's postbit block.

yeah this is a good feature
coz, people can see how many have GOOD REP and BAD REP on all their post
thanks teds for next update ... i cant wait hehehehe

Ted S 08-19-2009 03:26 PM

Quote:

Originally Posted by kawe (Post 1870250)
yeah this is a good feature
coz, people can see how many have GOOD REP and BAD REP on all their post
thanks teds for next update ... i cant wait hehehehe

It's on the to do list.

SnakeV 08-19-2009 04:42 PM

Quote:

Originally Posted by kawe (Post 1870250)
yeah this is a good feature
coz, people can see how many have GOOD REP and BAD REP on all their post
thanks teds for next update ... i cant wait hehehehe

The idea of kawe is really very good, would be great if is possible to put it in the postbit below post count the total of points that the user have.

This option will be great especially with the scaled 1-10 point ranking, for example if a user send 10 points and other 5 points the points can be counted and display it in the postbit with:
Points: 15.

Thank you Ted your plugins are great :o

Question:
It is possible to put the possibility for the users to rating the thread (first post).

(I use this hack for an especial use, not for an answer forum).

Ted S 08-19-2009 08:05 PM

Quote:

Originally Posted by SnakeV (Post 1870550)
The idea of kawe is really very good, would be great if is possible to put it in the postbit below post count the total of points that the user have.

This option will be great especially with the scaled 1-10 point ranking, for example if a user send 10 points and other 5 points the points can be counted and display it in the postbit with:
Points: 15.

Thank you Ted your plugins are great

This feature will just be a variable that you can stick anywhere in the postbit you like.

Quote:

Originally Posted by SnakeV (Post 1870550)
It is possible to put the possibility for the users to rating the thread (first post).

(I use this hack for an especial use, not for an answer forum).

That's a different mod as the ratings are entirely different BUT I was alpha testing it last night.

Megatr0n 08-19-2009 08:11 PM

Ted, I have installed this plugin but I can't find where you rate them inside a thread?

Ted S 08-19-2009 08:15 PM

Quote:

Originally Posted by Megatr0n (Post 1870655)
Ted, I have installed this plugin but I can't find where you rate them inside a thread?

You don't... This is all post rating.

Thread ratings will be soon and a different mod.


All times are GMT. The time now is 09:34 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.03385 seconds
  • Memory Usage 1,764KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (5)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