function escrow_update_old_active_escrows() { //finsih active escrows global $forum_db, $forum_config; $now = time(); $time_delta = $forum_config['o_escrow_duration'] * 60 * 60; $time_delta2 = $forum_config['o_empty_escrow_duration'] * 60 * 60; $query = array('SELECT' => '*', 'FROM' => 'escrows AS e', 'WHERE' => 'e.status=' . BITCOINS_RECEIVED); $result = $forum_db->query_build($query) or error(__FILE__, __LINE__); while ($row = $result->fetch_assoc()) { if ($row['time'] + $time_delta < $now) { change_escrow_status($row['index'], BITCOINS_RELEASED); } } //finish escrows that ware declared but not paid - free addresses $query = array('SELECT' => '*', 'FROM' => 'escrows AS e', 'WHERE' => 'e.status=' . ESCROW_STARTED); $result = $forum_db->query_build($query) or error(__FILE__, __LINE__); while ($row = $result->fetch_assoc()) { if ($row['time'] + $time_delta2 < $now) { change_escrow_status($row['index'], ESCROW_FINISHED); change_address_status_by_address($row['btcaddress'], ADDRESS_FREE); } } }
require FORUM_ROOT . 'include/parser.php'; } $message = preparse_bbcode($message, $errors); } if ($message == '') { $errors[] = $lang_post['No message']; } $now = time(); // Did everything go according to plan? if (empty($errors) && !isset($_POST['preview']) and $fid) { $post_info = array('poster' => $username, 'poster_id' => $forum_user['id'], 'subject' => $subject, 'message' => $message, 'hide_smilies' => '0', 'posted' => $now, 'forum_id' => $fid, 'forum_name' => $cur_posting['forum_name'], 'update_user' => true, 'update_unread' => true, 'visibility' => '4'); $new_tid = escrow_publish_topic_problem($post_info); //przypisuje escrow okreslone id problemu set_escrow_problemid($_SESSION['escrowinfo']['index'], $new_tid); // zmiana statusu escrow na PROBLEM_REPORTED change_escrow_status($_SESSION['escrowinfo']['index'], PROBLEM_REPORTED); $problem_link = FORUM_ROOT . 'viewtopic.php?id=' . $new_tid; //wyslij wiadomosc o zgloszeniu problemu escrow_notify_problem_occured($_SESSION['escrowinfo'], $problem_link); //zanotuj ze w tym escrow wystapil problem note_problem_occured($_SESSION['escrowinfo']['index']); //zanotuj powod problemu i zadane rozwiazanie if ($_POST['claim_reason'] == 'NOT_RECEIVED') { $claim_reason = NOT_RECEIVED; } else { if ($_POST['claim_reason'] == 'FALSE_DESCRIPTION') { $claim_reason = FALSE_DESCRIPTION; } } if ($_POST['claim_action'] == 'FULL_REFUND') { $claim_action = FULL_REFUND;