コード例 #1
0
ファイル: 1003.php プロジェクト: rwruss/ib3
<?php

require_once './slotFunctions.php';
require_once './objectClass.php';
$slotFile = fopen($gamePath . '/gameSlots.slt', 'rb');
$objFile = fopen($gamePath . '/objects.dat', 'rb');
$thisObj = loadObject($postVals[1], $objFile, 400);
// confirm that the player owns this object
if ($thisObj->get('owner') == $pGameID) {
    include './objects/obj_' . $thisObj->get('oType') . '.php';
} else {
    echo 'You do not own this object';
}
fclose($objFile);
fclose($slotFile);
コード例 #2
0
ファイル: 1002.php プロジェクト: rwruss/ib3
<?php

require_once './slotFunctions.php';
require_once './objectClass.php';
$slotFile = fopen($gamePath . '/gameSlots.slt', 'rb');
$objFile = fopen($gamePath . '/objects.dat', 'rb');
$thisBusiness = loadObject($pGameId, $objFile, 400);
if ($thisBusiness->get('ownedObjects') > 0) {
    $ownedObjects = new itemSlot($thisBusiness->get('ownedObjects'), $slotFile, 40);
    for ($i = 1; $i < sizeof($ownedObjects->slotData); $i++) {
        $thisObject = loadObject($ownedObjects->slotData[$i], $objFile, 400);
        echo 'Object ' . $ownedObjects->slotData[$i] . '<br>';
    }
} else {
    echo 'You do not own anything yet - start buying!';
}
fclose($slotFile);
fclose($objFile);
コード例 #3
0
 }
 fclose($file);
 $data = $parser->parseFeed($output);
 //The table names
 $elements = $data[0];
 //The parsed data
 $attrs = $data[1];
 $element_nr = count($elements);
 $notifications = array();
 for ($i = 0; $i < $element_nr; $i++) {
     $id = $attrs[$i]["id"];
     if (!$id) {
         continue;
     }
     //Check if this row already exists in the table
     $n = loadObject($id, $elements[$i]);
     if ($n === false) {
         //New element, INSERT it into table
         $tmp = array_values($attrs[$i]);
         addslashesextended($tmp);
         if ($HARD_DELETE && $attrs[$i]["del"] == "yes") {
             //Ignoring deleted data
         } else {
             $sql = "INSERT INTO " . $elements[$i] . " (" . implode(',', array_keys($attrs[$i])) . ") VALUES('" . implode("','", $tmp) . "')";
             $db->query($sql) or $db->raise_error();
             #echo $sql ."\n";
         }
     } else {
         //If HARD_DELETE is true and del=yes, delete the row, otherwise set del=yes
         if ($HARD_DELETE && $attrs[$i]["del"] == "yes") {
             $sql = "DELETE FROM " . $elements[$i] . " WHERE id=" . $id;