Hi, I needed to make thankyoulike clicks to also add reputation points, so I came up with the following code which I wanted to share in case someone else needs it:
I add it in public_html/thankyoulike.php file just above this line:
Works perfectly (in tapatalk as well) but needs to be added after every update of the Thank you / Like plugin. If there is a better way to do it, I will be grateful to know.
// Build array of reputation data.
$reputation = array(
"uid" => intval($post['uid']),
"adduid" => $mybb->user['uid'],
"pid" => intval($post['pid']),
"reputation" => 1,
"dateline" => TIME_NOW,
"comments" => ''
);
// Insert a new reputation
$db->insert_query("reputation", $reputation);
// Update user
$db->write_query("UPDATE ".TABLE_PREFIX."users SET reputation=reputation+1 WHERE uid=".intval($post['uid']));
I add it in public_html/thankyoulike.php file just above this line:
// Update tyl count in posts and threads and users and total
Works perfectly (in tapatalk as well) but needs to be added after every update of the Thank you / Like plugin. If there is a better way to do it, I will be grateful to know.