{%include concat(template.path, '/links.html')%} {%include concat(template.path, '/header.html')%} {% set widgetname = 'blog' %} {% set pkid = xget('pkid') %} {% if pkid is not null %} {% set addViews = ioCallAction( 'io.model.cms20.content.blog.addViews', { pkid: pkid, widget_name: widgetname, } ) %} {% set data = widgetDataByType( 'blog', { widget_name: widgetname, start: 0, limit: 1, filter: { public: 1, lang: (site.languages[currentlang] is defined ? currentlang : site.langdefault), pkid: pkid, '<=ugmtimePublic': time() }, viewall: 1, } ).res.0 %} {{setTitlePre(data.head~' - '~page.name)}} {% if data.image is not null and data.image != '' %} {{setMetaImage('//'~site.domain~'/files/sites/'~data.site_owner~'/'~data.widget_name~'/'~data.image)}} {% endif %} {% if data.tag %} {{setMetaKeywordsPre(data.tag)}} {% endif %} {{writeMetaArticle(widgetname, pkid, currentlang)}}
{% set dataimage = '/img/cms/no-img.jpg' %} {% if data.image is not null and data.image != '' %} {% set dataimage = '/files/sites/'~data.site_owner~'/'~data.widget_name~'/'~data.image %} {% endif %}

{{data.head}}

{{data.description | youTubeVideo | purify | raw}} {{data.gmtimePublic | iostrtodate('d.m', 'Asia/Almaty')}}
{{data.likes}}
{{data.comments}}
{% if data.domain is not null %} {% set href = link('http://'~data.domain~'/blog/?pkid='~data.pkid) %} {% endif %}

{{translate['eop.view_news_on_site']}}

{{translate['eop.all_news']}}

{{translate['eop.comment']}}

{{widgetCommentsRender({ foreignPkid: pkid, order: { gmtimeAdd: 'asc', }, div: '
%owner% | %datetime% {% if (user.isAdmin or user.isSuperAdmin or permission2("self.cms.'~site.id~'.comments.manage")) and not user.isGuest %} {% endif %}
%text%
{##}
' })}}
{% else %} {% set filter = {public: 1, lang: (site.languages[currentlang] is defined ? currentlang : site.langdefault), '<=ugmtimePublic': time()} %} {% if xget('category') is not null %} {% set filter = xadd(filter, 'category', xget('category')) %} {% endif %} {% if xget('text') is not null %} {% set filter = xadd(filter, 'text', xget('text')) %} {% endif %} {% if xget('city') is not null and neqi(xget('city'), '0') %} {% set filter = xadd(filter, 'city', xget('city')) %} {% elseif xget('region') is not null and neqi(xget('region'), '0') %} {% set filter = xadd(filter, 'region', xget('region')) %} {% elseif xget('country') is not null and neqi(xget('country'), '0') %} {% set filter = xadd(filter, 'country', xget('country')) %} {% endif %} {% set onpage = 12 %} {% set start = (xget('page', 1) - 1) * onpage %} {% set r = widgetDataByType( 'blog', { widget_name: widgetname, start: start, limit: onpage, filter: filter, order: { ugmtimePublic: 'desc', }, } ) %} {% set list = r.res %} {% set list_count = r.count %}
{% for item in list %} {% set href = link('/blog/?pkid='~item.pkid) %} {% if item.domain is not null %} {% set href = link('http://'~item.domain~'/blog/?pkid='~item.pkid) %} {% endif %} {% endfor %}
{% set ppage = max(xget('page', 0), 1) %} {% set alfa = 1 %} {% set count = (list_count / onpage) | ceil %} {% if count > 1 %} {% endif %}
{% endif %} {%include concat(template.path, '/footer.html')%}