Файл: upload/includes/topchart3.php
Строк: 69
<?php
$coun = $_SESSION['country'];
$coun = $_REQUEST['selectedStoreFront'];
function topChart($rsstype, $coun, $rsssize = 100) {
global $coun,$domain;
$url = "http://itunes.apple.com/$coun/rss/".$rsstype."/limit=".$rsssize."/xml";
$data = simplexml_load_file($url);
$pagetitle = $data->title;
$topupdated = $data->updated;
$parsed = array();
foreach($data->entry as $entry) {
$ns = $entry->children('im', true);
$parsed[] = array(
'name' => (string)$ns->name,
'category' => (string)$entry->category->attributes()->label,
'summary' => substr((string)$entry->summary, 0, 30),
'link' => (string)$entry->id,
'image' => (string)$ns->image[1],
'price' => (string)$ns->price,
'artist' => (string)$ns->artist,
'artistUrl' => (string)$ns->artist->attributes()->href
);
}
?>
<div id="toplist">
<h2><?php echo $pagetitle; ?></h2>
<p>Last Updated on: <?php echo $topupdated ?> <?php echo $_REQUEST['selectedStoreFront'];?></p>
<?php include 'list.php' ?>
<ul id="item-list">
<?php foreach($parsed as $entry) {
$appsurls = $entry['link'];
$appsurls=explode('/id',$appsurls);
$appsurls=explode('?',$appsurls[1]);
$entry['artist'] = str_replace(" ", "_", $entry['artist']);
$entry['artist'] = str_replace("%20", "_", $entry['artist']);
?>
<li class="well">
<a href="<?php echo $domain; ?>/app/<?php echo cleanURL($entry['name']) ?>/<?= $appsurls[0]; ?>/"><img src="<?= $entry['image'] ?>" alt="<?= $entry['name'] ?>" title="<?= $entry['name'] ?>" /></a>
<p><span class="title"><a href="<?php echo $domain; ?>/app/<?php echo cleanURL($entry['name']) ?>/<?= $appsurls[0]; ?>/"><?= $entry['name'] ?></a></span>
<a class="top-company" href="<?php echo $domain; ?>/search.php?q=<?= $entry['artist'] ?>"><span class="developer"><?= str_replace("_"," ",$entry['artist']) ?></span></a></p> </li>
<? } ?>
</ul>
</div>
<?php
}