// COINS DONATION OPTIONS. if ($donation_option === $donation_option1) { // Checks if coins is enabled in the config or else log this. if ($coins_enabled == true) { // Checks if charname exists. if ($total > 0) { // Donate Rewards Coins I. if ($amount == $donatecoinamount1) { // Checks if coins option 1 is enabled in the config or else make a log. if ($coins1_enabled == true) { // Checks if the character is online and telnet is enabled. if ($onlinearray == 1 && $use_telnet == true) { // If character is online lets send some telnet commands. $telnet->init(); echo $telnet->write("give " . $charname . " " . $item_id . " " . $donatecoinreward1 . ""); echo $telnet->disconnect(); // TODO: need to check if this is closing the connection. } else { try { // Does the character already have the item ? $sql_have_item = $connection->prepare('SELECT owner_id FROM items WHERE item_id = :item_id AND owner_id = :charId AND loc = :invertory '); $sql_have_item->execute(array(':item_id' => $item_id, ':charId' => $charId, ':invertory' => $invertory)); $sql_have_item_fetch = $sql_have_item->fetchAll(); $exist = count($sql_have_item_fetch); } catch (PDOException $e) { // Local file reporting. // Logging: file location. $local_log_file = $log_location_ipn; // Logging: Timestamp $local_log = '[' . date('m/d/Y g:i A') . '] - '; // Logging: response from the server.