Merge pull request #1803 from eddiemonge/combine

minor changes to combine.php
This commit is contained in:
Todd Parker 2011-06-14 11:42:40 -07:00
commit 7e40ddff4e
5 changed files with 22 additions and 27 deletions

View file

@ -1,18 +1,17 @@
<?php
if (!isset($type) || !isset($elements))
if ( ! isset($type) || ! isset($elements) )
{
echo "\$type and \$elements must be specified!";
echo '$type and $elements must be specified!';
exit;
}
$contents = '';
reset($elements);
while (list(,$element) = each($elements)) {
$contents .= "\n\n" . file_get_contents($element);
foreach ( $elements as $file ) {
$contents .= file_get_contents($file). "\n\n";
}
header("Content-Type: " . $type);
header("Content-Length: " . strlen($contents));
echo $contents;
?>
header('Content-Type: ' . $type);
header('Content-Length: ' . strlen($contents));
echo $contents;

View file

@ -1,4 +1,4 @@
<?
<?php
$location = isset($_GET['location']) ? $_GET['location'] : '02135';
//get xml from google api
@ -21,7 +21,7 @@ $forecast_list = $xml->xpath("/xml_api_reply/weather/forecast_conditions");
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery Mobile Framework - Weather for <?= $information[0]->city['data']; ?></title>
<title>jQuery Mobile Framework - Weather for <?php echo $information[0]->city['data']; ?></title>
<link rel="stylesheet" href="../../themes/default/" />
<script src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.js"></script>
@ -47,7 +47,7 @@ $forecast_list = $xml->xpath("/xml_api_reply/weather/forecast_conditions");
<form action="" method="get" class="ui-body ui-body-a ">
<label for="location">Change zip code:</label>
<input type="search" name="location" id="location" value="<?=$location; ?>" placeholder="zip code..." data-theme="a" />
<input type="search" name="location" id="location" value="<?php echo$location; ?>" placeholder="zip code..." data-theme="a" />
<input type="submit" data-role="nojs" value="submit" />
</form>
@ -56,10 +56,10 @@ $forecast_list = $xml->xpath("/xml_api_reply/weather/forecast_conditions");
<h1>Currently in <?=$information[0]->city['data']; ?>:</h1>
<div class="current ui-body ui-bar-a ui-corner-all">
<img src="<?= 'http://www.google.com' . $current[0]->icon['data']?>" alt="weather">
<img src="<?php echo 'http://www.google.com' . $current[0]->icon['data']?>" alt="weather">
<p class="condition">
<?= $current[0]->temp_f['data'] ?>&deg; F,
<?= $current[0]->condition['data'] ?>
<?php echo $current[0]->temp_f['data']; ?>&deg; F,
<?php echo $current[0]->condition['data']; ?>
</p>
</div>
@ -67,24 +67,23 @@ $forecast_list = $xml->xpath("/xml_api_reply/weather/forecast_conditions");
<ul data-role="listview" data-inset="true" data-theme="a">
<li data-role="list-divider">This week's forecast</li>
<? foreach ($forecast_list as $forecast) : ?>
<?php foreach ($forecast_list as $forecast) : ?>
<li>
<img src="<?= 'http://www.google.com' . $forecast->icon['data']?>">
<h3><?= $forecast->day_of_week['data']; ?></h3>
<img src="<?php echo 'http://www.google.com' . $forecast->icon['data']; ?>">
<h3><?php echo $forecast->day_of_week['data']; ?></h3>
<p>
<?= $forecast->low['data'] ?>&deg; F - <?= $forecast->high['data'] ?>&deg; F,
<?= $forecast->condition['data'] ?>
<?php echo $forecast->low['data']; ?>&deg; F - <?php echo $forecast->high['data']; ?>&deg; F,
<?php echo $forecast->condition['data']; ?>
</p>
</li>
<? endforeach ?>
<?php endforeach; ?>
</ul>
</div>
</div>
</body>
</html>

View file

@ -30,5 +30,4 @@ $elements = array(
'jquery.mobile.init.js'
);
include('../combine.php');
?>
include('../combine.php');

View file

@ -19,5 +19,4 @@ $elements = array(
'jquery.mobile.forms.slider.css'
);
include('../../combine.php');
?>
include('../../combine.php');

View file

@ -20,4 +20,3 @@ $elements = array(
);
include('../../combine.php');
?>