'',
'minrate' => '3',
'countrycode' => 'us',
'scrollspeed' => '7000'
), $atts );
if (empty($attributes['appid']) || is_numeric($attributes['appid']) == false)
{
return "There is an error with the 'appid' attribute of your App Reviews shortcode";
}
$json = file_get_contents('https://itunes.apple.com/'. $attributes['countrycode'] .'/rss/customerreviews/page=1/id=' . $attributes['appid'] . '/sortBy=mostRecent/json');
$reviews = json_decode($json, true);
if (isset($reviews['feed']['entry']))
{
$names = array();
$count = -1;
$addedcount = 0;
foreach($reviews['feed']['entry'] as $item) {
if ($count > -1)
{
$names[$addedcount] = '
' . $item['author']['name']['label'] . ' said:
' . $item['title']['label'] . '
"' . $item['content']['label'] . '"';
$addedcount = $addedcount + 1;
}
$count = $count + 1;
}
$js_array = json_encode($names);
$arr1 = str_split($attributes['appid']);
$idText = '';
foreach ($arr1 as $num)
{
$idText = $idText . toAlpha($num);
}
echo '';
$output = '