Changeset 178 for minimanager/scripts/gen_lib.php
- Timestamp:
- Dec 23, 2007, 2:55:36 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
minimanager/scripts/gen_lib.php
r142 r178 13 13 function send_ingame_mail($to, $from, $subject, $body, $gold = 0, $item = 0, $stack = 1){ 14 14 global $lang_global, $characters_db, $realm_id; 15 15 16 16 $sql_0 = new SQL; 17 17 $sql_0->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 18 18 19 19 $result = $sql_0->query("SELECT MAX(`id`) FROM item_text"); 20 20 $item_page_id = ($sql_0->result($result, 0)) + 1; … … 24 24 $mail_id = ($sql_0->result($result, 0)) + 1; 25 25 26 26 $item_guid = ($item) ? gen_item_instance($to, $item, $stack) : 0; 27 27 28 $result = $sql_0->query("INSERT INTO mail (id,messageType,sender,receiver,subject,itemTextId,item_guid,item_template,expire_time,deliver_time,money,cod,checked) 29 VALUES ($mail_id, 0, '$from', '$to', '$subject', '$item_page_id', '$item_guid', '$item', '".(time() + (30*24*3600))."','".(time()+5)."', '$gold', 0, 0)"); 30 28 if ($item == 0) { 29 $has_items = 0; 30 } else { 31 $has_items = 1; 32 } 33 34 $result = $sql_0->query("INSERT INTO mail (id,messageType,sender,receiver,subject,itemTextId,has_items,expire_time,deliver_time,money,cod,checked) 35 VALUES ($mail_id, 0, '$from', '$to', '$subject', '$item_page_id', '$has_items', '".(time() + (30*24*3600))."','".(time()+5)."', '$gold', 0, 0)"); 36 37 if ($has_items) { 38 $result = $sql_0->query("INSERT INTO mail_items (mail_id,item_guid,item_template) 39 VALUES ($mail_id, '$item_guid', '$item')"); 40 } 41 31 42 if ($result) { 32 33 43 $sql_0->close(); 44 return $mail_id; 34 45 } else { 35 46 $sql_0->close(); … … 54 65 WHERE entry = '$item_id'"); 55 66 $item_template = $sql_1->fetch_row($result); 56 67 57 68 if ($item_template[1] <= 1) $stack = 1; 58 69 59 70 $item_data = array( 60 71 'OBJECT_FIELD_GUID' => $guid, … … 82 93 'ITEM_FIELD_MAXDURABILITY' => $item_template[2].' ' 83 94 ); 84 95 85 96 $data = implode(" ",$item_data); 86 97 87 98 $result = $sql_1->query("INSERT INTO item_instance (guid, owner_guid, data) VALUES ($guid, '$owner','$data')"); 88 99 89 100 if ($result) { 90 101 $sql_1->close();
Note:
See TracChangeset
for help on using the changeset viewer.