@register.assigment_tag
def count_callbacks():
data = CallBacks.objects.filter(read=False).count()
return {'data': data }
{% count_callbacks as cc%}
{% if cc.data != 0 %}
Count = {{ cc.data }}
{% endif %}
<?php
setlocale(LC_ALL, 'ru_RU.UTF-8');
header('Content-type: text/html; charset=utf-8');
$rss = simplexml_load_file("http://www.calend.ru/img/export/calend.rss");
echo "<b>Ближайшие праздники:</b><br />";
foreach ($rss->channel->item as $item) {
echo $item->title."<br />";
}
?>
$xml = simplexml_load_file('url');
foreach ($xml->resource as $resource) {
echo "add address=" . $resource->ip . " name=" . $resource->dns . "</br>";
}