~includeonce('../config.tmpl')
~set('meta_robots','noindex,follow')
~include('../site/header.tmpl')
Rubriques
~include('../site/rubriques.tmpl', 'articles/', 'side-links')
~includewithcache('box_sections.tmpl')
~include('../site/sidebox.tmpl')
~rem('vérifie le portail')
~if(~get_dirname(2) == 'articles',
~list(~get('database'),
"SELECT topics.id
FROM topics
WHERE
topics.main=1
AND topics.state=~get('state_ok')
AND topics.topic='~addslashes(~get_dirname(1))'",
'LM',~setl('topic_id', ~fld('id'))
)
)
Articles :
~list(~get('database'),
'SELECT count(*) as count
FROM articles
WHERE articles.state=~get('state_ok')
~if(~getl('topic_id'),'AND articles.topic_id=~getl('topic_id')')
','LM',
~set('num',~fld('count'))
)
~include('../site/next_page.tmpl',~get_filenamevar(1),~get('num'),20,'index')
~list(~get('database'),
"SELECT
articles.id,
articles.topic_id,
articles.title,
articles.timestamp,
articles.chapo,
articles.body,
articles_sections.longname AS section
FROM articles, articles_sections
WHERE
articles.state=~get('state_ok')
AND articles_sections.id=articles.section_id
~if(~getl('topic_id'),'AND articles.topic_id=~getl('topic_id')')
ORDER BY articles.timestamp DESC
LIMIT 20 OFFSET ~get('indice')",
'LF','
',
'LL','
',
'LM',~include('archives.txt'),
'LD',~http_error(404)
)
~include('../site/next_page.tmpl',~get_filenamevar(1),~get('num'),20,'index')
~include('../site/footer.tmpl')