~includeonce('../config.tmpl') ~includeonce('../lib/thumbnail.tmpl') ~setl('gal_img', ~get_first_img( ~get('res_type_galleries'), ~integer(~get_filenamevar(1)),~integer(~get_filenamevar(2))-1)) ~setl('cur_img', ~get('first_img_id')) ~setl('cur_alt', ~get('first_img_alt')) ~setl('tmp', ~get_first_img( ~get('res_type_galleries'), ~integer(~get_filenamevar(1)),~integer(~get_filenamevar(2))+0)) ~if( ~getl('tmp'), ~setl('next_img', ~get('first_img_id')) ) ~if( ~integer(~get_filenamevar(2))>1, ' ~setl('tmp', ~get_first_img( ~get('res_type_galleries'), ~integer(~get_filenamevar(1)),~integer(~get_filenamevar(2))-2)) ~setl('prev_img', ~get('first_img_id')) ') ~noeval(~getl('tmp'), ~add_meta('http-equiv="refresh" content="8; url=photos,~get_filenamevar(1),~integer( ~get_filenamevar(2) +1 ).html"')) ~list(~get('database'), "SELECT title FROM galleries WHERE galleries.id=~integer(~get_filenamevar(1)) AND galleries.timestamp <= CURRENT_TIMESTAMP() AND galleries.state=~get('state_ok')", 'LM',~set('title', '~fld('title') / ~getl('cur_alt')', 'gallery_title', ~fld('title')), 'LD',~http_error(404) ) ~include('../site/header.tmpl')

~if( ~getl('prev_img'), ' ~get_img_thumbnail(~getl('prev_img')) ') ~if( ~getl('next_img'), ' ~get_img_thumbnail(~getl('next_img')) ')

~include('../box/submit.tmpl') ~include('../site/sidebox.tmpl')
~list(~get('database'), "SELECT count(*) as count FROM images, images_ressources, galleries WHERE images.state=~get('state_ok') AND galleries.id=~integer(~get_filenamevar(1)) AND galleries.state=~get('state_ok') AND galleries.timestamp <= CURRENT_TIMESTAMP() AND images_ressources.res_type=~integer(~get('res_type_galleries')) AND images_ressources.res_id=~integer(~get_filenamevar(1)) AND images.id=images_ressources.image_id", 'LM',~set('num',~fld('count')) ) ~if(~get_filenamevar(1) && ~getl('gal_img'), '

~get('gallery_title')

~include('../site/next_page.tmpl',~get_filenamevar(2),~get('num'),1,'photos,~get_filenamevar(1)')
~list(~get('database'), "SELECT alt, description, author_id FROM images WHERE id=~integer(~getl('cur_img')) ",'LF','

~if( ~getl('next_img'),'') ~getl('gal_img') ~if( ~getl('next_img'),'')
~fld('alt')
~if(~fld('description'), ~include('../site/replace.tmpl', ~output_filter(~fld('description')), '', ~get('res_type_galleries'), ~integer(~get_filenamevar(1))) )

~includeonce('../lib/author.tmpl') ~disp_author( ~fld('user_id'), ~fld('author_id'), ~fld('timestamp'))
')
~include('../site/next_page.tmpl',~get_filenamevar(2),~get('num'),1,'photos,~get_filenamevar(1)')

~img('img/svg/up-a.svg','Index','intxt') Retour au diaporama

~include("../site/news_comments.tmpl",~integer(~get_filenamevar(1)),~get('res_type_galleries'), 'nocomments') ',~http_error(404) )
~include("../site/footer.tmpl")