hasExpired()) {
$tmp = fetchAllHouses_03();
$cache->setContent($tmp);
$cache->save();
foreach ($tmp as $t) {
if ($t['town'] == $townid) $array[] = $t;
}
$array = isset($array) ? $array : false;
} else {
$tmp = $cache->load();
foreach ($tmp as $t) {
if ($t['town'] == $townid) $array[] = $t;
}
$array = isset($array) ? $array : false;
}
// Design and present the list
if ($array) {
?>
house list.
Name: |
Size: |
Doors: |
Beds: |
Price: |
Owner: |
';
echo "". $value['name'] ." | ";
echo "". $value['size'] ." | ";
echo "". $value['doors'] ." | ";
echo "". $value['beds'] ." | ";
echo "". $value['price'] ." | ";
if ($value['owner'] == 0) echo "None | ";
else {
$data = user_character_data($value['owner'], 'name');
echo ''. $data['name'] .' | ';
}
echo '';
// end foreach
}
?>
';
//Token::debug($_POST['token']);
echo 'Please clear your web cache/cookies OR use another web browser
';
}
} else {
if (empty($_POST) === true && $config['TFSVersion'] === 'TFS_03') {
if ($config['allowSubPages']) header('Location: sub.php?page=houses');
else echo 'Sub page system disabled.';
} else if ($config['TFSVersion'] === 'TFS_02') {
$house = $config['house'];
if (!is_file($house['house_file'])) {
echo("House file not found
FAILED TO LOCATE/READ FILE AT:
". $house['house_file'] ."
LINUX users: Make sure www-data have read access to file.
WINDOWS users: Learn to write correct file path.
");
exit();
}
// Load and cache SQL house data:
$cache = new Cache('engine/cache/houses/sqldata');
if ($cache->hasExpired()) {
$house_query = mysql_select_multi('SELECT `players`.`name`, `houses`.`id` FROM `players`, `houses` WHERE `houses`.`owner` = `players`.`id`;');
$cache->setContent($house_query);
$cache->save();
} else {
$house_query = $cache->load();
}
$sqmPrice = $house['price_sqm'];
$house_load = simplexml_load_file($house['house_file']);
if ($house_query !== false && $house_load !== false) {
?>
House list
House |
Location |
Owner |
Size | Rent |
'. $row['name'] .'';
}
foreach ($house_load as $house_fetch){
$house_price = (int)$house_fetch['size'] * $sqmPrice;
?>
|
|
|
|
|
Something is wrong with the cache.';
}
}
include 'layout/overall/footer.php'; ?>