Quote:
Originally Posted by teedizz
is it possible to where when someone hits the tahnk you button, it adds to your reputation? Im willing to pay for the hack if need be but I have to see proff that you can make it work....contact me if you can do so
|
actually, it's very easy. althou i don't have "thank you" hack install on my board, by looking at the hack, you can add a query to insert to reputation table and update reputation field in user table when a use click on thank you button.
Of course, you must have "thank you" hack installed.
FIND: (in newreply.php)
PHP Code:
$DB_site->query("
INSERT INTO ". TABLE_PREFIX ."thanks
(userid, username, date, threadid)
VALUES ('$bbuserinfo[userid]', '" . addslashes($bbuserinfo[username]) . "', " . TIMENOW . ", '$threadid')");
BELOW, ADD:
PHP Code:
$getreplevel = $DB_site->query_first("
SELECT reputationlevelid
FROM " . TABLE_PREFIX . "reputationlevel
WHERE $posts[userid] >= minimumreputation
ORDER BY minimumreputation
DESC LIMIT 1
");
$replevelid = intval($getreplevel['reputationlevelid']);
$DB_site->query_first("
UPDATE " . TABLE_PREFIX . "user
SET reputation = reputation+1,
reputationlevelid = $replevelid
WHERE userid = $posts[userid]
");
$DB_site->query("
INSERT INTO ". TABLE_PREFIX ."reputation
(postid, userid, reputation, whoadded, reason, dateline)
VALUES ('$posts[postid]', '$posts[userid]', '0', '$bbuserinfo[userid]', '', " . TIMENOW . ")");
it updates 2 table, user + reputation.
note that this add-on has not been tested.