<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://ngcms.ru/forum/extern.php?action=feed&amp;tid=2102&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Next Generation CMS :: Форум поддержкиmeteo :: Информер погоды]]></title>
		<link>https://ngcms.ru/forum/viewtopic.php?id=2102</link>
		<description><![CDATA[Самые свежие сообщения в meteo :: Информер погоды.]]></description>
		<lastBuildDate>Sun, 28 Feb 2016 13:08:13 +0000</lastBuildDate>
		<generator>FluxBB 1.5.11</generator>
		<item>
			<title><![CDATA[Re: meteo :: Информер погоды]]></title>
			<link>https://ngcms.ru/forum/viewtopic.php?pid=41306#p41306</link>
			<description><![CDATA[<div class="codebox"><pre><code>foreach($data-&gt;day as $day):?&gt;
&lt;li&gt;&lt;?php $s6=$s6+1;?&gt;&lt;input type=&quot;radio&quot; 
&lt;?php if($s6==1) echo &quot;checked&quot;;
else
echo &quot;&quot;;?&gt; name=&quot;tabs&quot; id=&quot;tab&lt;?php echo $s1=$s1+1;?&gt;&quot;&gt;
&lt;label for=&quot;tab&lt;?php echo $s2=$s2+1;?&gt;&quot;&gt;&lt;div class=&quot;date&quot;&gt;&lt;?php echo getDayDate($day[&#039;date&#039;]);?&gt;&lt;/div&gt;&lt;/label&gt;
&lt;div id=&quot;tab-content&lt;?php echo $s3=$s3+1;?&gt;&quot; class=&quot;tab-content animated fadeIn&quot;&gt;
&lt;div class=&quot;item&quot;&gt;&lt;table&gt;&lt;tr class=&quot;day-part&quot;&gt;&lt;td&gt;Утром&lt;/td&gt;&lt;td&gt;Днем&lt;/td&gt;&lt;td&gt;Вечером&lt;/td&gt;&lt;td&gt;Ночью&lt;/td&gt;
&lt;/tr&gt;&lt;tr class=&quot;day-temp&quot;&gt;&lt;?php for($i = 0;$i &lt; 4;$i++): // т.к. нам не нужны данные day_short и night_short, мы останавливаем проход на 4
$img = $day-&gt;day_part[$i]-&gt;{&#039;image-v3&#039;};?&gt;&lt;td&gt;&lt;?php echo getTempSign($day-&gt;day_part[$i]-&gt;{&#039;temperature-data&#039;}-&gt;avg);?&gt; °C &lt;img src=&quot;pogoda/&lt;?php echo $img;?&gt;.png&quot; width=&quot;48&quot; height=&quot;48&quot; /&gt;&lt;/td&gt;&lt;?php endfor;?&gt;
&lt;/tr&gt;&lt;tr class=&quot;day-param&quot;&gt;&lt;?php for($i = 0;$i &lt; 4;$i++): // т.к. нам не нужны данные day_short и night_short, мы останавливаем проход на 4?&gt;
&lt;td&gt;&lt;p&gt;&lt;strong&gt;&lt;?php echo $day-&gt;day_part[$i]-&gt;weather_type;?&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;ветер: &lt;?php echo getWindDirection($day-&gt;day_part[$i]-&gt;wind_direction).&#039; &#039;.$day-&gt;day_part[$i]-&gt;wind_speed;?&gt; м/с&lt;/p&gt;
&lt;p&gt;влажность: &lt;?php echo $day-&gt;day_part[$i]-&gt;humidity;?&gt;%&lt;/p&gt;&lt;p&gt;давление: &lt;?php echo $day-&gt;day_part[$i]-&gt;pressure;?&gt; мм рт. ст.&lt;/p&gt;
&lt;/td&gt;&lt;?php endfor;?&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;&lt;?php
endforeach;?&gt;</code></pre></div><p>Весь вот этот кусок переписывать надо, т. к. он тупо выводит данные в HTML напрямую (хоть echo, хоть print - один хрен), тогда как для этого существует шаблон. <br />Кстати, стилям в php-файле тоже делать нечего.</p><p>Пример, как вывести блок - ищи в плагине xnews.</p>]]></description>
			<author><![CDATA[dummy@example.com (Zemlemer)]]></author>
			<pubDate>Sun, 28 Feb 2016 13:08:13 +0000</pubDate>
			<guid>https://ngcms.ru/forum/viewtopic.php?pid=41306#p41306</guid>
		</item>
		<item>
			<title><![CDATA[Re: meteo :: Информер погоды]]></title>
			<link>https://ngcms.ru/forum/viewtopic.php?pid=41304#p41304</link>
			<description><![CDATA[<p>понятно,сам ни хрена не сделаю</p>]]></description>
			<author><![CDATA[dummy@example.com (irbees2008)]]></author>
			<pubDate>Sun, 28 Feb 2016 11:12:55 +0000</pubDate>
			<guid>https://ngcms.ru/forum/viewtopic.php?pid=41304#p41304</guid>
		</item>
		<item>
			<title><![CDATA[Re: meteo :: Информер погоды]]></title>
			<link>https://ngcms.ru/forum/viewtopic.php?pid=41303#p41303</link>
			<description><![CDATA[<p>Нужно не print, а писать в переменную и выводить через template.</p>]]></description>
			<author><![CDATA[dummy@example.com (infinity237)]]></author>
			<pubDate>Sun, 28 Feb 2016 11:06:48 +0000</pubDate>
			<guid>https://ngcms.ru/forum/viewtopic.php?pid=41303#p41303</guid>
		</item>
		<item>
			<title><![CDATA[Re: meteo :: Информер погоды]]></title>
			<link>https://ngcms.ru/forum/viewtopic.php?pid=41302#p41302</link>
			<description><![CDATA[<p>Исправил на print а разницы не ту <img src="https://ngcms.ru/forum/img/smilies/hmm.png" width="15" height="15" alt="hmm" /></p>]]></description>
			<author><![CDATA[dummy@example.com (irbees2008)]]></author>
			<pubDate>Sun, 28 Feb 2016 11:04:19 +0000</pubDate>
			<guid>https://ngcms.ru/forum/viewtopic.php?pid=41302#p41302</guid>
		</item>
		<item>
			<title><![CDATA[Re: meteo :: Информер погоды]]></title>
			<link>https://ngcms.ru/forum/viewtopic.php?pid=41301#p41301</link>
			<description><![CDATA[<p>Естественно, там же echo.</p>]]></description>
			<author><![CDATA[dummy@example.com (infinity237)]]></author>
			<pubDate>Sun, 28 Feb 2016 10:43:59 +0000</pubDate>
			<guid>https://ngcms.ru/forum/viewtopic.php?pid=41301#p41301</guid>
		</item>
		<item>
			<title><![CDATA[Re: meteo :: Информер погоды]]></title>
			<link>https://ngcms.ru/forum/viewtopic.php?pid=41300#p41300</link>
			<description><![CDATA[<p>Все равно выводит в тело ,даже без переменной <img src="https://ngcms.ru/forum/img/smilies/hmm.png" width="15" height="15" alt="hmm" /></p>]]></description>
			<author><![CDATA[dummy@example.com (irbees2008)]]></author>
			<pubDate>Sun, 28 Feb 2016 10:15:34 +0000</pubDate>
			<guid>https://ngcms.ru/forum/viewtopic.php?pid=41300#p41300</guid>
		</item>
		<item>
			<title><![CDATA[Re: meteo :: Информер погоды]]></title>
			<link>https://ngcms.ru/forum/viewtopic.php?pid=41294#p41294</link>
			<description><![CDATA[<div class="codebox"><pre><code>$template[&#039;vars&#039;][&#039;plugin_meteo&#039;] = $data;</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (infinity237)]]></author>
			<pubDate>Sat, 27 Feb 2016 16:31:06 +0000</pubDate>
			<guid>https://ngcms.ru/forum/viewtopic.php?pid=41294#p41294</guid>
		</item>
		<item>
			<title><![CDATA[Re: meteo :: Информер погоды]]></title>
			<link>https://ngcms.ru/forum/viewtopic.php?pid=41293#p41293</link>
			<description><![CDATA[<p>Что еще не правильно делаю?,выводит но в тело сайта,а не где переменная</p><div class="codebox"><pre class="vscroll"><code>&lt;?php
// Protect against hack attempts
if (!defined(&#039;NGCMS&#039;)) die (&#039;HAL&#039;);

add_act(&#039;index&#039;, &#039;plugin_meteo&#039;);
$city   = intval(pluginGetVariable(&#039;meteo&#039;,&#039;city&#039;));
$cache_lifetime = 7200; //время кэша файла в секундах, 3600=1 час
$cache_file = &#039;weather_&#039;.$city.&#039;.xml&#039;; // временный файл-кэш 


function plugin_meteo($city)
 {
 global $config, $template;
 $url = &#039;http://export.yandex.ru/weather-ng/forecasts/&#039;.$city.&#039;.xml&#039;;
$userAgent = &#039;Googlebot/2.1 (+http://www.google.com/bot.html)&#039;;
$xml = &#039;weather_&#039;.$city.&#039;.xml&#039;;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);
$output = curl_exec($ch);
$fh = fopen($xml, &#039;w&#039;);
fwrite($fh, $output);
fclose($fh);
 }

if ( file_exists($cache_file) ) {
 $cache_modified = time() - @filemtime($cache_file);
 if ( $cache_modified &gt; $cache_lifetime ) 

{
//обновляем файл погоды, если время файла кэша устарело
plugin_meteo($city);
}
}
else {
//если нет файла погоды вообще, закачиваем его
plugin_meteo($city);
}
?&gt;
&lt;?php
if(file_exists($cache_file)):
$data = simplexml_load_file($cache_file); ?&gt;
&lt;style type=&quot;text/css&quot;&gt;
.weather{position:relative;border-bottom:1px solid #d5d5d5;padding-bottom:35px;}
.weather .date{font-size:13px;font-weight:700;padding-bottom:5px;text-transform:uppercase;border-bottom:1px solid #d5d5d5;margin-top:10px;}
.weather .item{background-color:#DAD9D5;padding:15px;font-family:Georgia;margin-bottom:20px;}
.weather .item table{border:0;width:100%;}
.weather .item table td{padding-bottom:15px;width:20%;vertical-align:baseline;padding-right:5px;}
.weather .item .day-part td{font-size:18px;}
.weather .item .day-temp td{font-size:30px;}
.weather .item .day-temp td img{margin-left:5px;}
.weather .item .day-param td{font-size:12px;}
.weather .item .day-param td p{padding-bottom:3px;}
.weather .days{margin-top:35px;border:0;width:100%;}
.weather .days td{width:50%;padding-bottom:35px;}
.weather .days a{font-family:Georgia;font-size:18px;text-decoration:underline;font-weight:700;}

.tabs input[type=radio] {
position: absolute;
top: -9999px;
left: -9999px;
}
.tabs {
width: 1000px;
float: none;
list-style: none;
position: relative;
padding: 0;
margin: 75px auto;
font-family: &quot;Georgia&quot;;
}
.tabs li{
float: left;
}
.tabs label {
display: block;
padding: 10px 8px;
border-radius: 2px 2px 0 0;
color: #000;
font-size: 18px;
font-weight: normal;
font-family: &#039;Lily Script One&#039;, helveti;
background: rgba(255,255,255,0.2);
cursor: pointer;
position: relative;
top: 3px;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.tabs label:hover {
background: rgba(255,255,255,0.5);
top: 0;
}
[id^=tab]:checked + label {
background: #B7B7B7;
color: white;
}
[id^=tab]:checked ~ [id^=tab-content] {
display: block;
}
.tab-content{
z-index: 2;
display: none;
text-align: left;
width: 100%;
font-size: 20px;
line-height: 140%;
padding-top: 10px;
background: #B7B7B7;
padding: 15px;
color: white;
position: absolute;
top: 53px;
left: 0;
box-sizing: border-box;
-webkit-animation-duration: 0.5s;
-o-animation-duration: 0.5s;
-moz-animation-duration: 0.5s;
animation-duration: 0.5s;
}&lt;/style&gt;&lt;div class=&quot;weather&quot;&gt;&lt;ul class=&quot;tabs&quot;&gt;&lt;?php
foreach($data-&gt;day as $day):?&gt;
&lt;li&gt;&lt;?php $s6=$s6+1;?&gt;&lt;input type=&quot;radio&quot; 
&lt;?php if($s6==1) echo &quot;checked&quot;;
else
echo &quot;&quot;;?&gt; name=&quot;tabs&quot; id=&quot;tab&lt;?php echo $s1=$s1+1;?&gt;&quot;&gt;
&lt;label for=&quot;tab&lt;?php echo $s2=$s2+1;?&gt;&quot;&gt;&lt;div class=&quot;date&quot;&gt;&lt;?php echo getDayDate($day[&#039;date&#039;]);?&gt;&lt;/div&gt;&lt;/label&gt;
&lt;div id=&quot;tab-content&lt;?php echo $s3=$s3+1;?&gt;&quot; class=&quot;tab-content animated fadeIn&quot;&gt;
&lt;div class=&quot;item&quot;&gt;&lt;table&gt;&lt;tr class=&quot;day-part&quot;&gt;&lt;td&gt;Утром&lt;/td&gt;&lt;td&gt;Днем&lt;/td&gt;&lt;td&gt;Вечером&lt;/td&gt;&lt;td&gt;Ночью&lt;/td&gt;
&lt;/tr&gt;&lt;tr class=&quot;day-temp&quot;&gt;&lt;?php for($i = 0;$i &lt; 4;$i++): // т.к. нам не нужны данные day_short и night_short, мы останавливаем проход на 4
$img = $day-&gt;day_part[$i]-&gt;{&#039;image-v3&#039;};?&gt;&lt;td&gt;&lt;?php echo getTempSign($day-&gt;day_part[$i]-&gt;{&#039;temperature-data&#039;}-&gt;avg);?&gt; °C &lt;img src=&quot;pogoda/&lt;?php echo $img;?&gt;.png&quot; width=&quot;48&quot; height=&quot;48&quot; /&gt;&lt;/td&gt;&lt;?php endfor;?&gt;
&lt;/tr&gt;&lt;tr class=&quot;day-param&quot;&gt;&lt;?php for($i = 0;$i &lt; 4;$i++): // т.к. нам не нужны данные day_short и night_short, мы останавливаем проход на 4?&gt;
&lt;td&gt;&lt;p&gt;&lt;strong&gt;&lt;?php echo $day-&gt;day_part[$i]-&gt;weather_type;?&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;ветер: &lt;?php echo getWindDirection($day-&gt;day_part[$i]-&gt;wind_direction).&#039; &#039;.$day-&gt;day_part[$i]-&gt;wind_speed;?&gt; м/с&lt;/p&gt;
&lt;p&gt;влажность: &lt;?php echo $day-&gt;day_part[$i]-&gt;humidity;?&gt;%&lt;/p&gt;&lt;p&gt;давление: &lt;?php echo $day-&gt;day_part[$i]-&gt;pressure;?&gt; мм рт. ст.&lt;/p&gt;
&lt;/td&gt;&lt;?php endfor;?&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;&lt;?php
endforeach;?&gt;
&lt;/ul&gt;&lt;/div&gt;
&lt;?php
endif;
// получаем локализованную дату
function getDayDate($date)
{
$date = strtotime($date);
$months = array(&#039;&#039;,&#039;/01&#039;,&#039;/02&#039;,&#039;/03&#039;,&#039;/04&#039;,&#039;/05&#039;,&#039;/06&#039;,&#039;/07&#039;,&#039;/08&#039;,&#039;/09&#039;,&#039;/10&#039;,&#039;/11&#039;,&#039;/12&#039;);
$days = array(&#039;ВС&#039;,&#039;ПН&#039;, &#039;ВТ&#039;, &#039;СР&#039;, &#039;ЧТ&#039;, &#039;ПТ&#039;, &#039;СБ&#039;);
return $days[date(&#039;w&#039;, $date)].&#039;, &#039;.(int)date(&#039;d&#039;,$date).&#039; &#039;.$months[date(&#039;n&#039;, $date)];
}
// получаем знак температуры
function getTempSign($temp)
{
$temp = (int)$temp;
return $temp &gt; 0 ? &#039;+&#039;.$temp : $temp;
}
// получаем направления ветра
function getWindDirection($wind)
{
$wind = (string)$wind;
$wind_direction = array(&#039;s&#039;=&gt;&#039;↑ ю&#039;,&#039;n&#039;=&gt;&#039;↓ с&#039;,&#039;w&#039;=&gt;&#039;→ з&#039;,&#039;e&#039;=&gt;&#039;← в&#039;,&#039;sw&#039;=&gt;&#039;↗ юз&#039;,&#039;se&#039;=&gt;&#039;↖ юв&#039;,&#039;nw&#039;=&gt;&#039;↘ сз&#039;,&#039;ne&#039;=&gt;&#039;↙ св&#039;);
return $wind_direction[$wind];
}

$template[&#039;vars&#039;][&#039;plugin_meteo&#039;] = $meteo;</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (irbees2008)]]></author>
			<pubDate>Sat, 27 Feb 2016 11:33:44 +0000</pubDate>
			<guid>https://ngcms.ru/forum/viewtopic.php?pid=41293#p41293</guid>
		</item>
		<item>
			<title><![CDATA[Re: meteo :: Информер погоды]]></title>
			<link>https://ngcms.ru/forum/viewtopic.php?pid=41292#p41292</link>
			<description><![CDATA[<p>хотел переделать чтоюбы брал с яндекса погоду ,но не работает правил только meteo.php</p><div class="codebox"><pre class="vscroll"><code>&lt;?php

// Protect against hack attempts
if (!defined(&#039;NGCMS&#039;)) die (&#039;HAL&#039;);

add_act(&#039;index&#039;, &#039;plugin_meteo&#039;);

function plugin_meteo() {
	global $config, $template;

$city   = intval(pluginGetVariable(&#039;meteo&#039;,&#039;city&#039;));

	// Generate cache file name [ we should take into account SWITCHER plugin ]
	$cacheFileName = md5(&#039;meteo&#039;.$config[&#039;theme&#039;].$config[&#039;default_lang&#039;]).&#039;.txt&#039;;


	if (pluginGetVariable(&#039;meteo&#039;,&#039;cache&#039;)) {
		$cacheData = cacheRetrieveFile($cacheFileName, extra_get_param(&#039;meteo&#039;,&#039;cacheExpire&#039;), &#039;meteo&#039;);
		if ($cacheData != false) {
			// We got data from cache. Return it and stop
			$template[&#039;vars&#039;][&#039;plugin_meteo&#039;] = $cacheData;
			return;
		}
		}
function loadxmlyansex($city)
 {
$url = &#039;http://export.yandex.ru/weather-ng/forecasts/&#039;.$city.&#039;.xml&#039;;
$userAgent = &#039;Googlebot/2.1 (+http://www.google.com/bot.html)&#039;;
$xml = &#039;weather_&#039;.$city.&#039;.xml&#039;;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);
$output = curl_exec($ch);
$fh = fopen($xml, &#039;w&#039;);
fwrite($fh, $output);
fclose($fh);
 }

if ( file_exists($cacheFileName) ) {
 $cache_modified = time() - @filemtime($cache_file);
 if ( $cache_modified &gt; $cacheExpire ) 

{
//обновляем файл погоды, если время файла кэша устарело
loadxmlyansex($city);
}
}
else {
//если нет файла погоды вообще, закачиваем его
loadxmlyansex($city);
}
?&gt;
&lt;?php
if(file_exists($cacheFileName)):
$data = simplexml_load_file($cacheFileName); ?&gt;
&lt;style type=&quot;text/css&quot;&gt;
.weather .date{font-size:13px;font-weight:700;padding-bottom:5px;text-transform:uppercase;border-bottom:1px solid #d5d5d5;margin-top:10px;}
.weather .item{background-color:#DAD9D5;padding:15px;font-family:Georgia;margin-bottom:20px;}
.weather .item table{border:0;width:100%;}
.weather .item table td{padding-bottom:15px;width:20%;vertical-align:baseline;padding-right:5px;}
.weather .item .day-part td{font-size:18px;}
.weather .item .day-temp td{font-size:30px;}
.weather .item .day-temp td img{margin-left:5px;}
.weather .item .day-param td{font-size:12px;}
.weather .item .day-param td p{padding-bottom:3px;}
.weather .days{margin-top:35px;border:0;width:100%;}
.weather .days td{width:50%;padding-bottom:35px;}
.weather .days a{font-family:Georgia;font-size:18px;text-decoration:underline;font-weight:700;}

.tabs input[type=radio] {
position: absolute;
top: -9999px;
left: -9999px;
}
.tabs {
width: 1000px;
float: none;
list-style: none;
position: relative;
padding: 0;
margin: 75px auto;
font-family: &quot;Georgia&quot;;
}
.tabs li{
float: left;
}
.tabs label {
display: block;
padding: 10px 8px;
border-radius: 2px 2px 0 0;
color: #000;
font-size: 18px;
font-weight: normal;
font-family: &#039;Lily Script One&#039;, helveti;
background: rgba(255,255,255,0.2);
cursor: pointer;
position: relative;
top: 3px;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.tabs label:hover {
background: rgba(255,255,255,0.5);
top: 0;
}
[id^=tab]:checked + label {
background: #B7B7B7;
color: white;
}
[id^=tab]:checked ~ [id^=tab-content] {
display: block;
}
.tab-content{
z-index: 2;
display: none;
text-align: left;
width: 100%;
font-size: 20px;
line-height: 140%;
padding-top: 10px;
background: #B7B7B7;
padding: 15px;
color: white;
position: absolute;
top: 53px;
left: 0;
box-sizing: border-box;
-webkit-animation-duration: 0.5s;
-o-animation-duration: 0.5s;
-moz-animation-duration: 0.5s;
animation-duration: 0.5s;
}&lt;/style&gt;&lt;div class=&quot;weather&quot;&gt;&lt;ul class=&quot;tabs&quot;&gt;&lt;?php
foreach($data-&gt;day as $day):?&gt;
&lt;li&gt;&lt;?php $s6=$s6+1;?&gt;&lt;input type=&quot;radio&quot; 
&lt;?php if($s6==1) echo &quot;checked&quot;;
else
echo &quot;&quot;;?&gt; name=&quot;tabs&quot; id=&quot;tab&lt;?php echo $s1=$s1+1;?&gt;&quot;&gt;
&lt;label for=&quot;tab&lt;?php echo $s2=$s2+1;?&gt;&quot;&gt;&lt;div class=&quot;date&quot;&gt;&lt;?php echo getDayDate($day[&#039;date&#039;]);?&gt;&lt;/div&gt;&lt;/label&gt;
&lt;div id=&quot;tab-content&lt;?php echo $s3=$s3+1;?&gt;&quot; class=&quot;tab-content animated fadeIn&quot;&gt;
&lt;div class=&quot;item&quot;&gt;&lt;table&gt;&lt;tr class=&quot;day-part&quot;&gt;&lt;td&gt;Утром&lt;/td&gt;&lt;td&gt;Днем&lt;/td&gt;&lt;td&gt;Вечером&lt;/td&gt;&lt;td&gt;Ночью&lt;/td&gt;
&lt;/tr&gt;&lt;tr class=&quot;day-temp&quot;&gt;&lt;?php for($i = 0;$i &lt; 4;$i++): // т.к. нам не нужны данные day_short и night_short, мы останавливаем проход на 4
$img = $day-&gt;day_part[$i]-&gt;{&#039;image-v3&#039;};?&gt;&lt;td&gt;&lt;?php echo getTempSign($day-&gt;day_part[$i]-&gt;{&#039;temperature-data&#039;}-&gt;avg);?&gt; °C &lt;img src=&quot;pogoda/&lt;?php echo $img;?&gt;.png&quot; width=&quot;48&quot; height=&quot;48&quot; /&gt;&lt;/td&gt;&lt;?php endfor;?&gt;
&lt;/tr&gt;&lt;tr class=&quot;day-param&quot;&gt;&lt;?php for($i = 0;$i &lt; 4;$i++): // т.к. нам не нужны данные day_short и night_short, мы останавливаем проход на 4?&gt;
&lt;td&gt;&lt;p&gt;&lt;strong&gt;&lt;?php echo $day-&gt;day_part[$i]-&gt;weather_type;?&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;ветер: &lt;?php echo getWindDirection($day-&gt;day_part[$i]-&gt;wind_direction).&#039; &#039;.$day-&gt;day_part[$i]-&gt;wind_speed;?&gt; м/с&lt;/p&gt;
&lt;p&gt;влажность: &lt;?php echo $day-&gt;day_part[$i]-&gt;humidity;?&gt;%&lt;/p&gt;&lt;p&gt;давление: &lt;?php echo $day-&gt;day_part[$i]-&gt;pressure;?&gt; мм рт. ст.&lt;/p&gt;
&lt;/td&gt;&lt;?php endfor;?&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;&lt;?php
endforeach;?&gt;
&lt;/ul&gt;&lt;/div&gt;
&lt;?php
endif;
// получаем локализованную дату
function getDayDate($date)
{
$date = strtotime($date);
$months = array(&#039;&#039;,&#039;/01&#039;,&#039;/02&#039;,&#039;/03&#039;,&#039;/04&#039;,&#039;/05&#039;,&#039;/06&#039;,&#039;/07&#039;,&#039;/08&#039;,&#039;/09&#039;,&#039;/10&#039;,&#039;/11&#039;,&#039;/12&#039;);
$days = array(&#039;ВС&#039;,&#039;ПН&#039;, &#039;ВТ&#039;, &#039;СР&#039;, &#039;ЧТ&#039;, &#039;ПТ&#039;, &#039;СБ&#039;);
return $days[date(&#039;w&#039;, $date)].&#039;, &#039;.(int)date(&#039;d&#039;,$date).&#039; &#039;.$months[date(&#039;n&#039;, $date)];
}
// получаем знак температуры
function getTempSign($temp)
{
$temp = (int)$temp;
return $temp &gt; 0 ? &#039;+&#039;.$temp : $temp;
}
// получаем направления ветра
function getWindDirection($wind)
{
$wind = (string)$wind;
$wind_direction = array(&#039;s&#039;=&gt;&#039;↑ ю&#039;,&#039;n&#039;=&gt;&#039;↓ с&#039;,&#039;w&#039;=&gt;&#039;→ з&#039;,&#039;e&#039;=&gt;&#039;← в&#039;,&#039;sw&#039;=&gt;&#039;↗ юз&#039;,&#039;se&#039;=&gt;&#039;↖ юв&#039;,&#039;nw&#039;=&gt;&#039;↘ сз&#039;,&#039;ne&#039;=&gt;&#039;↙ св&#039;);
return $wind_direction[$wind];
}

$template[&#039;vars&#039;][&#039;plugin_meteo&#039;] = $meteo;

	if (extra_get_param(&#039;meteo&#039;,&#039;cache&#039;)) {
		cacheStoreFile($cacheFileName, $meteo, &#039;meteo&#039;);
	}


}</code></pre></div><p>Что не правильно? код взят отсюда http://seo-zona.ru/informer-pogody-delaem-sami-2015-06-06.html</p>]]></description>
			<author><![CDATA[dummy@example.com (irbees2008)]]></author>
			<pubDate>Fri, 26 Feb 2016 09:38:22 +0000</pubDate>
			<guid>https://ngcms.ru/forum/viewtopic.php?pid=41292#p41292</guid>
		</item>
		<item>
			<title><![CDATA[Re: meteo :: Информер погоды]]></title>
			<link>https://ngcms.ru/forum/viewtopic.php?pid=36135#p36135</link>
			<description><![CDATA[<p>Попробуй после:</p><div class="codebox"><pre><code>$meteo = str_replace(&#039;h1 a&#039;,&#039;h1&#039;,$html);</code></pre></div><p>Добавить:</p><div class="codebox"><pre><code>$meteo = iconv(&quot;utf-8&quot;, &quot;windows-1251&quot;, $meteo);</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (infinity237)]]></author>
			<pubDate>Mon, 02 Sep 2013 20:19:37 +0000</pubDate>
			<guid>https://ngcms.ru/forum/viewtopic.php?pid=36135#p36135</guid>
		</item>
		<item>
			<title><![CDATA[Re: meteo :: Информер погоды]]></title>
			<link>https://ngcms.ru/forum/viewtopic.php?pid=36134#p36134</link>
			<description><![CDATA[<p>Кодировка информера чудесным образом сменилась с win1251 на utf-8. Как вернуть назад?</p>]]></description>
			<author><![CDATA[dummy@example.com (Judest)]]></author>
			<pubDate>Mon, 02 Sep 2013 19:08:01 +0000</pubDate>
			<guid>https://ngcms.ru/forum/viewtopic.php?pid=36134#p36134</guid>
		</item>
		<item>
			<title><![CDATA[meteo :: Информер погоды]]></title>
			<link>https://ngcms.ru/forum/viewtopic.php?pid=24763#p24763</link>
			<description><![CDATA[<p>Плагин отображает на сайте информер погоды.<br />При активации плагина становится доступна переменная {plugin_meteo}. </p><p><span class="postimg"><img src="http://photoload.ru/data/4b/bd/85/4bbd85202620f12f89f7a20e141e789f.jpg" alt="4bbd85202620f12f89f7a20e141e789f.jpg" /></span></p><p><strong>Поддерживаемые функции:</strong><br />+ Вывод данных<br />+ Хреновое кеширование</p><div class="quotebox"><blockquote><div><p>[0.01][2011-11-04]<br />+ Первая версия плагина</p></div></blockquote></div>]]></description>
			<author><![CDATA[dummy@example.com (infinity237)]]></author>
			<pubDate>Fri, 04 Nov 2011 07:52:21 +0000</pubDate>
			<guid>https://ngcms.ru/forum/viewtopic.php?pid=24763#p24763</guid>
		</item>
	</channel>
</rss>
