diff --git a/about.php b/about.php index 322a82d86..3c34968e7 100644 --- a/about.php +++ b/about.php @@ -20,11 +20,16 @@ //----------------------------------------------------------- personnal include include_once( './include/init.inc.php' ); //----------------------------------------------------- template initialization -$vtp = new VTemplate; +// +// Start output of page +// +$title= $lang['about_page_title']; +include('include/page_header.php'); + $handle = $vtp->Open( './template/'.$user['template'].'/about.vtp' ); initialize_template(); -$tpl = array('about_page_title','about_title','about_message','about_return'); +$tpl = array('about_title','about_message','about_return'); templatize_array( $tpl, 'lang', $handle ); $vtp->setVar( $handle, 'user_template', $user['template'] ); @@ -33,4 +38,5 @@ $vtp->setVar( $handle, 'back_url', add_session_id( $url ) ); //----------------------------------------------------------- html code display $code = $vtp->Display( $handle, 0 ); echo $code; +include('include/page_tail.php'); ?> \ No newline at end of file diff --git a/category.php b/category.php index 6a5ad4481..78b98e7bb 100644 --- a/category.php +++ b/category.php @@ -16,10 +16,6 @@ * the Free Software Foundation; * * * ***************************************************************************/ -// determine the initial instant to indicate the generation time of this page -$t1 = explode( ' ', microtime() ); -$t2 = explode( '.', $t1[0] ); -$t2 = $t1[1].'.'.$t2[1]; //----------------------------------------------------------- personnal include include_once( './include/init.inc.php' ); //---------------------------------------------------------------------- logout @@ -102,26 +98,33 @@ if ( isset( $_GET['num'] ) $page['plain_structure'] = get_user_plain_structure(); $page['structure'] = create_user_structure( '' ); $page['structure'] = update_structure( $page['structure'] ); + //----------------------------------------------------- template initialization -$vtp = new VTemplate; + +// +// Start output of page +// +$title = $page['title']; +include('include/page_header.php'); + $handle = $vtp->Open( './template/'.$user['template'].'/category.vtp' ); initialize_template(); $tpl = array( 'categories','hint_category','sub-cat','images_available','total', 'title_menu','nb_image_category','send_mail','title_send_mail', - 'generation_time','connected_user','recent_image','days','generation_time', + 'connected_user','recent_image','days', 'favorite_cat_hint','favorite_cat','stats','most_visited_cat_hint', 'most_visited_cat','recent_cat','recent_cat_hint','upload_picture', 'comments' ); templatize_array( $tpl, 'lang', $handle ); -$tpl = array( 'mail_webmaster','webmaster','top_number','version','site_url' ); +$tpl = array( 'mail_webmaster','webmaster','top_number'); templatize_array( $tpl, 'conf', $handle ); $tpl = array( 'short_period','long_period','lien_collapsed', 'username' ); templatize_array( $tpl, 'user', $handle ); -$tpl = array( 'title','navigation_bar','cat_comment','cat_nb_images' ); +$tpl = array( 'navigation_bar','cat_comment','cat_nb_images' ); templatize_array( $tpl, 'page', $handle ); // special global template vars @@ -404,7 +407,7 @@ elseif ( ( isset( $page['cat'] ) $thumbnail_title = $lang['hint_category']; $url_link = './category.php?cat='.$subcat_id; - if ( !in_array( $page['cat'], $page['tab_expand'] ) ) + if ( isset($page['cat'])&& !in_array( $page['cat'], $page['tab_expand'] ) ) { array_push( $page['tab_expand'], $page['cat'] ); $page['expand'] = implode( ',', $page['tab_expand'] ); @@ -487,10 +490,9 @@ if ( isset ( $page['cat'] ) ) //------------------------------------------------------------ log informations pwg_log( 'category', $page['title'] ); mysql_close(); -//------------------------------------------------------------- generation time -$time = get_elapsed_time( $t2, get_moment() ); -$vtp->setGlobalVar( $handle, 'time', $time ); //----------------------------------------------------------- html code display $code = $vtp->Display( $handle, 0 ); echo $code; + +include('include/page_tail.php'); ?> \ No newline at end of file diff --git a/comments.php b/comments.php index ad07958af..46e8e7562 100644 --- a/comments.php +++ b/comments.php @@ -46,7 +46,7 @@ function display_pictures( $mysql_result, $maxtime, $forbidden_cat_ids ) $subrow = mysql_fetch_array( mysql_query( $query ) ); $category_id = $subrow['category_id']; - if ( $array_cat_directories[$category_id] == '' ) + if ( !isset($array_cat_directories[$category_id])) { $array_cat_directories[$category_id] = get_complete_dir( $category_id ); @@ -133,12 +133,16 @@ function display_pictures( $mysql_result, $maxtime, $forbidden_cat_ids ) } } //----------------------------------------------------- template initialization -$vtp = new VTemplate; +// +// Start output of page +// +$title= $lang['title_comments']; +include('include/page_header.php'); + $handle = $vtp->Open( './template/'.$user['template'].'/comments.vtp' ); initialize_template(); $tpl = array( 'title_comments','stats_last_days','search_return_main_page' ); templatize_array( $tpl, 'lang', $handle ); -$vtp->setGlobalVar( $handle, 'text_color', $user['couleur_text'] ); //--------------------------------------------------- number of days to display if ( isset( $_GET['last_days'] ) ) define( 'MAX_DAYS', $_GET['last_days'] ); else define( 'MAX_DAYS', 0 ); @@ -182,4 +186,5 @@ display_pictures( $result, $maxtime, $user['restrictions'] ); //----------------------------------------------------------- html code display $code = $vtp->Display( $handle, 0 ); echo $code; +include('include/page_tail.php'); ?> \ No newline at end of file diff --git a/identification.php b/identification.php index cf34195dc..5dc193c83 100644 --- a/identification.php +++ b/identification.php @@ -43,10 +43,14 @@ if ( isset( $_POST['login'] ) ) } } //----------------------------------------------------- template initialization -$vtp = new VTemplate; +// +// Start output of page +// +$title = $lang['ident_page_title']; +include('include/page_header.php'); + $handle = $vtp->Open( './template/default/identification.vtp' ); // language -$vtp->setGlobalVar( $handle, 'ident_page_title', $lang['ident_page_title'] ); $vtp->setGlobalVar( $handle, 'ident_title', $lang['ident_title'] ); $vtp->setGlobalVar( $handle, 'login', $lang['login'] ); $vtp->setGlobalVar( $handle, 'password', $lang['password'] ); @@ -109,4 +113,5 @@ if ( $conf['access'] == 'free' ) //----------------------------------------------------------- html code display $code = $vtp->Display( $handle, 0 ); echo $code; +include('include/page_tail.php'); ?> \ No newline at end of file diff --git a/include/init.inc.php b/include/init.inc.php index 19e308441..6b3af68bb 100644 --- a/include/init.inc.php +++ b/include/init.inc.php @@ -16,6 +16,11 @@ * the Free Software Foundation; * * * ***************************************************************************/ +// determine the initial instant to indicate the generation time of this page +$t1 = explode( ' ', microtime() ); +$t2 = explode( '.', $t1[0] ); +$t2 = $t1[1].'.'.$t2[1]; + define( 'PREFIX_INCLUDE', '' ); include_once( './include/config.inc.php' ); diff --git a/include/page_header.php b/include/page_header.php new file mode 100644 index 000000000..68bb17993 --- /dev/null +++ b/include/page_header.php @@ -0,0 +1,30 @@ +Open( './template/'.$user['template'].'/header.vtp' ); +$vtp->setGlobalVar( $handle, 'charset', $lang['charset'] ); +$vtp->setGlobalVar( $handle, 'style', './template/'.$user['template'].'/'.$user['template'].'.css'); + + // refresh + if ( isset( $refresh ) && $refresh >0 && isset($url_link)) + { + $vtp->addSession( $handle, 'refresh' ); + $vtp->setVar( $handle, 'refresh.time', $refresh ); + $url = $url_link.'&slideshow='.$refresh; + $vtp->setVar( $handle, 'refresh.url', add_session_id( $url ) ); + $vtp->closeSession( $handle, 'refresh' ); + } + +$vtp->setGlobalVar( $handle, 'title', $title ); +$vtp->setVarF( $handle, 'header', './template/'.$user['template'].'/header.htm' ); + +// +// Generate the page +// + +$code = $vtp->Display( $handle, 0 ); +echo $code; +?> \ No newline at end of file diff --git a/include/page_tail.php b/include/page_tail.php new file mode 100644 index 000000000..d4548f170 --- /dev/null +++ b/include/page_tail.php @@ -0,0 +1,19 @@ +Open( './template/'.$user['template'].'/footer.vtp' ); + +//------------------------------------------------------------- generation time +$time = get_elapsed_time( $t2, get_moment() ); +$vtp->setGlobalVar( $handle, 'time', $time ); + +$vtp->setGlobalVar( $handle, 'generation_time', $lang['generation_time'] ); +$vtp->setGlobalVar( $handle, 'version', $conf['version'] ); +$vtp->setGlobalVar( $handle, 'site_url', $conf['site_url'] ); +$vtp->setVarF( $handle, 'footer', './template/'.$user['template'].'/footer.htm' ); + +// +// Generate the page +// + +$code = $vtp->Display( $handle, 0 ); +echo $code; +?> \ No newline at end of file diff --git a/picture.php b/picture.php index 06d57ed27..067a271ea 100644 --- a/picture.php +++ b/picture.php @@ -16,7 +16,6 @@ * the Free Software Foundation; * * * ***************************************************************************/ - // this page shows the image full size //----------------------------------------------------------- personnal include include_once( './include/init.inc.php' ); @@ -161,8 +160,68 @@ if ( isset( $_GET['add_fav'] ) ) exit(); } } + +//---------------------------------------------- next picture thumbnail display +$next = 0; +if ( $page['num'] < $page['cat_nb_images']-1 ) +{ + $next = $page['num'] + 1; + $query = 'SELECT DISTINCT(id),name,file,tn_ext,storage_category_id'; + $query.= ' FROM '.PREFIX_TABLE.'images'; + $query.= ' LEFT JOIN '.PREFIX_TABLE.'image_category AS ic ON id=ic.image_id'; + $query.= $page['where']; + $query.= $conf['order_by']; + $query.= ' LIMIT '.$next.',1'; + $query.= ';'; + $result = mysql_query( $query ); + $row = mysql_fetch_array( $result ); + + if ( !isset($array_cat_directories[$row['storage_category_id']])) + { + $array_cat_directories[$row['storage_category_id']] = + get_complete_dir( $row['storage_category_id'] ); + } + $cat_directory = $array_cat_directories[$row['storage_category_id']]; + + $file = substr ( $row['file'], 0, strrpos ( $row['file'], ".") ); + $next_lien_thumbnail = $cat_directory.'thumbnail/'; + $next_lien_thumbnail.= $conf['prefix_thumbnail'].$file.".".$row['tn_ext']; + + if ( $row['name'] != "" ) + { + $next_alt_thumbnail = $row['name']; + } + else + { + $next_alt_thumbnail = $file; + } + $next_title = $lang['next_image']." : ".$next_alt_thumbnail; + + $next_url_link = './picture.php?image_id='.$row['id'].'&cat='.$page['cat']; + $next_url_link.= '&expand='.$_GET['expand']; + if ( $page['cat'] == 'search' ) + { + $next_url_link.= "&search=".$_GET['search'].'&mode='.$_GET['mode']; + } +} //----------------------------------------------------- template initialization -$vtp = new VTemplate; +// +// Start output of page +// +//------------------------------------------------------------------ page title +$title = $page['name']; +if ( $title == '') +{ + $title = str_replace("_"," ",get_filename_wo_extension($page['file'])); +} +$refresh = 0; +if ( isset( $_GET['slideshow'] ) && isset($next_url_link)) +{ + $refresh= $_GET['slideshow']; + $url_link = $next_url_link; +} +include('include/page_header.php'); + $handle = $vtp->Open( './template/'.$user['template'].'/picture.vtp' ); initialize_template(); @@ -170,8 +229,6 @@ $tpl = array( 'back','submit','comments_title','comments_del','delete', 'comments_add','author','slideshow','slideshow_stop', 'period_seconds' ); templatize_array( $tpl, 'lang', $handle ); -$vtp->setGlobalVar( $handle, 'user_template', $user['template'] ); -$vtp->setGlobalVar( $handle, 'text_color', $user['couleur_text'] ); //-------------------------------------------------------- slideshow management if ( isset( $_GET['slideshow'] ) ) { @@ -199,7 +256,8 @@ else $url = './picture.php'; $url.= '?image_id='.$page['id']; $url.= '&cat='.$page['cat']; - $url.= '&expand='.$_GET['expand']; + if (isset($_GET['expand'])) + $url.= '&expand='.$_GET['expand']; if ( $page['cat'] == 'search' ) { $url.= '&search='.$_GET['search']; @@ -211,16 +269,7 @@ else } $vtp->closeSession( $handle, 'start_slideshow' ); } -//------------------------------------------------------------------ page title -if ( $page['name'] != '' ) -{ - $vtp->setGlobalVar( $handle, 'page_title', $page['name'] ); -} -else -{ - $page_title = str_replace("_"," ",get_filename_wo_extension($page['file'])); - $vtp->setGlobalVar( $handle, 'page_title', $page_title ); -} + //-------------------------------------------------- previous picture thumbnail if ( $page['num'] >= 1 ) { @@ -329,7 +378,9 @@ $final_width = $picture_size[0]; $final_height = $picture_size[1]; $url_link = './category.php?cat='.$page['cat'].'&'; -$url_link.= 'num='.$page['num'].'&expand='.$_GET['expand']; +$url_link.= 'num='.$page['num']; +if (isset($_GET['expand'])) + $url_link.='&expand='.$_GET['expand']; if ( $page['cat'] == 'search' ) { $url_link.= "&search=".$_GET['search'].'&mode='.$_GET['mode']; @@ -337,7 +388,6 @@ if ( $page['cat'] == 'search' ) $vtp->setGlobalVar( $handle, 'picture_link', add_session_id( $url_link ) ); $vtp->setGlobalVar( $handle, 'picture_width', $final_width ); $vtp->setGlobalVar( $handle, 'picture_height', $final_height ); -$vtp->setGlobalVar( $handle, 'picture_border_color', $user['couleur_text'] ); $vtp->setGlobalVar( $handle, 'picture_src', $lien_image ); $vtp->setGlobalVar( $handle, 'picture_alt', $page['file'] ); @@ -445,7 +495,9 @@ $vtp->closeSession( $handle, 'info_line' ); if ( $page['cat'] != 'fav' and !$user['is_the_guest'] ) { $url = './picture.php?cat='.$page['cat'].'&image_id='.$page['id']; - $url.= '&expand='.$_GET['expand'].'&add_fav=1'; + if (isset($_GET['expand'])) + $url.= '&expand='.$_GET['expand']; + $url.='&add_fav=1'; if ( $page['cat'] == 'search' ) { $url.= '&search='.$_GET['search'].'&mode='.$_GET['mode']; @@ -479,68 +531,21 @@ if ( $user['status'] == 'admin' ) $vtp->setVar( $handle, 'modification.link', add_session_id( $url ) ); $vtp->setVar( $handle, 'modification.name', $lang['link_info_image'] ); } -//---------------------------------------------- next picture thumbnail display -if ( $page['num'] < $page['cat_nb_images']-1 ) + +if ( $next ) { - $next = $page['num'] + 1; - $query = 'SELECT DISTINCT(id),name,file,tn_ext,storage_category_id'; - $query.= ' FROM '.PREFIX_TABLE.'images'; - $query.= ' LEFT JOIN '.PREFIX_TABLE.'image_category AS ic ON id=ic.image_id'; - $query.= $page['where']; - $query.= $conf['order_by']; - $query.= ' LIMIT '.$next.',1'; - $query.= ';'; - $result = mysql_query( $query ); - $row = mysql_fetch_array( $result ); - - if ( !isset($array_cat_directories[$row['storage_category_id']])) - { - $array_cat_directories[$row['storage_category_id']] = - get_complete_dir( $row['storage_category_id'] ); - } - $cat_directory = $array_cat_directories[$row['storage_category_id']]; - - $file = substr ( $row['file'], 0, strrpos ( $row['file'], ".") ); - $lien_thumbnail = $cat_directory.'thumbnail/'; - $lien_thumbnail.= $conf['prefix_thumbnail'].$file.".".$row['tn_ext']; - - if ( $row['name'] != "" ) - { - $alt_thumbnail = $row['name']; - } - else - { - $alt_thumbnail = $file; - } - $next_title = $lang['next_image']." : ".$alt_thumbnail; - - $url_link = './picture.php?image_id='.$row['id'].'&cat='.$page['cat']; - $url_link.= '&expand='.$_GET['expand']; - if ( $page['cat'] == 'search' ) - { - $url_link.= "&search=".$_GET['search'].'&mode='.$_GET['mode']; - } // sending vars for display $vtp->addSession( $handle, 'next' ); - $vtp->setGlobalVar( $handle, 'next.url', add_session_id( $url_link ) ); + $vtp->setGlobalVar( $handle, 'next.url', add_session_id( $next_url_link ) ); $vtp->setGlobalVar( $handle, 'next.title', $next_title ); - $vtp->setGlobalVar( $handle, 'next.src', $lien_thumbnail ); - $vtp->setGlobalVar( $handle, 'next.alt', $alt_thumbnail ); + $vtp->setGlobalVar( $handle, 'next.src', $next_lien_thumbnail ); + $vtp->setGlobalVar( $handle, 'next.alt', $next_alt_thumbnail ); $vtp->closeSession( $handle, 'next' ); - // slideshow - if ( isset( $_GET['slideshow'] ) ) - { - $vtp->addSession( $handle, 'refresh' ); - $vtp->setVar( $handle, 'refresh.time', $_GET['slideshow'] ); - $url = $url_link.'&slideshow='.$_GET['slideshow']; - $vtp->setVar( $handle, 'refresh.url', add_session_id( $url ) ); - $vtp->closeSession( $handle, 'refresh' ); - } } else { - $vtp->addSession( $handle, 'previous_empty' ); - $vtp->closeSession( $handle, 'previous_empty' ); + $vtp->addSession( $handle, 'next_empty' ); + $vtp->closeSession( $handle, 'next_empty' ); } //---------------------------------------------------- users's comments display if ( $conf['show_comments'] ) @@ -645,7 +650,8 @@ if ( $conf['show_comments'] ) $page['nb_comments'] = $row['nb_comments']; // navigation bar creation $url = './picture.php?cat='.$page['cat'].'&image_id='.$page['id']; - $url.= '&expand='.$_GET['expand']; + if (isset($_GET['expand'])) + $url.= '&expand='.$_GET['expand']; if ( $page['cat'] == 'search' ) { $url.= '&search='.$_GET['search'].'&mode='.$_GET['mode']; @@ -742,4 +748,6 @@ mysql_close(); //----------------------------------------------------------- html code display $code = $vtp->Display( $handle, 0 ); echo $code; + +include('include/page_tail.php'); ?> \ No newline at end of file diff --git a/profile.php b/profile.php index b900d1be3..e9fb7dc93 100644 --- a/profile.php +++ b/profile.php @@ -124,10 +124,15 @@ if ( isset( $_POST['submit'] ) ) } } //----------------------------------------------------- template initialization -$vtp = new VTemplate; +// +// Start output of page +// +$title = $lang['customize_page_title']; +include('include/page_header.php'); + $handle = $vtp->Open( './template/'.$user['template'].'/profile.vtp' ); initialize_template(); -$tpl = array( 'customize_page_title','customize_title','password','new', +$tpl = array( 'customize_title','password','new', 'reg_confirm','submit','create_cookie' ); templatize_array( $tpl, 'lang', $handle ); //----------------------------------------------------------------- form action @@ -368,4 +373,5 @@ if ( $conf['authorize_cookies'] ) //----------------------------------------------------------- html code display $code = $vtp->Display( $handle, 0 ); echo $code; +include('include/page_tail.php'); ?> \ No newline at end of file diff --git a/register.php b/register.php index 0d32ca9db..5d32458b9 100644 --- a/register.php +++ b/register.php @@ -42,11 +42,14 @@ if ( isset( $_POST['submit'] ) ) } } //----------------------------------------------------- template initialization -$vtp = new VTemplate; +// +// Start output of page +// +$title= $lang['register_page_title']; +include('include/page_header.php'); + $handle = $vtp->Open( './template/'.$user['template'].'/register.vtp' ); // language -$vtp->setGlobalVar( $handle, 'register_page_title', - $lang['register_page_title'] ); $vtp->setGlobalVar( $handle, 'register_title', $lang['register_title'] ); $vtp->setGlobalVar( $handle, 'ident_guest_visit',$lang['ident_guest_visit'] ); $vtp->setGlobalVar( $handle, 'submit', $lang['submit'] ); @@ -102,4 +105,5 @@ $vtp->closeSession( $handle, 'line' ); //----------------------------------------------------------- html code display $code = $vtp->Display( $handle, 0 ); echo $code; +include('include/page_tail.php'); ?> \ No newline at end of file diff --git a/search.php b/search.php index 21d5a5fca..96ec244ab 100644 --- a/search.php +++ b/search.php @@ -53,10 +53,14 @@ if ( isset( $_POST['search'] ) ) } } //----------------------------------------------------- template initialization -$vtp = new VTemplate; +// +// Start output of page +// +$title= $lang['search_title']; +include('include/page_header.php'); + $handle = $vtp->Open( './template/'.$user['template'].'/search.vtp' ); initialize_template(); - $tpl = array( 'search_title','search_return_main_page','submit', 'search_comments' ); templatize_array( $tpl, 'lang', $handle ); @@ -93,7 +97,7 @@ $vtp->addSession( $handle, 'radio' ); $vtp->setVar( $handle, 'radio.name', 'mode' ); $vtp->setVar( $handle, 'radio.value', 'OR' ); $vtp->setVar( $handle, 'radio.option', $lang['search_mode_or'] ); -if (isset($_POST['mode']) && ($_POST['mode'] == 'OR' or $_POST['mode'] == '' )) +if (!isset($_POST['mode']) || $_POST['mode'] == 'OR' ) { $vtp->setVar( $handle, 'radio.checked', ' checked="checked"' ); } @@ -117,6 +121,7 @@ $vtp->setGlobalVar( $handle, 'back_url', add_session_id( './category.php' ) ); $code = $vtp->Display( $handle, 0 ); echo $code; //------------------------------------------------------------ log informations -pwg_log( 'search', $page['title'] ); +pwg_log( 'search', $title ); mysql_close(); +include('include/page_tail.php'); ?> \ No newline at end of file diff --git a/template/default/about.vtp b/template/default/about.vtp index 7a0802fef..5b416d1b8 100644 --- a/template/default/about.vtp +++ b/template/default/about.vtp @@ -1,11 +1,3 @@ - - - {#style} - {#about_page_title} - - - - {#header} -
@@ -26,7 +18,4 @@
- {#footer} - - \ No newline at end of file + \ No newline at end of file diff --git a/template/default/category.vtp b/template/default/category.vtp index ed4cc67a9..64d0d6005 100644 --- a/template/default/category.vtp +++ b/template/default/category.vtp @@ -1,11 +1,3 @@ - - - - {#style} - {#title} - - - {#header}
@@ -16,11 +8,11 @@
[ {#nb_total_pictures} {#total} ]
-
  {#favorite_cat} [ {#nb_favorites} ] +
 > {#favorite_cat} [ {#nb_favorites} ] -
  {#stats} -
      {#top_number} {#most_visited_cat} -
      {#recent_cat} {#icon_short} +
 > {#stats} +
     > {#top_number} {#most_visited_cat} +
     > {#recent_cat} {#icon_short} {#frame_end}
 
@@ -101,12 +93,4 @@
- - - - - {#footer} - - \ No newline at end of file + \ No newline at end of file diff --git a/template/default/comments.vtp b/template/default/comments.vtp index 133f9578c..f7fad81f8 100644 --- a/template/default/comments.vtp +++ b/template/default/comments.vtp @@ -1,52 +1,3 @@ - - - {#style} - {#title_comments} - - - - - - {#header} -
@@ -113,7 +64,4 @@ {#frame_end}
- {#footer} - - \ No newline at end of file + \ No newline at end of file diff --git a/template/default/default.css b/template/default/default.css new file mode 100644 index 000000000..15e44e56d --- /dev/null +++ b/template/default/default.css @@ -0,0 +1,164 @@ +a { +text-decoration:none; +} + +a:hover { +text-decoration:underline; +} + +a.back { +color: #FFFFFF; +} + +body { +font-family:arial,sans-serif; +font-size:12px; +background-color:#444444; +color: #FFFFFF; +margin:5px; +} + +table,input { +font-family:arial,sans-serif; +font-size:12px; +} + +.imgLink { +border:1px solid #FFFFFF; +} + +.titrePage,.titreMenu,.menu,.info, a { +color:#FFFFFF; +} +.titreMenu,.menu,.info { +margin-bottom:5px; +white-space:nowrap; +} +.menu,.titrePage,.info { +margin-left:2px; +margin-right:2px; +} +.menuInfoCat { +font-family:sans-serif; +font-size:11px; +} +.totalImages { +text-align:center; +margin-top:5px; +font-family:sans-serif; +font-size:11px; +} +.titreMenu { +font-weight:600; +text-align:center; +} +.info { +text-align:right; +} +.titrePage { +white-space:nowrap; +font-weight:500; +font-size:18px; +text-align:center; +} +.comments,.infoCat,.navigationBar { +margin-top:10px; +margin-bottom:10px; +} +.comments { +text-align:justify; +font-style:italic; +} +.navigationBar { +text-align:center; +} +.infoCat { +text-align:left; +} +.thumbnail { +font-size:11px; +text-align:center; +} +.copyright { +font-size:11px; +text-align:center; +font-family:sans-serif; +letter-spacing:0.3mm; +} +.commentImage { +font-weight:bold; +text-align:center; +font-size:17px; +} +.bouton { +background:#EEEEEE; +} +input { +border-width:1; +border-color:#000000; +background:#ffffff; +color: #000000; +} +table { +border-collapse:collapse; +} +table.thumbnail { +border-collapse:separate; +} +td { +font-family:sans-serif; +padding:0; +} +.errors { +text-align:left; +margin-top:5px; +margin-bottom:5px; +background-color:red; +font-weight:bold; +border:1px solid black; +color:white; +} +div.information { +text-align:center; +border:2px solid #FFFFFF; +margin:10px;padding:5px; +} + +.commentsAuthor,.commentsTitle,.commentsInfos,.commentsContent,.commentsNavigationBar { + color:#FFFFFF; + font-family:arial,sans-Serif; + font-size:12px; + } + .commentsTitle,.commentsAuthor { + text-align:center; + font-weight:bold; + } + .commentsInfos { + margin:3px 3px 3px 10px; + font-size:11px; + text-align:right; + } + .commentsContent { + margin:10px; + } + .commentsTitle { + margin-top:15px; + } + .commentsAuthor { + margin:5px; + } + .commentsNavigationBar { + margin:10px; + } + .tableComment { + width:100%; + border:2px solid #FFFFFF; + margin:10px; + } + .cellAuthor { + border-right:1px solid #FFFFFF; + width:100px; + } + .cellInfo { + border-bottom:1px solid #FFFFFF; + } \ No newline at end of file diff --git a/template/default/footer.vtp b/template/default/footer.vtp new file mode 100644 index 000000000..1cf62a5d5 --- /dev/null +++ b/template/default/footer.vtp @@ -0,0 +1,8 @@ + + + + {#footer} + + \ No newline at end of file diff --git a/template/default/header.vtp b/template/default/header.vtp new file mode 100644 index 000000000..e97197576 --- /dev/null +++ b/template/default/header.vtp @@ -0,0 +1,13 @@ + + + + + + + + +{#title} + + + +{#header} diff --git a/template/default/htmlfunctions.inc.php b/template/default/htmlfunctions.inc.php index c3b2872b7..ad52bfc13 100644 --- a/template/default/htmlfunctions.inc.php +++ b/template/default/htmlfunctions.inc.php @@ -17,10 +17,10 @@ * * ***************************************************************************/ -include( PREFIX_INCLUDE.'./template/'.$user['template'].'/theme/conf.php' ); +//include( PREFIX_INCLUDE.'./template/'.$user['template'].'/theme/conf.php' ); $user['lien_expanded']='./template/'.$user['template'].'/theme/expanded.gif'; $user['lien_collapsed']='./template/'.$user['template'].'/theme/collapsed.gif'; -include_once( PREFIX_INCLUDE.'./template/'.$user['template'].'/style.inc.php'); +//include_once( PREFIX_INCLUDE.'./template/'.$user['template'].'/style.inc.php'); function get_icon( $date_comparaison ) { @@ -160,15 +160,15 @@ function initialize_template() { global $vtp, $handle, $user, $lang; - $vtp->setGlobalVar( $handle, 'charset', $lang['charset'] ); - $vtp->setGlobalVar( $handle, 'style', $user['style'] ); + // $vtp->setGlobalVar( $handle, 'charset', $lang['charset'] ); + //$vtp->setGlobalVar( $handle, 'style', $user['style'] ); $vtp->setGlobalVar( $handle, 'frame_start', get_frame_start() ); $vtp->setGlobalVar( $handle, 'frame_begin', get_frame_begin() ); $vtp->setGlobalVar( $handle, 'frame_end', get_frame_end() ); - $vtp->setVarF( $handle, 'header', - './template/'.$user['template'].'/header.htm' ); - $vtp->setVarF( $handle, 'footer', - './template/'.$user['template'].'/footer.htm' ); + //$vtp->setVarF( $handle, 'header', + // './template/'.$user['template'].'/header.htm' ); + //$vtp->setVarF( $handle, 'footer', + // './template/'.$user['template'].'/footer.htm' ); } function display_category( $category, $indent, $handle ) diff --git a/template/default/identification.vtp b/template/default/identification.vtp index 6240d0f99..132776ad6 100644 --- a/template/default/identification.vtp +++ b/template/default/identification.vtp @@ -1,11 +1,3 @@ - - - {#style} - {#ident_page_title} - - - - {#header} -
@@ -72,7 +64,4 @@ {#frame_end}
- {#footer} - - \ No newline at end of file + \ No newline at end of file diff --git a/template/default/picture.vtp b/template/default/picture.vtp index 6af7f54c6..2fddd393a 100644 --- a/template/default/picture.vtp +++ b/template/default/picture.vtp @@ -1,54 +1,3 @@ - - - - - - - {#style} - - - {#page_title} - - - {#header}
{#content}
@@ -85,7 +34,7 @@
 
{#frame_start}1%{#frame_begin} - {#picture_alt} + {#picture_alt}
{#picture_comment}
@@ -184,7 +133,4 @@ -
- {#footer} - - \ No newline at end of file + \ No newline at end of file diff --git a/template/default/profile.vtp b/template/default/profile.vtp index 3aef1460a..e53394e97 100644 --- a/template/default/profile.vtp +++ b/template/default/profile.vtp @@ -1,11 +1,3 @@ - - - {#style} - {#customize_page_title} - - - - {#header} -
@@ -96,7 +88,4 @@ {#frame_end}
- {#footer} - - \ No newline at end of file + \ No newline at end of file diff --git a/template/default/register.vtp b/template/default/register.vtp index f7104641c..f4d97c52f 100644 --- a/template/default/register.vtp +++ b/template/default/register.vtp @@ -1,11 +1,3 @@ - - - {#style} - {#register_page_title} - - - - {#header} -
@@ -68,7 +60,4 @@ {#frame_end}
- {#footer} - - \ No newline at end of file + \ No newline at end of file diff --git a/template/default/search.vtp b/template/default/search.vtp index 5b6f094ea..bc6b92995 100644 --- a/template/default/search.vtp +++ b/template/default/search.vtp @@ -1,11 +1,3 @@ - - - {#style} - {#search_title} - - - - {#header} -
@@ -78,7 +70,4 @@ {#frame_end}
- {#footer} - - \ No newline at end of file + \ No newline at end of file diff --git a/template/default/style.inc.php b/template/default/style.inc.php deleted file mode 100644 index ac4fa32d2..000000000 --- a/template/default/style.inc.php +++ /dev/null @@ -1,147 +0,0 @@ - * - * author : Pierrick LE GALL * - * * - * $Id$ - * * - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; * - * * - ***************************************************************************/ -$user['style'] = ''; \ No newline at end of file diff --git a/template/default/theme/conf.php b/template/default/theme/conf.php deleted file mode 100644 index 0f77103e5..000000000 --- a/template/default/theme/conf.php +++ /dev/null @@ -1,23 +0,0 @@ - * - * author : Jerome * - * * - * $Id$ - * * - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; * - * * - ***************************************************************************/ - -$user['couleur_fond'] = '#444444'; -$user['couleur_text_fond'] = 'white'; -$user['couleur_text'] = 'white'; -?> \ No newline at end of file diff --git a/template/default/upload.vtp b/template/default/upload.vtp index 1ac1c3ccb..3b618442e 100644 --- a/template/default/upload.vtp +++ b/template/default/upload.vtp @@ -1,11 +1,3 @@ - - - {#style} - {#upload_title} - - - - {#header} -
@@ -109,7 +101,4 @@ {#frame_end}
- {#footer} - - \ No newline at end of file + \ No newline at end of file diff --git a/upload.php b/upload.php index 91f93e973..98505961b 100644 --- a/upload.php +++ b/upload.php @@ -109,13 +109,7 @@ if ( isset( $page['cat'] ) and is_numeric( $page['cat'] ) ) $page['cat_site_id'] = $result['site_id']; $page['cat_name'] = $result['name']; $page['cat_uploadable'] = $result['uploadable']; -} -else -{ - $access_forbidden = true; -} -if ( $access_forbidden == true - or $page['cat_site_id'] != 1 +if ( $page['cat_site_id'] != 1 or !$conf['upload_available'] or !$page['cat_uploadable'] ) { @@ -124,8 +118,13 @@ if ( $access_forbidden == true echo $lang['thumbnails'].''; exit(); } +} //----------------------------------------------------- template initialization -$vtp = new VTemplate; +// +// Start output of page +// +$title= $lang['upload_title']; +include('include/page_header.php'); $handle = $vtp->Open( './template/'.$user['template'].'/upload.vtp' ); initialize_template(); @@ -347,12 +346,16 @@ if ( !$page['upload_successful'] ) else $mail_address=$user['mail_address']; $vtp->setGlobalVar( $handle, 'user_mail_address',$user['mail_address'] ); // name of the picture + if (isset($_POST['name'])) $vtp->setVar( $handle, 'fields.name', $_POST['name'] ); // author + if (isset($_POST['author'])) $vtp->setVar( $handle, 'fields.author', $_POST['author'] ); // date of creation + if (isset($_POST['date_creation'])) $vtp->setVar( $handle, 'fields.date_creation', $_POST['date_creation'] ); // comment + if (isset($_POST['comment'])) $vtp->setVar( $handle, 'fields.comment', $_POST['comment'] ); $vtp->closeSession( $handle, 'fields' ); @@ -373,4 +376,5 @@ $vtp->setGlobalVar( $handle, 'return_url', add_session_id( $url ) ); //----------------------------------------------------------- html code display $code = $vtp->Display( $handle, 0 ); echo $code; +include('include/page_tail.php'); ?> \ No newline at end of file