Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function final_post($user_id, $session_id, $ip, $host_id, $ppm, $mode, $total_time, $amount)
- {
- global $DB, $PREFS;
- //?action=periodic&user_id=USER_ID&session_id=SESSION_ID&ip=IP&host_id=HOST_ID&ppm=PPM&mode=MODE&total_time=TOTAL_TIME&amount=AMOUNT
- //get session info
- $result = $DB->query("SELECT * FROM " . DB_PREFIX . "sessions WHERE session_id='$session_id' LIMIT 1");
- $obj = $DB->fetch_object($result);
- $holdup = $obj->holdup;
- $credit = ($holdup /10 ) - $amount;
- if ($credit > 0)
- {
- $newcredits = $credit * 10;
- // credit member with remaining of time
- $DB->query("UPDATE ".DB_PREFIX."members SET totalcredits=totalcredits+'$newcredits' WHERE hostname='$user_id' LIMIT 1");
- //update sessions table
- $DB->query("UPDATE " . DB_PREFIX . "sessions SET amount='$amount', duration='$total_time' WHERE session_id='$session_id'");
- // credit model with credits
- if($mode = 2)
- {
- $creditsearned = (GCHAT_COMM/100) * ($amount * 10);
- $DB->query("UPDATE ".DB_PREFIX."members SET creditsearned=creditsearned+'$creditsearned' WHERE hostname='$host_id' LIMIT 1");
- }elseif($mode=3)
- {
- $creditsearned = (PCHAT_COMM/100) * ($amount * 10);
- $DB->query("UPDATE ".DB_PREFIX."members SET creditsearned=creditsearned+'$creditsearned' WHERE hostname='$host_id' LIMIT 1");
- }
- }
- //$fp = fopen('vars.txt','a');
- //fwrite($fp, date('m-d-Y H:i:s').' '.$action.' '.$user_id.' '.$session_id.' '.$ip.' '.$host_id.' '.$ppm.' '.$mode.' '.$total_time.' '.$amount.' '.$amount.' '.chr(13).chr(10));
- //fclose($fp);
- echo('&accepted=1');
- }
Add Comment
Please, Sign In to add comment