~includeonce('../config.tmpl') ~includeonce('../lib/settings.tmpl') ~set('meta_robots','noindex,follow') ~include('../site/header.tmpl')
~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')), 'LD',~http_error(404) ) ) ~if(~get_dirname(3), ~http_error(404))

Articles :

~list(~get('database'), 'SELECT count(*) as count FROM articles WHERE articles.state=~get('state_ok') AND articles.post_timestamp <= CURRENT_TIMESTAMP() ~if(~getl('topic_id'),'AND articles.topic_id=~getl('topic_id')') ','LM', ~set('num',~fld('count')) ) ~setl('res_per_page', ~getcnf('articles_count_index_main', 20)) ~include('../site/next_page.tmpl',~get_filenamevar(1),~get('num'), ~getl('res_per_page'),'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.post_timestamp <= CURRENT_TIMESTAMP() AND articles_sections.id=articles.section_id ~if(~getl('topic_id'),'AND articles.topic_id=~getl('topic_id')') ORDER BY articles.timestamp DESC LIMIT ~getl('res_per_page') OFFSET ~get('indice')", 'LF','
', 'LL','
', 'LM',~include('archives.txt'), 'LD',~http_error(404) ) ~include('../site/next_page.tmpl',~get_filenamevar(1),~get('num'), ~getl('res_per_page'),'index')
~include('../site/footer.tmpl')