PDA

View Full Version : Tieing the Thank You hack with Reputation


teedizz
04-22-2005, 10:45 PM
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

teedizz
04-28-2005, 06:38 PM
bump...tha last coder couldnt do it

tnguy3n
04-28-2005, 09:10 PM
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)

$DB_site->query("
INSERT INTO ". TABLE_PREFIX ."thanks
(userid, username, date, threadid)
VALUES ('$bbuserinfo[userid]', '" . addslashes($bbuserinfo[username]) . "', " . TIMENOW . ", '$threadid')");

BELOW, ADD:

$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.

Marco van Herwaarden
04-29-2005, 03:54 AM
WHERE $posts[userid] >= minimumreputation
I didn't have my coffee yet, but you are selecting records that have a minimumreputation less-equal then a userid?

(anyway the test should be the other way round "tablefield <= value".

teedizz
04-29-2005, 07:39 AM
thank you tnguy3n ...i will try it out.....so when someone hits the thank you button it will add to your reputation then right? Thats what the changes you provided will do?

that hack isnt gonna work for my hack..cause my hack doesnt have the same stuff in that file

teedizz
04-30-2005, 06:47 PM
bump