![]() |
|
#1
|
|||
|
|||
|
Reputation points not being given
however, when a user gets a 'good post' or 'bad post' they are not receiving vbplaza points. Any ideas? |
|
#3
|
|||
|
|||
|
Right - but doesn't it give the user points for good/bad reputation?
vbBux Per Good Reputation vbBux Per Bad Reputation Last edited by tavenger5; 04-21-2009 at 11:17 AM. |
|
#4
|
||||
|
||||
|
Not according to the code it has. The rating system is entirely separate than the user reputation. If you search for the word "rep" inside their script, it's not found anywhere.
-CMX |
|
#5
|
|||
|
|||
|
I see what you're saying now. I was referring to vbplaza in the last post, sorry.
Helpful answers does give rep points for helpful answers. The section of code that does this is under "Helpful Answers -- Rep System", in the xml. |
|
#8
|
||||
|
||||
|
Replace the plugin with this code for plugin: helpfulanswers_dorate
Code:
// only run this code if rep is being used AND the feature is enabled for HA
// for good measure we should be sure they aren't rating their own post too
if ($vbulletin->options['reputationenable'] AND $vbulletin->options['helpans_rep_use'] AND $userid != $vbulletin->userinfo['userid']){
// first we setup the reputation type
if($vbulletin->GPC['rank'] AND !$vbulletin->options['helpans_rank_ten']){
$reputation = 'pos';
} else if (!$vbulletin->options['helpans_rank_ten'] AND $vbulletin->GPC['rank'] > 5){
$reputation = 'pos';
} else {
$reputation = 'neg';
}
// check if negative rep is allowed and if so, is it on in HA
if($reputation == 'pos' OR ($reputation == 'neg' AND ($vbulletin->bf_ugp_genericpermissions['cannegativerep'] AND $vbulletin->options['helpans_rep_neg']))){
// now we get the user's info
$userinfo = fetch_userinfo($postinfo['userid']);
cache_permissions($userinfo);
if ($reputation == 'pos')
{
// grab points
$points = $userinfo['permissions']['vbbux_pergoodrep'];
}
else
{
// grab points
$points = $userinfo['permissions']['vbbux_perbadrep'];
}
@vbplaza_quick_add_points($userinfo['userid'], $points);
// then we get their rep power
if($vbulletin->options['helpans_rep_solid'] AND $vbulletin->options['helpans_rep_solidnum']){
// options say to use a predefined score
$score = $vbulletin->options['helpans_rep_solidnum'];
if($reputation == 'neg'){ $score = $score * -1; }
} else {
// options say to use the user's real score
require_once(DIR . '/includes/functions_reputation.php');
$score = fetch_reppower($vbulletin->userinfo, $permissions, $reputation);
if($vbulletin->options['helpans_rep_part']){
// options say to diminish the power of the real score
$score = $score * $vbulletin->options['helpans_rep_partnum'];
}
}
$userinfo['reputation'] += $score; // update the score
// Determine this user's reputationlevelid.
$reputationlevel = $db->query_first_slave("
SELECT reputationlevelid
FROM " . TABLE_PREFIX . "reputationlevel
WHERE $userinfo[reputation] >= minimumreputation
ORDER BY minimumreputation
DESC LIMIT 1
");
// init user data manager
$userdata =& datamanager_init('User', $vbulletin, ERRTYPE_STANDARD);
$userdata->set_existing($userinfo);
$userdata->set('reputation', $userinfo['reputation']);
$userdata->set('reputationlevelid', intval($reputationlevel['reputationlevelid']));
$userdata->pre_save();
if($reputation == 'pos'){
$rate_reason = $vbphrase['helpfulans_rate_pos'];
} else {
$rate_reason = $vbphrase['helpfulans_rate_neg'];
}
/*insert query*/
$db->query_write("
INSERT IGNORE INTO " . TABLE_PREFIX . "reputation (postid, reputation, userid, whoadded, reason, dateline)
VALUES ($postid, $score, ". $postinfo['userid'] .", " . $vbulletin->userinfo['userid'] . ", '". $rate_reason ."' ,'" . TIMENOW . "')
");
$userdata->save();
-CMX |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|