~includeonce('../config.tmpl')
~includeonce('../lib/settings.tmpl')
~includeonce('../site/utils.tmpl')
~includeonce('../lib/news.tmpl')
~list(~get('database'),
"SELECT topics.id, topics.title
FROM topics WHERE topics.topic='~addslashes(~get_filenamevar(0))' LIMIT 1"
,'LM'
,{~set('topic_title',~fld('title')),~setl('topic_id',~fld('id'))}
,'LD',~list(~get('database'),
"SELECT topics.id, topics.topic
FROM topics
WHERE topics.topic='~addslashes(~display_clean_url(~get_filenamevar(0),'topic'))'
OR topics.topic='~addslashes(~str_replace('_','-',~get_filenamevar(0)))'
LIMIT 1",
'LM',~redirect('~get_site_url()infos/topics/~fld('topic').html', 301)
,'LD', ~http_error(404)
)
)
~set('title','Dépeches de la rubrique ~get('topic_title')')
~add_rss('~absolute_templeet()infos/topics/~get_filenamevar(0).rss','Dépêches pour ~get('topic_title')')
~include('../site/header.tmpl')
~include('../box/submit.tmpl')
~includewithcache('../models/col.tmpl', ~getl('topic_id'))
~include('../site/sidebox.tmpl')
~set('num', ~news_count_by_topic(~get('topic_title')))
~setl('news_per_page', ~getcnf('news_count_index_topic', 25))
~include('../site/next_page.tmpl',~get_filenamevar(1),~get('num'), ~getl('news_per_page'))
~list(~get('database'),
"SELECT
news.id,
news.body,
news.topic_id,
news.title,
news.timestamp
FROM news, tags, tags_ressources
WHERE
news.state=~get('state_ok')
AND news.timestamp <= CURRENT_TIMESTAMP()
AND tags.tag='~addslashes(~get('topic_title'))'
AND tags_ressources.tag_id=tags.id
AND tags_ressources.res_type=~integer(~get('res_type_news'))
AND tags_ressources.res_id=news.id
GROUP BY news.id
ORDER BY news.timestamp DESC
LIMIT ~getl('news_per_page') OFFSET ~get('indice')",
'LF','
',
'LL','
',
'LM',~includewithcache('news2nd.txt', ~fld('id')),
'LD',~http_error(404)
)
~include('../site/next_page.tmpl',~get_filenamevar(1),~get('num'), ~getl('news_per_page'))
~include('../site/footer.tmpl')