~dont_cache() ~includeonce('../config.tmpl') ~includeonce('../lib/settings.tmpl') ~include('../updateuser.tmpl') ~set('meta_robots','noindex,follow') ~include('../site/header.tmpl') ~defunc("display_spelled",~sparam(1)) ~if(~preg_match("/^([1-9][0-9]*)$/",~get_filenamevar(2)), ~set('sectid',~get_filenamevar(2)),~http_error(404)) ~include('leftbox.tmpl')
~list(~get('database'),"SELECT COUNT(*) AS count FROM tips WHERE state=~get('state_ok') AND section_id=~integer(~get('sectid')) ",'LM',~set('num', ~fld('count')) ) ~setl('res_per_page',~getcnf('tips_count_index_main', 20)) ~include('../site/next_page.tmpl',~get_filenamevar(1),~get('num'), ~getl('res_per_page'),'index') ~list(~get('database'),"SELECT tips.id, users.id AS user_id_tip, tips.title, tips.tip, tips.user_id, tips.section_id, tips.insert_timestamp AS timestamp FROM tips, users WHERE users.id=tips.user_id AND tips.state=~get('state_ok') AND tips.section_id=~integer(~get('sectid')) ORDER BY id DESC LIMIT ~getl('res_per_page') OFFSET ~get('indice')", 'LM',~include('show_one.tmpl')) ~include('../site/next_page.tmpl',~get_filenamevar(1),~get('num'), ~getl('res_per_page'),'index')
~include('../site/footer.tmpl')