*#i', '$1', $this->post['message']); $helpful_answers = ''; $helpfulthisthread = 0; if($forum['helpfulanswerbits']){ $helpfulthisthread = 1; } $helpans_incforums = array(); $helpans_excforums = array(); if(strlen($this->registry->options['helpans_incforums']) > 1){ $helpans_incforums = preg_split("/,/", $this->registry->options['helpans_incforums'], -1, PREG_SPLIT_NO_EMPTY); } if(strlen($this->registry->options['helpans_excforums']) > 1){ $helpans_excforums = preg_split("/,/", $this->registry->options['helpans_excforums'], -1, PREG_SPLIT_NO_EMPTY); } if($helpans_incforums AND !in_array($post['threadid'],$helpans_incforums)){ $helpfulthisthread = 0; } if($helpans_excforums AND in_array($post['threadid'],$helpans_excforums)){ $helpfulthisthread = 0; } $post['habadrank'] = $post['hatotalrank'] - $post['hagoodrank']; // first we check if the forum supports helpful answers before wasting any resources // we should also be sure this isn't an announcement if($helpfulthisthread AND THIS_SCRIPT != 'announcement'){ $show['helpfulanswer'] = true; $show['rate_helpfulanswer'] = false; // pull the banned user list into an array if (trim($this->registry->options['helpans_banned']) != '') { $helpful_banned = preg_split("/,/", $this->registry->options['helpans_banned'], -1, PREG_SPLIT_NO_EMPTY); } else { $helpful_banned = Array('0'); } // lets see if they can rate // cant have rated before; must be a member if(!$post['helpfulanswerid'] AND $this->registry->userinfo['userid']){ if(!$this->registry->options['helpans_self'] AND $this->registry->userinfo['userid'] == $post['userid']){ // cant rate their own post unless enabled $show['rate_helpfulanswer']=false; } else if (in_array($this->registry->userinfo['userid'],$helpful_banned)) { // cant be banned $show['rate_helpfulanswer']=false; } else if ($this->registry->options['helpans_min'] AND $this->registry->userinfo['posts'] < $this->registry->options['helpans_minnum']) { // might need to have more post count $show['rate_helpfulanswer']=false; } else { // all good, keep going $show['rate_helpfulanswer']=true; } // cant vote and no votes done, dont show anything if(!$show['rate_helpfulanswer'] && !$post['totalrank']){ $show['helpfulanswer'] = false; } } if($post['goodrank'] AND $post['totalrank']){ $post['avgrank'] = $post['goodrank'] / $post['totalrank']; // avg rank for 10 point scale } else { $post['avgrank'] = ''; } $post['badrank'] = $post['totalrank'] - $post['goodrank']; if($post['goodrank'] > $post['badrank']){ $post['helpfulgood'] = 1; } else { $post['helpfulgood'] = 0; } $post['overallrank'] = $post['goodrank'] - $post['badrank']; // may end up disabling this all for the first post if($this->registry->options['helpans_hidefirst'] AND $post['postid'] == $thread['firstpostid']){ $show['helpfulanswer'] = false; $show['rate_helpfulanswer'] = false; } ($hook = vBulletinHook::fetch_hook('helpfulanswers_show_normal')) ? eval($hook) : false; // handle 10-point option if($this->registry->options['helpans_rank_ten']){ // fix up any long values if($post[avgrank] > 0) { $post[avgrank] = number_format($post[avgrank], 2, '.', ''); } if($post[totalrank] > 0) { $post[totalrank] = number_format($post[totalrank], 2, '.', ''); } $helpful_answers_template = 'helpful_answers_ten'; } else if($this->registry->options['helpans_txtimg'] == 4 OR $this->registry->options['helpans_txtimg'] == 5){ $helpful_answers_template = 'helpful_answers_roll'; } else { $helpful_answers_template = 'helpful_answers'; } // handle text & image options if($this->registry->options['helpans_txtimg'] == 2){ // thumbs $helpfulanswer_yes = '
'; $helpfulanswer_no = '
'; } else if($this->registry->options['helpans_txtimg'] == 3){ // plus - minus $helpfulanswer_yes = '
'; $helpfulanswer_no = '
'; } else { // default to plain text $helpfulanswer_yes = $vbphrase['helpfulanswer_yes']; $helpfulanswer_no = $vbphrase['helpfulanswer_no']; } if($this->registry->options['helpans_onevote'] AND $this->registry->userinfo['userid']){ $helpfulvote = $this->registry->db->query_first_slave(" SELECT helpfulanswerid as uid FROM " . TABLE_PREFIX . "helpfulanswer as helpfulanswer WHERE threadid = " . $post['threadid'] . " AND userid = ". $this->registry->userinfo['userid'] ." LIMIT 1 "); if($helpfulvote['uid']){ $show['rate_helpfulanswer'] = false; } } $post['goodrank'] = intval($post['goodrank']); $post['badrank'] = intval($post['badrank']); $post['totalrank'] = intval($post['totalrank']); if(!$this->registry->options['helpans_manual']){ $templater = vB_Template::create($helpful_answers_template); $templater->register('post', $post); $templater->register('helpfulanswer_yes', $helpfulanswer_yes); $templater->register('helpfulanswer_no', $helpfulanswer_no); $template_hook['postbit_messagearea_start'] .= $templater->render(); } else { $templater = vB_Template::create($helpful_answers_template); $templater->register('post', $post); $templater->register('helpfulanswer_yes', $helpfulanswer_yes); $templater->register('helpfulanswer_no', $helpfulanswer_no); $templatevalues['helpful_answers'] = $templater->render(); vB_Template:
reRegister('postbit_legacy', $templatevalues); vB_Template:
reRegister('postbit', $templatevalues); } if($this->registry->options['helpans_hidelow'] AND (($post['goodrank'] - $post['totalrank']) < $this->registry->options['helpans_hidelownum']) ){ $templater = vB_Template::create('helpful_answers_hidelowstart'); $templater->register('post', $post); $template_hook['postbit_start'] .= $templater->render(); $templater = vB_Template::create('helpful_answers_hidelowend'); $template_hook['postbit_end'] .= $templater->render(); } // now we handle the message for the most helpful post if($this->registry->options['helpans_mosthelp_post'] AND $post['threadid'] > 1){ $helpfulanswer = $this->registry->db->query_first_slave(" SELECT postid,goodrank,totalrank FROM " . TABLE_PREFIX . "helpfulpost as helpfulpost WHERE threadid = " . $post['threadid'] . " ORDER BY goodrank/totalrank DESC LIMIT 1 "); if($helpfulanswer['goodrank'] >= $this->registry->options['helpans_mosthelp_post_cnt']){ $templater = vB_Template::create('helpful_answers_mosthelp_post'); $template_hook['postbit_end'] .= $templater->render(); } } }

hoffentlich gehts an meinem pc zuhause normal




hoffentlich gehts an meinem pc zuhause normal