diff options
author | gweltas <gweltas@piwigo.org> | 2004-03-20 00:52:37 +0000 |
---|---|---|
committer | gweltas <gweltas@piwigo.org> | 2004-03-20 00:52:37 +0000 |
commit | 4128835db8d7b8e619951d4c31e23bd934758f09 (patch) | |
tree | 4fddd9ea03f3ebeeaba73c3a42f7130e29a54b58 | |
parent | 8850aabc34e524e1a7816c363657e3176502a708 (diff) |
- Template migration
- Admin Control Panel migration
- Language migration
git-svn-id: http://piwigo.org/svn/trunk@393 68402e56-0260-453c-a942-63ccdbb3a9ee
71 files changed, 2295 insertions, 3342 deletions
@@ -36,13 +36,11 @@ $title= $lang['about_page_title']; include(PHPWG_ROOT_PATH.'include/page_header.php'); $template->set_filenames(array('about'=>'about.tpl')); -initialize_template(); - $template->assign_vars(array( 'PAGE_TITLE' => $title, 'L_ABOUT' => $lang['about_message'], 'L_RETURN' => $lang['about_return'], - 'U_RETURN' => add_session_id('./category.php?'.$_SERVER['QUERY_STRING']) + 'U_RETURN' => add_session_id(PHPWG_ROOT_PATH.'category.php?'.$_SERVER['QUERY_STRING']) ) ); @@ -27,21 +27,10 @@ //----------------------------------------------------------- include define('PHPWG_ROOT_PATH','./'); +define('IN_ADMIN', true); include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); -include_once( './admin/include/isadmin.inc.php' ); -//----------------------------------------------------- template initialization -$vtp = new VTemplate; -$handle = $vtp->Open( './template/'.$user['template'].'/admin.vtp' ); -// language -$tpl = array( 'title_default','charset','install_warning' ); -templatize_array( $tpl, 'lang', $handle ); -$vtp->setGlobalVar( $handle, 'style', './template/'.$user['template'].'/'.$user['template'].'-admin.css'); -//-------------------------------------------------- install.php still exists ? -if ( is_file( './install.php' ) ) -{ - $vtp->addSession( $handle, 'install_warning' ); - $vtp->closeSession( $handle, 'install_warning' ); -} +include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' ); + //--------------------------------------- validating page and creation of title $page_valide = false; $title = ''; @@ -52,8 +41,8 @@ switch ( $_GET['page'] ) $title = $lang['title_liste_users']; $page_valide = true; break; case 'user_modify': $title = $lang['title_modify']; $page_valide = true; break; - case 'user_perm': - if ( !is_numeric( $_GET['user_id'] ) ) $_GET['user_id'] = -1; + case 'user_search': + /* if ( !is_numeric( $_GET['user_id'] ) ) $_GET['user_id'] = -1; $query = 'SELECT status,username'; $query.= ' FROM '.USERS_TABLE; $query.= ' WHERE id = '.$_GET['user_id']; @@ -71,14 +60,15 @@ switch ( $_GET['page'] ) else { $page_valide = false; - } - break; + }*/ + $title = $lang['title_user_perm']; + //.' '.$_POST['username']; + $page_valide = true; break; case 'group_list' : $title = $lang['title_groups']; $page_valide = true; break; case 'group_perm' : if ( !is_numeric( $_GET['group_id'] ) ) $_GET['group_id'] = -1; - $query = 'SELECT name'; - $query.= ' FROM '.PREFIX_TABLE.'groups'; + $query = 'SELECT name FROM '.GROUPS_TABLE; $query.= ' WHERE id = '.$_GET['group_id']; $query.= ';'; $result = mysql_query( $query ); @@ -127,16 +117,16 @@ switch ( $_GET['page'] ) $title = $lang['title_thumbnails']; if ( isset( $_GET['dir'] ) ) { - $title.= ' '.$lang['title_thumbnails_2'].' <span style="color:#006699;">'; + $title.= ' '.$lang['title_thumbnails_2'].' <span class="titreImg">'; // $_GET['dir'] contains : // ./galleries/vieux_lyon ou // ./galleries/vieux_lyon/visite ou // ./galleries/vieux_lyon/visite/truc ... $dir = explode( "/", $_GET['dir'] ); $title.= $dir[2]; - for ( $i = 3; $i < sizeof( $dir ) - 1; $i++ ) + for ( $i = 2; $i < sizeof( $dir ) - 1; $i++ ) { - $title.= ' > '.$dir[$i]; + $title.= ' > '.$dir[$i+1]; } $title.= "</span>"; } @@ -154,43 +144,9 @@ switch ( $_GET['page'] ) $title = $lang['title_default']; break; } if ( $title == '' ) $title = $lang['title_default']; -$vtp->setGlobalVar( $handle, 'title', $title ); -//--------------------------------------------------------------------- summary -$link_start = './admin.php?page='; -// configuration -$vtp->addSession( $handle, 'summary' ); -$vtp->setVar( $handle, 'summary.indent', '' ); -$vtp->setVar( $handle, 'summary.link', - add_session_id( $link_start.'configuration' ) ); -$vtp->setVar( $handle, 'summary.name', $lang['menu_config'] ); -$vtp->closeSession( $handle, 'summary' ); -// users -$vtp->addSession( $handle, 'summary' ); -$vtp->setVar( $handle, 'summary.indent', '| ' ); -$vtp->setVar( $handle, 'summary.link', - add_session_id( $link_start.'user_list' ) ); -$vtp->setVar( $handle, 'summary.name', $lang['menu_users'] ); -$vtp->closeSession( $handle, 'summary' ); -// groups -$vtp->addSession( $handle, 'summary' ); -$vtp->setVar( $handle, 'summary.indent', '| ' ); -$vtp->setVar( $handle, 'summary.link', - add_session_id( $link_start.'group_list' ) ); -$vtp->setVar( $handle, 'summary.name', $lang['menu_groups'] ); -$vtp->closeSession( $handle, 'summary' ); -// categories -$vtp->addSession( $handle, 'summary' ); -$vtp->setVar( $handle, 'summary.indent', '| ' ); -$vtp->setVar( $handle, 'summary.link',add_session_id( $link_start.'cat_list')); -$vtp->setVar( $handle, 'summary.name', $lang['menu_categories'] ); -$vtp->closeSession( $handle, 'summary' ); + // waiting -$vtp->addSession( $handle, 'summary' ); -$vtp->setVar( $handle, 'summary.indent', '| ' ); -$vtp->setVar( $handle, 'summary.link', - add_session_id( $link_start.'waiting' ) ); -$query = 'SELECT id'; -$query.= ' FROM '.PREFIX_TABLE.'waiting'; +$query = 'SELECT id FROM '.WAITING_TABLE; $query.= " WHERE validated='false'"; $query.= ';'; $result = mysql_query( $query ); @@ -199,71 +155,60 @@ if ( mysql_num_rows( $result ) > 0 ) { $nb_waiting = ' [ '.mysql_num_rows( $result ).' ]'; } -$vtp->setVar( $handle, 'summary.name', $lang['menu_waiting'].$nb_waiting ); -$vtp->closeSession( $handle, 'summary' ); // comments -$vtp->addSession( $handle, 'summary' ); -$vtp->setVar( $handle, 'summary.indent', '| ' ); -$vtp->setVar( $handle, 'summary.link', - add_session_id( $link_start.'comments' ) ); -$query = 'SELECT id'; -$query.= ' FROM '.PREFIX_TABLE.'comments'; +$query = 'SELECT id FROM '.COMMENTS_TABLE; $query.= " WHERE validated='false'"; $query.= ';'; $result = mysql_query( $query ); -$nb_waiting = ''; +$nb_comments = ''; if ( mysql_num_rows( $result ) > 0 ) { - $nb_waiting = ' [ '.mysql_num_rows( $result ).' ]'; + $nb_comments = ' [ '.mysql_num_rows( $result ).' ]'; } -$vtp->setVar( $handle, 'summary.name', $lang['menu_comments'].$nb_waiting ); -$vtp->closeSession( $handle, 'summary' ); -// update -$vtp->addSession( $handle, 'summary' ); -$vtp->setVar( $handle, 'summary.indent', '| ' ); -$vtp->setVar( $handle, 'summary.link', - add_session_id( $link_start.'update' ) ); -$vtp->setVar( $handle, 'summary.name', $lang['menu_update'] ); -$vtp->closeSession( $handle, 'summary' ); -// thumbnails -$vtp->addSession( $handle, 'summary' ); -$vtp->setVar( $handle, 'summary.indent', '| ' ); -$vtp->setVar( $handle, 'summary.link', - add_session_id( $link_start.'thumbnail' ) ); -$vtp->setVar( $handle, 'summary.name', $lang['menu_thumbnails'] ); -$vtp->closeSession( $handle, 'summary' ); -// history -$vtp->addSession( $handle, 'summary' ); -$vtp->setVar( $handle, 'summary.indent', '| ' ); -$vtp->setVar( $handle, 'summary.link', - add_session_id( $link_start.'stats' ) ); -$vtp->setVar( $handle, 'summary.name', $lang['menu_history'] ); -$vtp->closeSession( $handle, 'summary' ); -// instructions -$vtp->addSession( $handle, 'summary' ); -$vtp->setVar( $handle, 'summary.indent', '| ' ); -$vtp->setVar( $handle, 'summary.link', - add_session_id( $link_start.'help' ) ); -$vtp->setVar( $handle, 'summary.name', $lang['menu_instructions'] ); -$vtp->closeSession( $handle, 'summary' ); -// back to thumbnails page -$vtp->addSession( $handle, 'summary' ); -$vtp->setVar( $handle, 'summary.indent', '| ' ); -$vtp->setVar( $handle, 'summary.link', add_session_id( './category.php' ) ); -$vtp->setVar( $handle, 'summary.name', $lang['menu_back'] ); -$vtp->closeSession( $handle, 'summary' ); + +$link_start = PHPWG_ROOT_PATH.'admin.php?page='; +//----------------------------------------------------- template initialization +include(PHPWG_ROOT_PATH.'include/page_header.php'); +$template->set_filenames( array('admin'=>'admin.tpl') ); + +$template->assign_vars(array( + 'L_CONFIG'=>$lang['menu_config'], + 'L_USERS'=>$lang['menu_users'], + 'L_GROUPS'=>$lang['menu_groups'], + 'L_CATEGORIES'=>$lang['menu_categories'], + 'L_WAITING'=>$lang['menu_waiting'].$nb_waiting, + 'L_COMMENTS'=>$lang['menu_comments'].$nb_comments, + 'L_UPDATE'=>$lang['menu_update'], + 'L_THUMBNAILS'=>$lang['menu_thumbnails'], + 'L_HISTORY'=>$lang['menu_history'], + 'L_FAQ'=>$lang['menu_instructions'], + 'L_RETURN'=>$lang['menu_back'], + + 'U_CONFIG'=>add_session_id($link_start.'configuration' ), + 'U_USERS'=>add_session_id($link_start.'user_search' ), + 'U_GROUPS'=>add_session_id($link_start.'group_list' ), + 'U_CATEGORIES'=>add_session_id($link_start.'cat_list' ), + 'U_WAITING'=>add_session_id($link_start.'waiting' ), + 'U_COMMENTS'=>add_session_id($link_start.'comments' ), + 'U_UPDATE'=>add_session_id($link_start.'update' ), + 'U_THUMBNAILS'=>add_session_id($link_start.'thumbnail' ), + 'U_HISTORY'=>add_session_id($link_start.'stats' ), + 'U_FAQ'=>add_session_id($link_start.'help' ), + 'U_RETURN'=>add_session_id(PHPWG_ROOT_PATH.'category.php') + )); + +//--------------------------------------------------------------------- summary +$link_start = PHPWG_ROOT_PATH.'admin.php?page='; //------------------------------------------------------------- content display if ( $page_valide ) { - include ( './admin/'.$_GET['page'].'.php' ); + if ($_GET['page']=='comments') include ( PHPWG_ROOT_PATH.'comments.php'); + else include ( PHPWG_ROOT_PATH.'admin/'.$_GET['page'].'.php' ); } else { - $vtp->setVar( - $handle, 'sub', - '<div style="text-align:center">'.$lang['default_message'].'</div>' ); + $template->assign_vars(array ('ADMIN_CONTENT'=> '<div style="text-align:center">'.$lang['default_message'].'</div>') ); } -//----------------------------------------------------------- html code display -$code = $vtp->Display( $handle, 0 ); -echo $code; +$template->pparse('admin'); +include(PHPWG_ROOT_PATH.'include/page_tail.php'); ?> diff --git a/admin/configuration.php b/admin/configuration.php index e7392f741..ba77a72f7 100644 --- a/admin/configuration.php +++ b/admin/configuration.php @@ -25,7 +25,12 @@ // | USA. | // +-----------------------------------------------------------------------+ -include_once( './admin/include/isadmin.inc.php' ); +if( !defined("PHPWG_ROOT_PATH") ) +{ + die ("Hacking attempt!"); +} + +include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' ); $Caracs = array("¥" => "Y", "µ" => "u", "À" => "A", "Á" => "A", "Â" => "A", "Ã" => "A", "Ä" => "A", "Å" => "A", @@ -44,35 +49,14 @@ $Caracs = array("¥" => "Y", "µ" => "u", "À" => "A", "Á" => "A", "ù" => "u", "ú" => "u", "û" => "u", "ü" => "u", "ý" => "y", "ÿ" => "y"); //------------------------------ verification and registration of modifications -$conf_infos = array(); -$query = 'SELECT param'; -$query.= ' FROM '.CONFIG_TABLE; -$query.= ';'; -$result = mysql_query( $query ); -while ( $row = mysql_fetch_array( $result ) ) -{ - array_push( $conf_infos, $row['param'] ); -} - -$default_user_infos = -array( 'nb_image_line','nb_line_page','language','maxwidth', - 'maxheight','expand','show_nb_comments','short_period','long_period', - 'template' ); $error = array(); if ( isset( $_POST['submit'] ) ) { $int_pattern = '/^\d+$/'; - // empty session table if asked - if ( $_POST['empty_session_table'] == 1 ) - { - $query = 'DELETE FROM '.PREFIX_TABLE.'sessions'; - $query.= ' WHERE expiration < '.time().';'; - mysql_query( $query ); - } // deletion of site as asked $site_deleted = false; $query = 'SELECT id'; - $query.= ' FROM '.PREFIX_TABLE.'sites'; + $query.= ' FROM '.SITES_TABLE; $query.= " WHERE galleries_url <> './galleries/';"; $result = mysql_query( $query ); while ( $row = mysql_fetch_array( $result ) ) @@ -134,13 +118,6 @@ if ( isset( $_POST['submit'] ) ) { array_push( $error, $lang['conf_err_sid_time'] ); } - // max_user_listbox must be an integer between 0 and 255 included - if ( !preg_match( $int_pattern, $_POST['max_user_listbox'] ) - or $_POST['max_user_listbox'] < 0 - or $_POST['max_user_listbox'] > 255 ) - { - array_push( $error, $lang['conf_err_max_user_listbox'] ); - } // the number of comments per page must be an integer between 5 and 50 // included if ( !preg_match( $int_pattern, $_POST['nb_comment_page'] ) @@ -185,7 +162,7 @@ if ( isset( $_POST['submit'] ) ) array_push( $error, $lang['conf_err_upload_maxheight_thumbnail'] ); } - if ( $_POST['maxwidth'] != '' +/* if ( $_POST['maxwidth'] != '' and ( !preg_match( $int_pattern, $_POST['maxwidth'] ) or $_POST['maxwidth'] < 50 ) ) { @@ -196,805 +173,158 @@ if ( isset( $_POST['submit'] ) ) or $_POST['maxheight'] < 50 ) ) { array_push( $error, $lang['err_maxheight'] ); - } + }*/ // updating configuraiton if no error found if ( count( $error ) == 0 ) { - foreach ( $conf_infos as $conf_info ) { - if ( isset( $_POST[$conf_info] ) ) + $result = mysql_query( "SELECT * FROM ".CONFIG_TABLE ); + while ( $row = mysql_fetch_array( $result ) ) + { + $config_name = $row['param']; + $conf[$config_name] = ( isset($_POST[$config_name]) ) ? $_POST[$config_name] : $row['value']; + if ( isset( $_POST[$config_name] ) ) { $query = 'UPDATE '.CONFIG_TABLE; - $query.= ' SET value = '; - if ( $_POST[$conf_info] == '' ) - { - $query.= 'NULL'; - } - else - { - $query.= "'".$_POST[$conf_info]."'"; - } - $query.= " WHERE param = '".$conf_info."'"; - $query.= ';'; + $query.= " SET value = '". str_replace("\'", "''", $conf[$config_name]) ; + $query.= "' WHERE param = '$config_name'"; mysql_query( $query ); } } - - $query = 'UPDATE '.USERS_TABLE; - $query.= ' SET'; - foreach ( $default_user_infos as $i => $default_user_info ) { - if ( $i > 0 ) $query.= ','; - else $query.= ' '; - $query.= $default_user_info; - $query.= ' = '; - if ( $_POST[$default_user_info] == '' ) - { - $query.= 'NULL'; - } - else - { - $query.= "'".$_POST[$default_user_info]."'"; - } - } - $query.= " WHERE username = 'guest'"; - $query.= ';'; - mysql_query( $query ); - } -//--------------------------------------------------------- data initialization - foreach ( $conf_infos as $conf_info ) { - $$conf_info = $_POST[$conf_info]; - } - foreach ( $default_user_infos as $default_user_info ) { - $$default_user_info = $_POST[$default_user_info]; } } -else -{ -//--------------------------------------------------------- data initialization - $query = 'SELECT param,value'; - $query.= ' FROM '.CONFIG_TABLE; - $query.= ';'; - $result = mysql_query( $query ); - while ( $row =mysql_fetch_array( $result ) ) - { - if ( isset( $row['value'] ) ) - { - $$row['param'] = $row['value']; - } - else - { - $$row['param'] = ''; - } - } - $query = 'SELECT '.implode( ',', $default_user_infos ); - $query.= ' FROM '.USERS_TABLE; - $query.= " WHERE username = 'guest'"; - $query.= ';'; - $row = mysql_fetch_array( mysql_query( $query ) ); - foreach ( $default_user_infos as $info ) { - if ( isset( $row[$info] ) ) $$info = $row[$info]; - else $$info = ''; - } -} +$access = ($conf['access']=='free')?'ACCESS_FREE':'ACCESS_RESTRICTED'; +$log = ($conf['log']=='true')?'HISTORY_YES':'HISTORY_NO'; +$mail_notif = ($conf['mail_notification']=='true')?'MAIL_NOTIFICATION_YES':'MAIL_NOTIFICATION_NO'; +$show_comments = ($conf['show_comments']=='true')?'SHOW_COMMENTS_YES':'SHOW_COMMENTS_NO'; +$comments_all = ($conf['comments_forall']=='true')?'COMMENTS_ALL_YES':'COMMENTS_ALL_NO'; +$comments_validation = ($conf['comments_validation']=='true')?'VALIDATE_COMMENTS_YES':'VALIDATE_COMMENTS_NO'; +$expand = ($conf['auto_expand']=='true')?'EXPAND_TREE_YES':'EXPAND_TREE_NO'; +$nb_comments = ($conf['show_nb_comments']=='true')?'NB_COMMENTS_YES':'NB_COMMENTS_NO'; +$upload = ($conf['upload_available']=='true')?'UPLOAD_YES':'UPLOAD_NO'; +$cookie = ($conf['authorize_cookies']=='true')?'COOKIE_YES':'COOKIE_NO'; + //----------------------------------------------------- template initialization -$sub = $vtp->Open( - './template/'.$user['template'].'/admin/configuration.vtp' ); +$template->set_filenames( array('config'=>'admin/configuration.tpl') ); + +$template->assign_vars(array( + 'ADMIN_NAME'=>$conf['webmaster'], + 'ADMIN_MAIL'=>$conf['mail_webmaster'], + 'THUMBNAIL_PREFIX'=>$conf['prefix_thumbnail'], + 'NB_COMMENTS_PAGE'=>$conf['nb_comment_page'], + 'LANG_SELECT'=>language_select($conf['default_lang'], 'default_lang'), + 'NB_IMAGE_LINE'=>$conf['nb_image_line'], + 'NB_ROW_PAGE'=>$conf['nb_line_page'], + 'STYLE_SELECT'=>style_select($conf['default_style'], 'default_style'), + 'SHORT_PERIOD'=>$conf['short_period'], + 'LONG_PERIOD'=>$conf['long_period'], + 'UPLOAD_MAXSIZE'=>$conf['upload_maxfilesize'], + 'UPLOAD_MAXWIDTH'=>$conf['upload_maxwidth'], + 'UPLOAD_MAXHEIGHT'=>$conf['upload_maxheight'], + 'TN_UPLOAD_MAXWIDTH'=>$conf['upload_maxwidth_thumbnail'], + 'TN_UPLOAD_MAXHEIGHT'=>$conf['upload_maxheight_thumbnail'], + 'SESSION_LENGTH'=>$conf['session_time'], + 'SESSION_ID_SIZE'=>$conf['session_id_size'], + + $access=>'checked="checked"', + $log=>'checked="checked"', + $mail_notif=>'checked="checked"', + $show_comments=>'checked="checked"', + $comments_all=>'checked="checked"', + $comments_validation=>'checked="checked"', + $expand=>'checked="checked"', + $nb_comments=>'checked="checked"', + $upload=>'checked="checked"', + $cookie=>'checked="checked"', + + 'L_CONFIRM'=>$lang['conf_confirmation'], + 'L_CONF_GENERAL'=>$lang['conf_general_title'], + 'L_ADMIN_NAME'=>$lang['conf_general_webmaster'], + 'L_ADMIN_NAME_INFO'=>$lang['conf_general_webmaster_info'], + 'L_ADMIN_MAIL'=>$lang['conf_general_mail'], + 'L_ADMIN_MAIL_INFO'=>$lang['conf_general_mail_info'], + 'L_THUMBNAIL_PREFIX'=>$lang['conf_general_prefix'], + 'L_THUMBNAIL_PREFIX_INFO'=>$lang['conf_general_prefix_info'], + 'L_ACCESS'=>$lang['conf_general_access'], + 'L_ACCESS_INFO'=>$lang['conf_general_access_info'], + 'L_ACCESS_FREE'=>$lang['conf_general_access_1'], + 'L_ACCESS_RESTRICTED'=>$lang['conf_general_access_2'], + 'L_HISTORY'=>$lang['conf_general_log'], + 'L_HISTORY_INFO'=>$lang['conf_general_log_info'], + 'L_MAIL_NOTIFICATION'=>$lang['conf_general_mail_notification'], + 'L_MAIL_NOTIFICATION_INFO'=>$lang['conf_general_mail_notification_info'], + 'L_CONF_COMMENTS'=>$lang['conf_comments_title'], + 'L_SHOW_COMMENTS'=>$lang['conf_comments_show_comments'], + 'L_SHOW_COMMENTS_INFO'=>$lang['conf_comments_show_comments_info'], + 'L_COMMENTS_ALL'=>$lang['conf_comments_forall'], + 'L_COMMENTS_ALL_INFO'=>$lang['conf_comments_forall_info'], + 'L_NB_COMMENTS_PAGE'=>$lang['conf_comments_comments_number'], + 'L_NB_COMMENTS_PAGE_INFO'=>$lang['conf_comments_comments_number_info'], + 'L_VALIDATE_COMMENTS'=>$lang['conf_comments_validation'], + 'L_VALIDATE_COMMENTS_INFO'=>$lang['conf_comments_validation_info'], + 'L_ABILITIES_SETTINGS'=>$lang['conf_default_title'], + 'L_LANG_SELECT'=>$lang['customize_language'], + 'L_LANG_SELECT_INFO'=>$lang['conf_default_language_info'], + 'L_NB_IMAGE_LINE'=>$lang['customize_nb_image_per_row'], + 'L_NB_IMAGE_LINE_INFO'=>$lang['conf_default_nb_image_per_row_info'], + 'L_NB_ROW_PAGE'=>$lang['customize_nb_row_per_page'], + 'L_NB_ROW_PAGE_INFO'=>$lang['conf_default_nb_row_per_page_info'], + 'L_STYLE_SELECT'=>$lang['customize_theme'], + 'L_STYLE_SELECT_INFO'=>$lang['conf_default_theme_info'], + 'L_SHORT_PERIOD'=>$lang['customize_short_period'], + 'L_SHORT_PERIOD_INFO'=>$lang['conf_default_short_period_info'], + 'L_LONG_PERIOD'=>$lang['customize_long_period'], + 'L_LONG_PERIOD_INFO'=>$lang['conf_default_long_period_info'], + 'L_EXPAND_TREE'=>$lang['customize_expand'], + 'L_EXPAND_TREE_INFO'=>$lang['conf_default_expand_info'], + 'L_NB_COMMENTS'=>$lang['customize_show_nb_comments'], + 'L_NB_COMMENTS_INFO'=>$lang['conf_default_show_nb_comments_info'], + 'L_UPLOAD'=>$lang['conf_upload_available'], + 'L_UPLOAD_INFO'=>$lang['conf_upload_available_info'], + 'L_CONF_UPLOAD'=>$lang['conf_upload_title'], + 'L_UPLOAD_MAXSIZE'=>$lang['conf_upload_maxfilesize'], + 'L_UPLOAD_MAXSIZE_INFO'=>$lang['conf_upload_maxfilesize_info'], + 'L_UPLOAD_MAXWIDTH'=>$lang['conf_upload_maxwidth'], + 'L_UPLOAD_MAXWIDTH_INFO'=>$lang['conf_upload_maxwidth_info'], + 'L_UPLOAD_MAXHEIGHT'=>$lang['conf_upload_maxheight'], + 'L_UPLOAD_MAXHEIGHT_INFO'=>$lang['conf_upload_maxheight_info'], + 'L_TN_UPLOAD_MAXWIDTH'=>$lang['conf_upload_maxwidth_thumbnail'], + 'L_TN_UPLOAD_MAXWIDTH_INFO'=>$lang['conf_upload_maxwidth_thumbnail_info'], + 'L_TN_UPLOAD_MAXHEIGHT'=>$lang['conf_upload_maxheight_thumbnail'], + 'L_TN_UPLOAD_MAXHEIGHT_INFO'=>$lang['conf_upload_maxheight_thumbnail'], + 'L_CONF_SESSION'=>$lang['conf_session_title'], + 'L_COOKIE'=>$lang['conf_session_cookie'], + 'L_COOKIE_INFO'=>$lang['conf_session_cookie_info'], + 'L_SESSION_LENGTH'=>$lang['conf_session_time'], + 'L_SESSION_LENGTH_INFO'=>$lang['conf_session_time_info'], + 'L_SESSION_ID_SIZE'=>$lang['conf_session_size'], + 'L_SESSION_ID_SIZE_INFO'=>$lang['conf_session_size_info'], + 'L_YES'=>$lang['yes'], + 'L_NO'=>$lang['no'], + 'L_SUBMIT'=>$lang['submit'], + + 'F_ACTION'=>add_session_id(PHPWG_ROOT_PATH.'admin.php?page=configuration') + )); $tpl = array( 'conf_confirmation','remote_site','delete', 'conf_remote_site_delete_info','submit','errors_title' ); -templatize_array( $tpl, 'lang', $sub ); + //-------------------------------------------------------------- errors display if ( sizeof( $error ) != 0 ) { - $vtp->addSession( $sub, 'errors' ); + $template->assign_block_vars('errors',array()); for ( $i = 0; $i < sizeof( $error ); $i++ ) { - $vtp->addSession( $sub, 'li' ); - $vtp->setVar( $sub, 'li.li', $error[$i] ); - $vtp->closeSession( $sub, 'li' ); + $template->assign_block_vars('errors.error',array('ERROR'=>$error[$i])); } - $vtp->closeSession( $sub, 'errors' ); } -//-------------------------------------------------------- confirmation display -if ( count( $error ) == 0 and isset( $_POST['submit'] ) ) +elseif ( isset( $_POST['submit'] ) ) { - $vtp->addSession( $sub, 'confirmation' ); - $vtp->closeSession( $sub, 'confirmation' ); + $template->assign_block_vars('confirmation' ,array()); } -//----------------------------------------------------------------- form action -$form_action = add_session_id( './admin.php?page=configuration' ); -$vtp->setVar( $sub, 'form_action', $form_action ); -//------------------------------------------------------- general configuration -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'title_line' ); -$vtp->setVar( $sub, 'title_line.title', $lang['conf_general_title'] ); -$vtp->closeSession( $sub, 'title_line' ); -$vtp->closeSession( $sub, 'line' ); - -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'space_line' ); -$vtp->closeSession( $sub, 'space_line' ); -$vtp->closeSession( $sub, 'line' ); -// webmaster name -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', $lang['conf_general_webmaster'] ); -$vtp->addSession( $sub, 'hidden' ); -$vtp->setVar( $sub, 'hidden.text', $webmaster ); -$vtp->setVar( $sub, 'hidden.name', 'webmaster' ); -$vtp->setVar( $sub, 'hidden.value', $webmaster ); -$vtp->closeSession( $sub, 'hidden' ); -$vtp->setVar( $sub, 'param_line.def', $lang['conf_general_webmaster_info'] ); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); -// webmaster mail address -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', $lang['conf_general_mail'] ); -$vtp->addSession( $sub, 'text' ); -$vtp->setVar( $sub, 'text.name', 'mail_webmaster' ); -$vtp->setVar( $sub, 'text.value', $mail_webmaster ); -$vtp->closeSession( $sub, 'text' ); -$vtp->setVar( $sub, 'param_line.def', $lang['conf_general_mail_info'] ); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); -// prefix for thumbnails -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', $lang['conf_general_prefix'] ); -$vtp->addSession( $sub, 'text' ); -$vtp->setVar( $sub, 'text.name', 'prefix_thumbnail' ); -$vtp->setVar( $sub, 'text.value', $prefix_thumbnail ); -$vtp->closeSession( $sub, 'text' ); -$vtp->setVar( $sub, 'param_line.def', $lang['conf_general_prefix_info'] ); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); -// access type -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', $lang['conf_general_access'] ); -$vtp->addSession( $sub, 'group' ); -$vtp->addSession( $sub, 'radio' ); -$vtp->setVar( $sub, 'radio.name', 'access' ); -$vtp->setVar( $sub, 'radio.value', 'free' ); -$vtp->setVar( $sub, 'radio.option', $lang['conf_general_access_1'] ); -$checked = ''; -if ( $access == 'free' ) -{ - $checked = ' checked="checked"'; -} -$vtp->setVar( $sub, 'radio.checked', $checked ); -$vtp->closeSession( $sub, 'radio' ); -$vtp->addSession( $sub, 'radio' ); -$vtp->setVar( $sub, 'radio.name', 'access' ); -$vtp->setVar( $sub, 'radio.value', 'restricted' ); -$vtp->setVar( $sub, 'radio.option', $lang['conf_general_access_2'] ); -$checked = ''; -if ( $access == 'restricted' ) -{ - $checked = ' checked="checked"'; -} -$vtp->setVar( $sub, 'radio.checked', $checked ); -$vtp->closeSession( $sub, 'radio' ); -$vtp->closeSession( $sub, 'group' ); -$vtp->setVar( $sub, 'param_line.def', $lang['conf_general_access_info'] ); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); -// maximum user number to display in the listbox of identification page -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', - $lang['conf_general_max_user_listbox'] ); -$vtp->addSession( $sub, 'text' ); -$vtp->setVar( $sub, 'text.name', 'max_user_listbox' ); -$vtp->setVar( $sub, 'text.value', $max_user_listbox ); -$vtp->closeSession( $sub, 'text' ); -$vtp->setVar( $sub, 'param_line.def', - $lang['conf_general_max_user_listbox_info'] ); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); -// activate log -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', $lang['conf_general_log'] ); -$vtp->addSession( $sub, 'group' ); -$vtp->addSession( $sub, 'radio' ); -$vtp->setVar( $sub, 'radio.name', 'log' ); -$vtp->setVar( $sub, 'radio.value', 'true' ); -$vtp->setVar( $sub, 'radio.option', $lang['yes'] ); -$checked = ''; -if ( $log == 'true' ) -{ - $checked = ' checked="checked"'; -} -$vtp->setVar( $sub, 'radio.checked', $checked ); -$vtp->closeSession( $sub, 'radio' ); -$vtp->addSession( $sub, 'radio' ); -$vtp->setVar( $sub, 'radio.name', 'log' ); -$vtp->setVar( $sub, 'radio.value', 'false' ); -$vtp->setVar( $sub, 'radio.option', $lang['no'] ); -$checked = ''; -if ( $log == 'false' ) -{ - $checked = ' checked="checked"'; -} -$vtp->setVar( $sub, 'radio.checked', $checked ); -$vtp->closeSession( $sub, 'radio' ); -$vtp->closeSession( $sub, 'group' ); -$vtp->setVar( $sub, 'param_line.def', - $lang['conf_general_log_info'] ); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); -// mail notification for admins -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', - $lang['conf_general_mail_notification'] ); -$vtp->addSession( $sub, 'group' ); -$vtp->addSession( $sub, 'radio' ); -$vtp->setVar( $sub, 'radio.name', 'mail_notification' ); -$vtp->setVar( $sub, 'radio.value', 'true' ); -$vtp->setVar( $sub, 'radio.option', $lang['yes'] ); -$checked = ''; -if ( $mail_notification == 'true' ) -{ - $checked = ' checked="checked"'; -} -$vtp->setVar( $sub, 'radio.checked', $checked ); -$vtp->closeSession( $sub, 'radio' ); -$vtp->addSession( $sub, 'radio' ); -$vtp->setVar( $sub, 'radio.name', 'mail_notification' ); -$vtp->setVar( $sub, 'radio.value', 'false' ); -$vtp->setVar( $sub, 'radio.option', $lang['no'] ); -$checked = ''; -if ( $mail_notification == 'false' ) -{ - $checked = ' checked="checked"'; -} -$vtp->setVar( $sub, 'radio.checked', $checked ); -$vtp->closeSession( $sub, 'radio' ); -$vtp->closeSession( $sub, 'group' ); -$vtp->setVar( $sub, 'param_line.def', - $lang['conf_general_mail_notification_info'] ); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); - -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'space_line' ); -$vtp->closeSession( $sub, 'space_line' ); -$vtp->closeSession( $sub, 'line' ); -//------------------------------------------------------ comments configuration -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'title_line' ); -$vtp->setVar( $sub, 'title_line.title', $lang['conf_comments_title'] ); -$vtp->closeSession( $sub, 'title_line' ); -$vtp->closeSession( $sub, 'line' ); - -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'space_line' ); -$vtp->closeSession( $sub, 'space_line' ); -$vtp->closeSession( $sub, 'line' ); -// show comments ? -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', $lang['conf_comments_show_comments'] ); -$vtp->addSession( $sub, 'group' ); -$vtp->addSession( $sub, 'radio' ); -$vtp->setVar( $sub, 'radio.name', 'show_comments' ); -$vtp->setVar( $sub, 'radio.value', 'true' ); -$vtp->setVar( $sub, 'radio.option', $lang['yes'] ); -$checked = ''; -if ( $show_comments == 'true' ) -{ - $checked = ' checked="checked"'; -} -$vtp->setVar( $sub, 'radio.checked', $checked ); -$vtp->closeSession( $sub, 'radio' ); -$vtp->addSession( $sub, 'radio' ); -$vtp->setVar( $sub, 'radio.name', 'show_comments' ); -$vtp->setVar( $sub, 'radio.value', 'false' ); -$vtp->setVar( $sub, 'radio.option', $lang['no'] ); -$checked = ''; -if ( $show_comments == 'false' ) -{ - $checked = ' checked="checked"'; -} -$vtp->setVar( $sub, 'radio.checked', $checked ); -$vtp->closeSession( $sub, 'radio' ); -$vtp->closeSession( $sub, 'group' ); -$vtp->setVar( $sub, 'param_line.def', - $lang['conf_comments_show_comments_info'] ); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); -// coments for all ? true -> guests can post messages -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', $lang['conf_comments_forall'] ); -$vtp->addSession( $sub, 'group' ); -$vtp->addSession( $sub, 'radio' ); -$vtp->setVar( $sub, 'radio.name', 'comments_forall' ); -$vtp->setVar( $sub, 'radio.value', 'true' ); -$vtp->setVar( $sub, 'radio.option', $lang['yes'] ); -$checked = ''; -if ( $comments_forall == 'true' ) -{ - $checked = ' checked="checked"'; -} -$vtp->setVar( $sub, 'radio.checked', $checked ); -$vtp->closeSession( $sub, 'radio' ); -$vtp->addSession( $sub, 'radio' ); -$vtp->setVar( $sub, 'radio.name', 'comments_forall' ); -$vtp->setVar( $sub, 'radio.value', 'false' ); -$vtp->setVar( $sub, 'radio.option', $lang['no'] ); -$checked = ''; -if ( $comments_forall == 'false' ) -{ - $checked = ' checked="checked"'; -} -$vtp->setVar( $sub, 'radio.checked', $checked ); -$vtp->closeSession( $sub, 'radio' ); -$vtp->closeSession( $sub, 'group' ); -$vtp->setVar( $sub, 'param_line.def', - $lang['conf_comments_forall_info'] ); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); -// number of comments per page -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', - $lang['conf_comments_comments_number'] ); -$vtp->addSession( $sub, 'text' ); -$vtp->setVar( $sub, 'text.name', 'nb_comment_page' ); -$vtp->setVar( $sub, 'text.value', $nb_comment_page ); -$vtp->closeSession( $sub, 'text' ); -$vtp->setVar( $sub, 'param_line.def', - $lang['conf_comments_comments_number_info'] ); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); -// coments validation -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', $lang['conf_comments_validation'] ); -$vtp->addSession( $sub, 'group' ); -$vtp->addSession( $sub, 'radio' ); -$vtp->setVar( $sub, 'radio.name', 'comments_validation' ); -$vtp->setVar( $sub, 'radio.value', 'true' ); -$vtp->setVar( $sub, 'radio.option', $lang['yes'] ); -$checked = ''; -if ( $comments_validation == 'true' ) -{ - $checked = ' checked="checked"'; -} -$vtp->setVar( $sub, 'radio.checked', $checked ); -$vtp->closeSession( $sub, 'radio' ); -$vtp->addSession( $sub, 'radio' ); -$vtp->setVar( $sub, 'radio.name', 'comments_validation' ); -$vtp->setVar( $sub, 'radio.value', 'false' ); -$vtp->setVar( $sub, 'radio.option', $lang['no'] ); -$checked = ''; -if ( $comments_validation == 'false' ) -{ - $checked = ' checked="checked"'; -} -$vtp->setVar( $sub, 'radio.checked', $checked ); -$vtp->closeSession( $sub, 'radio' ); -$vtp->closeSession( $sub, 'group' ); -$vtp->setVar( $sub, 'param_line.def', - $lang['conf_comments_validation_info'] ); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); - -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'space_line' ); -$vtp->closeSession( $sub, 'space_line' ); -$vtp->closeSession( $sub, 'line' ); -//-------------------------------------------------- default user configuration -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'title_line' ); -$vtp->setVar( $sub, 'title_line.title', $lang['conf_default_title'] ); -$vtp->closeSession( $sub, 'title_line' ); -$vtp->closeSession( $sub, 'line' ); - -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'space_line' ); -$vtp->closeSession( $sub, 'space_line' ); -$vtp->closeSession( $sub, 'line' ); -// default language -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', $lang['customize_language'] ); -$vtp->addSession( $sub, 'select' ); -$vtp->setVar( $sub, 'select.name', 'language' ); -$option = get_languages( './language/' ); -for ( $i = 0; $i < sizeof( $option ); $i++ ) -{ - $vtp->addSession( $sub, 'option' ); - $vtp->setVar( $sub, 'option.option', $option[$i] ); - if ( $option[$i] == $language ) - { - $vtp->setVar( $sub, 'option.selected', ' selected="selected"' ); - } - $vtp->closeSession( $sub, 'option' ); -} -$vtp->closeSession( $sub, 'select' ); -$vtp->setVar( $sub, 'param_line.def', $lang['conf_default_language_info'] ); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); -// number of image per row -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', $lang['customize_nb_image_per_row'] ); -$vtp->addSession( $sub, 'select' ); -$vtp->setVar( $sub, 'select.name', 'nb_image_line' ); -for ( $i = 0; $i < sizeof( $conf['nb_image_row'] ); $i++ ) -{ - $vtp->addSession( $sub, 'option' ); - $vtp->setVar( $sub, 'option.option', $conf['nb_image_row'][$i] ); - if ( $conf['nb_image_row'][$i] == $nb_image_line ) - { - $vtp->setVar( $sub, 'option.selected', ' selected="selected"' ); - } - $vtp->closeSession( $sub, 'option' ); -} -$vtp->closeSession( $sub, 'select' ); -$vtp->setVar( $sub, 'param_line.def', - $lang['conf_default_nb_image_per_row_info'] ); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); -// number of row per page -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', $lang['customize_nb_row_per_page'] ); -$vtp->addSession( $sub, 'select' ); -$vtp->setVar( $sub, 'select.name', 'nb_line_page' ); -for ( $i = 0; $i < sizeof( $conf['nb_row_page'] ); $i++ ) -{ - $vtp->addSession( $sub, 'option' ); - $vtp->setVar( $sub, 'option.option', $conf['nb_row_page'][$i] ); - if ( $conf['nb_row_page'][$i] == $nb_line_page ) - { - $vtp->setVar( $sub, 'option.selected', ' selected="selected"' ); - } - $vtp->closeSession( $sub, 'option' ); -} -$vtp->closeSession( $sub, 'select' ); -$vtp->setVar( $sub, 'param_line.def', - $lang['conf_default_nb_row_per_page_info'] ); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); -// template -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', $lang['customize_theme'] ); -$vtp->addSession( $sub, 'select' ); -$vtp->setVar( $sub, 'select.name', 'template' ); -$option = get_dirs( './template/' ); - -for ( $i = 0; $i < sizeof( $option ); $i++ ) -{ - $vtp->addSession( $sub, 'option' ); - $vtp->setVar( $sub, 'option.option', $option[$i] ); - if ( $option[$i] == $template ) - { - $vtp->setVar( $sub, 'option.selected', ' selected="selected"' ); - } - $vtp->closeSession( $sub, 'option' ); -} -$vtp->closeSession( $sub, 'select' ); -$vtp->setVar( $sub, 'param_line.def', $lang['conf_default_theme_info'] ); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); -// short period time -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', $lang['customize_short_period'] ); -$vtp->addSession( $sub, 'text' ); -$vtp->setVar( $sub, 'text.name', 'short_period' ); -$vtp->setVar( $sub, 'text.value', $short_period ); -$vtp->closeSession( $sub, 'text' ); -$vtp->setVar( $sub, 'param_line.def', $lang['conf_default_short_period_info']); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); -// long period time -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', $lang['customize_long_period'] ); -$vtp->addSession( $sub, 'text' ); -$vtp->setVar( $sub, 'text.name', 'long_period' ); -$vtp->setVar( $sub, 'text.value', $long_period ); -$vtp->closeSession( $sub, 'text' ); -$vtp->setVar( $sub, 'param_line.def', $lang['conf_default_long_period_info'] ); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); -// max displayed width -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', $lang['maxwidth'] ); -$vtp->addSession( $sub, 'text' ); -$vtp->setVar( $sub, 'text.name', 'maxwidth' ); -$vtp->setVar( $sub, 'text.value', $maxwidth ); -$vtp->closeSession( $sub, 'text' ); -$vtp->setVar( $sub, 'param_line.def', $lang['conf_default_maxwidth_info'] ); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); -// max displayed height -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', $lang['maxheight'] ); -$vtp->addSession( $sub, 'text' ); -$vtp->setVar( $sub, 'text.name', 'maxheight' ); -$vtp->setVar( $sub, 'text.value', $maxheight ); -$vtp->closeSession( $sub, 'text' ); -$vtp->setVar( $sub, 'param_line.def', $lang['conf_default_maxheight_info'] ); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); -// expand all categories ? -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', $lang['customize_expand'] ); -$vtp->addSession( $sub, 'group' ); -$vtp->addSession( $sub, 'radio' ); -$vtp->setVar( $sub, 'radio.name', 'expand' ); - -$vtp->setVar( $sub, 'radio.value', 'true' ); -$checked = ''; -if ( $expand == 'true' ) -{ - $checked = ' checked="checked"'; -} -$vtp->setVar( $sub, 'radio.checked', $checked ); -$vtp->setVar( $sub, 'radio.option', $lang['yes'] ); -$vtp->closeSession( $sub, 'radio' ); -$vtp->addSession( $sub, 'radio' ); -$vtp->setVar( $sub, 'radio.name', 'expand' ); -$vtp->setVar( $sub, 'radio.value', 'false' ); -$checked = ''; -if ( $expand == 'false' ) -{ - $checked = ' checked="checked"'; -} -$vtp->setVar( $sub, 'radio.checked', $checked ); -$vtp->setVar( $sub, 'radio.option', $lang['no'] ); -$vtp->closeSession( $sub, 'radio' ); -$vtp->closeSession( $sub, 'group' ); -$vtp->setVar( $sub, 'param_line.def', $lang['conf_default_expand_info'] ); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); -// show number of comments on thumbnails page -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', $lang['customize_show_nb_comments'] ); -$vtp->addSession( $sub, 'group' ); -$vtp->addSession( $sub, 'radio' ); -$vtp->setVar( $sub, 'radio.name', 'show_nb_comments' ); -$vtp->setVar( $sub, 'radio.value', 'true' ); -$checked = ''; -if ( $show_nb_comments == 'true' ) -{ - $checked = ' checked="checked"'; -} -$vtp->setVar( $sub, 'radio.checked', $checked ); -$vtp->setVar( $sub, 'radio.option', $lang['yes'] ); -$vtp->closeSession( $sub, 'radio' ); -$vtp->addSession( $sub, 'radio' ); -$vtp->setVar( $sub, 'radio.name', 'show_nb_comments' ); -$vtp->setVar( $sub, 'radio.value', 'false' ); -$checked = ''; -if ( $show_nb_comments == 'false' ) -{ - $checked = ' checked="checked"'; -} -$vtp->setVar( $sub, 'radio.checked', $checked ); -$vtp->setVar( $sub, 'radio.option', $lang['no'] ); -$vtp->closeSession( $sub, 'radio' ); -$vtp->closeSession( $sub, 'group' ); -$vtp->setVar( $sub, 'param_line.def', $lang['conf_default_show_nb_comments_info'] ); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); - -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'space_line' ); -$vtp->closeSession( $sub, 'space_line' ); -$vtp->closeSession( $sub, 'line' ); -//-------------------------------------------------------- upload configuration -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'title_line' ); -$vtp->setVar( $sub, 'title_line.title', $lang['conf_upload_title'] ); -$vtp->closeSession( $sub, 'title_line' ); -$vtp->closeSession( $sub, 'line' ); - -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'space_line' ); -$vtp->closeSession( $sub, 'space_line' ); -$vtp->closeSession( $sub, 'line' ); -// is upload available ? -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_available'] ); -$vtp->addSession( $sub, 'group' ); -$vtp->addSession( $sub, 'radio' ); -$vtp->setVar( $sub, 'radio.name', 'upload_available' ); -$vtp->setVar( $sub, 'radio.value', 'true' ); -$checked = ''; -if ( $upload_available == 'true' ) -{ - $checked = ' checked="checked"'; -} -$vtp->setVar( $sub, 'radio.checked', $checked ); -$vtp->setVar( $sub, 'radio.option', $lang['yes'] ); -$vtp->closeSession( $sub, 'radio' ); -$vtp->addSession( $sub, 'radio' ); -$vtp->setVar( $sub, 'radio.name', 'upload_available' ); -$vtp->setVar( $sub, 'radio.value', 'false' ); -$checked = ''; -if ( $upload_available == 'false' ) -{ - $checked = ' checked="checked"'; -} -$vtp->setVar( $sub, 'radio.checked', $checked ); -$vtp->setVar( $sub, 'radio.option', $lang['no'] ); -$vtp->closeSession( $sub, 'radio' ); -$vtp->closeSession( $sub, 'group' ); -$vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_available_info'] ); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); -// max filesize uploadable -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_maxfilesize'] ); -$vtp->addSession( $sub, 'text' ); -$vtp->setVar( $sub, 'text.name', 'upload_maxfilesize' ); -$vtp->setVar( $sub, 'text.value', $upload_maxfilesize ); -$vtp->closeSession( $sub, 'text' ); -$vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxfilesize_info'] ); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); -// maxwidth uploadable -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_maxwidth'] ); -$vtp->addSession( $sub, 'text' ); -$vtp->setVar( $sub, 'text.name', 'upload_maxwidth' ); -$vtp->setVar( $sub, 'text.value', $upload_maxwidth ); -$vtp->closeSession( $sub, 'text' ); -$vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxwidth_info'] ); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); -// maxheight uploadable -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_maxheight'] ); -$vtp->addSession( $sub, 'text' ); -$vtp->setVar( $sub, 'text.name', 'upload_maxheight' ); -$vtp->setVar( $sub, 'text.value', $upload_maxheight ); -$vtp->closeSession( $sub, 'text' ); -$vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxheight_info'] ); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); -// maxwidth for thumbnail -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name',$lang['conf_upload_maxwidth_thumbnail']); -$vtp->addSession( $sub, 'text' ); -$vtp->setVar( $sub, 'text.name', 'upload_maxwidth_thumbnail' ); -$vtp->setVar( $sub, 'text.value', $upload_maxwidth_thumbnail ); -$vtp->closeSession( $sub, 'text' ); -$vtp->setVar($sub,'param_line.def',$lang['conf_upload_maxwidth_thumbnail_info']); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); -// maxheight for thumbnail -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub,'param_line.name',$lang['conf_upload_maxheight_thumbnail']); -$vtp->addSession( $sub, 'text' ); -$vtp->setVar( $sub, 'text.name', 'upload_maxheight_thumbnail' ); -$vtp->setVar( $sub, 'text.value', $upload_maxheight_thumbnail ); -$vtp->closeSession( $sub, 'text' ); -$vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxheight_thumbnail_info']); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); - -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'space_line' ); -$vtp->closeSession( $sub, 'space_line' ); -$vtp->closeSession( $sub, 'line' ); -//------------------------------------------------------ sessions configuration -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'title_line' ); -$vtp->setVar( $sub, 'title_line.title', $lang['conf_session_title'] ); -$vtp->closeSession( $sub, 'title_line' ); -$vtp->closeSession( $sub, 'line' ); - -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'space_line' ); -$vtp->closeSession( $sub, 'space_line' ); -$vtp->closeSession( $sub, 'line' ); -// authorize cookies ? -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', $lang['conf_session_cookie'] ); -$vtp->addSession( $sub, 'group' ); -$vtp->addSession( $sub, 'radio' ); -$vtp->setVar( $sub, 'radio.name', 'authorize_cookies' ); -$vtp->setVar( $sub, 'radio.value', 'true' ); -$checked = ''; -if ( $authorize_cookies == 'true' ) -{ - $checked = ' checked="checked"'; -} -$vtp->setVar( $sub, 'radio.checked', $checked ); -$vtp->setVar( $sub, 'radio.option', $lang['yes'] ); -$vtp->closeSession( $sub, 'radio' ); -$vtp->addSession( $sub, 'radio' ); -$vtp->setVar( $sub, 'radio.name', 'authorize_cookies' ); -$vtp->setVar( $sub, 'radio.value', 'false' ); -$checked = ''; -if ( $authorize_cookies == 'false' ) -{ - $checked = ' checked="checked"'; -} -$vtp->setVar( $sub, 'radio.checked', $checked ); -$vtp->setVar( $sub, 'radio.option', $lang['no'] ); -$vtp->closeSession( $sub, 'radio' ); -$vtp->closeSession( $sub, 'group' ); -$vtp->setVar( $sub, 'param_line.def', $lang['conf_session_cookie_info'] ); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); -// session size -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', $lang['conf_session_size'] ); -$vtp->addSession( $sub, 'text' ); -$vtp->setVar( $sub, 'text.name', 'session_id_size' ); -$vtp->setVar( $sub, 'text.value', $session_id_size ); -$vtp->closeSession( $sub, 'text' ); -$vtp->setVar( $sub, 'param_line.def', $lang['conf_session_size_info']); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); -// session length -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', $lang['conf_session_time'] ); -$vtp->addSession( $sub, 'text' ); -$vtp->setVar( $sub, 'text.name', 'session_time' ); -$vtp->setVar( $sub, 'text.value', $session_time ); -$vtp->closeSession( $sub, 'text' ); -$vtp->setVar( $sub, 'param_line.def', $lang['conf_session_time_info']); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); -// session keyword -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', $lang['conf_session_key'] ); -$vtp->addSession( $sub, 'text' ); -$vtp->setVar( $sub, 'text.name', 'session_keyword' ); -$vtp->setVar( $sub, 'text.value', $session_keyword ); -$vtp->closeSession( $sub, 'text' ); -$vtp->setVar( $sub, 'param_line.def', $lang['conf_session_key_info']); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); -// session deletion -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'param_line' ); -$vtp->setVar( $sub, 'param_line.name', $lang['conf_session_delete'] ); -$vtp->addSession( $sub, 'check' ); -$vtp->addSession( $sub, 'box' ); -$vtp->setVar( $sub, 'box.name', 'empty_session_table' ); -$vtp->setVar( $sub, 'box.value', '1' ); -$vtp->setVar( $sub, 'box.checked', ' checked="checked"' ); -$vtp->closeSession( $sub, 'box' ); -$vtp->closeSession( $sub, 'check' ); -$vtp->setVar( $sub, 'param_line.def', $lang['conf_session_delete_info'] ); -$vtp->closeSession( $sub, 'param_line' ); -$vtp->closeSession( $sub, 'line' ); - -$vtp->addSession( $sub, 'line' ); -$vtp->addSession( $sub, 'space_line' ); -$vtp->closeSession( $sub, 'space_line' ); -$vtp->closeSession( $sub, 'line' ); //------------------------------------------------ remote sites administration $query = 'select id,galleries_url'; -$query.= ' from '.PREFIX_TABLE.'sites'; +$query.= ' from '.SITES_TABLE; $query.= " where galleries_url <> './galleries/';"; $result = mysql_query( $query ); if ( mysql_num_rows( $result ) > 0 ) @@ -1018,5 +348,5 @@ if ( mysql_num_rows( $result ) > 0 ) $vtp->closeSession( $sub, 'remote_sites' ); } //----------------------------------------------------------- sending html code -$vtp->Parse( $handle , 'sub', $sub ); +$template->assign_var_from_handle('ADMIN_CONTENT', 'config'); ?> diff --git a/admin/help.php b/admin/help.php index 22669ce13..770d6d187 100644 --- a/admin/help.php +++ b/admin/help.php @@ -24,33 +24,25 @@ // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | // | USA. | // +-----------------------------------------------------------------------+ -include_once( './admin/include/isadmin.inc.php' ); +include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' ); //----------------------------------------------------- template initialization -$sub = $vtp->Open( './template/'.$user['template'].'/admin/help.vtp' ); -$tpl = array( ); -templatize_array( $tpl, 'lang', $sub ); +$template->set_filenames( array('help'=>'admin/help.tpl') ); + //----------------------------------------------------- help categories display $categories = array( 'images','thumbnails','database','remote','upload', 'virtual','groups','access','infos' ); foreach ( $categories as $category ) { - $vtp->addSession( $sub, 'cat' ); + $template->assign_block_vars('cat', array('NAME'=>$lang['help_'.$category.'_title'])); if ( $category == 'images' ) { - $vtp->addSession( $sub, 'illustration' ); - $vtp->setVar( $sub, 'illustration.pic_src', './admin/images/admin.png' ); - $vtp->setVar( $sub, 'illustration.pic_alt', '' ); - $vtp->setVar( $sub, 'illustration.caption', $lang['help_images_intro'] ); - $vtp->closeSession( $sub, 'illustration' ); + $template->assign_block_vars('cat.illustration', array( + 'SRC_IMG'=>PHPWG_ROOT_PATH.'admin/images/admin.png', + 'CAPTION'=>$lang['help_images_intro'] + )); } - $vtp->setVar( $sub, 'cat.name', $lang['help_'.$category.'_title'] ); foreach ( $lang['help_'.$category] as $item ) { - $vtp->addSession( $sub, 'item' ); - $vtp->setVar( $sub, 'item.content', $item ); - $vtp->closeSession( $sub, 'item' ); + $template->assign_block_vars('cat.item', array('CONTENT'=>$item)); } - - $vtp->closeSession( $sub, 'cat' ); } -//----------------------------------------------------------- sending html code -$vtp->Parse( $handle , 'sub', $sub ); +$template->assign_var_from_handle('ADMIN_CONTENT', 'help'); ?> diff --git a/admin/include/functions.php b/admin/include/functions.php index bb22b50ac..6a690ae4f 100644 --- a/admin/include/functions.php +++ b/admin/include/functions.php @@ -667,7 +667,7 @@ function update_user_category( $categories ) $restrictions ) ); $query = 'SELECT MAX(date_last) AS last_date'; - $query.= ' FROM '.PREFIX_TABLE.'categories'; + $query.= ' FROM '.CATEGORIES_TABLE; $query.= ' WHERE id IN ('.$category['id']; if ( count( $user_all_subcats ) > 0 ) $query.= ','.implode( ',', $user_all_subcats ); @@ -735,8 +735,7 @@ function get_user_restrictions( $user_id, $user_status, $check_invisible, $use_groups = true ) { // 1. retrieving ids of private categories - $query = 'SELECT id'; - $query.= ' FROM '.PREFIX_TABLE.'categories'; + $query = 'SELECT id FROM '.CATEGORIES_TABLE; $query.= " WHERE status = 'private'"; $query.= ';'; $result = mysql_query( $query ); @@ -749,8 +748,7 @@ function get_user_restrictions( $user_id, $user_status, $authorized = array(); // 2.1. retrieving authorized categories thanks to personnal user // authorization - $query = 'SELECT cat_id'; - $query.= ' FROM '.PREFIX_TABLE.'user_access'; + $query = 'SELECT cat_id FROM '.USER_ACCESS_TABLE; $query.= ' WHERE user_id = '.$user_id; $query.= ';'; $result = mysql_query( $query ); @@ -763,8 +761,8 @@ function get_user_restrictions( $user_id, $user_status, if ( $use_groups ) { $query = 'SELECT ga.cat_id'; - $query.= ' FROM '.PREFIX_TABLE.'user_group as ug'; - $query.= ', '.PREFIX_TABLE.'group_access as ga'; + $query.= ' FROM '.USER_GROUP_TABLE.' as ug'; + $query.= ', '.GROUP_ACCESS_TABLE.' as ga'; $query.= ' WHERE ug.group_id = ga.group_id'; $query.= ' AND ug.user_id = '.$user_id; $query.= ';'; @@ -789,8 +787,7 @@ function get_user_restrictions( $user_id, $user_status, // 3. adding to the restricted categories, the invisible ones if ( $user_status != 'admin' ) { - $query = 'SELECT id'; - $query.= ' FROM '.PREFIX_TABLE.'categories'; + $query = 'SELECT id FROM '.CATEGORIES_TABLE; $query.= " WHERE visible = 'false';"; $result = mysql_query( $query ); while ( $row = mysql_fetch_array( $result ) ) @@ -821,13 +818,13 @@ function synchronize() // cleaning user_category table for users to update foreach( $user_restrictions as $user_id => $restrictions ) { $query = 'DELETE'; - $query.= ' FROM '.PREFIX_TABLE.'user_category'; + $query.= ' FROM '.USER_CATEGORY_TABLE; $query.= ' WHERE user_id = '.$user_id; $query.= ';'; mysql_query( $query ); } - $query = 'INSERT INTO '.PREFIX_TABLE.'user_category'; + $query = 'INSERT INTO '.USER_CATEGORY_TABLE; $query.= ' (user_id,category_id,date_last,nb_sub_categories) VALUES '; $query.= $values; $query.= ';'; @@ -902,7 +899,7 @@ function synchronize_group( $group_id ) $query = 'SELECT id'; $query.= ' FROM '.USERS_TABLE; - $query.= ', '.PREFIX_TABLE.'user_group'; + $query.= ', '.USER_GROUP_TABLE; $query.= ' WHERE group_id = '.$group_id; $query.= ' AND id = user_id'; $query.= ';'; @@ -979,7 +976,7 @@ function is_user_allowed( $category_id, $restrictions ) if ( in_array( $category_id, $restrictions ) ) return 1; $query = 'SELECT uppercats'; - $query.= ' FROM '.PREFIX_TABLE.'categories'; + $query.= ' FROM '.CATEGORIES_TABLE; $query.= ' WHERE id = '.$category_id; $query.= ';'; $row = mysql_fetch_array( mysql_query( $query ) ); diff --git a/admin/include/isadmin.inc.php b/admin/include/isadmin.inc.php index 2b053d7b1..be3b9e10f 100644 --- a/admin/include/isadmin.inc.php +++ b/admin/include/isadmin.inc.php @@ -25,7 +25,7 @@ // | USA. | // +-----------------------------------------------------------------------+ -include( './admin/include/functions.php' ); +include( PHPWG_ROOT_PATH.'admin/include/functions.php' ); $isadmin = true; if ( $user['status'] != 'admin' ) diff --git a/admin/search.php b/admin/search.php new file mode 100644 index 000000000..4bfae3039 --- /dev/null +++ b/admin/search.php @@ -0,0 +1,107 @@ +<? +// +-----------------------------------------------------------------------+ +// | search.php | +// +-----------------------------------------------------------------------+ +// | application : PhpWebGallery <http://phpwebgallery.net> | +// | branch : BSF (Best So Far) | +// +-----------------------------------------------------------------------+ +// | file : $RCSfile$ +// | last update : $Date$ +// | last modifier : $Author$ +// | revision : $Revision$ +// +-----------------------------------------------------------------------+ +// | 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 | +// | | +// | This program is distributed in the hope that it will be useful, but | +// | WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | General Public License for more details. | +// | | +// | You should have received a copy of the GNU General Public License | +// | along with this program; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | +// | USA. | +// +-----------------------------------------------------------------------+ + +define('PHPWG_ROOT_PATH','../'); +include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); +include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' ); + +//----------------------------------------------------- template initialization +$title = $lang['Find_username']; +include(PHPWG_ROOT_PATH.'include/page_header.php'); + +$template->set_filenames( array('search'=>'admin/search_username.tpl') ); +$template->assign_vars(array( + 'USERNAME'=>( !empty($search_match) ) ? strip_tags($search_match) : '', + + 'L_SEARCH_USERNAME'=>$lang['Find_username'], + 'L_SEARCH'=>$lang['search'], + 'L_SEARCH_EXPLAIN'=>$lang['Search_author_explain'], + 'L_SELECT'=>$lang['Select'], + 'L_UPDATE_USERNAME'=>$lang['Look_up_user'], + 'L_CLOSE_WINDOW'=>$lang['Close'], + + 'F_SEARCH_ACTION' => add_session_id($PHP_SELF), + )); + +//----------------------------------------------------------------- form action +// +// Define initial vars +// +if ( isset($_POST['mode']) || isset($_GET['mode']) ) +{ + $mode = ( isset($_POST['mode']) ) ? $_POST['mode'] : $_GET['mode']; +} +else +{ + $mode = ''; +} +$search_match = ''; +if ( isset($_POST['search_username']) ) +{ + $search_match = $_POST['search_username']; +} + +$username_list = ''; +if ( !empty($search_match) ) +{ + $username_search = preg_replace('/\*/', '%', trim(strip_tags($search_match))); + + $sql = "SELECT username + FROM " . USERS_TABLE . " + WHERE username LIKE '" . str_replace("\'", "''", $username_search) . "' + ORDER BY username"; + if ( !($result = mysql_query($sql)) ) + { + die('Could not obtain search results'); + } + + if ( $row = mysql_fetch_array($result) ) + { + do + { + $username_list .= '<option value="' . $row['username'] . '">' . $row['username'] . '</option>'; + } + while ( $row = mysql_fetch_array($result) ); + } + else + { + $username_list .= '<option>' . $lang['No_match']. '</option>'; + } + mysql_free_result($result); +} + +//------------------------------------------------------------------ users list +if ( !empty($username_list)) +{ + $template->assign_block_vars('switch_select_name', array( + 'F_USERNAME_OPTIONS'=>$username_list + )); +} + +$template->pparse('search'); +include(PHPWG_ROOT_PATH.'include/page_tail.php'); +?>
\ No newline at end of file diff --git a/admin/thumbnail.php b/admin/thumbnail.php index e77420ea3..21e549396 100644 --- a/admin/thumbnail.php +++ b/admin/thumbnail.php @@ -24,7 +24,7 @@ // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | // | USA. | // +-----------------------------------------------------------------------+ -include_once( './admin/include/isadmin.inc.php' ); +include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' ); //------------------------------------------------------------------- functions // get_subdirs returns an array containing all sub directory names, // excepting : '.', '..' and 'thumbnail'. @@ -211,228 +211,196 @@ function RatioResizeImg( $filename, $newWidth, $newHeight, $path, $tn_ext ) } } -// array_max returns the highest value of the given array -function array_max( $array ) -{ - sort( $array, SORT_NUMERIC ); - return array_pop( $array ); -} - -// array_min returns the lowest value of the given array -function array_min( $array ) -{ - sort( $array, SORT_NUMERIC ); - return array_shift( $array ); -} - -// array_avg returns the average value of the array -function array_avg( $array ) -{ - return array_sum( $array ) / sizeof( $array ); -} - // get_displayed_dirs builds the tree of dirs under "galleries". If a // directory contains pictures without thumbnails, the become linked to the // page of thumbnails creation. function get_displayed_dirs( $dir, $indent ) { - global $conf,$lang,$vtp,$sub; + global $lang; $sub_dirs = get_subdirs( $dir ); + $output = ''; + if (!empty($sub_dirs)) + { + $output.='<ul class="menu">'; // write of the dirs foreach ( $sub_dirs as $sub_dir ) { + $output.='<li>'; $pictures = get_images_without_thumbnail( $dir.'/'.$sub_dir ); - $vtp->addSession( $sub, 'dir' ); - $vtp->setVar( $sub, 'dir.indent', $indent ); if ( count( $pictures ) > 0 ) { - $vtp->addSession( $sub, 'linked' ); - $url = './admin.php?page=thumbnail&dir='.$dir."/".$sub_dir; - $vtp->setVar( $sub, 'linked.url', add_session_id( $url ) ); - $vtp->setVar( $sub, 'linked.name', $sub_dir ); - $vtp->setVar( $sub, 'linked.nb_pic', count( $pictures ) ); - $vtp->closeSession( $sub, 'linked' ); + $url = add_session_id(PHPWG_ROOT_PATH.'admin.php?page=thumbnail&dir='.$dir.'/'.$sub_dir); + $output.='<a class="adminMenu" href="'.$url.'">'.$sub_dir.'</a> [ '.count( $pictures ).' '; + $output.=$lang['thumbnail'].' ]'; } else { - $vtp->addSession( $sub, 'unlinked' ); - $vtp->setVar( $sub, 'unlinked.name', $sub_dir ); - $vtp->closeSession( $sub, 'unlinked' ); + $output.=$sub_dir; } - $vtp->closeSession( $sub, 'dir' ); // recursive call - get_displayed_dirs( $dir.'/'.$sub_dir, - $indent+30 ); + $output.=get_displayed_dirs( $dir.'/'.$sub_dir, + $indent+30 ); + $output.='</li>'; + } + $output.='</ul>'; } + return $output; } + +$errors = array(); +$pictures = array(); +$stats = array(); + +if ( isset( $_GET['dir'] ) && isset( $_POST['submit'] )) +{ + $pictures = get_images_without_thumbnail( $_GET['dir'] ); + // checking criteria + if ( !ereg( "^[0-9]{2,3}$", $_POST['width'] ) or $_POST['width'] < 10 ) + { + array_push( $errors, $lang['tn_err_width'].' 10' ); + } + if ( !ereg( "^[0-9]{2,3}$", $_POST['height'] ) or $_POST['height'] < 10 ) + { + array_push( $errors, $lang['tn_err_height'].' 10' ); + } + + // picture miniaturization + if ( count( $errors ) == 0 ) + { + $stats = scandir( $_GET['dir'], $_POST['width'], $_POST['height'] ); + } +} + //----------------------------------------------------- template initialization -$sub = $vtp->Open( './template/'.$user['template'].'/admin/thumbnail.vtp' ); -$tpl = array( - 'tn_dirs_title','tn_dirs_alone','tn_params_title','tn_params_GD', - 'tn_params_GD_info','tn_width','tn_params_width_info','tn_height', - 'tn_params_height_info','tn_params_create','tn_params_create_info', - 'tn_params_format','tn_params_format_info','submit','tn_alone_title', - 'filesize','tn_picture','tn_results_title','thumbnail', - 'tn_results_gen_time','tn_stats','tn_stats_nb','tn_stats_total', - 'tn_stats_max','tn_stats_min','tn_stats_mean' ); -templatize_array( $tpl, 'lang', $sub ); -$vtp->setGlobalVar( $sub, 'user_template', $user['template'] ); +$template->set_filenames( array('thumbnail'=>'admin/thumbnail.tpl') ); + +$template->assign_vars(array( + 'L_THUMBNAIL_TITLE'=>$lang['tn_dirs_title'], + 'L_UNLINK'=>$lang['tn_dirs_alone'], + 'L_RESULTS'=>$lang['tn_results_title'], + 'L_TN_PICTURE'=>$lang['tn_picture'], + 'L_FILESIZE'=>$lang['filesize'], + 'L_WIDTH'=>$lang['tn_width'], + 'L_HEIGHT'=>$lang['tn_height'], + 'L_GENERATED'=>$lang['tn_results_gen_time'], + 'L_THUMBNAIL'=>$lang['thumbnail'], + 'L_PARAMS'=>$lang['tn_params_title'], + 'L_GD'=>$lang['tn_params_GD'], + 'L_GD_INFO'=>$lang['tn_params_GD_info'], + 'L_WIDTH_INFO'=>$lang['tn_params_width_info'], + 'L_HEIGHT_INFO'=>$lang['tn_params_height_info'], + 'L_CREATE'=>$lang['tn_params_create'], + 'L_CREATE_INFO'=>$lang['tn_params_create_info'], + 'L_FORMAT'=>$lang['tn_params_format'], + 'L_FORMAT_INFO'=>$lang['tn_params_format_info'], + 'L_SUBMIT'=>$lang['submit'], + 'L_REMAINING'=>$lang['tn_alone_title'], + 'L_TN_STATS'=>$lang['tn_stats'], + 'L_TN_NB_STATS'=>$lang['tn_stats_nb'], + 'L_TN_TOTAL'=>$lang['tn_stats_total'], + 'L_TN_MAX'=>$lang['tn_stats_max'], + 'L_TN_MIN'=>$lang['tn_stats_min'], + 'L_TN_AVERAGE'=>$lang['tn_stats_mean'], + + 'T_STYLE'=>$user['template'] + )); + //----------------------------------------------------- miniaturization results -if ( isset( $_GET['dir'] ) ) +if ( sizeof( $errors ) != 0 ) { - $pictures = get_images_without_thumbnail( $_GET['dir'] ); - if ( count( $pictures ) == 0 ) + $template->assign_block_vars('errors',array()); + for ( $i = 0; $i < sizeof( $errors ); $i++ ) { - $vtp->addSession( $sub, 'warning' ); - $vtp->closeSession( $sub, 'warning' ); + $template->assign_block_vars('errors.error',array('ERROR'=>$errors[$i])); } - elseif ( isset( $_POST['submit'] ) ) +} +else if ( isset( $_GET['dir'] ) && isset( $_POST['submit'] ) && !empty($stats)) +{ + $times = array(); + foreach ( $stats as $stat ) { + array_push( $times, $stat['time'] ); + } + $sum=array_sum( $times ); + $average = $sum/sizeof($times); + sort( $times, SORT_NUMERIC ); + $max = array_pop($times); + $min = array_shift( $times); + + $template->assign_block_vars('results',array( + 'TN_NB'=>count( $stats ), + 'TN_TOTAL'=>number_format( $sum, 2, '.', ' ').' ms', + 'TN_MAX'=>number_format( $max, 2, '.', ' ').' ms', + 'TN_MIN'=>number_format( $min, 2, '.', ' ').' ms', + 'TN_AVERAGE'=>number_format( $average, 2, '.', ' ').' ms' + )); + if ( !count( $pictures ) ) { - // checking criteria - $errors = array(); - if ( !ereg( "^[0-9]{2,3}$", $_POST['width'] ) or $_POST['width'] < 10 ) - { - array_push( $errors, $lang['tn_err_width'].' 10' ); - } - if ( !ereg( "^[0-9]{2,3}$", $_POST['height'] ) or $_POST['height'] < 10 ) - { - array_push( $errors, $lang['tn_err_height'].' 10' ); - } - // picture miniaturization - if ( count( $errors ) == 0 ) - { - $vtp->addSession( $sub, 'results' ); - $stats = scandir( $_GET['dir'], $_POST['width'], $_POST['height'] ); - $times = array(); - foreach ( $stats as $stat ) { - array_push( $times, $stat['time'] ); - } - $max = array_max( $times ); - $min = array_min( $times ); - foreach ( $stats as $i => $stat ) { - $vtp->addSession( $sub, 'picture' ); - if ( $i % 2 == 1 ) - { - $vtp->setVar( $sub, 'picture.class', 'row2' ); - } - $vtp->setVar( $sub, 'picture.num', ($i+1) ); - $vtp->setVar( $sub, 'picture.file', $stat['file'] ); - $vtp->setVar( $sub, 'picture.filesize', $stat['size'] ); - $vtp->setVar( $sub, 'picture.width', $stat['width'] ); - $vtp->setVar( $sub, 'picture.height', $stat['height'] ); - $vtp->setVar( $sub, 'picture.thumb_file', $stat['tn_file'] ); - $vtp->setVar( $sub, 'picture.thumb_filesize', $stat['tn_size'] ); - $vtp->setVar( $sub, 'picture.thumb_width', $stat['tn_width'] ); - $vtp->setVar( $sub, 'picture.thumb_height', $stat['tn_height'] ); - $vtp->setVar( $sub, 'picture.time', - number_format( $stat['time'], 2, '.', ' ').' ms' ); - if ( $stat['time'] == $max ) - { - $vtp->setVar( $sub, 'picture.color', 'red' ); - } - else if ( $stat['time'] == $min ) - { - $vtp->setVar( $sub, 'picture.color', 'green' ); - } - $vtp->closeSession( $sub, 'picture' ); - } - // general statistics - $vtp->setVar( $sub, 'results.stats_nb', count( $stats ) ); - $vtp->setVar( $sub, 'results.stats_total', - number_format( array_sum( $times ), 2, '.', ' ').' ms' ); - $vtp->setVar( $sub, 'results.stats_max', - number_format( $max, 2, '.', ' ').' ms' ); - $vtp->setVar( $sub, 'results.stats_min', - number_format( $min, 2, '.', ' ').' ms' ); - $vtp->setVar( $sub, 'results.stats_mean', - number_format( array_avg( $times ), 2, '.', ' ').' ms' ); - $vtp->closeSession( $sub, 'results' ); - } - else - { - $vtp->addSession( $sub, 'errors' ); - foreach ( $errors as $error ) { - $vtp->addSession( $sub, 'li' ); - $vtp->setVar( $sub, 'li.li', $error ); - $vtp->closeSession( $sub, 'li' ); - } - $vtp->closeSession( $sub, 'errors' ); - } + $template->assign_block_vars('warning',array()); } -//-------------------------------------------------- miniaturization parameters - if ( sizeof( $pictures ) != 0 ) + + foreach ( $stats as $i => $stat ) { - $vtp->addSession( $sub, 'params' ); - $url = './admin.php?page=thumbnail&dir='.$_GET['dir']; - $vtp->setVar( $sub, 'params.action', add_session_id( $url ) ); - // GD version selected... - if ( isset( $_POST['gd'] ) and $_POST['gd'] == 1 ) - { - $vtp->setVar( $sub, 'params.gd1_checked', ' checked="checked"' ); - } - else - { - $vtp->setVar( $sub, 'params.gd2_checked', ' checked="checked"' ); - } - // width values - if ( isset( $_POST['width'] ) ) - { - $vtp->setVar( $sub, 'params.width_value', $_POST['width'] ); - } - else - { - $vtp->setVar( $sub, 'params.width_value', '128' ); - } - // height value - if ( isset( $_POST['height'] ) ) - { - $vtp->setVar( $sub, 'params.height_value', $_POST['height'] ); - } - else - { - $vtp->setVar( $sub, 'params.height_value', '96' ); - } - // options for the number of picture to miniaturize : "n" - $options = array( 5,10,20,40 ); - if ( isset( $_POST['n'] ) ) $n = $_POST['n']; - else $n = 5; - foreach ( $options as $option ) { - $vtp->addSession( $sub, 'n_option' ); - $vtp->setVar( $sub, 'n_option.option', $option ); - if ( $option == $n ) - { - $vtp->setVar( $sub, 'n_option.selected', ' selected="selected"' ); - } - $vtp->closeSession( $sub, 'n_option' ); + $class = ($i % 2)? 'row1':'row2'; + $color=''; + if ($stat['time']==$max) $color = 'red'; + elseif ($stat['time']==$min) $color = '#33FF00'; + $template->assign_block_vars('results.picture',array( + 'NB_IMG'=>($i+1), + 'FILE_IMG'=>$stat['file'], + 'FILESIZE_IMG'=>$stat['size'], + 'WIDTH_IMG'=>$stat['width'], + 'HEIGHT_IMG'=>$stat['height'], + 'TN_FILE_IMG'=>$stat['tn_file'], + 'TN_FILESIZE_IMG'=>$stat['tn_size'], + 'TN_WIDTH_IMG'=>$stat['tn_width'], + 'TN_HEIGHT_IMG'=>$stat['tn_height'], + 'GEN_TIME'=>number_format( $stat['time'], 2, '.', ' ').' ms', + + 'T_COLOR'=>$color, + 'T_CLASS'=>$class + )); } - $vtp->closeSession( $sub, 'params' ); + } +//-------------------------------------------------- miniaturization parameters +if ( isset( $_GET['dir'] ) && !sizeof( $pictures )) +{ + $form_url = PHPWG_ROOT_PATH.'admin.php?page=thumbnail&dir='.$_GET['dir']; + $gd = !empty( $_POST['gd'] )?$_POST['gd']:2; + $width = !empty( $_POST['width'] )?$_POST['width']:128; + $height = !empty( $_POST['height'] )?$_POST['height']:96; + $gdlabel = 'GD'.$gd.'_CHECKED'; + + $template->assign_block_vars('params',array( + 'F_ACTION'=>add_session_id($form_url), + $gdlabel=>'checked="checked"', + 'WIDTH_TN'=>$width, + 'HEIGHT_TN'=>$height + )); + //---------------------------------------------------------- remaining pictures - $vtp->addSession( $sub, 'remainings' ); - $pictures = get_images_without_thumbnail( $_GET['dir'] ); - $vtp->setVar( $sub, 'remainings.total', count( $pictures ) ); - foreach ( $pictures as $i => $picture ) { - $vtp->addSession( $sub, 'remaining' ); - if ( $i % 2 == 1 ) - { - $vtp->setVar( $sub, 'remaining.class', 'row2' ); - } - $vtp->setVar( $sub, 'remaining.num', ($i+1) ); - $vtp->setVar( $sub, 'remaining.file', $picture['name'] ); - $vtp->setVar( $sub, 'remaining.filesize', $picture['size'] ); - $vtp->setVar( $sub, 'remaining.width', $picture['width'] ); - $vtp->setVar( $sub, 'remaining.height', $picture['height'] ); - $vtp->closeSession( $sub, 'remaining' ); + $pictures = get_images_without_thumbnail( $_GET['dir'] ); + $template->assign_block_vars('remainings',array('TOTAL_IMG'=>count( $pictures ))); + + foreach ( $pictures as $i => $picture ) + { + $class = ($i % 2)? 'row1':'row2'; + $template->assign_block_vars('remainings.remaining',array( + 'NB_IMG'=>($i+1), + 'FILE_TN'=>$picture['name'], + 'FILESIZE_IMG'=>$picture['size'], + 'WIDTH_IMG'=>$picture['width'], + 'HEIGHT_IMG'=>$picture['height'], + + 'T_CLASS'=>$class + )); } - $vtp->closeSession( $sub, 'remainings' ); - } } //-------------------------------------------------------------- directory list else { - $vtp->addSession( $sub, 'directory_list' ); - get_displayed_dirs( './galleries', 60 ); - $vtp->closeSession( $sub, 'directory_list' ); + $categories = get_displayed_dirs( './galleries', 60 ); + $template->assign_block_vars('directory_list',array('CATEGORY_LIST'=>$categories)); } -//----------------------------------------------------------- sending html code -$vtp->Parse( $handle , 'sub', $sub ); + +$template->assign_var_from_handle('ADMIN_CONTENT', 'thumbnail'); ?> diff --git a/admin/update.php b/admin/update.php index a894193ac..1803d5468 100644 --- a/admin/update.php +++ b/admin/update.php @@ -25,7 +25,7 @@ // | USA. | // +-----------------------------------------------------------------------+ -include_once( './admin/include/isadmin.inc.php' ); +include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' ); //------------------------------------------------------------------- functions function insert_local_category( $id_uppercat ) { @@ -35,11 +35,10 @@ function insert_local_category( $id_uppercat ) $output = ''; // 0. retrieving informations on the category to display - $cat_directory = './galleries'; + $cat_directory = PHPWG_ROOT_PATH.'galleries'; if ( is_numeric( $id_uppercat ) ) { - $query = 'SELECT name,uppercats,dir'; - $query.= ' FROM '.PREFIX_TABLE.'categories'; + $query = 'SELECT name,uppercats,dir FROM '.CATEGORIES_TABLE; $query.= ' WHERE id = '.$id_uppercat; $query.= ';'; $row = mysql_fetch_array( mysql_query( $query ) ); @@ -52,8 +51,7 @@ function insert_local_category( $id_uppercat ) $local_dir = ''; $database_dirs = array(); - $query = 'SELECT id,dir'; - $query.= ' FROM '.PREFIX_TABLE.'categories'; + $query = 'SELECT id,dir FROM '.CATEGORIES_TABLE; $query.= ' WHERE id IN ('.$uppercats.')'; $query.= ';'; $result = mysql_query( $query ); @@ -68,11 +66,10 @@ function insert_local_category( $id_uppercat ) $cat_directory.= '/'.$local_dir; // 1. display the category name to update - $src = './template/'.$user['template'].'/admin/images/puce.gif'; - $output = '<img src="'.$src.'" alt=">" />'; - $output.= '<span style="font-weight:bold;">'.$name.'</span>'; + $output = '<ul class="menu">'; + $output.= '<li><strong>'.$name.'</strong>'; $output.= ' [ '.$dir.' ]'; - $output.= '<div class="retrait">'; + $output.= '</li>'; // 2. we search pictures of the category only if the update is for all // or a cat_id is specified @@ -85,8 +82,7 @@ function insert_local_category( $id_uppercat ) $sub_dirs = get_category_directories( $cat_directory ); $sub_category_dirs = array(); - $query = 'SELECT id,dir'; - $query.= ' FROM '.PREFIX_TABLE.'categories'; + $query = 'SELECT id,dir FROM '.CATEGORIES_TABLE; $query.= ' WHERE site_id = 1'; if (!is_numeric($id_uppercat)) $query.= ' AND id_uppercat IS NULL'; else $query.= ' AND id_uppercat = '.$id_uppercat; @@ -134,13 +130,13 @@ function insert_local_category( $id_uppercat ) // we have to create the category if ( count( $inserts ) > 0 ) { - $query = 'INSERT INTO '.PREFIX_TABLE.'categories'; + $query = 'INSERT INTO '.CATEGORIES_TABLE; $query.= ' (dir,name,site_id,id_uppercat,uppercats) VALUES '; $query.= implode( ',', $inserts ); $query.= ';'; mysql_query( $query ); // updating uppercats field - $query = 'UPDATE '.PREFIX_TABLE.'categories'; + $query = 'UPDATE '.CATEGORIES_TABLE; $query.= ' SET uppercats = '; if ( $uppercats != '' ) $query.= "CONCAT('".$uppercats."',',',id)"; else $query.= 'id'; @@ -153,7 +149,7 @@ function insert_local_category( $id_uppercat ) // Recursive call on the sub-categories (not virtual ones) $query = 'SELECT id'; - $query.= ' FROM '.PREFIX_TABLE.'categories'; + $query.= ' FROM '.CATEGORIES_TABLE; $query.= ' WHERE site_id = 1'; if (!is_numeric($id_uppercat)) $query.= ' AND id_uppercat IS NULL'; else $query.= ' AND id_uppercat = '.$id_uppercat; @@ -167,7 +163,7 @@ function insert_local_category( $id_uppercat ) if ( is_numeric( $id_uppercat ) ) { - $output.= '</div>'; + $output.= '</ul>'; } return $output; } @@ -187,7 +183,7 @@ function insert_local_image( $dir, $category_id ) // - are not in the directory anymore // - don't have the associated thumbnail available anymore $query = 'SELECT id,file,tn_ext'; - $query.= ' FROM '.PREFIX_TABLE.'images'; + $query.= ' FROM '.IMAGES_TABLE; $query.= ' WHERE storage_category_id = '.$category_id; $query.= ';'; $result = mysql_query( $query ); @@ -217,8 +213,7 @@ function insert_local_image( $dir, $category_id ) } $registered_pictures = array(); - $query = 'SELECT file'; - $query.= ' FROM '.PREFIX_TABLE.'images'; + $query = 'SELECT file FROM '.IMAGES_TABLE; $query.= ' WHERE storage_category_id = '.$category_id; $query.= ';'; $result = mysql_query( $query ); @@ -233,7 +228,7 @@ function insert_local_image( $dir, $category_id ) $unvalidated_pictures = array(); $query = 'SELECT file,infos,validated'; - $query.= ' FROM '.PREFIX_TABLE.'waiting'; + $query.= ' FROM '.WAITING_TABLE; $query.= ' WHERE storage_category_id = '.$category_id; $query.= ';'; $result = mysql_query( $query ); @@ -293,7 +288,7 @@ function insert_local_image( $dir, $category_id ) $value.= ','.$date_creation; // deleting the waiting element - $query = 'DELETE FROM '.PREFIX_TABLE.'waiting'; + $query = 'DELETE FROM '.WAITING_TABLE; $query.= " WHERE file = '".$unregistered_picture."'"; $query.= ' AND storage_category_id = '.$category_id; $query.= ';'; @@ -336,7 +331,7 @@ function insert_local_image( $dir, $category_id ) if ( count( $inserts ) > 0 ) { // inserts all found pictures - $query = 'INSERT INTO '.PREFIX_TABLE.'images'; + $query = 'INSERT INTO '.IMAGES_TABLE; $query.= ' (file,storage_category_id,date_available,tn_ext'; $query.= ',filesize,width,height'; $query.= ',name,author,comment,date_creation)'; @@ -349,7 +344,7 @@ function insert_local_image( $dir, $category_id ) $ids = array(); $query = 'SELECT id'; - $query.= ' FROM '.PREFIX_TABLE.'images'; + $query.= ' FROM '.IMAGES_TABLE; $query.= ' WHERE storage_category_id = '.$category_id; $query.= ';'; $result = mysql_query( $query ); @@ -360,13 +355,13 @@ function insert_local_image( $dir, $category_id ) // recreation of the links between this storage category pictures and // its storage category - $query = 'DELETE FROM '.PREFIX_TABLE.'image_category'; + $query = 'DELETE FROM '.IMAGE_CATEGORY_TABLE; $query.= ' WHERE category_id = '.$category_id; $query.= ' AND image_id IN ('.implode( ',', $ids ).')'; $query.= ';'; mysql_query( $query ); - $query = 'INSERT INTO '.PREFIX_TABLE.'image_category'; + $query = 'INSERT INTO '.IMAGE_CATEGORY_TABLE; $query.= '(category_id,image_id) VALUES '; foreach ( $ids as $num => $image_id ) { if ( $num > 0 ) $query.= ','; @@ -395,15 +390,14 @@ function remote_images() $vtp->setVar( $sub, 'remote_update.url', $url ); // 2. is the site already existing ? - $query = 'SELECT id'; - $query.= ' FROM '.PREFIX_TABLE.'sites'; + $query = 'SELECT id FROM '.SITES_TABLE; $query.= " WHERE galleries_url = '".$url."'"; $query.= ';'; $result = mysql_query( $query ); if ( mysql_num_rows($result ) == 0 ) { // we have to register this site in the database - $query = 'INSERT INTO '.PREFIX_TABLE.'sites'; + $query = 'INSERT INTO '.SITES_TABLE; $query.= " (galleries_url) VALUES ('".$url."')"; $query.= ';'; mysql_query( $query ); @@ -437,7 +431,7 @@ function insert_remote_category( $xml_content, $site_id, $id_uppercat, $level ) if ( is_numeric( $id_uppercat ) ) { $query = 'SELECT name,uppercats,dir'; - $query.= ' FROM '.PREFIX_TABLE.'categories'; + $query.= ' FROM '.CATEGORIES_TABLE; $query.= ' WHERE id = '.$id_uppercat; $query.= ';'; $row = mysql_fetch_array( mysql_query( $query ) ); @@ -467,8 +461,7 @@ function insert_remote_category( $xml_content, $site_id, $id_uppercat, $level ) // $database_dirs contains dir names contained in the database for this // id_uppercat and site_id $database_dirs = array(); - $query = 'SELECT id,dir'; - $query.= ' FROM '.PREFIX_TABLE.'categories'; + $query = 'SELECT id,dir FROM '.CATEGORIES_TABLE; $query.= ' WHERE site_id = '.$site_id; if (!is_numeric($id_uppercat)) $query.= ' AND id_uppercat IS NULL'; else $query.= ' AND id_uppercat = '.$id_uppercat; @@ -508,13 +501,13 @@ function insert_remote_category( $xml_content, $site_id, $id_uppercat, $level ) // we have to create the category if ( count( $inserts ) > 0 ) { - $query = 'INSERT INTO '.PREFIX_TABLE.'categories'; + $query = 'INSERT INTO '.CATEGORIES_TABLE; $query.= ' (dir,name,site_id,id_uppercat,uppercats) VALUES '; $query.= implode( ',', $inserts ); $query.= ';'; mysql_query( $query ); // updating uppercats field - $query = 'UPDATE '.PREFIX_TABLE.'categories'; + $query = 'UPDATE '.CATEGORIES_TABLE; $query.= ' SET uppercats = '; if ( $uppercats != '' ) $query.= "CONCAT('".$uppercats."',',',id)"; else $query.= 'id'; @@ -527,7 +520,7 @@ function insert_remote_category( $xml_content, $site_id, $id_uppercat, $level ) // Recursive call on the sub-categories (not virtual ones) $query = 'SELECT id,dir'; - $query.= ' FROM '.PREFIX_TABLE.'categories'; + $query.= ' FROM '.CATEGORIES_TABLE; $query.= ' WHERE site_id = '.$site_id; if (!is_numeric($id_uppercat)) $query.= ' AND id_uppercat IS NULL'; else $query.= ' AND id_uppercat = '.$id_uppercat; @@ -567,8 +560,7 @@ function insert_remote_image( $xml_dir, $category_id ) // we have to delete all the images from the database that are not in the // directory anymore (not in the XML anymore) - $query = 'SELECT id,file'; - $query.= ' FROM '.PREFIX_TABLE.'images'; + $query = 'SELECT id,file FROM '.IMAGES_TABLE; $query.= ' WHERE storage_category_id = '.$category_id; $query.= ';'; $result = mysql_query( $query ); @@ -584,8 +576,7 @@ function insert_remote_image( $xml_dir, $category_id ) } $database_pictures = array(); - $query = 'SELECT file'; - $query.= ' FROM '.PREFIX_TABLE.'images'; + $query = 'SELECT file FROM '.IMAGES_TABLE; $query.= ' WHERE storage_category_id = '.$category_id; $query.= ';'; $result = mysql_query( $query ); @@ -630,7 +621,7 @@ function insert_remote_image( $xml_dir, $category_id ) if ( count( $inserts ) > 0 ) { // inserts all found pictures - $query = 'INSERT INTO '.PREFIX_TABLE.'images'; + $query = 'INSERT INTO '.IMAGES_TABLE; $query.= ' (file,storage_category_id,date_available,tn_ext'; $query.= ',filesize,width,height)'; $query.= ' VALUES '; @@ -641,8 +632,7 @@ function insert_remote_image( $xml_dir, $category_id ) // what are the ids of the pictures in the $category_id ? $ids = array(); - $query = 'SELECT id'; - $query.= ' FROM '.PREFIX_TABLE.'images'; + $query = 'SELECT id FROM '.IMAGES_TABLE; $query.= ' WHERE storage_category_id = '.$category_id; $query.= ';'; $result = mysql_query( $query ); @@ -653,13 +643,13 @@ function insert_remote_image( $xml_dir, $category_id ) // recreation of the links between this storage category pictures and // its storage category - $query = 'DELETE FROM '.PREFIX_TABLE.'image_category'; + $query = 'DELETE FROM '.IMAGE_CATEGORY_TABLE; $query.= ' WHERE category_id = '.$category_id; $query.= ' AND image_id IN ('.implode( ',', $ids ).')'; $query.= ';'; mysql_query( $query ); - $query = 'INSERT INTO '.PREFIX_TABLE.'image_category'; + $query = 'INSERT INTO '.IMAGE_CATEGORY_TABLE; $query.= '(category_id,image_id) VALUES '; foreach ( $ids as $num => $image_id ) { if ( $num > 0 ) $query.= ','; @@ -671,25 +661,28 @@ function insert_remote_image( $xml_dir, $category_id ) return $output; } + //----------------------------------------------------- template initialization -$sub = $vtp->Open( './template/'.$user['template'].'/admin/update.vtp' ); -$tpl = array( 'update_default_title', 'update_only_cat', 'update_all', - 'update_research_conclusion', 'update_deletion_conclusion', - 'remote_site', 'update_part_research' ); -templatize_array( $tpl, 'lang', $sub ); -$vtp->setGlobalVar( $sub, 'user_template', $user['template'] ); +$template->set_filenames( array('update'=>'admin/update.tpl') ); + +$template->assign_vars(array( + 'L_UPDATE_TITLE'=>$lang['update_default_title'], + 'L_CAT_UPDATE'=>$lang['update_only_cat'], + 'L_ALL_UPDATE'=>$lang['update_all'], + 'L_RESULT_UPDATE'=>$lang['update_part_research'], + 'L_NEW_CATEGORY'=>$lang['update_research_conclusion'], + 'L_DEL_CATEGORY'=>$lang['update_deletion_conclusion'], + + 'U_CAT_UPDATE'=>add_session_id( PHPWG_ROOT_PATH.'admin.php?page=update&update=cats' ), + 'U_ALL_UPDATE'=>add_session_id( PHPWG_ROOT_PATH.'admin.php?page=update&update=all' ) + )); + +$tpl = array('remote_site'); //-------------------------------------------- introduction : choices of update // Display choice if "update" var is not specified if (!isset( $_GET['update'] )) { - $vtp->addSession( $sub, 'introduction' ); - // only update the categories, not the pictures. - $url = add_session_id( './admin.php?page=update&update=cats' ); - $vtp->setVar( $sub, 'introduction.only_cat:url', $url ); - // update the entire tree folder - $url = add_session_id( './admin.php?page=update&update=all' ); - $vtp->setVar( $sub, 'introduction.all:url', $url ); - $vtp->closeSession( $sub, 'introduction' ); + $template->assign_block_vars('introduction',array()); } //-------------------------------------------------- local update : ./galleries else @@ -698,7 +691,7 @@ else $start = get_moment(); $count_new = 0; $count_deleted = 0; - $vtp->addSession( $sub, 'local_update' ); + if ( isset( $page['cat'] ) ) { $categories = insert_local_category( $page['cat'] ); @@ -708,11 +701,12 @@ else $categories = insert_local_category( 'NULL' ); } $end = get_moment(); - echo get_elapsed_time( $start, $end ).' for update <br />'; - $vtp->setVar( $sub, 'local_update.categories', $categories ); - $vtp->setVar( $sub, 'local_update.count_new', $count_new ); - $vtp->setVar( $sub, 'local_update.count_deleted', $count_deleted ); - $vtp->closeSession( $sub, 'local_update' ); + //echo get_elapsed_time( $start, $end ).' for update <br />'; + $template->assign_block_vars('update',array( + 'CATEGORIES'=>$categories, + 'NEW_CAT'=>$count_new, + 'DEL_CAT'=>$count_deleted + )); } //------------------------------------------------- remote update : listing.xml if ( @is_file( './admin/listing.xml' ) ) @@ -734,7 +728,7 @@ if ( @is_file( './admin/listing.xml' ) ) //---------------------------------------- update informations about categories if ( isset( $_GET['update'] ) or isset( $page['cat'] ) - or @is_file( './listing.xml' ) ) + or @is_file( './listing.xml' ) && DEBUG) { $start = get_moment(); update_category( 'all' ); @@ -747,5 +741,5 @@ if ( isset( $_GET['update'] ) echo get_elapsed_time( $start, $end ).' for synchronize_all_users<br />'; } //----------------------------------------------------------- sending html code -$vtp->Parse( $handle , 'sub', $sub ); +$template->assign_var_from_handle('ADMIN_CONTENT', 'update'); ?> diff --git a/admin/user_list.php b/admin/user_list.php index 82bbeb86c..09ec07d3c 100644 --- a/admin/user_list.php +++ b/admin/user_list.php @@ -24,7 +24,10 @@ // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | // | USA. | // +-----------------------------------------------------------------------+ -include_once( './admin/include/isadmin.inc.php' ); +include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' ); + + + //----------------------------------------------------- template initialization $sub = $vtp->Open( './template/'.$user['template'].'/admin/user_list.vtp' ); $tpl = array( 'listuser_confirm','listuser_modify_hint','listuser_modify', diff --git a/admin/user_perm.php b/admin/user_perm.php index f3a6e4c06..424f85021 100644 --- a/admin/user_perm.php +++ b/admin/user_perm.php @@ -24,15 +24,96 @@ // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | // | USA. | // +-----------------------------------------------------------------------+ -include_once( './admin/include/isadmin.inc.php' ); + +if( !defined("IN_ADMIN") ) +{ + die ("Hacking attempt!"); +} + +include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' ); + +// +// Username search +// +function username_search($search_match) +{ + global $db, $board_config, $template, $lang, $images, $theme, $phpEx, $phpbb_root_path; + global $starttime, $gen_simple_header; + + $gen_simple_header = TRUE; + + $username_list = ''; + if ( !empty($search_match) ) + { + $username_search = preg_replace('/\*/', '%', trim(strip_tags($search_match))); + + $sql = "SELECT username + FROM " . USERS_TABLE . " + WHERE username LIKE '" . str_replace("\'", "''", $username_search) . "' + ORDER BY username"; + if ( !($result = $db->sql_query($sql)) ) + { + message_die(GENERAL_ERROR, 'Could not obtain search results', '', __LINE__, __FILE__, $sql); + } + + if ( $row = $db->sql_fetchrow($result) ) + { + do + { + $username_list .= '<option value="' . $row['username'] . '">' . $row['username'] . '</option>'; + } + while ( $row = $db->sql_fetchrow($result) ); + } + else + { + $username_list .= '<option>' . $lang['No_match']. '</option>'; + } + $db->sql_freeresult($result); + } + + $page_title = $lang['Search']; + include($phpbb_root_path . 'includes/page_header.'.$phpEx); + + $template->set_filenames(array( + 'search_user_body' => 'search_username.tpl') + ); + + $template->assign_vars(array( + 'USERNAME' => ( !empty($search_match) ) ? strip_tags($search_match) : '', + + 'L_CLOSE_WINDOW' => $lang['Close_window'], + 'L_SEARCH_USERNAME' => $lang['Find_username'], + 'L_UPDATE_USERNAME' => $lang['Select_username'], + 'L_SELECT' => $lang['Select'], + 'L_SEARCH' => $lang['Search'], + 'L_SEARCH_EXPLAIN' => $lang['Search_author_explain'], + 'L_CLOSE_WINDOW' => $lang['Close_window'], + + 'S_USERNAME_OPTIONS' => $username_list, + 'S_SEARCH_ACTION' => append_sid("search.$phpEx?mode=searchuser")) + ); + + if ( $username_list != '' ) + { + $template->assign_block_vars('switch_select_name', array()); + } + + $template->pparse('search_user_body'); + + include($phpbb_root_path . 'includes/page_tail.'.$phpEx); + + return; +} + +if (isset($HTTP_POST_VARS['username']) || isset( $_POST['submit'] )) +{ //----------------------------------------------------- template initialization -$sub = $vtp->Open( './template/'.$user['template'].'/admin/user_perm.vtp' ); +$template->set_filenames( array('user'=>'admin/user_perm.tpl') ); + $error = array(); $tpl = array( 'permuser_authorized','permuser_forbidden','submit', 'permuser_parent_forbidden','permuser_info_message', 'adduser_info_back','permuser_only_private' ); -templatize_array( $tpl, 'lang', $sub ); -$vtp->setGlobalVar( $sub, 'user_template', $user['template'] ); //--------------------------------------------------------------------- updates if ( isset( $_POST['submit'] ) ) { @@ -67,6 +148,7 @@ if ( isset( $_POST['submit'] ) ) $vtp->closeSession( $sub, 'confirmation' ); } //---------------------------------------------------------------- form display + $restrictions = get_user_restrictions( $_GET['user_id'], $page['user_status'], false, false ); $action = './admin.php?page=user_perm&user_id='.$_GET['user_id']; @@ -183,6 +265,19 @@ while ( $row = mysql_fetch_array( $result ) ) } $vtp->closeSession( $sub, 'category' ); } +//----------------------------------------------------------- default code +else +{ +$sub = $vtp->Open( '../template/'.$user['template'].'/admin/user_select_body.vtp' ); +$tpl = array( 'Look_up_user', 'Find_username', 'Select_username' ); +templatize_array( $tpl, 'lang', $sub ); + $vtp->addSession( $sub, 'user' ); + $vtp->setVarTab( $sub, array( + 'user.S_USER_ACTION' => append_sid("./admin.php?page=user_search"), + 'user.U_SEARCH_USER' => append_sid("./search.php")) + ); + $vtp->closeSession( $sub, 'user' ); +} //----------------------------------------------------------- sending html code $vtp->Parse( $handle , 'sub', $sub ); ?> diff --git a/admin/user_search.php b/admin/user_search.php new file mode 100644 index 000000000..2fd21d9c4 --- /dev/null +++ b/admin/user_search.php @@ -0,0 +1,125 @@ +<?php +// +-----------------------------------------------------------------------+ +// | user_search.php | +// +-----------------------------------------------------------------------+ +// | application : PhpWebGallery <http://phpwebgallery.net> | +// | branch : BSF (Best So Far) | +// +-----------------------------------------------------------------------+ +// | file : $RCSfile$ +// | last update : $Date$ +// | last modifier : $Author$ +// | revision : $Revision$ +// +-----------------------------------------------------------------------+ +// | 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 | +// | | +// | This program is distributed in the hope that it will be useful, but | +// | WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | General Public License for more details. | +// | | +// | You should have received a copy of the GNU General Public License | +// | along with this program; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | +// | USA. | +// +-----------------------------------------------------------------------+ + +if( !defined("IN_ADMIN") ) +{ + die ("Hacking attempt!"); +} + +include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' ); + +$userdata = array(); +if ( isset( $_POST['submituser'] ) ) +{ + $userdata = getuserdata($_POST['username']); + if (!$userdata) echo "Utilisateur inexistant"; +} + +if ( isset( $_POST['submit'] ) ) +{ + // cleaning the user_access table for this user + $query = 'DELETE FROM '.USER_ACCESS_TABLE; + $query.= ' WHERE user_id = '.$_GET['user_id']; + $query.= ';'; + mysql_query( $query ); + // selecting all private categories + $query = 'SELECT id FROM '.CATEGORIES_TABLE; + $query.= " WHERE status = 'private'"; + $query.= ';'; + $result = mysql_query( $query ); + while ( $row = mysql_fetch_array( $result ) ) + { + $radioname = $row['id']; + if ( $_POST[$radioname] == 0 ) + { + $query = 'INSERT INTO '.USER_ACCESS_TABLE; + $query.= ' (user_id,cat_id) VALUES'; + $query.= ' ('.$_GET['user_id'].','.$row['id'].')'; + $query.= ';'; + mysql_query ( $query ); + } + } + check_favorites( $_GET['user_id'] ); + synchronize_user( $_GET['user_id'] ); +} + +$user_id = (!empty($userdata['id']))?$userdata['id']:''; + +$template->set_filenames( array('user'=>'admin/user_perm.tpl') ); +$template->assign_vars(array( + 'L_SELECT_USERNAME'=>$lang['Select_username'], + 'L_LOOKUP_USER'=>$lang['Look_up_user'], + 'L_FIND_USERNAME'=>$lang['Find_username'], + 'L_AUTH_USER'=>$lang['permuser_only_private'], + 'L_SUBMIT'=>$lang['submit'], + 'L_AUTHORIZED'=>$lang['permuser_authorized'], + 'L_FORBIDDEN'=>$lang['permuser_forbidden'], + 'L_PARENT_FORBIDDEN'=>$lang['permuser_parent_forbidden'], + + 'F_SEARCH_USER_ACTION' => add_session_id(PHPWG_ROOT_PATH.'admin.php?page=user_search'), + 'F_AUTH_ACTION' => add_session_id(PHPWG_ROOT_PATH.'admin.php?page=user_search&user_id='.$user_id), + 'U_SEARCH_USER' => add_session_id(PHPWG_ROOT_PATH.'admin/search.php') + )); + +if (!$userdata) +{ + $template->assign_block_vars('search',array()); +} +else +{ + $template->assign_block_vars('permission',array()); + $restrictions = get_user_restrictions( $userdata['id'], $userdata['status'], + false, false ); + + // only private categories are listed + $query = 'SELECT id FROM '.CATEGORIES_TABLE; + $query.= " WHERE status = 'private';"; + $result = mysql_query( $query ); + while ( $row = mysql_fetch_array( $result ) ) + { + $is_user_allowed = is_user_allowed( $row['id'], $restrictions ); + $url = PHPWG_ROOT_PATH.'admin.php?page=cat_perm&cat_id='.$row['id']; + $cat_infos = get_cat_info( $row['id'] ); + $template->assign_block_vars('permission.category',array( + 'CAT_NAME'=> get_cat_display_name($cat_infos['name'],' > ', 'font-weight:bold;' ), + 'CAT_ID'=>$row['id'], + 'AUTH_YES'=>!$is_user_allowed?'checked="checked"':'', + 'AUTH_NO' =>$is_user_allowed?'checked="checked"':'', + 'CAT_URL'=>add_session_id($url) + )); + + // any subcat forbidden for this user ? + if ( $is_user_allowed == 2 ) + { + $template->assign_block_vars('permission.category.parent_forbidden',array()); + } + } +} + +//----------------------------------------------------------- sending html code +$template->assign_var_from_handle('ADMIN_CONTENT', 'user'); +?> diff --git a/category.php b/category.php index d837c7445..a4c749e42 100644 --- a/category.php +++ b/category.php @@ -54,7 +54,7 @@ function display_category( $category, $indent ) { global $user,$template,$page; - $url = './category.php?cat='.$category['id']; + $url = PHPWG_ROOT_PATH.'category.php?cat='.$category['id']; $style = ''; if ( isset( $page['cat'] ) @@ -65,7 +65,7 @@ function display_category( $category, $indent ) } $name = $category['name']; - if ( $name == '' ) $name = str_replace( '_', ' ', $category['dir'] ); + if (empty($name)) $name = str_replace( '_', ' ', $category['dir'] ); $template->assign_block_vars( 'category', @@ -89,7 +89,7 @@ function display_category( $category, $indent ) } else { - $url = './category.php'; + $url = PHPWG_ROOT_PATH.'category.php'; if (isset($page['cat'])) { $url .='?cat='.$page['cat']; @@ -115,9 +115,10 @@ function display_category( $category, $indent ) // recursive call if ( $category['expanded'] ) { - foreach ( $category['subcats'] as $subcat ) { + foreach ( $category['subcats'] as $subcat ) + { $template->assign_block_vars('category.subcat', array()); - display_category( $subcat, $indent.str_repeat( ' ', 2 )); + display_category( $subcat, $indent.str_repeat( ' ', 2 )); } } } @@ -243,7 +244,7 @@ $template->assign_vars(array( 'U_FAVORITE' => add_session_id( PHPWG_ROOT_PATH.'category.php?cat=fav' ), 'U_MOST_VISITED'=>add_session_id( PHPWG_ROOT_PATH.'category.php?cat=most_visited' ), 'U_RECENT'=>add_session_id( PHPWG_ROOT_PATH.'category.php?cat=recent' ), - 'U_LOGOUT' => add_session_id( PHPWG_ROOT_PATH.'category.php?act=logout' ), + 'U_LOGOUT' => PHPWG_ROOT_PATH.'category.php?act=logout', 'U_ADMIN'=>add_session_id( PHPWG_ROOT_PATH.'admin.php' ), 'U_PROFILE'=>add_session_id(PHPWG_ROOT_PATH.'profile.php?'.str_replace( '&', '&', $_SERVER['QUERY_STRING'] )) ) @@ -383,17 +384,16 @@ if ( isset( $page['cat'] ) && $page['cat_nb_images'] != 0 ) 'U_IMG_LINK'=>add_session_id( $url_link ) )); - + if ( $conf['show_comments'] && $user['show_nb_comments'] ) { - $vtp->addSession( $handle, 'nb_comments' ); $query = 'SELECT COUNT(*) AS nb_comments'; $query.= ' FROM '.COMMENTS_TABLE.' WHERE image_id = '.$row['id']; $query.= " AND validated = 'true'"; $query.= ';'; $row = mysql_fetch_array( mysql_query( $query ) ); - $vtp->setVar( $handle, 'nb_comments.nb', $row['nb_comments'] ); - $vtp->closeSession( $handle, 'nb_comments' ); + $template->assign_block_vars( 'thumbnails.line.thumbnail.nb_comments', + array('NB_COMMENTS'=>$row['nb_comments']) ); } } } @@ -446,7 +446,7 @@ else $thumbnail_title = $lang['hint_category']; - $url_link = './category.php?cat='.$subcat_id; + $url_link = PHPWG_ROOT_PATH.'category.php?cat='.$subcat_id; $date = $page['plain_structure'][$subcat_id]['date_last']; @@ -483,7 +483,7 @@ if ( isset ( $page['cat'] ) ) and $conf['upload_available'] and $page['cat_uploadable'] ) { - $url = './upload.php?cat='.$page['cat']; + $url = PHPWG_ROOT_PATH.'upload.php?cat='.$page['cat']; $template->assign_block_vars('upload',array('U_UPLOAD'=>add_session_id( $url ))); } } diff --git a/comments.php b/comments.php index 19503ccaa..1ae42749f 100644 --- a/comments.php +++ b/comments.php @@ -26,8 +26,11 @@ // +-----------------------------------------------------------------------+ //----------------------------------------------------------- include -define('PHPWG_ROOT_PATH','./'); -include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); +if (!defined('IN_ADMIN')) +{ + define('PHPWG_ROOT_PATH','./'); + include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); +} //--------------------------------------------------- number of days to display if ( isset( $_GET['last_days'] ) ) define( 'MAX_DAYS', $_GET['last_days'] ); @@ -36,28 +39,60 @@ else define( 'MAX_DAYS', 0 ); $array_cat_directories = array(); $array_cat_names = array(); $array_cat_site_id = array(); + +// comment deletion +if ( isset( $_POST['delete'] ) ) +{ + $mod_sql=''; + while( list($id, $row_id) = @each($_POST['comment_id']) ) + { + $mod_sql .= ( ( $mod_sql != '' ) ? ', ' : '' ) . $row_id; + } + $query = 'DELETE FROM '.COMMENTS_TABLE.' WHERE id IN ('.$mod_sql.');'; + mysql_query( $query ); +} + +//--------------------------------------------------------- comments validation +if ( isset( $_POST['validate'] ) ) +{ + $mod_sql=''; + while( list($id, $row_id) = @each($_POST['comment_id']) ) + { + $mod_sql .= ( ( $mod_sql != '' ) ? ', ' : '' ) . $row_id; + } + $query = 'UPDATE '.COMMENTS_TABLE; + $query.= " SET validated = 'true'"; + $query.=' WHERE id IN ('.$mod_sql.');'; + mysql_query( $query ); +} //------------------------------------------------------- last comments display // // Start output of page // -$title= $lang['title_comments']; -include(PHPWG_ROOT_PATH.'include/page_header.php'); +if (!defined('IN_ADMIN')) +{ + $title= $lang['title_comments']; + include(PHPWG_ROOT_PATH.'include/page_header.php'); +} $template->set_filenames( array('comments'=>'comments.tpl') ); -initialize_template(); - $template->assign_vars(array( - 'L_TITLE' => $lang['title_comments'], - 'L_STATS' => $lang['stats_last_days'], - 'L_RETURN' => $lang['search_return_main_page'], + 'L_COMMENT_TITLE' => $title, + 'L_COMMENT_STATS' => $lang['stats_last_days'], + 'L_COMMENT_RETURN' => $lang['search_return_main_page'], + 'L_DELETE' =>$lang['delete'], + 'L_VALIDATE'=>$lang['submit'], - 'U_HOME' => add_session_id( 'category.php' ) + 'T_DEL_IMG' =>PHPWG_ROOT_PATH.'template/'.$user['template'].'/theme/delete.gif', + + 'U_HOME' => add_session_id( PHPWG_ROOT_PATH.'category.php' ) ) ); foreach ( $conf['last_days'] as $option ) { - $url = './comments.php?last_days='.($option - 1); + $url = $PHP_SELF.'?last_days='.($option - 1); + if (defined('IN_ADMIN')) $url.= '&page=comments'; $template->assign_block_vars('last_day_option', array ( 'OPTION'=>$option, 'T_STYLE'=>(( $option == MAX_DAYS + 1 )?'text-decoration:underline;':''), @@ -70,22 +105,28 @@ $date = date( 'Y-m-d', time() - ( MAX_DAYS*24*60*60 ) ); list($year,$month,$day) = explode( '-', $date); $maxtime = mktime( 0,0,0,$month,$day,$year ); $query = 'SELECT DISTINCT(ic.image_id) as image_id,'; -$query .= '(ic.category_id) as category_id'; -$query.= ' FROM '.PREFIX_TABLE.'comments AS c'; -$query.= ', '.PREFIX_TABLE.'image_category AS ic'; +$query.= '(ic.category_id) as category_id'; +$query.= ' FROM '.COMMENTS_TABLE.' AS c'; +$query.= ', '.IMAGE_CATEGORY_TABLE.' AS ic'; $query.= ' WHERE c.image_id = ic.image_id'; $query.= ' AND date > '.$maxtime; -$query.= " AND validated = 'true'"; -// we must not show pictures of a forbidden category -if ( $user['forbidden_categories'] != '' ) +if ( $user['status'] != 'admin' ) { - $query.= ' AND category_id NOT IN '; - $query.= '('.$user['forbidden_categories'].')'; + $query.= " AND validated = 'true'"; + // we must not show pictures of a forbidden category + if ( $user['forbidden_categories'] != '' ) + { + $query.= ' AND category_id NOT IN '; + $query.= '('.$user['forbidden_categories'].')'; + } } $query.= ' ORDER BY ic.image_id DESC'; $query.= ';'; $result = mysql_query( $query ); - +if ( $user['status'] == 'admin' ) +{ + $template->assign_block_vars('validation', array()); +} while ( $row = mysql_fetch_array( $result ) ) { $category_id=$row['category_id']; @@ -112,7 +153,7 @@ while ( $row = mysql_fetch_array( $result ) ) $file = get_filename_wo_extension( $subrow['file'] ); // name of the picture $name = $array_cat_names[$category_id].' > '; - if ( $subrow['name'] != '' ) $name.= $subrow['name']; + if (!empty($subrow['name'])) $name.= $subrow['name']; else $name.= str_replace( '_', ' ', $file ); $name.= ' [ '.$subrow['file'].' ]'; // source of the thumbnail picture @@ -120,7 +161,7 @@ while ( $row = mysql_fetch_array( $result ) ) $src.= 'thumbnail/'.$conf['prefix_thumbnail']; $src.= $file.'.'.$subrow['tn_ext']; // link to the full size picture - $url = './picture.php?cat='.$category_id; + $url = PHPWG_ROOT_PATH.'picture.php?cat='.$category_id; $url.= '&image_id='.$row['image_id']; $template->assign_block_vars('picture',array( @@ -130,18 +171,20 @@ while ( $row = mysql_fetch_array( $result ) ) )); // for each picture, retrieving all comments - $query = 'SELECT id,date,author,content'; - $query.= ' FROM '.COMMENTS_TABLE; + $query = 'SELECT * FROM '.COMMENTS_TABLE; $query.= ' WHERE image_id = '.$row['image_id']; $query.= ' AND date > '.$maxtime; - $query.= " AND validated = 'true'"; + if ( $user['status'] != 'admin' ) + { + $query.= " AND validated = 'true'"; + } $query.= ' ORDER BY date DESC'; $query.= ';'; $handleresult = mysql_query( $query ); while ( $subrow = mysql_fetch_array( $handleresult ) ) { $author = $subrow['author']; - if ( $subrow['author'] == '' ) $author = $lang['guest']; + if ( empty($subrow['author'] )) $author = $lang['guest']; $content = nl2br( $subrow['content'] ); // replace _word_ by an underlined word @@ -159,13 +202,28 @@ while ( $row = mysql_fetch_array( $result ) ) $replacement = '<span style="font-style:italic;">\1</span>'; $content = preg_replace( $pattern, $replacement, $content ); $template->assign_block_vars('picture.comment',array( - 'AUTHOR'=>$author, - 'DATE'=>format_date( $subrow['date'], 'unix', true ), - 'CONTENT'=>$content, + 'COMMENT_AUTHOR'=>$author, + 'COMMENT_DATE'=>format_date( $subrow['date'], 'unix', true ), + 'COMMENT'=>$content, )); + if ( $user['status'] == 'admin' ) + { + $template->assign_block_vars('picture.comment.validation', array( + 'ID'=> $subrow['id'], + 'CHECKED'=>($subrow['validated']=='false')?'checked="checked"': '' + )); + } } } //----------------------------------------------------------- html code display -$template->pparse('comments'); -include(PHPWG_ROOT_PATH.'include/page_tail.php'); +if (defined('IN_ADMIN')) +{ + $template->assign_var_from_handle('ADMIN_CONTENT', 'comments'); +} +else +{ + $template->assign_block_vars('title',array()); + $template->pparse('comments'); + include(PHPWG_ROOT_PATH.'include/page_tail.php'); +} ?> diff --git a/identification.php b/identification.php index ac2477d27..44cde32fd 100644 --- a/identification.php +++ b/identification.php @@ -60,7 +60,6 @@ $title = $lang['ident_page_title']; include(PHPWG_ROOT_PATH.'include/page_header.php'); $template->set_filenames( array('identification'=>'identification.tpl') ); -initialize_template(); $template->assign_vars(array( 'MAIL_ADMIN' => $conf['mail_webmaster'], diff --git a/include/common.inc.php b/include/common.inc.php index f3f6fa945..2478850a9 100644 --- a/include/common.inc.php +++ b/include/common.inc.php @@ -125,7 +125,6 @@ include(PHPWG_ROOT_PATH . 'include/constants.php'); include(PHPWG_ROOT_PATH . 'include/config.inc.php'); include(PHPWG_ROOT_PATH . 'include/functions.inc.php'); include(PHPWG_ROOT_PATH . 'include/template.php'); -include(PHPWG_ROOT_PATH . 'include/vtemplate.class.php'); // // Database connection @@ -202,6 +201,5 @@ include(PHPWG_ROOT_PATH . 'include/user.inc.php'); // displaying the username in the language of the connected user, instead of // "guest" as you can find in the database if ( $user['is_the_guest'] ) $user['username'] = $lang['guest']; -include_once( './template/'.$user['template'].'/htmlfunctions.inc.php' ); define('PREFIX_TABLE', $table_prefix); ?> diff --git a/include/config.inc.php b/include/config.inc.php index e4185dcb9..47175ec44 100644 --- a/include/config.inc.php +++ b/include/config.inc.php @@ -54,7 +54,7 @@ $conf['top_number'] = 10; $conf['anti-flood_time'] = 60; // seconds between 2 comments : 0 to disable $conf['max_LOV_categories'] = 50; -$conf['default_lang'] = 'fr_FR'; $conf['default_style'] = 'default'; ?> + diff --git a/include/constants.php b/include/constants.php index 473bacfdc..ddc6a639d 100644 --- a/include/constants.php +++ b/include/constants.php @@ -29,6 +29,9 @@ define('DEBUG', 1); // Debugging on //define('DEBUG', 0); // Debugging off +// User level +define('ANONYMOUS', 2); + // Error codes define('GENERAL_MESSAGE', 200); define('GENERAL_ERROR', 202); @@ -40,7 +43,7 @@ define('CATEGORIES_TABLE', $table_prefix.'categories'); define('COMMENTS_TABLE', $table_prefix.'comments'); define('CONFIG_TABLE', $table_prefix.'config'); define('FAVORITES_TABLE', $table_prefix.'favorites'); -define('GROUPS_ACCESS_TABLE', $table_prefix.'group_access'); +define('GROUP_ACCESS_TABLE', $table_prefix.'group_access'); define('GROUPS_TABLE', $table_prefix.'groups'); define('HISTORY_TABLE', $table_prefix.'history'); define('IMAGE_CATEGORY_TABLE', $table_prefix.'image_category'); diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php index 34697897f..0c6671974 100644 --- a/include/functions_user.inc.php +++ b/include/functions_user.inc.php @@ -229,42 +229,29 @@ function check_login_authorization() // Initialise user settings on page load function init_userprefs($userdata) { - global $conf, $template, $lang, $lang_mapping; - $style = $conf['default_style']; - if ( !$userdata['is_the_guest'] ) - { - if ( !empty($userdata['language'])) - { - $conf['default_lang'] = $userdata['language']; - } - if ( !empty($userdata['template'])) - { - $style = $userdata['template']; - } - } - - if ( !file_exists(@realpath(PHPWG_ROOT_PATH . 'language/' . $conf['default_lang'] . '/common.lang.php')) ) - { - $conf['default_lang'] = 'en_EN'; - } - include_once(PHPWG_ROOT_PATH . 'language/' . $conf['default_lang'] . '/common.lang.php'); + global $conf, $template, $lang, $lang_info; + include_once(PHPWG_ROOT_PATH . 'language/infos.lang.php'); - if ( !file_exists(@realpath(PHPWG_ROOT_PATH . 'language/' . $conf['default_lang'] . '/lang.lang.php')) ) + $language = (!empty($userdata['language']) && !$userdata['is_the_guest'] )?$userdata['language']:$conf['default_lang']; + $style = (!empty($userdata['template'])&& !$userdata['is_the_guest'] )?$userdata['template']:$conf['default_style']; + + if ( !file_exists(@realpath(PHPWG_ROOT_PATH . 'language/' . $language . '/common.lang.php')) ) { - $conf['default_lang'] = 'en_EN'; + $language = 'en_EN'; } - include_once(PHPWG_ROOT_PATH . 'language/' . $conf['default_lang'] . '/lang.lang.php'); + include_once(PHPWG_ROOT_PATH . 'language/' . $language . '/common.lang.php'); + if ($userdata['status'] == 'admin') { - $admin_lang = $userdata['language']; - if ( !file_exists(@realpath(PHPWG_ROOT_PATH . 'language/' . $conf['default_lang'] . '/admin.lang.php')) ) + if ( !file_exists(@realpath(PHPWG_ROOT_PATH . 'language/' . $language. '/admin.lang.php')) ) { - $admin_lang = 'en_EN'; + $language = 'en_EN'; } - include_once(PHPWG_ROOT_PATH . 'language/' . $admin_lang . '/admin.lang.php'); + include_once(PHPWG_ROOT_PATH . 'language/' . $language . '/admin.lang.php'); } - + + $lang_info['current_code']=$language; $template= setup_style($style); return; } @@ -280,13 +267,22 @@ function setup_style($style) function encode_ip($dotquad_ip) { - $ip_sep = explode('.', $dotquad_ip); - return sprintf('%02x%02x%02x%02x', $ip_sep[0], $ip_sep[1], $ip_sep[2], $ip_sep[3]); + $ip_sep = explode('.', $dotquad_ip); + return sprintf('%02x%02x%02x%02x', $ip_sep[0], $ip_sep[1], $ip_sep[2], $ip_sep[3]); } function decode_ip($int_ip) { - $hexipbang = explode('.', chunk_split($int_ip, 2, '.')); - return hexdec($hexipbang[0]). '.' . hexdec($hexipbang[1]) . '.' . hexdec($hexipbang[2]) . '.' . hexdec($hexipbang[3]); + $hexipbang = explode('.', chunk_split($int_ip, 2, '.')); + return hexdec($hexipbang[0]). '.' . hexdec($hexipbang[1]) . '.' . hexdec($hexipbang[2]) . '.' . hexdec($hexipbang[3]); +} + +function getuserdata($user) +{ + $sql = "SELECT * FROM " . USERS_TABLE; + $sql.= " WHERE "; + $sql .= ( ( is_integer($user) ) ? "id = $user" : "username = '" . str_replace("\'", "''", $user) . "'" ) . " AND id <> " . ANONYMOUS; + $result = mysql_query($sql); + return ( $row = mysql_fetch_array($result) ) ? $row : false; } ?> diff --git a/include/page_header.php b/include/page_header.php index af28eba0e..6067c65e8 100644 --- a/include/page_header.php +++ b/include/page_header.php @@ -30,20 +30,27 @@ // $template->set_filenames(array('header'=>'header.tpl')); -$css = './template/'.$user['template'].'/'.$user['template'].'.css'; +$charset = empty($lang_info['charset'][$lang_info['current_code']])? + $lang_info['default']['charset']:$lang_info['charset'][$lang_info['current_code']]; +$dir = empty($lang_info['direction'][$lang_info['current_code']])? + $lang_info['default']['direction']:$lang_info['direction'][$lang_info['current_code']]; +$css = PHPWG_ROOT_PATH.'template/'.$user['template'].'/'.$user['template'].'.css'; $template->assign_vars(array( - 'S_CONTENT_ENCODING' => $lang['charset'], - 'T_STYLE' => $css, - 'PAGE_TITLE' => $title - )); + 'CONTENT_ENCODING' => $charset, + 'PAGE_TITLE' => $title, + 'LANG'=>substr($lang_info['current_code'],0,2), + 'DIR'=>$dir, + + 'T_STYLE' => $css + )); // refresh if ( isset( $refresh ) && $refresh >0 && isset($url_link)) { $url = $url_link.'&slideshow='.$refresh; $template->assign_vars(array( - 'S_REFRESH_TIME' => $refresh, + 'REFRESH_TIME' => $refresh, 'U_REFRESH' => add_session_id( $url ) )); $template->assign_block_vars('refresh', array()); @@ -64,5 +71,4 @@ header( 'Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT' ); header( 'Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT' ); $template->pparse('header'); -$vtp=new VTemplate; ?> diff --git a/include/script.js b/include/script.js new file mode 100644 index 000000000..7821299c6 --- /dev/null +++ b/include/script.js @@ -0,0 +1,28 @@ +function SelectAll( formulaire ) +{ +len = formulaire.elements.length; +var i=0; +for( i = 0; i < len; i++) +{ + if ( formulaire.elements[i].type=='checkbox' + && formulaire.elements[i].name != 'copie') + { + formulaire.elements[i].checked = true; + } +} +} + +function Inverser( formulaire ) +{ +len = formulaire.elements.length; +var i=0; +for( i=0; i<len; i++) +{ + if ( formulaire.elements[i].type=='checkbox' + && formulaire.elements[i].name != 'copie') + { + formulaire.elements[i].checked = !formulaire.elements[i].checked; + } +} +} + diff --git a/include/vtemplate.class.php b/include/vtemplate.class.php deleted file mode 100644 index 93554bd59..000000000 --- a/include/vtemplate.class.php +++ /dev/null @@ -1,601 +0,0 @@ -<?php -// +-----------------------------------------------------------------------+ -// | vtemplate.class.php | -// +-----------------------------------------------------------------------+ -// | application : PhpWebGallery <http://phpwebgallery.net> | -// | branch : BSF (Best So Far) | -// +-----------------------------------------------------------------------+ -// | file : $RCSfile$ -// | last update : $Date$ -// | last modifier : $Author$ -// | revision : $Revision$ -// +-----------------------------------------------------------------------+ -// | 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 | -// | | -// | This program is distributed in the hope that it will be useful, but | -// | WITHOUT ANY WARRANTY; without even the implied warranty of | -// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | -// | General Public License for more details. | -// | | -// | You should have received a copy of the GNU General Public License | -// | along with this program; if not, write to the Free Software | -// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | -// | USA. | -// +-----------------------------------------------------------------------+ -// to make it work on nexen.net -set_magic_quotes_runtime(0); - -if ( !isset( $DEFINE_VTEMPLATE ) ) -{ - define("ALL",1); - // Tag d'ouverture des variables : vous pouvez changer ce paramètre. - define("VARTAG","{#"); - define("VTEMPLATE_VERSION","1.3.1"); - define("VTEMPLATE_TYPE","BA"); - define("VTEMPLATE_BUILD","6"); - - class Err { - var $msg; - var $titre; - - function error( $errno, $arg = "", $code = 0, $disp = 0 ) { - // Gestion des erreurs - switch ( $errno ) - { - case 1: - $this->titre="Erreur de session n° $code"; - $this->msg = "La zone $arg est déjà ouverte.Avant d'ajouter une session sur cette zone, vous devez la fermer à l'aide de la fonction closeSession().<br>" ; - break; - case 2: - $this->titre="Erreur de session n° $code"; - $this->msg = "Vous tentez de fermer une session de la zone $arg alors qu'aucune session pour cette zone n'existe.Pour ouvrir une session, utilisez la fonction addSession().<br>"; - break; - case 3: - $this->titre="Erreur de session n° $code"; - $var = $arg[1]; - $zone = $arg[0]; - $this->msg = "Vous essayez de valoriser la variable $var sans avoir créer de session de la zone $zone.Utilisez la fonction addSession() pour créer une session, puis setVar pour valoriser une variable.<br>"; - break; - case 4: - $this->titre="Erreur de session n° $code"; - $var = $arg[1]; - $zone = $arg[0]; - $this->msg = "La variable $var que vous souhaitez valoriser n'existe pas dans la zone $zone.<br>"; - break; - case 5: - $this->titre="Erreur de parsing n° $code"; - $this->msg = "Vous utilisez des caractère non autorisés pour déclarer vos zones.Vous pouvez utiliser tous les caractères à l'exception de \'{\' , \'#\' \'}\' et \'|\'.<br>"; - break; - case 6: - $this->titre="Erreur de parsing n° $code"; - $this->msg = "Vous ne pouvez pas utiliser le même nom ($arg)de zone plusieurs fois.<br>"; - break; - case 7: - $this->titre="Erreur de parsing n° $code"; - $this->msg = "Vous avez oublié de fermer la zone $arg.<br>"; - break; - case 8: - $this->titre="Erreur de traitement n° $code"; - $this->msg = "Le fichier template $arg est introuvable.<br>"; - break; - case 9: - $this->titre="Erreur de traitement n° $code"; - $this->msg = "Impossible d'ouvrir le fichier $arg.Vérifiez les droits de ce fichier.<br>"; - break; - case 10: - $this->titre="Erreur de traitement n° $code"; - $this->msg = "Impossible de lire le fichier template $arg.<br>"; - break; - case 11: - $this->titre="Erreur de traitement n° $code"; - $this->msg = "La zone $arg est introuvable.Vérifiez la syntaxe de cette zone.<br>"; - break; - case 12: - $this->titre="Erreur de traitement n° $code"; - $this->msg = "La variable $arg est introuvable .Vérifiez la syntaxe de la variable.<br>"; - break; - case 13: - $this->titre="Erreur de traitement n° $code"; - $this->msg = "L'identifiant de fichier spécifié n'existe pas.Vérifiez les fonctions Open() de votre script.<br>"; - break; - case 14: - $this->titre="Erreur de traitement n° $code"; - $var = $arg[1]; - $file = $arg[0]; - $this->msg = "La variable $var dans le fichier $file est introuvable.Vérifiez la syntaxe de la variable.<br>"; - break; - case 15: - $this->titre="Erreur de traitement n° $code"; - $var = $arg[2]; - $zone = $arg[1]; - $fichier = $arg[0]; - $this->msg = "La variable $var dans la zone $zone du fichier $fichier est introuvable.Vérifiez la syntaxe de la variable et du nom de la zone.<br>"; - break; - default: - $this->titre = "Erreur inconnue $code"; - $this->msg = "Veuillez le rapporter aux auteurs de la classe."; - } - $this->titre .= ": <br>"; - if ( $disp ) - { - $web = "Pour plus d'informations, consultez la <a href=\"http://www.virtual-solution.net/vtemplate/docs/debug-mod.php?version=".VTEMPLATE_VERSION."&build=".VTEMPLATE_BUILD."&type=".VTEMPLATE_TYPE."&error=$code\" target=\"_blank\">doc en ligne</a>"; - echo "<font face=verdana size=2 color=red><u>$this->titre</u><i>$this->msg</i>$web<br><br></font>"; - } - return -1; - } - } // Fin classe - - class Session extends err { - var $name; // Name of the session - var $globalvar = array(); // List of global variable of the session - var $varlist = array(); // List of var in this session - var $subzone = array(); // list of sub-zone - var $temp; // Generated code for the current session - var $generated = NULL; // The final code - var $source; // Source code - var $used=0; // Indicates if the session contain used variable - var $stored; // Give the filename were is stored the session - - function Session( $name, $source, $stored ) { - $this->name = $name; - $this->source = $source; - $this->stored = $stored; - $this->parseVar(); - } - - function parseVar(){ - // Récupération des noms des variables - $regle = "|".VARTAG."(.*)}|sU"; - preg_match_all ($regle,$this->source,$var1); - // Création du tableau de variable à partir de la liste parsée. - $this->varlist=@array_merge($var[1],$var1[1]); - return 1; - } - - function init(){ - if ( $this->used ) - return $this->error(1,array($this->stored,$this->name),"SESSION1",1); - // Reset generated code - $this->temp = $this->source; - $this->used = 1; - } - - function closeSession(){ - // Check if the zone has been used. - if ( !$this->used ) - return $this->error(2,array($this->stored,$this->name),"SESSION2",1); - // Set Globals vars. - $this->generateCode(); - $this->used=0; - return 1; - } - - function reset(){ - $this->used = 0; - $this->generated = NULL; - return 1; - } - - function addSubZone( &$subzone ) { - $this->subzone[$subzone->name] = &$subzone; - return 1; - } - - function setVar($varname,$value){ - if ( !$this->used ) - return $this->error(3,array($this->stored,$this->name,$varname), - "SESSION3",1); - if (!in_array($varname,$this->varlist)) - return $this->error(4,array($this->name,$varname),"SESSION4",1); - $regle = "(\\".VARTAG."$varname\})"; - $this->temp = preg_replace($regle,$value,$this->temp); - return 1; - } - - function dispVar(){ - echo "Liste variables de $this->name:<br>"; - foreach ( $this->varlist as $vars ) echo "$vars <br>"; - } - - function setGlobalVar($varname,$value){ - $set = 0; - if (in_array($varname,$this->varlist ) ) - { - // Replace the var into this session - $this->globalvar[$varname]=$value; - $set = 1; - } - // Replace the var into sub zones - foreach(array_keys($this->subzone) as $subzone){ - $set = $this->subzone[$subzone]->setGlobalVar($varname,$value) || $set; - } - return $set; - } - - function replaceGlobalVar(){ - if ( count($this->globalvar) ) - { - foreach($this->globalvar as $varname => $value) { - $regle = "(\\".VARTAG."$varname\})"; - $this->temp = preg_replace($regle,$value,$this->temp); - } - } - } - - - function generateCode(){ - if ($this->used == 0) return $this->generated; - // Replace global var. - if ( count($this->globalvar) ) $this->replaceGlobalVar(); - // Replace all unused variable by "" - $regle = "|\\".VARTAG."([^}]*)\}|"; - $this->temp = preg_replace($regle,"",$this->temp); - // Generate the subzone(s) code - if(count($this->subzone)){ - foreach(array_keys($this->subzone) as $subzone){ - $text = ($this->subzone[$subzone]->used) ? $this->subzone[$subzone]->generateCode() : $this->subzone[$subzone]->generated; - $this->temp = preg_replace("(\|$subzone\|)",$text,$this->temp); - $this->subzone[$subzone]->reset(); - } - } - $this->generated .= $this->temp; - return $this->generated; - } - - function inVarList($varname){ - return in_array($varname,$this->varlist); - } - } // Fin classe - - class VTemplate_Private extends Err{ - /**************************************** - * Private Class. * - ****************************************/ - - var $sources=array(); // Sources des zones issues - // de la premiere partie du parsing. - var $sessions=array(); // Tableau de sessions - var $v_global=array(); // Globla var array. - -/**************************************************************** - Parsing Functions for Template files. ( PF 1.0 ) - ****************************************************************/ - - function getNom($code){ - // Retourne le premier nom de zone qu'il trouve dans le code - preg_match("(<!--VTP_([^()]+)-->)sU",$code,$reg); - // Tester la présence des caratère invalides dans le nom ( | et {}); - if ( @count( explode("|",$reg[1]))>1 - || @count(explode("{",$reg[1]))>1 - || @count(explode("}",$reg[1]))>1 ) - exit($this->error(5,$reg[1],"PARSE1",1)); - return @$reg[1]; - } - - function endTag($code,$nom){ - // Renvoie TRUE(1) si le tag de fermeture est présent. - preg_match("(<!--/VTP_$nom-->)sU",$code,$reg); - return ($reg[0]!="<!--/VTP_$nom-->") ? 0 : 1; - } - - function getSource($code,$nom,$type=0){ - // Retourne le source de la zone de nom $nom - preg_match_all ("(<!--VTP_$nom-->(.*)<!--/VTP_$nom-->)sU",$code,$reg); - return $reg[$type][0]; - } - - function parseZone($code_source,$nom_zone="|root|"){ - // Fonction récursive de parsing du fichier template - // Vérification que la zone n'existe pas - if (isset($this->sources[$nom_zone])) - exit($this->error(6,$nom_zone,"PARSE2",1)); - // Enregistrement du code source - $this->sources[$nom_zone]["source"]=$code_source; - // Rappel de la fonction pour chaque fils. - while ($nom_fils=$this->getNom($this->sources[$nom_zone]["source"]) ) { - // Vérification que le tag de fin est présent. - if (!$this->endTag($code_source,$nom_fils)) - exit($this->error(7,$nom_fils,"PARSE3",1)); - // Parse le fils - $this->parseZone($this->getSource($this->sources[$nom_zone]["source"],$nom_fils,1),$nom_fils); - // Enregistre le nom du fils dans la liste des fils - $this->sources[$nom_zone]["fils"][]=$nom_fils; - // Remplace le code du fils dans le source du père - $this->sources[$nom_zone]["source"]=str_replace( - $this->getSource($this->sources[$nom_zone]["source"],$nom_fils,0), - "|$nom_fils|", - $this->sources[$nom_zone]["source"]); - // Teste si la zone $nom_fils n'existe pas plusieurs fois - // dans la zone $nom_zone - if (count(explode("|$nom_fils|",$this->sources[$nom_zone]["source"]))>2) - exit($this->error(6,$nom_fils,"PARSE4",1)); - } // fin While - return 1; - } - -/**************************************************************** - Session Management functions ( SMF 1.0 ) - ****************************************************************/ - - function createSession($handle,$zone = "|root|"){ - // Create a new session of the zone - $this->sessions[$handle][$zone] = new Session($zone,$this->sources[$zone]["source"],$this->file_name[$handle]); - // Create sub-zone - if (@count($this->sources[$zone]["fils"])){ - foreach($this->sources[$zone]["fils"] as $subzone){ - $this->createSession($handle,$subzone); - $this->sessions[$handle][$zone]->addSubZone($this->sessions[$handle][$subzone]); - } - } - //end createSession - } - - -/**************************************************************** - Global Variable Management Functions ( GVMF 1.0 ) - ****************************************************************/ - - function setGZone($handle,$zone,$var,$value){ - // Define Global var for $zone and its sub-zone. - // Set global value to $zone vars. - return $this->sessions[$handle][$zone]->setGlobalVar($var,$value); - } - - function setGFile($handle,$var,$value) { - return $this->sessions[$handle]["|root|"]->setGlobalVar($var,$value); - } - - function setGAll($var,$value){ - $declare = 0; - $this->v_global[$var]=$value; - if (is_array($this->sessions)){ - foreach($this->sessions as $handle => $v){ - $declare = $this->setGFile($handle,$var,$value) || $declare; - } - } - return $declare; - } - - function setGOpened($handle){ -// Set Global var into the opened file - foreach($this->v_global as $name => $val){ - $this->setGFile($handle,$name,$val); - } - return 1; - } - -// Fin VTemplate_Private - } - - - class VTemplate extends VTemplate_Private{ -/**************************************** - * Public Class. * - * ***************************************/ - - -/**************************************************************** - Core Functions -*****************************************************************/ - - - function Open($nomfichier){ -// Ouverture d'un fichier source et retourne le handle de ce fichier -// Création du handle: - $handle = "{".count($this->sessions)."}" ; - - -// Récupération du source à parser - if (!@file_exists($nomfichier)) return $this->error(8,$nomfichier,"TTT1",1); - if (!$f_id=@fopen($nomfichier,"r")) return $this->error(9,$nomfichier,"TTT2",1); - if (!$source=@fread($f_id, filesize($nomfichier))) return $this->error(10,$nomfichier,"TTT3",1); - clearstatcache(); - fclose($f_id); - -// Store the filename - $this->file_name[$handle]=$nomfichier; - -// Parse les zones - $this->parseZone($source); - -// Création du tableau de session - $this->createSession($handle); - -//Nettoyage des variables temporaires - $this->sources=NULL; - -// Set global var. - $this->setGOpened($handle); - - $this->addSession($handle); - return $handle; - } - - function newSession($handle="{0}",$nom_zone = "|root|"){ - if ( $this->sessions[$handle][$nom_zone]->used ) $this->closeSession($handle,$nom_zone); - $this->addSession($handle,$nom_zone,$cache,$time,$num_session); - return 1; - } - - function addSession($handle="{0}",$nom_zone = "|root|"){ - // Does the zone exist ? - if(!isset($this->sessions[$handle][$nom_zone])) return $this->error(11,array($nom_zone,$this->file_name[$handle]),"TTT4",1); - $this->sessions[$handle][$nom_zone]->init(); - return 1; - } - - function closeSession($handle="{0}",$nom_zone = "|root|"){ -// Close the current session and all his sub-session - // Check if the zone exists. - if(!isset($this->sessions[$handle][$nom_zone])) return $this->error(11,array($nom_zone,$this->file_name[$handle]),"TTT5",1); - // Closing sub-zone - $this->sessions[$handle][$nom_zone]->closeSession(); - return 1; - } - - function setGlobalVar($arg1,$arg2,$arg3){ - if ($arg1 == 1){ - if (!$this->setGAll($arg2,$arg3)) return $this->error(12,$arg2,"TTT6",1); - return 1; - } - if (!isset($this->sessions[$arg1])) return $this->error(13,$arg1,"TTT7",1); - $tab=explode(".",$arg2); - if (count($tab)==1){ - if (!$this->setGFile($arg1,$arg2,$arg3)) return $this->error(14,array($this->file_name[$arg1],$arg2),"TTT8",1); - } - else if (count($tab==2)){ - if (!isset($this->sessions[$arg1][$tab[0]])) return $this->error(11,array($tab[0],$this->file_name[$arg1],"TTT9",1)); - if (!$this->setGZone($arg1,$tab[0],$tab[1],$arg3)) return $this->error(15,array($this->file_name[$arg1],$tab[0],$tab[1]),"TTT10",1); - } - return 1; - } - - function setVar($handle,$zone_var,$val){ - // Fill the variable - $tab=explode(".",$zone_var); - if(count($tab)==2){ - $zone=$tab[0]; - $var=$tab[1]; - } - else - { - $zone="|root|"; - $var=$tab[0]; - } - - // Teste l'existence de la zone dans la liste - if (!isset($this->sessions[$handle][$zone])) return $this->error(11,array($this->file_name[$handle],$zone),"TTT11",1); - - //Enregistre la variable - return $this->sessions[$handle][$zone]->setVar($var,$val); - } - - function Parse($handle_dest,$zone_var_dest,$handle_source,$zone_source="|root|"){ - if($this->sessions[$handle_source][$zone_source]->used == 1) $this->closeSession($handle_source,$zone_source); - $this->setVar($handle_dest,$zone_var_dest, $this->sessions[$handle_source][$zone_source]->generated); - } - - function setVarF($handle,$zone_var,$file){ -// Fonction qui ouvre le fichier file et copie ce qu'il y a dedans dans une variable. - $tab=explode(".",$zone_var); - -// Récupération nom de la zone et de la variable. - if(count($tab)==2){ - $zone=$tab[0]; - $var=$tab[1]; - } - else - { - $zone="|root|"; - $var=$tab[0]; - } -// Teste l'existence de la zone dans la liste - if (!is_object($this->sessions[$handle][$zone])) return $this->error(11,array($handle,$zone),"TTT12",1); - - // Récupération du source à lire - if (!@file_exists($file)) return $this->error(8,$file,"TTT13",1); - if (!$f_id=@fopen($file,"r")) return $this->error(9,$file,"TTT14",1); - if (!$val=@fread($f_id, filesize($file))) return $this->error(10,$file,"TTT15",1); - clearstatcache(); - fclose($f_id); - -//Enregistre la variable - return $this->sessions[$handle][$zone]->setVar($var,$val); - } - - - - - - function isZone($handle, $zone="|root|") - { - return isset($this->sessions[$handle][$zone]) ; - } - - function Display($handle="{0}",$display=1,$zone="|root|"){ - $this->closeSession($handle,$zone); - $c_genere = $this->sessions[$handle][$zone]->generated; - - if ($display) echo $c_genere; else return ($c_genere); - } -//fonction complementaire version BETA - -/* - * - On peut l'utiliser : -- SetVarTab($array): tout les couples clef/valeur sont valorisées -- SetVarTab($array,$index) seuls les couples clef/valeur dont la clef est dans le tableau index ou dont la valeur == $index (si pas tableau) -Si $index contient ou est une clef de type zone.clef, la clef sera extraite du texte est servira d'index pour $array - -Vincent -*/ - - function setVarTab($handle,$zones,$index = array()){ - if (is_array($index)) - { - if (count($index)>0) - { - reset($index); - while (list (, $key) = each ($index)) - { - $tab=explode(".",$key); - if(count($tab)==2){ - $var=$tab[1]; - } - else - { - $var=$tab[0]; - } - setVar($handle,$key,$zones[$var]); - } - } - else - { - reset($zones); - while (list ($key, $val) = each ($zones)) - { - setVar($handle,$key,$val); - } - } - } - else - { - setVar($handle,$index,$zones[$index]); - } - } - - function setGlobalVarTab($handle,$zones,$index = array()){ - if (is_array($index)) - { - if (count($index)>0) - { - reset($index); - while (list (, $key) = each ($index)) - { - $tab=explode(".",$key); - if ( count( $tab ) == 2 ) $var=$tab[1]; - else $var=$tab[0]; - setGlobalVar( $handle, $key, $zones[$var] ); - } - } - else - { - reset($zones); - while (list ($key, $val) = each ($zones)) - { - GlobalVar($handle,$key,$val); - } - } - } - else - { - setBlobalVar($handle,$index,$zones[$index]); - } - } - // End VTemplate - } - $DEFINE_VTEMPLATE = 1; -} -?> diff --git a/install.php b/install.php index 706fba2ea..3d520be99 100644 --- a/install.php +++ b/install.php @@ -152,12 +152,7 @@ if ( !file_exists(@realpath(PHPWG_ROOT_PATH . 'language/' . $language . '/instal } include( './language/'.$language.'/install.lang.php' ); include( './language/'.$language.'/admin.lang.php' ); -$mapping_lang = $language; -if ( !file_exists(@realpath(PHPWG_ROOT_PATH . 'language/' . $language . '/lang.lang.php')) ) -{ - $mapping_lang = 'en_EN'; -} -include_once(PHPWG_ROOT_PATH . 'language/' . $mapping_lang . '/lang.lang.php'); +include_once(PHPWG_ROOT_PATH . 'language/infos.lang.php'); // Obtain various vars $dbhost = (!empty($_POST['dbhost'])) ? $_POST['dbhost'] : 'localhost'; @@ -172,10 +167,6 @@ $admin_pass1 = (!empty($_POST['admin_pass1'])) ? $_POST['admin_pass1'] : ''; $admin_pass2 = (!empty($_POST['admin_pass2'])) ? $_POST['admin_pass2'] : ''; $admin_mail = (!empty($_POST['admin_mail'])) ? $_POST['admin_mail'] : ''; -$lang_options = $lang['lang']; -@asort($lang_options); -@reset($lang_options); - $infos = array(); $errors = array(); @@ -283,6 +274,12 @@ if ( isset( $_POST['install'] )) $query.= " WHERE param = 'mail_webmaster'"; $query.= ';'; mysql_query( $query ); + + $query = 'UPDATE '.CONFIG_TABLE; + $query.= " SET value = '".$language."'"; + $query.= " WHERE param = 'default_lang'"; + $query.= ';'; + mysql_query( $query ); $query = 'INSERT INTO '.SITES_TABLE; $query.= " (id,galleries_url) VALUES (1, './galleries/');"; @@ -343,11 +340,10 @@ $template->assign_vars(array( 'F_DB_PREFIX'=>$table_prefix, 'F_ADMIN'=>$admin_name, 'F_ADMIN_EMAIL'=>$admin_mail, - 'F_LANG_SELECT'=>make_jumpbox($lang_options, $language, true), + 'F_LANG_SELECT'=>language_select($language), - 'T_CONTENT_ENCODING' => $lang['charset'], - 'T_STYLE' => './template/'.$install_style.'/'.$install_style.'-admin.css') - ); + 'T_CONTENT_ENCODING' => $lang['default']['charset'] + )); //-------------------------------------------------------- errors & infos display if ( sizeof( $errors ) != 0 ) diff --git a/language/en_UK.iso-8859-1/lang.lang.php b/language/en_UK.iso-8859-1/lang.lang.php deleted file mode 100644 index b6e229b5e..000000000 --- a/language/en_UK.iso-8859-1/lang.lang.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php -// +-----------------------------------------------------------------------+ -// | index.lang.php | -// +-----------------------------------------------------------------------+ -// | application : PhpWebGallery <http://phpwebgallery.net> | -// | branch : 1.4 | -// +-----------------------------------------------------------------------+ -// | file : $RCSfile$ -// | last update : $Date$ -// | last modifier : $Author$ -// | revision : $Revision$ -// +-----------------------------------------------------------------------+ -// | 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 | -// | | -// | This program is distributed in the hope that it will be useful, but | -// | WITHOUT ANY WARRANTY; without even the implied warranty of | -// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | -// | General Public License for more details. | -// | | -// | You should have received a copy of the GNU General Public License | -// | along with this program; if not, write to the Free Software | -// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | -// | USA. | -// +-----------------------------------------------------------------------+ - -$lang['lang'] = array( - 'fr_FR'=>'French', - 'en_EN'=>'English', - 'es_ES'=>'Spanish', - 'de_DE'=>'German', - 'ca'=>'Catalan', - 'no'=>'Norsk', - 'hu'=>'Hungarian', - 'ja'=>'Japanese', - 'sv'=>'Swedish' - ); - -$lang['charset'] = 'iso-8859-1'; -?>
\ No newline at end of file diff --git a/language/infos.lang.php b/language/infos.lang.php new file mode 100644 index 000000000..c34d7df2c --- /dev/null +++ b/language/infos.lang.php @@ -0,0 +1,96 @@ +<?php +// +-----------------------------------------------------------------------+ +// | infos.lang_info.php | +// +-----------------------------------------------------------------------+ +// | application : PhpWebGallery <http://phpwebgallery.net> | +// | branch : 1.4 | +// +-----------------------------------------------------------------------+ +// | file : $RCSfile$ +// | last update : $Date$ +// | last modifier : $Author$ +// | revision : $Revision$ +// +-----------------------------------------------------------------------+ +// | 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 | +// | | +// | This program is distributed in the hope that it will be useful, but | +// | WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | General Public License for more details. | +// | | +// | You should have received a copy of the GNU General Public License | +// | along with this program; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | +// | USA. | +// +-----------------------------------------------------------------------+ + +$lang_info['language']['zh_CN'] = '简体中文'; // Simplified Chinese +$lang_info['language']['zh_TW'] = '繁體中文'; // Traditional Chinese +$lang_info['language']['zh_TW.utf8'] = '繁體中文 (UTF-'; // Traditional Chinese (UTF- +$lang_info['language']['bg_BG'] = 'Български'; // Bulgarian +$lang_info['language']['ca_ES'] = 'Català'; // Catalan +$lang_info['language']['cs_CZ'] = 'Česky'; // Czech +$lang_info['language']['cs_CZ.cp1250'] = 'Česky CP'; // Czech +$lang_info['language']['cs_CZ.iso'] = 'Česky ISO'; // Czech +$lang_info['language']['da_DK'] = 'Dansk'; // Danish +$lang_info['language']['de_DE'] = 'Deutsch'; // German +$lang_info['language']['en_EN'] = 'English'; +$lang_info['language']['en_GB'] = 'English (UK)'; +$lang_info['language']['en_US'] = 'English (US)'; +$lang_info['language']['es_ES'] = 'Español'; // Spanish +$lang_info['language']['fr_FR'] = 'Français'; // French +$lang_info['language']['it_IT'] = 'Italiano'; // Italian +$lang_info['language']['he_IL'] = 'עברית'; // Hebrew +$lang_info['language']['is_IS'] = 'Íslenska'; // Icelandic +$lang_info['language']['ja_JP'] = '日本語 (EUC-JP)'; // Japanese (EUC-JP) +$lang_info['language']['ko_KR'] = '한국어'; // Korean +$lang_info['language']['lt_LT'] = 'Lietuvių'; // Lithuanian +$lang_info['language']['hu_HU'] = 'Magyar'; // Hungarian +$lang_info['language']['nl_NL'] = 'Nederlands'; // Dutch +$lang_info['language']['no_NO'] = 'Norsk bokmål'; // Norwegian (Bokmal) +$lang_info['language']['pl_PL'] = 'Polski'; // Polish +$lang_info['language']['pt_PT'] = 'Português'; // Portuguese +$lang_info['language']['pt_BR'] = 'Português Brasileiro'; // Portuguese (Brazil) +$lang_info['language']['ru_RU'] = 'Русский (Windows)'; // Russian (Windows) +$lang_info['language']['ru_RU.koi8r'] = 'Русский (KOI8-R)'; // Russian (KOI8-R) +$lang_info['language']['sl_SI'] = 'Slovenščina'; // Slovenian +$lang_info['language']['fi_FI'] = 'Suomi'; // Finnish +$lang_info['language']['sv_SE'] = 'Svenska'; // Swedish +$lang_info['language']['tr_TR'] = 'Türkçe'; // Turkish +$lang_info['language']['uk_UA'] = 'Українська'; // Ukranian + +/** + ** Charsets + ** + ** Add your own charsets, if your system uses others than "normal" + ** + **/ + + $lang_info['default']['charset'] = 'ISO-8859-1'; + + $lang_info['charset']['bg_BG'] = 'windows-1251'; + $lang_info['charset']['cs_CZ'] = 'ISO-8859-2'; + $lang_info['charset']['he_IL'] = 'windows-1255'; + $lang_info['charset']['hu_HU'] = 'ISO-8859-2'; + $lang_info['charset']['ja_JP'] = 'EUC-JP'; + $lang_info['charset']['ko_KR'] = 'EUC-KR'; + $lang_info['charset']['lt_LT'] = 'windows-1257'; + $lang_info['charset']['pl_PL'] = 'ISO-8859-2'; + $lang_info['charset']['ru_RU'] = 'windows-1251'; + + $lang_info['charset']['sl_SI'] = 'ISO-8859-2'; + $lang_info['charset']['tr_TR'] = 'ISO-8859-9'; + $lang_info['charset']['uk_UA'] = 'KOI8-U'; + $lang_info['charset']['zh_CN'] = 'GB2312'; + $lang_info['charset']['zh_TW'] = 'BIG5'; + + +/** + ** Direction + **/ + + $lang_info['default']['direction'] = 'ltr'; + $lang_info['direction']['he_IL'] = 'rtl' ; + +?>
\ No newline at end of file diff --git a/picture.php b/picture.php index 03d5300c3..d28dde037 100644 --- a/picture.php +++ b/picture.php @@ -47,7 +47,7 @@ initialize_category( 'picture' ); if ( 0 ) { echo '<div style="text-align:center;">'.$lang['access_forbiden'].'<br />'; - echo '<a href="'.add_session_id( './category.php' ).'">'; + echo '<a href="'.add_session_id( PHPWG_ROOT_PATH.'category.php' ).'">'; echo $lang['thumbnails'].'</a></div>'; exit(); } @@ -130,18 +130,14 @@ for ($i=0; $i<$nb_row;$i++) $picture[$j]['url'] = PHPWG_ROOT_PATH.'picture.php?image_id='.$row['id']; $picture[$j]['url'].= '&cat='.$page['cat']; - if ( isset( $_GET['expand'] ) ) - $picture[$j]['url'].= '&expand='.$_GET['expand']; if ( $page['cat'] == 'search' ) { $picture[$j]['url'].= "&search=".$_GET['search'].'&mode='.$_GET['mode']; } } -$url_home = './category.php?cat='.$page['cat'].'&'; +$url_home = PHPWG_ROOT_PATH.'category.php?cat='.$page['cat'].'&'; $url_home.= 'num='.$page['num']; -if (isset($_GET['expand'])) - $url_home.='&expand='.$_GET['expand']; if ( $page['cat'] == 'search' ) { $url_home.= "&search=".$_GET['search'].'&mode='.$_GET['mode']; @@ -190,6 +186,80 @@ if ( isset( $_GET['add_fav'] ) ) } } +//--------------------------------------------------------- comment registeration + if ( isset( $_POST['content'] ) && !empty($_POST['content']) ) + { + $register_comment = true; + $author = !empty($_POST['author'])?$_POST['author']:$lang['guest']; + // if a guest try to use the name of an already existing user, he must + // be rejected + if ( $author != $user['username'] ) + { + $query = 'SELECT COUNT(*) AS user_exists'; + $query.= ' FROM '.USERS_TABLE; + $query.= " WHERE username = '".$author."'"; + $query.= ';'; + $row = mysql_fetch_array( mysql_query( $query ) ); + if ( $row['user_exists'] == 1 ) + { + $template->assign_block_vars('information', array('INFORMATION'=>$lang['comment_user_exists'])); + $register_comment = false; + } + } + + if ( $register_comment ) + { + // anti-flood system + $reference_date = time() - $conf['anti-flood_time']; + $query = 'SELECT id FROM '.COMMENTS_TABLE; + $query.= ' WHERE date > '.$reference_date; + $query.= " AND author = '".$author."'"; + $query.= ';'; + if ( mysql_num_rows( mysql_query( $query ) ) == 0 + || $conf['anti-flood_time'] == 0 ) + { + $query = 'INSERT INTO '.COMMENTS_TABLE; + $query.= ' (author,date,image_id,content,validated) VALUES ('; + $query.= "'".$author."'"; + $query.= ','.time().','.$_GET['image_id']; + $query.= ",'".htmlspecialchars( $_POST['content'], ENT_QUOTES)."'"; + if ( !$conf['comments_validation'] || $user['status'] == 'admin' ) + $query.= ",'true'"; + else + $query.= ",'false'"; + $query.= ');'; + mysql_query( $query ); + // information message + $message = $lang['comment_added']; + if ( $conf['comments_validation'] and $user['status'] != 'admin' ) + { + $message.= '<br />'.$lang['comment_to_validate']; + } + $template->assign_block_vars('information', array('INFORMATION'=>$message)); + // notification to the administrators + if ( $conf['mail_notification'] ) + { + $cat_name = get_cat_display_name( $page['cat_name'], ' > ', '' ); + $cat_name = strip_tags( $cat_name ); + notify( 'comment', $cat_name.' > '.$picture['current']['name']); + } + } + else + { + // information message + $template->assign_block_vars('information', array('INFORMATION'=>$lang['comment_anti-flood'])); + } + } + } + // comment deletion + if ( isset( $_GET['del'] ) + && is_numeric( $_GET['del'] ) + && $user['status'] == 'admin' ) + { + $query = 'DELETE FROM '.COMMENTS_TABLE.' WHERE id = '.$_GET['del'].';'; + mysql_query( $query ); + } + // // Start output of page // @@ -235,7 +305,6 @@ $picture_size = get_picture_size( $original_width, $original_height, include(PHPWG_ROOT_PATH.'include/page_header.php'); $template->set_filenames(array('picture'=>'picture.tpl')); -initialize_template(); $template->assign_vars(array( 'CATEGORY' => $title_img, @@ -263,8 +332,9 @@ $template->assign_vars(array( 'L_DELETE' =>$lang['delete'], 'L_SUBMIT' =>$lang['submit'], 'L_AUTHOR' =>$lang['author'], + 'L_COMMENT' =>$lang['comment'], - 'T_DEL_IMG' =>'./template/'.$user['template'].'/theme/delete.gif', + 'T_DEL_IMG' =>PHPWG_ROOT_PATH.'template/'.$user['template'].'/theme/delete.gif', 'U_PREV_IMG' => add_session_id($picture['prev']['url']), 'U_NEXT_IMG' => add_session_id($picture['next']['url']), @@ -299,6 +369,12 @@ if ($prev>=0) $template->assign_block_vars('previous', array()); if ($next) $template->assign_block_vars('next', array()); //--------------------------------------------------------- picture information +// legend +if ( !empty($picture['current']['comment']) ) +{ + $template->assign_block_vars('legend', array()); +} + // author if ( !empty($picture['current']['author']) ) { @@ -358,8 +434,7 @@ if ( !empty($picture['current']['keywords'])) { $keywords = explode( ',', $picture['current']['keywords'] ); $content = ''; - $url = './category.php?cat=search'; - if ( isset( $_GET['expand'] ) ) $url.= '&expand='.$_GET['expand']; + $url = PHPWG_ROOT_PATH.'category.php?cat=search'; $url.= '&mode=OR&search='; foreach ( $keywords as $i => $keyword ) { $local_url = add_session_id( $url.$keyword ); @@ -388,16 +463,14 @@ if ( !$user['is_the_guest'] ) $row = mysql_fetch_array( $result ); if (!$row['nb_fav']) { - $url = './picture.php?cat='.$page['cat'].'&image_id='.$_GET['image_id']; - if (isset($_GET['expand'])) - $url.= '&expand='.$_GET['expand']; + $url = PHPWG_ROOT_PATH.'picture.php?cat='.$page['cat'].'&image_id='.$_GET['image_id']; $url.='&add_fav=1'; if ( $page['cat'] == 'search' ) { $url.= '&search='.$_GET['search'].'&mode='.$_GET['mode']; } $template->assign_block_vars('favorite', array( - 'FAVORITE_IMG' => './template/'.$user['template'].'/theme/favorite.gif', + 'FAVORITE_IMG' => PHPWG_ROOT_PATH.'template/'.$user['template'].'/theme/favorite.gif', 'FAVORITE_HINT' =>$lang['add_favorites_hint'], 'FAVORITE_ALT' =>'[ '.$lang['add_favorites_alt'].' ]', 'U_FAVORITE'=> add_session_id( $url ) @@ -405,10 +478,10 @@ if ( !$user['is_the_guest'] ) } else { - $url = './picture.php?cat='.$page['cat'].'&image_id='.$_GET['image_id']; - $url.= '&expand='.$_GET['expand'].'&add_fav=0'; + $url = PHPWG_ROOT_PATH.'picture.php?cat='.$page['cat'].'&image_id='.$_GET['image_id']; + $url.= '&add_fav=0'; $template->assign_block_vars('favorite', array( - 'FAVORITE_IMG' => './template/'.$user['template'].'/theme/del_favorite.gif', + 'FAVORITE_IMG' => PHPWG_ROOT_PATH.'template/'.$user['template'].'/theme/del_favorite.gif', 'FAVORITE_HINT' =>$lang['del_favorites_hint'], 'FAVORITE_ALT' =>'[ '.$lang['del_favorites_alt'].' ]', 'U_FAVORITE'=> add_session_id( $url ) @@ -424,79 +497,6 @@ if ( $user['status'] == 'admin' ) //---------------------------------------------------- users's comments display if ( $conf['show_comments'] ) { - // comment registeration - if ( isset( $_POST['content'] ) && !empty($_POST['content']) ) - { - $register_comment = true; - $author = !empty($_POST['author'])?$_POST['author']:$lang['guest']; - // if a guest try to use the name of an already existing user, he must - // be rejected - if ( $author != $user['username'] ) - { - $query = 'SELECT COUNT(*) AS user_exists'; - $query.= ' FROM '.USERS_TABLE; - $query.= " WHERE username = '".$author."'"; - $query.= ';'; - $row = mysql_fetch_array( mysql_query( $query ) ); - if ( $row['user_exists'] == 1 ) - { - $template->assign_block_vars('information', array('INFORMATION'=>$lang['comment_user_exists'])); - $register_comment = false; - } - } - - if ( $register_comment ) - { - // anti-flood system - $reference_date = time() - $conf['anti-flood_time']; - $query = 'SELECT id FROM '.COMMENTS_TABLE; - $query.= ' WHERE date > '.$reference_date; - $query.= " AND author = '".$author."'"; - $query.= ';'; - if ( mysql_num_rows( mysql_query( $query ) ) == 0 - || $conf['anti-flood_time'] == 0 ) - { - $query = 'INSERT INTO '.COMMENTS_TABLE; - $query.= ' (author,date,image_id,content,validated) VALUES ('; - $query.= "'".$author."'"; - $query.= ','.time().','.$_GET['image_id']; - $query.= ",'".htmlspecialchars( $_POST['content'], ENT_QUOTES)."'"; - if ( !$conf['comments_validation'] || $user['status'] == 'admin' ) - $query.= ",'true'"; - else - $query.= ",'false'"; - $query.= ');'; - mysql_query( $query ); - // information message - $message = $lang['comment_added']; - if ( $conf['comments_validation'] and $user['status'] != 'admin' ) - { - $message.= '<br />'.$lang['comment_to_validate']; - } - $template->assign_block_vars('information', array('INFORMATION'=>$message)); - // notification to the administrators - if ( $conf['mail_notification'] ) - { - $cat_name = get_cat_display_name( $page['cat_name'], ' > ', '' ); - $cat_name = strip_tags( $cat_name ); - notify( 'comment', $cat_name.' > '.$picture['current']['name']); - } - } - else - { - // information message - $template->assign_block_vars('information', array('INFORMATION'=>$lang['comment_anti-flood'])); - } - } - } - // comment deletion - if ( isset( $_GET['del'] ) - && is_numeric( $_GET['del'] ) - && $user['status'] == 'admin' ) - { - $query = 'DELETE FROM '.COMMENTS_TABLE.' WHERE id = '.$_GET['del'].';'; - mysql_query( $query ); - } // number of comment for this picture $query = 'SELECT COUNT(*) AS nb_comments'; $query.= ' FROM '.COMMENTS_TABLE.' WHERE image_id = '.$_GET['image_id']; @@ -505,9 +505,7 @@ if ( $conf['show_comments'] ) $row = mysql_fetch_array( mysql_query( $query ) ); // navigation bar creation - $url = './picture.php?cat='.$page['cat'].'&image_id='.$_GET['image_id']; - if (isset($_GET['expand'])) - $url.= '&expand='.$_GET['expand']; + $url = PHPWG_ROOT_PATH.'picture.php?cat='.$page['cat'].'&image_id='.$_GET['image_id']; if ( $page['cat'] == 'search' ) { $url.= '&search='.$_GET['search'].'&mode='.$_GET['mode']; diff --git a/profile.php b/profile.php index 2fb1b9de3..064101732 100644 --- a/profile.php +++ b/profile.php @@ -127,26 +127,46 @@ if ( isset( $_POST['submit'] ) ) } } //----------------------------------------------------- template initialization -// -// Start output of page -// +$expand = ($user['expand']=='true')?'EXPAND_TREE_YES':'EXPAND_TREE_NO'; +$nb_comments = ($user['show_nb_comments']=='true')?'NB_COMMENTS_YES':'NB_COMMENTS_NO'; + $title = $lang['customize_page_title']; include(PHPWG_ROOT_PATH.'include/page_header.php'); $template->set_filenames(array('profile'=>'profile.tpl')); -initialize_template(); $template->assign_vars(array( - 'L_TITLE' => $lang['customize_title'], + 'LANG_SELECT'=>language_select($user['language'], 'language'), + 'NB_IMAGE_LINE'=>$user['nb_image_line'], + 'NB_ROW_PAGE'=>$user['nb_line_page'], + 'STYLE_SELECT'=>style_select($user['template'], 'template'), + 'SHORT_PERIOD'=>$user['short_period'], + 'LONG_PERIOD'=>$user['long_period'], + + $expand=>'checked="checked"', + $nb_comments=>'checked="checked"', + + 'L_TITLE' => $lang['customize_title'], 'L_PASSWORD' => $lang['password'], 'L_NEW' => $lang['new'], 'L_CONFIRM' => $lang['reg_confirm'], - 'L_SUBMIT' => $lang['submit'], 'L_COOKIE' => $lang['create_cookie'], - - 'F_ACTION' => add_session_id( './profile.php' ), - - 'U_RETURN' => add_session_id('./category.php?'.$_SERVER['QUERY_STRING']) + 'L_CONFIRM'=>$lang['conf_confirmation'], + 'L_LANG_SELECT'=>$lang['customize_language'], + 'L_NB_IMAGE_LINE'=>$lang['customize_nb_image_per_row'], + 'L_NB_ROW_PAGE'=>$lang['customize_nb_row_per_page'], + 'L_STYLE_SELECT'=>$lang['customize_theme'], + 'L_SHORT_PERIOD'=>$lang['customize_short_period'], + 'L_LONG_PERIOD'=>$lang['customize_long_period'], + 'L_EXPAND_TREE'=>$lang['customize_expand'], + 'L_NB_COMMENTS'=>$lang['customize_show_nb_comments'], + 'L_YES'=>$lang['yes'], + 'L_NO'=>$lang['no'], + 'L_SUBMIT'=>$lang['submit'], + + 'F_ACTION'=>add_session_id(PHPWG_ROOT_PATH.'profile.php'), + + 'U_RETURN' => add_session_id(PHPWG_ROOT_PATH.'category.php?'.$_SERVER['QUERY_STRING']) )); //-------------------------------------------------------------- errors display @@ -159,42 +179,6 @@ if ( sizeof( $errors ) != 0 ) } } -$template->assign_block_vars('select',array( - 'F_LABEL'=>$lang['customize_nb_image_per_row'], - 'F_NAME'=>'nb_image_line', - 'F_OPTIONS'=>make_jumpbox($conf['nb_image_row'], $user['nb_image_line']) - )); - -$template->assign_block_vars('select',array( - 'F_LABEL'=>$lang['customize_nb_row_per_page'], - 'F_NAME'=>'nb_line_page', - 'F_OPTIONS'=>make_jumpbox($conf['nb_row_page'], $user['nb_line_page']) - )); - -$template->assign_block_vars('select',array( - 'F_LABEL'=>$lang['customize_template'], - 'F_NAME'=>'template', - 'F_OPTIONS'=>make_jumpbox(get_dirs( './template' ), $user['template']) - )); - -$template->assign_block_vars('select',array( - 'F_LABEL'=>$lang['customize_language'], - 'F_NAME'=>'language', - 'F_OPTIONS'=>make_jumpbox($lang['lang'], $user['language'], true) - )); - -$template->assign_block_vars('text',array( - 'F_LABEL'=>$lang['customize_short_period'], - 'F_NAME'=>'short_period', - 'F_VALUE'=>$user['short_period'] - )); - -$template->assign_block_vars('text',array( - 'F_LABEL'=>$lang['customize_long_period'], - 'F_NAME'=>'long_period', - 'F_VALUE'=>$user['long_period'] - )); - $template->assign_block_vars('text',array( 'F_LABEL'=>$lang['maxwidth'], 'F_NAME'=>'maxwidth', @@ -213,16 +197,6 @@ $template->assign_block_vars('text',array( 'F_VALUE'=>$user['mail_address'] )); -$template->assign_block_vars('radio',array( - 'F_LABEL'=>$lang['customize_expand'], - 'F_OPTIONS'=>make_radio('expand', array(true=>$lang['yes'], false=>$lang['no']), $user['expand'], true) - )); - -$template->assign_block_vars('radio',array( - 'F_LABEL'=>$lang['customize_show_nb_comments'], - 'F_OPTIONS'=>make_radio('show_nb_comments', array(true=>$lang['yes'], false=>$lang['no']), $user['show_nb_comments'], true) - )); - //----------------------------------------------------------- html code display $template->pparse('profile'); include(PHPWG_ROOT_PATH.'include/page_tail.php'); diff --git a/register.php b/register.php index d32eb0d31..bfd2e5ef7 100644 --- a/register.php +++ b/register.php @@ -51,8 +51,8 @@ if ( isset( $_POST['submit'] ) ) } } -$login = empty($_POST['login'])?$_POST['login']:''; -$email = empty($_POST['login'])?$_POST['login']:''; +$login = !empty($_POST['login'])?$_POST['login']:''; +$email = !empty($_POST['login'])?$_POST['login']:''; //----------------------------------------------------- template initialization // @@ -62,8 +62,6 @@ $title= $lang['register_page_title']; include(PHPWG_ROOT_PATH.'include/page_header.php'); $template->set_filenames( array('register'=>'register.tpl') ); -initialize_template(); - $template->assign_vars(array( 'L_TITLE' => $lang['register_title'], 'L_GUEST' => $lang['ident_guest_visit'], @@ -79,10 +77,10 @@ $template->assign_vars(array( )); //-------------------------------------------------------------- errors display -if ( sizeof( $errors ) != 0 ) +if ( sizeof( $error ) != 0 ) { $template->assign_block_vars('errors',array()); - for ( $i = 0; $i < sizeof( $errors ); $i++ ) + for ( $i = 0; $i < sizeof( $error ); $i++ ) { $template->assign_block_vars('errors.error',array('ERROR'=>$errors[$i])); } diff --git a/search.php b/search.php index 48aa84f45..85df38202 100644 --- a/search.php +++ b/search.php @@ -69,8 +69,6 @@ $title= $lang['search_title']; include(PHPWG_ROOT_PATH.'include/page_header.php'); $template->set_filenames( array('search'=>'search.tpl') ); -initialize_template(); - $template->assign_vars(array( 'L_TITLE' => $lang['search_title'], 'L_COMMENTS' => $lang['search_comments'], diff --git a/template/default/about.tpl b/template/default/about.tpl index 41eddc785..34616f83c 100644 --- a/template/default/about.tpl +++ b/template/default/about.tpl @@ -1,21 +1,10 @@ - <table style="width:100%;height:100%"> - <tr align="center" valign="middle"> - <td> - {T_START}1px{T_BEGIN} - <div class="titrePage">{PAGE_TITLE}</div> - {T_END} - <div style="margin-bottom:5px;"> </div> - {T_START}50%{T_BEGIN} - <div class="menu" style="white-space:normal;margin:10px;"> - {L_ABOUT} - </div> - {T_END} - <div style="text-align:center;margin:5px;"> - <a href="{U_RETURN}">{L_RETURN}</a> - </div> - <div style="text-align:center;margin:5px;"> - <img src="./template/default/images/php_sqreuil_artistes.gif" alt="php logo" /> - </div> - </td> - </tr> - </table>
\ No newline at end of file +<div class="titrePage">{PAGE_TITLE}</div> +<div class="menu" style="white-space:normal;margin:10px;"> + {L_ABOUT} +</div> +<div style="text-align:center;margin:5px;"> +<a href="{U_RETURN}">{L_RETURN}</a> +</div> +<div style="text-align:center;margin:5px;"> +<img src="./template/default/images/php_sqreuil_artistes.gif" alt="php logo" /> +</div>
\ No newline at end of file diff --git a/template/default/admin.tpl b/template/default/admin.tpl new file mode 100644 index 000000000..7b9dd9462 --- /dev/null +++ b/template/default/admin.tpl @@ -0,0 +1,21 @@ +<!-- BEGIN install_warning --> + <p class="install_warning">{L_INSTALL_WARNING}</div> +<!-- END install_warning --> +<div class="adminMenu"> + <a class="adminMenu" href="{U_CONFIG}">{L_CONFIG}</a> | + <a class="adminMenu" href="{U_USERS}">{L_USERS}</a> | + <a class="adminMenu" href="{U_GROUPS}">{L_GROUPS}</a> | + <a class="adminMenu" href="{U_CATEGORIES}">{L_CATEGORIES}</a> | + <a class="adminMenu" href="{U_WAITING}">{L_WAITING}</a> | + <a class="adminMenu" href="{U_COMMENTS}">{L_COMMENTS}</a> | + <a class="adminMenu" href="{U_UPDATE}">{L_UPDATE}</a> | + <a class="adminMenu" href="{U_THUMBNAILS}">{L_THUMBNAILS}</a> | + <a class="adminMenu" href="{U_HISTORY}">{L_HISTORY}</a> | + <a class="adminMenu" href="{U_FAQ}">{L_FAQ}</a> | + <a class="adminMenu" href="{U_RETURN}">{L_RETURN}</a> +</div> +<div align="center"> +<div class="adminMain"> + <div class="titrePage">{PAGE_TITLE}</div> + {ADMIN_CONTENT} +</div></div> diff --git a/template/default/admin.vtp b/template/default/admin.vtp deleted file mode 100644 index abe85807d..000000000 --- a/template/default/admin.vtp +++ /dev/null @@ -1,66 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset={#charset}" /> -<meta http-equiv="Content-Style-Type" content="text/css" /> - <title>{#title_default}</title> - <link rel="stylesheet" href="{#style}" type="text/css" /> - <script language="javascript"> - function SelectAll( formulaire ) - { - len = formulaire.elements.length; - var i=0; - for( i = 0; i < len; i++) - { - if ( formulaire.elements[i].type=='checkbox' - && formulaire.elements[i].name != 'copie') - { - formulaire.elements[i].checked = true; - } - } - } - - function Inverser( formulaire ) - { - len = formulaire.elements.length; - var i=0; - for( i=0; i<len; i++) - { - if ( formulaire.elements[i].type=='checkbox' - && formulaire.elements[i].name != 'copie') - { - formulaire.elements[i].checked = !formulaire.elements[i].checked; - } - } - } - </script> - - </head> - <body> - <!--VTP_install_warning--><div class="install_warning">{#install_warning}</div><!--/VTP_install_warning--> - <table width="100%"> - <tr> - <td class="summary"> - <!--VTP_summary--> - {#indent}<a href="{#link}">{#name}</a> - <!--/VTP_summary--> - </td> - </tr> - <tr> - <td align="center" valign="top"> - <div class="grostitre">{#title}</div> - <br /> - <center> - <table width="95%" class="table1"> - <tr> - <td class="contenucellule"> - {#sub} - </td> - </tr> - </table> - </center> - </td> - </tr> - </table> - </body> -</html>
\ No newline at end of file diff --git a/template/default/admin/comments.vtp b/template/default/admin/comments.vtp deleted file mode 100644 index 051008156..000000000 --- a/template/default/admin/comments.vtp +++ /dev/null @@ -1,81 +0,0 @@ -<!--VTP_section--> -<table style="width:100%;"> - <tr> - <th> - {#title} - <!--VTP_last_days--> - [ - <!--VTP_last_day_option--> - <a href="{#link}" style="{#style}">{#option}</a>{#separation} - <!--/VTP_last_day_option--> - {#stats_last_days} - ] - <!--/VTP_last_days--> - <!--VTP_open--> - [ <a href="{#url}">{#open}</a> ] - <!--/VTP_open--> - <!--VTP_close--> - [ <a href="{#url}">{#close}</a> ] - <!--/VTP_close--> - </th> - </tr> -</table> -<!--VTP_start_form--> -<form action="{#action}" method="post"> -<!--/VTP_start_form--> -<!--VTP_picture--> -<div style="border:2px solid #D3DCE3;margin:3px;"> - <table style="width:100%;"> - <tr> - <td valign="top" width="1px"> - <!-- the thumbnail of the picture, linked to the full size page --> - <a href="{#thumb_url}" title="{#thumb_title}"> - <img src="{#thumb_src}" class="imgLink" alt="{#thumb_alt}"/> - </a> - </td> - <td> - <div style="font-weight:bold;">{#title}</div> - <!--VTP_comment--> - <table style="width:100%;"> - <tr> - <td> - <table class="tableComment"> - <tr> - <td rowspan="2" valign="top" class="cellAuthor"> - <div class="commentsAuthor">{#author}</div> - </td> - <td class="cellInfo"> - <div class="commentsInfos"> - {#date}<!--VTP_delete--><a href="{#link}" title="{#comments_del}"><img src="./template/{#user_template}/admin/images/delete.gif" style="border:none;margin-left:5px;" alt="[{#delete}]"/></a><!--/VTP_delete--> - </div> - </td> - </tr> - <tr> - <td> - <div class="commentsContent">{#content}</div> - </td> - </tr> - </table> - </td> - <!--VTP_validation--> - <td style="width:1px;"> - <input type="checkbox" name="validate-{#id}" value="true" /> - </td> - <!--/VTP_validation--> - </tr> - </table> - <!--/VTP_comment--> - </td> - </tr> - </table> -</div> -<!--/VTP_picture--> -<!--VTP_submit--> -<div style="text-align:center;margin:10px;"> - <input type="submit" name="submit" value="{#submit}" /> -</div> -<!--/VTP_submit--> -<!--VTP_end_form--> -</form> -<!--/VTP_end_form--> -<!--/VTP_section-->
\ No newline at end of file diff --git a/template/default/admin/configuration.tpl b/template/default/admin/configuration.tpl new file mode 100644 index 000000000..845c87435 --- /dev/null +++ b/template/default/admin/configuration.tpl @@ -0,0 +1,233 @@ +<!-- BEGIN errors --> +<div class="errors"> +<ul> + <!-- BEGIN error --> + <li>{errors.error.ERROR}</li> + <!-- END error --> +</ul> +</div> +<!-- END errors --> +<!-- BEGIN confirmation --> +<div class="info">{L_CONFIRM}</div> +<!-- END confirmation --> +<form method="post" action="{F_ACTION}"> +<table width="100%"> + <tr class="admin"> + <th colspan="3">{L_CONF_GENERAL}</th> + </tr> + <tr> + <td colspan="3"> </td> + </tr> + <tr> + <td width="20%" >{L_ADMIN_NAME}</td> + <td><input type="text" size="25" name="webmaster" value="{ADMIN_NAME}" /></td> + <td width="50%" >{L_ADMIN_NAME_INFO}</td> + </tr> + <tr> + <td>{L_ADMIN_MAIL}</td> + <td><input type="text" size="25" maxlength="100" name="mail_webmaster" value="{ADMIN_MAIL}" /></td> + <td>{L_ADMIN_MAIL_INFO}</td> + </tr> + <tr> + <td>{L_THUMBNAIL_PREFIX}</td> + <td><input type="text" size="3" maxlength="4" name="prefix_thumbnail" value="{THUMBNAIL_PREFIX}" /></td> + <td>{L_THUMBNAIL_PREFIX_INFO}</td> + </tr> + <tr> + <td>{L_ACCESS}</td> + <td><input type="radio" class="radio" name="access" value="free" {ACCESS_FREE} />{L_ACCESS_FREE} + <input type="radio" class="radio" name="access" value="restricted" {ACCESS_RESTRICTED} />{L_ACCESS_RESTRICTED}</td> + <td>{L_ACCESS_INFO}</td> + </tr> + <tr> + <td>{L_HISTORY}</td> + <td><input type="radio" class="radio" name="log" value="true" {HISTORY_YES} />{L_YES} + <input type="radio" class="radio" name="log" value="false" {HISTORY_NO} />{L_NO}</td> + <td>{L_HISTORY_INFO}</td> + </tr> + <tr> + <td>{L_MAIL_NOTIFICATION}</td> + <td><input type="radio" class="radio" name="mail_notification" value="true" {MAIL_NOTIFICATION_YES} />{L_YES} + <input type="radio" class="radio" name="mail_notification" value="false" {MAIL_NOTIFICATION_NO} />{L_NO}</td> + <td>{L_MAIL_NOTIFICATION_INFO}</td> + </tr> + <tr> + <td colspan="3"> </td> + </tr> + <tr class="admin"> + <th colspan="3">{L_CONF_COMMENTS}</th> + </tr> + <tr> + <td colspan="3"> </td> + </tr> + <tr> + <td>{L_SHOW_COMMENTS}</td> + <td><input type="radio" class="radio" name="show_comments" value="true" {SHOW_COMMENTS_YES} />{L_YES} + <input type="radio" class="radio" name="show_comments" value="false" {SHOW_COMMENTS_NO} />{L_NO}</td> + <td>{L_SHOW_COMMENTS_INFO}</td> + </tr> + <tr> + <td>{L_COMMENTS_ALL}</td> + <td><input type="radio" class="radio" name="comments_forall" value="true" {COMMENTS_ALL_YES} />{L_YES} + <input type="radio" class="radio" name="comments_forall" value="false" {COMMENTS_ALL_NO} />{L_NO}</td> + <td>{L_COMMENTS_ALL_INFO}</td> + </tr> + <tr> + <td>{L_NB_COMMENTS_PAGE}</td> + <td><input type="text" size="3" maxlength="4" name="nb_comment_page" value="{NB_COMMENTS_PAGE}" /></td> + <td>{L_NB_COMMENTS_PAGE_INFO}</td> + </tr> + <tr> + <td>{L_VALIDATE_COMMENTS}</td> + <td><input type="radio" class="radio" name="comments_validation" value="true" {VALIDATE_COMMENTS_YES} />{L_YES} + <input type="radio" class="radio" name="comments_validation" value="false" {VALIDATE_COMMENTS_NO} />{L_NO}</td> + <td>{L_VALIDATE_COMMENTS_INFO}</td> + </tr> + <tr> + <td colspan="3"> </td> + </tr> + <tr class="admin"> + <th colspan="3">{L_ABILITIES_SETTINGS}</th> + </tr> + <tr> + <td colspan="3"> </td> + </tr> + <tr> + <td>{L_LANG_SELECT}</td> + <td>{LANG_SELECT}</td> + <td>{L_LANG_SELECT_INFO}</td> + </tr> + <tr> + <td>{L_NB_IMAGE_LINE}</td> + <td><input type="text" size="3" maxlength="2" name="nb_image_line" value="{NB_IMAGE_LINE}" /></td> + <td>{L_NB_IMAGE_LINE_INFO}</td> + </tr> + <tr> + <td>{L_NB_ROW_PAGE}</td> + <td><input type="text" size="3" maxlength="2" name="nb_line_page" value="{NB_ROW_PAGE}" /></td> + <td>{L_NB_ROW_PAGE_INFO}</td> + </tr> + <tr> + <td>{L_STYLE_SELECT}</td> + <td>{STYLE_SELECT}</td> + <td>{L_STYLE_SELECT_INFO}</td> + </tr> + <tr> + <td>{L_SHORT_PERIOD}</td> + <td><input type="text" size="3" maxlength="2" name="short_period" value="{SHORT_PERIOD}" /></td> + <td>{L_SHORT_PERIOD_INFO}</td> + </tr> + <tr> + <td>{L_LONG_PERIOD}</td> + <td><input type="text" size="3" maxlength="2" name="long_period" value="{LONG_PERIOD}" /></td> + <td>{L_LONG_PERIOD_INFO}</td> + </tr> + <tr> + <td>{L_EXPAND_TREE}</td> + <td><input type="radio" class="radio" name="auto_expand" value="true" {EXPAND_TREE_YES} />{L_YES} + <input type="radio" class="radio" name="auto_expand" value="false" {EXPAND_TREE_NO} />{L_NO}</td> + <td>{L_EXPAND_TREE_INFO}</td> + </tr> + <tr> + <td>{L_NB_COMMENTS}</td> + <td><input type="radio" class="radio" name="show_nb_comments" value="true" {NB_COMMENTS_YES} />{L_YES} + <input type="radio" class="radio" name="show_nb_comments" value="false" {NB_COMMENTS_NO} />{L_NO}</td> + <td>{L_NB_COMMENTS_INFO}</td> + </tr> + <tr> + <td colspan="3"> </td> + </tr> + <tr class="admin"> + <th colspan="3">{L_CONF_UPLOAD}</th> + </tr> + <tr> + <td colspan="3"> </td> + </tr> + <tr> + <td>{L_UPLOAD}</td> + <td><input type="radio" class="radio" name="upload_available" value="true" {UPLOAD_YES} />{L_YES} + <input type="radio" class="radio" name="upload_available" value="false" {UPLOAD_NO} />{L_NO}</td> + <td>{L_UPLOAD_INFO}</td> + </tr> + <tr> + <td>{L_UPLOAD_MAXSIZE}</td> + <td><input type="text" size="4" maxlength="4" name="upload_maxfilesize" value="{UPLOAD_MAXSIZE}" /></td> + <td>{L_UPLOAD_MAXSIZE_INFO}</td> + </tr> + <tr> + <td>{L_UPLOAD_MAXWIDTH}</td> + <td><input type="text" size="4" maxlength="4" name="upload_maxwidth" value="{UPLOAD_MAXWIDTH}" /></td> + <td>{L_UPLOAD_MAXWIDTH_INFO}</td> + </tr> + <tr> + <td>{L_UPLOAD_MAXHEIGHT}</td> + <td><input type="text" size="4" maxlength="4" name="upload_maxheight" value="{UPLOAD_MAXHEIGHT}" /></td> + <td>{L_UPLOAD_MAXHEIGHT_INFO}</td> + </tr> + <tr> + <td>{L_TN_UPLOAD_MAXWIDTH}</td> + <td><input type="text" size="4" maxlength="4" name="upload_maxwidth_thumbnail" value="{TN_UPLOAD_MAXWIDTH}" /></td> + <td>{L_TN_UPLOAD_MAXWIDTH_INFO}</td> + </tr> + <tr> + <td>{L_TN_UPLOAD_MAXHEIGHT}</td> + <td><input type="text" size="4" maxlength="4" name="upload_maxheight_thumbnail" value="{TN_UPLOAD_MAXHEIGHT}" /></td> + <td>{L_TN_UPLOAD_MAXHEIGHT_INFO}</td> + </tr> + <tr> + <td colspan="3"> </td> + </tr> + <tr class="admin"> + <th colspan="3">{L_CONF_SESSION}</th> + </tr> + <tr> + <td colspan="3"> </td> + </tr> + <tr> + <td>{L_COOKIE}</td> + <td><input type="radio" class="radio" name="authorize_cookies" value="true" {COOKIE_YES} />{L_YES} + <input type="radio" class="radio" name="authorize_cookies" value="false" {COOKIE_NO} />{L_NO}</td> + <td>{L_COOKIE_INFO}</td> + </tr> + <tr> + <td>{L_SESSION_LENGTH}</td> + <td><input type="text" size="4" maxlength="6" name="session_time" value="{SESSION_LENGTH}" /></td> + <td>{L_SESSION_LENGTH_INFO}</td> + </tr> + <tr> + <td>{L_SESSION_ID_SIZE}</td> + <td><input type="text" size="2" maxlength="3" name="session_id_size" value="{SESSION_ID_SIZE}" /></td> + <td>{L_SESSION_ID_SIZE_INFO}</td> + </tr> + <!-- BEGIN remote_sites --> + <tr> + <th colspan="3" align="center">{#remote_site}</th> + </tr> + <tr> + <td colspan=3><div style='margin-bottom:0px'> </div></td> + </tr> + <tr> + <td> </td> + <td align="center">{#delete}</td> + <td> </td> + </tr> + <!-- BEGIN site --> + <tr> + <td>{#url}</td> + <td align="center"><input type="checkbox" name="delete_site_{#id}" value="1" /></td> + <!-- BEGIN rowspan --> + <td class="row2" rowspan="{#nb_sites}">{#conf_remote_site_delete_info}</td> + <!-- END rowspan --> + </tr> + <!-- END site --> + <tr> + <td colspan=3><div style='margin-bottom:0px'> </div></td> + </tr> + <!-- END remote_sites --> + <tr> + <td colspan="3" align="center"> + <input type="submit" name="submit" class="bouton" value="{L_SUBMIT}"> + </td> + </tr> + </table> +</form>
\ No newline at end of file diff --git a/template/default/admin/configuration.vtp b/template/default/admin/configuration.vtp deleted file mode 100644 index b3ec239ee..000000000 --- a/template/default/admin/configuration.vtp +++ /dev/null @@ -1,88 +0,0 @@ -<!--VTP_errors--> -<div class="errors"> - <div class="errors_title">{#errors_title}</div> - <ul> - <!--VTP_li--> - <li>{#li}</li> - <!--/VTP_li--> - </ul> -</div> -<!--/VTP_errors--> -<!--VTP_confirmation--> - <div class="info">{#conf_confirmation}</div> -<!--/VTP_confirmation--> -<form method="post" action="{#form_action}"> - <table width="100%"> - <!--VTP_line--> - <!--VTP_param_line--> - <tr> - <td>{#name}</td> - <td align="center"> - <!--VTP_select--> - <select name="{#name}"> - <!--VTP_option--> - <option{#selected}>{#option}</option> - <!--/VTP_option--> - </select> - <!--/VTP_select--> - <!--VTP_hidden--> - {#text}<input type="hidden" name="{#name}" value="{#value}" /> - <!--/VTP_hidden--> - <!--VTP_text--> - <input type="text" name="{#name}" value="{#value}" /> - <!--/VTP_text--> - <!--VTP_group--> - <!--VTP_radio--> - <input type="radio" name="{#name}" value="{#value}"{#checked}/>{#option} - <!--/VTP_radio--> - <!--/VTP_group--> - <!--VTP_check--> - <!--VTP_box--> - <input type="checkbox" name="{#name}" value="{#value}"{#checked}/>{#option} - <!--/VTP_box--> - <!--/VTP_check--> - </td> - <td width="50%" class="row2">{#def}</td> - </tr> - <!--/VTP_param_line--> - <!--VTP_title_line--> - <tr> - <th colspan="3">{#title}</th> - </tr> - <!--/VTP_title_line--> - <!--VTP_space_line--> - <tr> - <td colspan="3"><div style="margin-bottom:0px"> </div></td> - </tr> - <!--/VTP_space_line--> - <!--/VTP_line--> - <!--VTP_remote_sites--> - <tr> - <th colspan="3" align="center">{#remote_site}</th> - </tr> - <tr> - <td colspan=3><div style='margin-bottom:0px'> </div></td> - </tr> - <tr> - <td> </td> - <td align="center">{#delete}</td> - <td> </td> - </tr> - <!--VTP_site--> - <tr> - <td>{#url}</td> - <td align="center"><input type="checkbox" name="delete_site_{#id}" value="1" /></td> - <!--VTP_rowspan--><td class="row2" rowspan="{#nb_sites}">{#conf_remote_site_delete_info}</td><!--/VTP_rowspan--> - </tr> - <!--/VTP_site--> - <tr> - <td colspan=3><div style='margin-bottom:0px'> </div></td> - </tr> - <!--/VTP_remote_sites--> - <tr> - <td colspan="3" align="center"> - <input type="submit" name="submit" value="{#submit}"> - </td> - </tr> - </table> -</form>
\ No newline at end of file diff --git a/template/default/admin/help.tpl b/template/default/admin/help.tpl new file mode 100644 index 000000000..f603fe5e5 --- /dev/null +++ b/template/default/admin/help.tpl @@ -0,0 +1,26 @@ +<table style="width:100%;"> + <!-- BEGIN cat --> + <tr class="admin"> + <th >{cat.NAME}</th> + </tr> + <tr> + <td> </td> + </tr> + <tr> + <td> + <!-- BEGIN illustration --> + <div style="text-align:center;margin:auto;margin-bottom:10px;"><img src="{cat.illustration.SRC_IMG}" style="border:1px solid black;" alt=""/></div> + {cat.illustration.CAPTION} + <!-- END illustration --> + <ul style="margin-right:10px;"> + <!-- BEGIN item --> + <li>{cat.item.CONTENT}</li> + <!-- END item --> + </ul> + </td> + </tr> + <tr> + <td> </td> + </tr> + <!-- END cat --> +</table>
\ No newline at end of file diff --git a/template/default/admin/help.vtp b/template/default/admin/help.vtp deleted file mode 100644 index 4e7692acd..000000000 --- a/template/default/admin/help.vtp +++ /dev/null @@ -1,26 +0,0 @@ -<table style="width:100%;"> - <!--VTP_cat--> - <tr> - <th>{#name}</th> - </tr> - <tr> - <td> </td> - </tr> - <tr> - <td> - <!--VTP_illustration--> - <div style="text-align:center;margin:auto;margin-bottom:10px;"><img src="{#pic_src}" style="border:1px solid black;" alt="{#pic_alt}"/></div> - {#caption} - <!--/VTP_illustration--> - <ul style="margin-right:10px;"> - <!--VTP_item--> - <li>{#content}</li> - <!--/VTP_item--> - </ul> - </td> - </tr> - <tr> - <td> </td> - </tr> - <!--/VTP_cat--> -</table>
\ No newline at end of file diff --git a/template/default/admin/search_username.tpl b/template/default/admin/search_username.tpl new file mode 100644 index 000000000..f3e676f8d --- /dev/null +++ b/template/default/admin/search_username.tpl @@ -0,0 +1,22 @@ +<script language="javascript" type="text/javascript"> +<!-- +function refresh_username(selected_username) +{ + opener.document.forms['post'].username.value = selected_username; + opener.focus(); + window.close(); +} +//--> +</script> +<div class="titrePage">{L_SEARCH_USERNAME}</div> +<form method="post" name="search" action="{F_SEARCH_ACTION}"> + <input type="text" name="search_username" value="{USERNAME}" class="post" /> + <input type="submit" name="search" value="{L_SEARCH}" class="bouton" /><br /> + <span class="gensmall">{L_SEARCH_EXPLAIN}</span><br /> + <!-- BEGIN switch_select_name --> + <span class="genmed">{L_UPDATE_USERNAME}<br /> + <select name="username_list">{switch_select_name.F_USERNAME_OPTIONS}</select> + <input type="submit" class="bouton" onClick="refresh_username(this.form.username_list.options[this.form.username_list.selectedIndex].value);return false;" name="use" value="{L_SELECT}" /></span><br /> + <!-- END switch_select_name --> + <br /><a href="javascript:window.close();" class="adminMenu">{L_CLOSE_WINDOW}</a> +</form> diff --git a/template/default/admin/thumbnail.tpl b/template/default/admin/thumbnail.tpl new file mode 100644 index 000000000..9c16d58bd --- /dev/null +++ b/template/default/admin/thumbnail.tpl @@ -0,0 +1,160 @@ +<!-- BEGIN directory_list --> +<div class="admin">{L_THUMBNAIL_TITLE}</div> +<ul class="menu"> +<li>galleries</li> +{directory_list.CATEGORY_LIST} +</ul> +<!-- END directory_list --> +<!-- BEGIN warning --> +<div style="text-align:center;font-weight:bold;margin:10px;"> [ 0 {L_UNLINK} ]</div> +<!-- END warning --> + +<!-- BEGIN errors --> +<div class="errors"> +<ul> + <!-- BEGIN error --> + <li>{errors.error.ERROR}</li> + <!-- END error --> +</ul> +</div> +<!-- END errors --> + +<!-- BEGIN results --> +<div class="admin">{L_RESULTS}</div> +<table style="width:100%;"> + <tr class="throw"> + <th> </td> + <th>{L_TN_PICTURE}</td> + <th>{L_FILESIZE}</td> + <th>{L_WIDTH}</td> + <th>{L_HEIGHT}</td> + <th>{L_GENERATED}</th> + <th>{L_THUMBNAIL}</td> + <th>{L_FILESIZE}</td> + <th>{L_WIDTH}</td> + <th>{L_HEIGHT}</td> + </tr> + <!-- BEGIN picture --> + <tr class="{results.picture.T_CLASS}"> + <td>{results.picture.NB_IMG}</td> + <td>{results.picture.FILE_IMG}</td> + <td style="text-align:right;">{results.picture.FILESIZE_IMG}</td> + <td style="text-align:right;">{results.picture.WIDTH_IMG}</td> + <td style="text-align:right;">{results.picture.HEIGHT_IMG}</td> + <th> + <div style="text-align:right;margin-right:5px;color:{results.picture.T_COLOR};">{results.picture.GEN_TIME}</div> + </th> + <td>{results.picture.TN_FILE_IMG}</td> + <td style="text-align:right;">{results.picture.TN_FILESIZE_IMG}</td> + <td style="text-align:right;">{results.picture.TN_WIDTH_IMG}</td> + <td style="text-align:right;">{results.picture.TN_HEIGHT_IMG}</td> + </tr> + <!-- END picture --> + <tr> + <td colspan="10"> </td> + </tr> +</table> +<table class="table2"> + <tr class="throw"> + <th colspan="2">{L_TN_STATS}</td> + </tr> + <tr> + <td>{L_TN_NB_STATS}</td> + <td style="text-align:center;">{results.TN_NB}</td> + </tr> + <tr> + <td>{L_TN_TOTAL}</td> + <td style="text-align:right;">{results.TN_TOTAL}</td> + </tr> + <tr> + <td>{L_TN_MAX}</td> + <td style="text-align:right;color:red;">{results.TN_MAX}</td> + </tr> + <tr> + <td>{L_TN_MIN}</td> + <td style="text-align:right;color:#33FF00;">{results.TN_MIN}</td> + </tr> + <tr> + <td>{L_TN_AVERAGE}</td> + <td style="text-align:right;">{results.TN_AVERAGE}</td> + </tr> +</table> +<br /> +<!-- END results --> + +<!-- BEGIN params --> +<form method="post" action="{params.F_ACTION}"> + <table style="width:100%;"> + <tr> + <th class="admin" colspan="3">{L_PARAMS}</th> + </tr> + <tr><td colspan="3"> </td></tr> + <tr> + <td><div class="key">{L_GD}</div></td> + <td class="choice"> + <input type="radio" name="gd" value="2" {params.GD2_CHECKED} />2.x + <input type="radio" name="gd" value="1" {params.GD1_CHECKED} />1.x + </td> + <td style="width:50%;" class="row2">{L_GD_INFO}</td> + </tr> + <tr> + <td><div class="key">{L_WIDTH}</div></td> + <td class="choice"> + <input type="text" name="width" value="{params.WIDTH_TN}"/> + </td> + <td>{L_WIDTH_INFO}</td> + </tr> + <tr> + <td><div class="key">{L_HEIGHT}</div></td> + <td class="choice"> + <input type="text" name="height" value="{params.HEIGHT_TN}"/> + </td> + <td>{L_HEIGHT_INFO}</td> + </tr> + <tr> + <td><div class="key">{L_CREATE}</div></td> + <td class="choice"> + <select name="n"> + <option selected>5</option> + <option>10</option> + <option>20</option> + <option>40</option> + </select> + </td> + <td>{L_CREATE_INFO}</td> + </tr> + <tr> + <td><div class="key">{L_FORMAT}</div></td> + <td class="choice"><span style="font-weight:bold;">jpeg</span></td> + <td>{L_FORMAT_INFO}</td> + </tr> + <tr> + <td colspan="3" style="text-align:center;"> + <input type="submit" name="submit" class="bouton" value="{L_SUBMIT}"/> + </td> + </tr> + </table> +</form> +<!-- END params --> + +<!-- BEGIN remainings --> +<div class="admin">{remainings.TOTAL_IMG} {L_REMAINING}</div> +<table style="width:100%;"> + <tr class="throw"> + <th> </td> + <th style="width:60%;">{L_TN_PICTURE}</td> + <th>{L_FILESIZE}</td> + <th>{L_WIDTH}</td> + <th>{L_HEIGHT}</td> + </tr> + <!-- BEGIN remaining --> + <tr class="{remainings.remaining.T_CLASS}"> + <td>{remainings.remaining.NB_IMG}</td> + <td><div style="margin-left:10px;">{remainings.remaining.FILE_TN}</div></td> + <td><div style="margin-left:10px;">{remainings.remaining.FILESIZE_IMG}</div></td> + <td><div style="margin-left:10px;">{remainings.remaining.WIDTH_IMG}</div></td> + <td><div style="margin-left:10px;">{remainings.remaining.HEIGHT_IMG}</div></td> + </tr> + <!-- END remaining --> +</table> +<!-- END remainings -->
\ No newline at end of file diff --git a/template/default/admin/thumbnail.vtp b/template/default/admin/thumbnail.vtp deleted file mode 100644 index 42a792eb8..000000000 --- a/template/default/admin/thumbnail.vtp +++ /dev/null @@ -1,188 +0,0 @@ -<!--VTP_directory_list--> -<table style="width:100%;"> - <tr> - <th>{#tn_dirs_title}</th> - </tr> - <tr> - <td> - <div style="text-indent:30px;"> - <img src="./template/{#user_template}/admin/images/puce.gif" alt=">" style="border:none;" /> - galleries - </div> - <!--VTP_dir--> - <div style="text-indent:{#indent}px;"> - <img src="./template/{#user_template}/admin/images/puce.gif" alt=">" style="border:none;" /> - <!--VTP_linked--> - <a href="{#url}">{#name}</a> [ {#nb_pic} {#tn_dirs_alone} ] - <!--/VTP_linked--> - <!--VTP_unlinked--> - {#name} - <!--/VTP_unlinked--> - </div> - <!--/VTP_dir--> - </td> - </tr> -</table> -<!--/VTP_directory_list--> - -<!--VTP_warning--> -<div style="text-align:center;font-weight:bold;margin:10px;"> [ 0 {#tn_dirs_alone} ]</div> -<!--/VTP_warning--> - -<!--VTP_errors--> -<div class="errors"> - <ul> - <!--VTP_li--> - <li>{#li}</li> - <!--/VTP_li--> - </ul> -</div> -<!--/VTP_errors--> - -<!--VTP_results--> -<table style="width:100%;"> - <tr> - <th colspan="10">{#tn_results_title}</th> - </tr> - <tr> - <td class="throw2"> </td> - <td class="throw2">{#tn_picture}</td> - <td class="throw2">{#filesize}</td> - <td class="throw2">{#tn_width}</td> - <td class="throw2">{#tn_height}</td> - <th>{#tn_results_gen_time}</th> - <td class="throw2">{#thumbnail}</td> - <td class="throw2">{#filesize}</td> - <td class="throw2">{#tn_width}</td> - <td class="throw2">{#tn_height}</td> - </tr> - <!--VTP_picture--> - <tr> - <td class="row2">{#num}</td> - <td class="{#class}">{#file}</td> - <td class="{#class}" style="text-align:right;">{#filesize}</td> - <td class="{#class}" style="text-align:right;">{#width}</td> - <td class="{#class}" style="text-align:right;">{#height}</td> - <th> - <div style="text-align:right;margin-right:5px;color:{#color};">{#time}</div> - </th> - <td class="{#class}">{#thumb_file}</td> - <td class="{#class}" style="text-align:right;">{#thumb_filesize}</td> - <td class="{#class}" style="text-align:right;">{#thumb_width}</td> - <td class="{#class}" style="text-align:right;">{#thumb_height}</td> - </tr> - <!--/VTP_picture--> - <tr> - <td colspan="10"> </td> - </tr> -</table> -<table style="margin:auto;border:1px solid black;"> - <tr> - <td colspan="2" style="text-align:center;font-weight:bold;" class="row2">{#tn_stats}</td> - </tr> - <tr> - <td>{#tn_stats_nb}</td> - <td style="text-align:center;">{#stats_nb}</td> - </tr> - <tr> - <td>{#tn_stats_total}</td> - <td style="text-align:right;">{#stats_total}</td> - </tr> - <tr> - <td>{#tn_stats_max}</td> - <td style="text-align:right;color:red;">{#stats_max}</td> - </tr> - <tr> - <td>{#tn_stats_min}</td> - <td style="text-align:right;color:green;">{#stats_min}</td> - </tr> - <tr> - <td>{#tn_stats_mean}</td> - <td style="text-align:right;">{#stats_mean}</td> - </tr> -</table> -<table> - <tr> - <td> </td> - </tr> -</table> -<!--/VTP_results--> - -<!--VTP_params--> -<form method="post" action="{#action}"> - <table style="width:100%;"> - <tr> - <th colspan="3">{#tn_params_title}</th> - </tr> - <tr><td colspan="3"> </td></tr> - <tr> - <td><div class="key">{#tn_params_GD}</div></td> - <td class="choice"> - <input type="radio" name="gd" value="2"{#gd2_checked} />2.x - <input type="radio" name="gd" value="1"{#gd1_checked} />1.x - </td> - <td style="width:50%;" class="row2">{#tn_params_GD_info}</td> - </tr> - <tr> - <td><div class="key">{#tn_width}</div></td> - <td class="choice"> - <input type="text" name="width" value="{#width_value}"/> - </td> - <td class="row2">{#tn_params_width_info}</td> - </tr> - <tr> - <td><div class="key">{#tn_height}</div></td> - <td class="choice"> - <input type="text" name="height" value="{#height_value}"/> - </td> - <td class="row2">{#tn_params_height_info}</td> - </tr> - <tr> - <td><div class="key">{#tn_params_create}</div></td> - <td class="choice"> - <select name="n"> - <!--VTP_n_option--> - <option{#selected}>{#option}</option> - <!--/VTP_n_option--> - </select> - </td> - <td class="row2">{#tn_params_create_info}</td> - </tr> - <tr> - <td><div class="key">{#tn_params_format}</div></td> - <td class="choice"><span style="font-weight:bold;">jpeg</span></td> - <td class="row2">{#tn_params_format_info}</td> - </tr> - <tr><td colspan="3"> </td></tr> - <tr> - <td colspan="3" style="text-align:center;"> - <input type="submit" name="submit" value="{#submit}"/> - </td> - </tr> - </table> -</form> -<!--/VTP_params--> - -<!--VTP_remainings--> -<table style="width:100%;"> - <tr> - <th colspan="5"><span style="color:#006699;">{#total}</span> {#tn_alone_title}</th> - </tr> - <tr> - <td class="throw2"> </td> - <td class="throw2" style="width:50%;">{#tn_picture}</td> - <td class="throw2" style="width:17%;">{#filesize}</td> - <td class="throw2" style="width:17%;">{#tn_width}</td> - <td class="throw2" style="width:16%;">{#tn_height}</td> - </tr> - <!--VTP_remaining--> - <tr> - <td class="row2">{#num}</td> - <td class="{#class}"><div style="margin-left:10px;">{#file}</div></td> - <td class="{#class}"><div style="margin-left:10px;">{#filesize}</div></td> - <td class="{#class}"><div style="margin-left:10px;">{#width}</div></td> - <td class="{#class}"><div style="margin-left:10px;">{#height}</div></td> - </tr> - <!--/VTP_remaining--> -</table> -<!--/VTP_remainings-->
\ No newline at end of file diff --git a/template/default/admin/update.tpl b/template/default/admin/update.tpl new file mode 100644 index 000000000..97ba87963 --- /dev/null +++ b/template/default/admin/update.tpl @@ -0,0 +1,31 @@ +<!-- BEGIN introduction --> +<div class="admin">{L_UPDATE_TITLE}</div> +<ul class="menu"> + <li><a href="{U_CAT_UPDATE}">{L_CAT_UPDATE}</a></li> + <li><a href="{U_ALL_UPDATE}">{L_ALL_UPDATE}</a></li> +</ul> +<!-- END introduction --> +<!-- BEGIN update --> +<div class="admin">{L_RESULT_UPDATE}</div> + {update.CATEGORIES} + <br /><span style="color:blue;">{update.NEW_CAT} {L_NEW_CATEGORY}</span> + <br /><span style="color:red;">{update.DEL_CAT} {L_DEL_CATEGORY}</span> +<!-- END update --> +<!-- BEGIN remote_update --> + <table> + <tr> + <th>{#remote_site}</th> + </tr> + <tr> + <td> + <div class="retrait"> + <span style="font-weight:bold;color:navy;">{#url}</span><br /><br /> + <!-- update.php generates itself HTML code for categories --> + {#categories} + <br /><span style="color:blue;">{#count_new} {#update_research_conclusion}</span> + <br /><span style="color:red;">{#count_deleted} {#update_deletion_conclusion}</span> + </div> + </td> + </tr> + </table> + <!-- END remote_update --> diff --git a/template/default/admin/update.vtp b/template/default/admin/update.vtp deleted file mode 100644 index 72deed543..000000000 --- a/template/default/admin/update.vtp +++ /dev/null @@ -1,49 +0,0 @@ -<table style="width:100%;"> - <!--VTP_introduction--> - <tr> - <th>{#update_default_title}</th> - </tr> - <tr> - <td> - <div class="retrait"> - <img src="./template/{#user_template}/admin/images/puce.gif" alt=">" /> - <a href="{#only_cat:url}">{#update_only_cat}</a> - <br /><img src="./template/{#user_template}/admin/images/puce.gif" alt=">" /> - <a href="{#all:url}">{#update_all}</a> - </div> - </td> - </tr> - <!--/VTP_introduction--> - <!--VTP_local_update--> - <tr> - <th>{#update_part_research}</th> - </tr> - <tr> - <td> - <div class="retrait"> - <span style="font-weight:bold;color:navy;">{#url}</span><br /><br /> - <!-- update.php generates itself HTML code for categories --> - {#categories} - <br /><span style="color:blue;">{#count_new} {#update_research_conclusion}</span> - <br /><span style="color:red;">{#count_deleted} {#update_deletion_conclusion}</span> - </div> - </td> - </tr> - <!--/VTP_local_update--> - <!--VTP_remote_update--> - <tr> - <th>{#remote_site}</th> - </tr> - <tr> - <td> - <div class="retrait"> - <span style="font-weight:bold;color:navy;">{#url}</span><br /><br /> - <!-- update.php generates itself HTML code for categories --> - {#categories} - <br /><span style="color:blue;">{#count_new} {#update_research_conclusion}</span> - <br /><span style="color:red;">{#count_deleted} {#update_deletion_conclusion}</span> - </div> - </td> - </tr> - <!--/VTP_remote_update--> -</table>
\ No newline at end of file diff --git a/template/default/admin/user_list.vtp b/template/default/admin/user_list.tpl index 562ef8c42..562ef8c42 100644 --- a/template/default/admin/user_list.vtp +++ b/template/default/admin/user_list.tpl diff --git a/template/default/admin/user_modify.vtp b/template/default/admin/user_modify.tpl index 475a0eff3..475a0eff3 100644 --- a/template/default/admin/user_modify.vtp +++ b/template/default/admin/user_modify.tpl diff --git a/template/default/admin/user_perm.tpl b/template/default/admin/user_perm.tpl new file mode 100644 index 000000000..bd5bb43d2 --- /dev/null +++ b/template/default/admin/user_perm.tpl @@ -0,0 +1,26 @@ +<!-- BEGIN search --> +<div class="admin">{L_SELECT_USERNAME}</div> +<form method="post" name="post" action="{F_SEARCH_USER_ACTION}"> + <input type="text" name="username" maxlength="50" size="20" /> + <input type="hidden" name="mode" value="edit" />{S_HIDDEN_FIELDS} + <input type="submit" name="submituser" value="{L_LOOKUP_USER}" class="bouton" /> + <input type="submit" name="usersubmit" value="{L_FIND_USERNAME}" class="bouton" onClick="window.open('{U_SEARCH_USER}', '_phpwgsearch', 'HEIGHT=250,resizable=yes,WIDTH=400');return false;" /> +</form> +<!-- END search --> +<!-- BEGIN permission --> +<div class="admin">{L_AUTH_USER}</div> +<form action="{F_AUTH_ACTION}" method="POST"> + <ul class="menu"> + <!-- BEGIN category --> + <li> <a href="{permission.category.CAT_URL}"><span style="color:{#color}">{permission.category.CAT_NAME}</span></a> + <!-- BEGIN parent_forbidden --> + {L_PARENT_FORBIDDEN} - + <!-- END parent_forbidden --> + <input type="radio" name="{permission.category.CAT_ID}" value="0" {permission.category.AUTH_YES}/>{L_AUTHORIZED} + <input type="radio" name="{permission.category.CAT_ID}" value="1" {permission.category.AUTH_NO}/>{L_FORBIDDEN} + </li> + <!-- END category --> + </ul> + <input type="submit" name="submit" class="bouton" value="{L_SUBMIT}"/> +</form> +<!-- END permission -->
\ No newline at end of file diff --git a/template/default/admin/user_perm.vtp b/template/default/admin/user_perm.vtp deleted file mode 100644 index bbe02ce84..000000000 --- a/template/default/admin/user_perm.vtp +++ /dev/null @@ -1,34 +0,0 @@ -<!--VTP_confirmation--> -<div class="info">{#permuser_info_message} [ <a href="{#back_url}">{#adduser_info_back}</a> ]</div> -<!--/VTP_confirmation--> - -<div class="info">{#permuser_only_private}</div> - -<form action="{#action}" method="post"> - <table style="width:100%;"> - <!--VTP_category--> - <tr> - <td> - <img src="./template/{#user_template}/admin/images/puce.gif" alt=">" /> <a href="{#cat_perm_link}"><span style="color:{#color}">{#name}</span></a> - <!--VTP_usergroups--> - [ - <!--VTP_usergroup--> - <a href="{#url}" style="color:{#color};">{#name}</a>{#separation} - <!--/VTP_usergroup--> - ] - <!--/VTP_usergroups--> - </td> - <td style="text-align:right;"> - <!--VTP_parent_forbidden--> - {#permuser_parent_forbidden} - <!--/VTP_parent_forbidden--> - <input type="radio" name="access-{#id}" value="0"{#authorized_checked}/>{#permuser_authorized} - <input type="radio" name="access-{#id}" value="1"{#forbidden_checked}/>{#permuser_forbidden} - </td> - </tr> - <!--/VTP_category--> - <tr> - <td colspan="2" align="center"><input type="submit" name="submit" value="{#submit}"/></td> - </tr> - </table> -</form>
\ No newline at end of file diff --git a/template/default/admin/user_select_body.tpl b/template/default/admin/user_select_body.tpl new file mode 100644 index 000000000..6790c2d00 --- /dev/null +++ b/template/default/admin/user_select_body.tpl @@ -0,0 +1,7 @@ +<div class="admin">{L_SELECT_USERNAME}</div> +<form method="post" name="post" action="{F_USER_ACTION}"> + <input type="text" name="username" maxlength="50" size="20" /> + <input type="hidden" name="mode" value="edit" />{S_HIDDEN_FIELDS} + <input type="submit" name="submituser" value="{L_LOOKUP_USER}" /> + <input type="submit" name="usersubmit" value="{L_FIND_USERNAME}" onClick="window.open('{U_SEARCH_USER}', '_phpwgsearch', 'HEIGHT=250,resizable=yes,WIDTH=400');return false;" /> +</form>
\ No newline at end of file diff --git a/template/default/category.tpl b/template/default/category.tpl index 7815c5b0d..deb4e2229 100644 --- a/template/default/category.tpl +++ b/template/default/category.tpl @@ -20,23 +20,29 @@ <span class="menuInfoCat">[ <span title="{category.NB_SUBCATS} {L_SUBCAT}">{category.NB_SUBCATS}</span> - <span title="{category.TOTAL_CAT} {L_IMG_AVAILABLE}">{category.TOTAL_CAT}</span> ]</span>{category.CAT_ICON}<br /> <!-- END category --> - <div class="totalImages">[ {NB_PICTURE} {L_TOTAL} ]</div> - <!-- BEGIN favorites --> - <br /> <img src="{T_COLLAPSED}" alt='' /> <a href="{U_FAVORITE}"><span title="{L_FAVORITE_HINT}" style="font-weight:bold;">{L_FAVORITE}</span></a> <span class="menuInfoCat">[ {favorites.NB_FAV} ]</span> - <!-- END favorites --> - <br /> <img src="{T_COLLAPSED}" alt='' /> <span style="font-weight:bold;">{L_STATS}</span> - <br /> <img src="{T_COLLAPSED}" alt='' /> <a href="{U_MOST_VISITED}"><span title="{L_MOST_VISITED_HINT}" style="font-weight:bold;">{TOP_VISITED} {L_MOST_VISITED}</span></a> - <br /> <img src="{T_COLLAPSED}" alt='' /> <a href="{U_RECENT}"><span title="{L_RECENT_HINT}" style="font-weight:bold;">{L_RECENT}</span></a> {T_SHORT} + <br /> + <ul class="menu"> + <!-- BEGIN favorites --> + <li><a href="{U_FAVORITE}"><span title="{L_FAVORITE_HINT}" style="font-weight:bold;">{L_FAVORITE}</span></a> <span class="menuInfoCat">[ {favorites.NB_FAV} ]</span></li> + <!-- END favorites --> + <li><span style="font-weight:bold;">{L_STATS}</span></li> + <ul class="menu"> + <li><a href="{U_MOST_VISITED}"><span title="{L_MOST_VISITED_HINT}" style="font-weight:bold;">{TOP_VISITED} {L_MOST_VISITED}</span></a></li> + <li><a href="{U_RECENT}"><span title="{L_RECENT_HINT}" style="font-weight:bold;">{L_RECENT}</span></a> {T_SHORT}</li> + </ul> + </ul> </div> <div class="titreMenu">{L_SUMMARY}</div> <div class="menu"> + <ul class="menu"> <!-- BEGIN summary --> - <img src="{T_COLLAPSED}" alt=''/> <a href="{summary.U_SUMMARY}" title="{summary.TITLE}">{summary.NAME}</a><br /> + <li><a href="{summary.U_SUMMARY}" title="{summary.TITLE}">{summary.NAME}</a></li> <!-- END summary --> <!-- BEGIN upload --> - <br /> <img src="{T_COLLAPSED}" alt=''/> <a href="{upload.U_UPLOAD}">{L_UPLOAD}</a> + <li><a href="{upload.U_UPLOAD}">{L_UPLOAD}</a></li> <!-- END upload --> + </ul> </div> <div class="titreMenu">{L_IDENTIFY}</div> <div class="menu"> @@ -46,7 +52,7 @@ {L_USERNAME}<br /> <input type="text" name="username" size="15" value="" /><br /> {L_PASSWORD}<br /> - <input type="password" name="password" size="15"><br /><br /> + <input type="password" name="password" size="15"><br /> <input type="submit" name="login" value="{L_SUBMIT}" class="bouton" /> </form> <!-- END login --> @@ -70,16 +76,16 @@ <tr> <!-- BEGIN thumbnail --> <td class="thumbnail"> - <a href="{thumbnails.line.thumbnail.U_IMG_LINK}" class="back"> + <a href="{thumbnails.line.thumbnail.U_IMG_LINK}"> <img src="{thumbnails.line.thumbnail.IMAGE}" alt="{thumbnails.line.thumbnail.IMAGE_ALT}" title="{thumbnails.line.thumbnail.IMAGE_TITLE}" - class="imgLink" /> + class="thumbLink" /> <br /> {thumbnails.line.thumbnail.IMAGE_NAME}</a> {thumbnails.line.thumbnail.IMAGE_TS} <!-- BEGIN nb_comments --> - <br />{thumbnails.line.thumbnail.NB_COMMENTS} {L_COMMENTS} + <br />{thumbnails.line.thumbnail.nb_comments.NB_COMMENTS} {L_COMMENT} <!-- END nb_comments --> </td> <!-- END thumbnail --> diff --git a/template/default/comments.tpl b/template/default/comments.tpl index e4a46e4b5..71f3a4c62 100644 --- a/template/default/comments.tpl +++ b/template/default/comments.tpl @@ -1,61 +1,55 @@ -<table style="width:100%;"> - <tr align="center" valign="middle"> - <td> - {T_START}1px{T_BEGIN} - <div class="titrePage">{L_TITLE}</div> - {T_END} - <div style="margin-bottom:20px"></div> - {T_START}90%{T_BEGIN} -<table style="width:100%;"> - <tr> - <th> +<!-- BEGIN title --> +<div class="titrePage">{L_COMMENT_TITLE}</div> +<!-- END title --> +<div class="admin"> [ <!-- BEGIN last_day_option --> - <a href="{last_day_option.U_OPTION}" style="{last_day_option.T_STYLE}">{last_day_option.OPTION}</a>{T_SEPARATION} + <a class="admin" href="{last_day_option.U_OPTION}" style="{last_day_option.T_STYLE}">{last_day_option.OPTION}</a>{T_SEPARATION} <!-- END last_day_option --> - {L_STATS} + {L_COMMENT_STATS} ] - [ <a href="{U_HOME}">{L_RETURN}</a> ] - </th> - </tr> -</table> + <!-- BEGIN title --> + [ <a class="admin" href="{U_HOME}">{L_COMMENT_RETURN}</a> ] + <!-- END title --> +</div> +<!-- BEGIN validation --> +<form action="{F_ACTION}" method="post"> +<!-- END validation --> +<table class="table2"> <!-- BEGIN picture --> -<div style="border:2px solid gray;margin:2px;padding:2px;"> - <table style="width:100%;"> - <tr> - <td valign="top" style="width:15%;"> - <!-- the thumbnail of the picture, linked to the full size page --> - <a href="{picture.U_THUMB}" title="{picture.TITLE_IMG}"> - <img src="{picture.I_THUMB}" class="imgLink" alt="{picture.THUMB_ALT_IMG}"/> - </a> - </td> - <td style="padding:10px;width:85%;"> - <div style="font-weight:bold;padding-left:10px;text-align:left;">{picture.TITLE_IMG}</div> - <!-- BEGIN comment --> - <table class="tableComment"> - <tr> - <td rowspan="2" valign="top" class="cellAuthor"> - <div class="commentsAuthor">{picture.comment.AUTHOR}</div> - </td> - <td class="cellInfo"> - <div class="commentsInfos"> - {picture.comment.DATE} - </div> - </td> - </tr> - <tr> - <td> - <div class="commentsContent">{picture.comment.CONTENT}</div> - </td> - </tr> - </table> - <!-- END comment --> - </td> - </tr> +<tr class="row1"> +<td > +<a href="{picture.U_THUMB}" title="{picture.TITLE_IMG}"> +<img src="{picture.I_THUMB}" class="thumbLink" alt="{picture.THUMB_ALT_IMG}"/> +</a> +</td> +<td class="tablecompact"> + <div class="commentTitle">{picture.TITLE_IMG}</div> + <div class="commentsNavigationBar">{picture.NAV_BAR}</div> + <table class="tablecompact"> + <!-- BEGIN comment --> + <tr class="throw"> + <td class="throw"> + {picture.comment.COMMENT_AUTHOR} + </td> + <td class="commentDate"> + {picture.comment.COMMENT_DATE} + <!-- BEGIN validation --> + <input type="checkbox" name="comment_id[]" value="{picture.comment.validation.ID}" {picture.comment.validation.CHECKED} /> + <!-- END validation --> + </td> + </tr> + <tr class="row1"> + <td class="comment" colspan="2">{picture.comment.COMMENT}</td> + </tr> + <!-- END comment --> </table> -</div> +</td> +</tr> <!-- END picture --> - {T_END} - </td> - </tr> -</table>
\ No newline at end of file +</table> +<!-- BEGIN validation --> +<input type="submit" name="validate" class="bouton" value="{L_VALIDATE}" /> +<input type="submit" name="delete" class="bouton" value="{L_DELETE}" /> +</form> +<!-- END validation -->
\ No newline at end of file diff --git a/template/default/default-admin.css b/template/default/default-admin.css deleted file mode 100644 index 7270c1bb1..000000000 --- a/template/default/default-admin.css +++ /dev/null @@ -1,93 +0,0 @@ -@import url("default.css"); - -a, a:hover { -color:#006699; -} - -body,font,table,input,form,select,textarea { -font-family:arial,verdana,sans-serif; -font-size:12px; -color:#000000; -text-align:left; -} -table -{ -border-collapse:separate; -} -body { -background-color:#E5E5E5; -margin:5px; -} - -.table1 { -border-collapse:collapse; -background-color:#FFFFFF; -} -.contenucellule { -background-color:#EEEEEE; -border:2px solid #006699; -} -.style1 { -margin-top:20px; -} -th { -font-weight:bold; -background-color:#D3DCE3; -margin-bottom:10px; -text-align: center; -} -td.row1 { -background-color:#E6E4E4; -} -td.row2,td.throw2 { -background-color:#E8E8E8; -} -td.throw2 { -text-align:center; -font-weight:bold; -} -td.row3 { -background-color:#eeeeee; -} -td.row4 { -background-color:#cccccc; -} -.info { -color:darkblue; -text-align:center; -} -div.key { -margin-left : 10px; -} -td.choice { -text-align : center; -} -div.install_warning { -text-align:center; -color:red; -margin:20px; -font-weight:bold; -} - -.tableComment,.cellAuthor,.cellInfo { -color:#000000; -border-color:#006699; -} -.commentsAuthor,.commentsTitle,.commentsInfos,.commentsContent -{ -color:#000000; -} -.errors { - text-align:left; - margin:25px; - background-color:#ffe1e1; - border:1px solid red; - color:black; -} -.errors_title { - margin:5px; - font-weight:bold; - font-size:120%; - text-align:center; - color:red; -}
\ No newline at end of file diff --git a/template/default/default.css b/template/default/default.css index 7a2d04405..148f36d0f 100644 --- a/template/default/default.css +++ b/template/default/default.css @@ -1,7 +1,7 @@ /* Main styles */ body { - font-family: Verdana, Arial, Helvetica, sans-serif; + font-family: Verdana, Geneva, Arial, sans-serif; font-size:10px; background-color:#000000; color:#E0E0E0; @@ -14,9 +14,12 @@ a { } a:hover { text-decoration:underline; - color:#FFFFAA; + color:#FFF48E; } +a.none:hover { + text-decoration:none; +} /* Navigation styles */ .titreMenu,.titrePage @@ -48,45 +51,53 @@ a:hover { font-weight:600; } -.menu -{ +.menu { margin:10px 5px 10px 5px; white-space:nowrap; font-size:11px; + text-align:left; } - /* Image related styles */ - -.imgLink { - border-style: solid; - border-width:2px; - border-color: #A0A0A0; - margin: 2px; +ul.menu { + text-align:left; + list-style-image : url(theme/collapsed.gif); + list-style-type: square ; + padding-left:15px; + margin:5px; } -.imgLink:hover { - text-decoration:none; +.navigationBar { + text-align:center; + margin-top:10px; + margin-bottom:10px; } + /* Image related styles */ + .image { - border: 1px solid #000000; - background-color: #FFFFFF; - text-align:center; - margin-top: 10px; - margin-bottom: 20px; - white-space: nowrap; - padding: 0px; - display: table; + border : 3px solid #FFFFFF; + margin : 10px 4px 10px 4px; +} + +a.image:hover { + text-decoration:none; } .commentImage { - font-weight:bold; - text-align:center; - font-size:17px; - color:#F0F0F0; + text-align:justify; + font-style:italic; + font-size:16px; + margin-top: 10px; margin-bottom: 10px; } +.nameImage { + text-align:center; + font-size:24px; + background-color: #666666; + border-top: 1px solid #222222; + border-bottom: 1px solid #222222; +} /* Table styles */ .main { @@ -109,43 +120,147 @@ a:hover { } .table2 { - background: #797979; + background-color: #797979; border: 1px solid #000000; - margin: 0px 10px 10px 10px; + margin: 0px 10px 0px 0px; + padding:0px; } -td{ - padding:0px; +.tablecompact{ + width:100%; + border-collapse:collapse; +} + +.row1,.row2 { + text-align:left; + padding:5px 0px 5px 0px; + height:20px; +} + +.row1 { + background-color:#505050; } +.throw { + color:#FFFFCC; + background-color:#3F3F3F; + width:100%; + text-align:center; + font-weight:bold; + border-top: 1px solid #000000; + border-bottom: 1px solid #000000; + height:20px; +} + +td.throw{ + text-align:left; + width:auto; +} /* Thumbnails styles */ .thumbnail { font-size:11px; text-align:center; - display:inline-table; vertical-align: baseline; + white-space: nowrap; } table.thumbnail { border-collapse:separate; + display:inline-table; } -/* Other styles */ -a.back { - color:#E0E0E0; +.thumbLink { + border-style: solid; + border-width:1px; + border-color: #A0A0A0; + margin: 2px; } -input { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size:11px; +a.thumbLink:hover { + text-decoration:none; } -.info,.commentsAuthor,.commentsTitle,.commentsInfos,.commentsContent,.commentsNavigationBar { - color:#E0E0E0; - background-color:#444444; +/* Comment styles */ +.commentTitle { + font-family: Arial, Helvetica, sans-serif; + font-size:12px; + background-color:#797979; + font-weight:bold; + padding: 15px 5px 10px 5px; +} + +.commentDate { + font-weight:lighter; + text-align:right; + color:#999999; + border-top: 1px solid #000000; + border-bottom: 1px solid #000000; +} + +.comment{ + color:#C6B78E; } +/* Form styles */ + +.bouton { + background-image: url(theme/button_bg.gif); + border: 1px solid #404750; + color:#FFFFFF; + padding-left: 3px; + padding-right: 3px; + font-weight:500; + background-position : bottom; + margin-top:10px; +} + +input,select { + background-color:#505050; + border: 1px solid #797979; + padding: 0; + color:#FFFFCC; +} + +/* Admin styles */ + +.adminMenu { + text-align:center; + font-size:12px; +} + +div.adminMenu{ +margin:10px 50px 10px 50px; +} + +a.adminMenu:hover{ + color : #C6B78E; +} + +a.adminMenu{ + color : #FFF48E; +} + +.admin { +font-weight:bold; +background-color:#444444; +margin:0px 0px 12px 0px; +text-align: center; +padding:0px; +color : #FFF48E; +} + +.adminMain +{ + border: 1px solid #000000; + background-color:#656565; + width:95%; + color:#FFFFFF; +} + +/* Other styles */ .info { + color:#E0E0E0; + background-color:#444444; margin-bottom:5px; white-space:nowrap; margin-left:5px; @@ -163,18 +278,9 @@ input { font-size:11px; } -.comments, .infoCat, .navigationBar { +.infoCat { margin-top:10px; margin-bottom:10px; -} -.comments { - text-align:justify; - font-style:italic; -} -.navigationBar { - text-align:center; -} -.infoCat { text-align:left; } @@ -184,15 +290,6 @@ input { letter-spacing:-1px; } -.bouton { - background:#E0E0E0; -} -textarea,input { - color:black; -} - - - .errors { text-align:left; margin-top:5px; @@ -209,32 +306,7 @@ div.information { margin:10px; padding:5px; } -.commentsAuthor, .commentsTitle, .commentsInfos, .commentsContent, .commentsNavigationBar { - - font-family:arial, sans-Serif; - font-size:12px; -} -.commentsTitle, .commentsAuthor { - text-align:center; - font-weight:bold; -} -.commentsInfos { - padding:3px 3px 3px 10px; - font-size:11px; - text-align:right; -} -.commentsContent { - margin:10px; -} -.commentsTitle { - margin-top:15px; -} -.commentsAuthor { - margin:5px; -} -.commentsNavigationBar { - margin:10px; -} + .tableComment,.cellAuthor,.cellInfo { border-color:#E0E0E0; border-style:solid; @@ -254,45 +326,3 @@ div.information { border-width:0px; border-bottom-width:1px; } - - .miniature { - border:solid 1px black; - } - .titretable1 { - color:black; - background-color:#D3DCE3; - text-align:center; - border:2px solid #006699; - font-weight:bold; - border-bottom:0px; - } - .grostitre { - text-align:center; - margin:10px 50px 10px 50px; - font-size:20px; - width:300px; - } - .plan { - margin:10px 10px 10px 2px; - white-space:nowrap; - } - .cat_plan { - font-weight:bold; - } - .retrait { - margin:10px; - margin-left:30px; - margin-top:2px; - } - .erreur { - color:red; - text-align:center; - } - .errors_title { - margin:5px; - font-weight:bold; - font-size:120%; - text-align:center; - color:red; - } - diff --git a/template/default/header.tpl b/template/default/header.tpl index 7e5deb3de..93d1005a1 100644 --- a/template/default/header.tpl +++ b/template/default/header.tpl @@ -1,13 +1,14 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{LANG}" lang="{LANG}" dir="{DIR}"> <head> -<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" /> +<meta http-equiv="Content-Type" content="text/html; charset={CONTENT_ENCODING}" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <!-- BEGIN refresh --> -<meta http-equiv="refresh" content="{S_REFRESH_TIME};url={U_REFRESH}"> +<meta http-equiv="refresh" content="{REFRESH_TIME};url={U_REFRESH}"> <!-- END refresh --> <title>{PAGE_TITLE}</title> <link rel="stylesheet" href="{T_STYLE}" type="text/css" /> +<script type="text/javascript" src="include/scripts.js"></script> </head> <body> <table class="main"> diff --git a/template/default/htmlfunctions.inc.php b/template/default/htmlfunctions.inc.php index c47ca2f1e..6031d1e45 100644 --- a/template/default/htmlfunctions.inc.php +++ b/template/default/htmlfunctions.inc.php @@ -38,14 +38,14 @@ function get_icon( $date_comparaison ) if ( $difference < $user['short_period'] * $jours ) { $icon_url.= 'new_short.gif'; - $title .= $user['short_period']; + $title .= $user['short_period']; } else { $icon_url.= 'new_long.gif'; - $title .= $user['long_period']; + $title .= $user['long_period']; } - $title .= ' '.$lang['days']; + $title .= ' '.$lang['days']; $size = getimagesize( $icon_url ); $output = '<img title="'.$title.'" src="'.$icon_url.'" style="border:0;'; $output.= 'height:'.$size[1].'px;width:'.$size[0].'px" alt="" />'; @@ -107,57 +107,7 @@ function create_navigation_bar( $url, $nb_element, $start, return $navigation_bar; } -function get_frame_start() -{ - return '<table style="padding:0px;border-collapse:collapse; width:'; -} - -function get_frame_begin() -{ - global $user; - $path = './template/'.$user['template'].'/theme/'; - $size_01 = getimagesize( $path.'01.gif' ); - $size_02 = getimagesize( $path.'02.gif' ); - $size_03 = getimagesize( $path.'03.gif' ); - return ';"> - <tr> - <td><img src="'.$path.'01.gif" style="margin:auto;width:'.$size_01[0].'px;display:box;" alt="" /></td> - <td><img src="'.$path.'02.gif" style="margin:auto;display:box;width:100%;height:'.$size_02[1].'px;" alt="" /></td> - <td><img src="'.$path.'03.gif" style="margin:auto;display:box;width:'.$size_03[0].'px;" alt="" /></td> - </tr> - <tr> - <td style="margin:autox;background:url('.$path.'04.gif);"></td> - <td style="margin:auto;background:url('.$path.'05.gif);width:100%;">'; -} - -function get_frame_end() -{ - global $user; - $path = './template/'.$user['template'].'/theme/'; - $size_08 = getimagesize( $path.'08.gif' ); - return ' - </td> - <td style="margin:auto;background:url('.$path.'06.gif);"></td> - </tr> - <tr > - <td><img src="'.$path.'07.gif" style="margin:auto;" alt="" /></td> - <td><img src="'.$path.'08.gif" style="margin:auto;width:100%;height:'.$size_08[1].'px;" alt="" /></td> - <td><img src="'.$path.'09.gif" style="margin:auto;" alt="" /></td> - </tr> - </table>'; -} -function initialize_template() -{ - global $template, $user, $lang; - - $template->assign_vars(array( - 'T_START' => get_frame_start(), - 'T_BEGIN' => get_frame_begin(), - 'T_END' => get_frame_end() - ) - ); -} function make_jumpbox($value, $selected, $usekeys=false) { @@ -188,4 +138,58 @@ function make_radio($name, $value, $selected, $usekeys=false) } return $boxstring; } + +// +// Pick a language, any language ... +// +function language_select($default, $select_name = "language") +{ + global $lang_info; + $dir = opendir(PHPWG_ROOT_PATH . 'language'); + $available_lang= array(); + + while ( $file = readdir($dir) ) + { + if (is_dir ( realpath(PHPWG_ROOT_PATH.'language/'.$file) ) + && !is_link(realpath(PHPWG_ROOT_PATH . 'language/' . $file)) + && isset($lang_info['language'][$file])) + { + $available_lang[$file] = $lang_info['language'][$file]; + } + } + closedir($dir); + @asort($available_lang); + @reset($available_lang); + + $lang_select = '<select name="' . $select_name . '" onchange="this.form.submit()">'; + while ( list($code, $displayname) = @each($available_lang) ) + { + $selected = ( strtolower($default) == strtolower($code) ) ? ' selected="selected"' : ''; + $lang_select .= '<option value="' . $code . '"' . $selected . '>' . ucwords($displayname) . '</option>'; + } + $lang_select .= '</select>'; + + return $lang_select; +} + +// +// Pick a template/theme combo, +// +function style_select($default_style, $select_name = "style") +{ + $dir = opendir(PHPWG_ROOT_PATH . 'template'); + $style_select = '<select name="' . $select_name . '">'; + while ( $file = readdir($dir) ) + { + if (is_dir ( realpath(PHPWG_ROOT_PATH.'template/'.$file) ) + && !is_link(realpath(PHPWG_ROOT_PATH . 'template/' . $file)) + && !strstr($file,'.')) + { + $selected = ( $file == $default_style ) ? ' selected="selected"' : ''; + $style_select .= '<option value="' . $file . '"' . $selected . '>' . $file . '</option>'; + } + } + closedir($dir); + return $style_select; +} ?> diff --git a/template/default/identification.tpl b/template/default/identification.tpl index 82b808b2f..eca0a9b89 100644 --- a/template/default/identification.tpl +++ b/template/default/identification.tpl @@ -1,61 +1,50 @@ - <table style="width:100%;height:100%"> - <tr align="center" valign="middle"> - <td> - {T_START}1px{T_BEGIN} - <div class="titrePage">{L_TITLE}</div> - {T_END} - <div style="margin-bottom:5px;"> </div> - {T_START}50%{T_BEGIN} - <div style="text-align:center;"> - <form action="{F_LOGIN_ACTION}" method="post"> - <table width="100%" cellpadding="4" cellspacing="1" border="0" align="center"> - <!-- BEGIN errors --> - <tr> - <td colspan="2"> - <div class="errors"> - <ul> - <!-- BEGIN error --> - <li>{errors.error.ERROR}</li> - <!-- END error --> - </ul> - </div> - </td> - </tr> - <!-- END errors --> - <tr> - <td colspan="2" align="center"> </td> - </tr> - <tr> - <td width="45%" align="right"><span class="gentbl">{L_USERNAME}:</span></td> - <td> - <input class="login" type="text" name="username" size="25" maxlength="40" value="{USERNAME}" /> - </td> - </tr> - <tr> - <td align="right"><span class="gentbl">{L_PASSWORD}:</span></td> - <td> - <input class="login" type="password" name="password" size="25" maxlength="25" /> - </td> - </tr> - <tr align="center"> - <td colspan="2"><input type="submit" name="login" value="{L_LOGIN}" class="bouton" /></td> - </tr> +<div class="titrePage">{L_TITLE}</div> +<div style="margin-top:15px;text-align:center;"> +<table width="60%" cellpadding="4" cellspacing="1" border="0" align="center"> +<form action="{F_LOGIN_ACTION}" method="post"> +<!-- BEGIN errors --> + <tr> + <td colspan="2"> + <div class="errors"> + <ul> + <!-- BEGIN error --> + <li>{errors.error.ERROR}</li> + <!-- END error --> + </ul> + </div> + </td> + </tr> + <!-- END errors --> + <tr> + <td colspan="2" align="center"> </td> + </tr> + <tr> + <td width="45%" align="right"><span class="gentbl">{L_USERNAME}:</span></td> + <td> + <input class="login" type="text" name="username" size="25" maxlength="40" value="{USERNAME}" /> + </td> + </tr> + <tr> + <td align="right"><span class="gentbl">{L_PASSWORD}:</span></td> + <td> + <input class="login" type="password" name="password" size="25" maxlength="25" /> + </td> + </tr> + <tr align="center"> + <td colspan="2"><input type="submit" name="login" value="{L_LOGIN}" class="bouton" /></td> + </tr> +</form> +</table> +<table style="width:80%;margin-left:auto;margin-right:auto;"> +<tr> + <td colspan="3" align="center"> + <!-- BEGIN free_access --> + <p><a href="./category.php">[ {L_GUEST} ]</a></p> + <a href="register.php"><img src="./template/{T_STYLE}/theme/register.gif" style="border:0;" alt=""/> {L_REGISTER}</a> - + <!-- END free_access --> + <a href="mailto:{MAIL_ADMIN}?subject=[PhpWebGallery] {L_FORGET}"><img src="./template/{T_STYLE}/theme/lost.gif" style="border:0;" alt=""/> {L_FORGET}</a> + </td> +</tr> </table> -</form> - <table style="width:80%;margin-left:auto;margin-right:auto;"> - <tr> - <td colspan="3" align="center"> - <!-- BEGIN free_access --> - <p><a href="./category.php">[ {L_GUEST} ]</a></p> - <a href="register.php"><img src="./template/{T_STYLE}/theme/register.gif" style="border:0;" alt=""/> {L_REGISTER}</a> - - <!-- END free_access --> - <a href="mailto:{MAIL_ADMIN}?subject=[PhpWebGallery] {L_FORGET}"><img src="./template/{T_STYLE}/theme/lost.gif" style="border:0;" alt=""/> {L_FORGET}</a> - </td> - </tr> - </table> - </div> - {T_END} - </td> - </tr> - </table>
\ No newline at end of file +</div>
\ No newline at end of file diff --git a/template/default/install.tpl b/template/default/install.tpl index f6127bf7e..78b9e1836 100644 --- a/template/default/install.tpl +++ b/template/default/install.tpl @@ -5,7 +5,62 @@ <meta http-equiv="Content-script-type" content="text/javascript" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <title>PhpWebGallery {RELEASE}</title> -<link rel="stylesheet" href="{T_STYLE}" type="text/css" /> +<style type="text/css"> +a, a:hover { +color:#006699; +} + +body,table,input,form,select { +font-family:arial,verdana,sans-serif; +font-size:12px; +color:#000000; +text-align:left; +} +table +{ +border-collapse:separate; +} +body { +background-color:#E5E5E5; +margin:5px; +} + +.contenucellule { +background-color:#EEEEEE; +border:2px solid #006699; +} + +th { +font-weight:bold; +background-color:#D3DCE3; +margin-bottom:10px; +text-align: center; +} +td.row1 { +background-color:#E6E4E4; +} +td.row2 +{ +background-color:#E8E8E8; +} + +.info { +color:darkblue; +text-align:center; +} +.errors { + text-align:left; + margin:25px; + background-color:#ffe1e1; + border:1px solid red; + color:black; +} +.grostitre { + text-align : center; + font-size : 20px; + margin-bottom : 20px; +} +</style> </head> <body> <table style="width:100%;height:100%"> @@ -57,9 +112,7 @@ <tr> <td width="30%">{L_LANG_TITLE}</td> <td colspan="2" align="left"> - <select name="language" onchange="this.form.submit()"> - {F_LANG_SELECT} - </select> + {F_LANG_SELECT} </td> </tr> <tr> diff --git a/template/default/picture.tpl b/template/default/picture.tpl index 7f664fec1..86e25dae1 100644 --- a/template/default/picture.tpl +++ b/template/default/picture.tpl @@ -21,21 +21,22 @@ <div class="table2"> <div class="titrePage">{CATEGORY}</div> <div class="titreImg">{PHOTO}</div> - <div class="image"> <a href="{U_HOME}"> - <img class="imgLink" src="{SRC_IMG}" style="width:{WIDTH_IMG}px;height:{HEIGHT_IMG}px;" alt="{ALT_IMG}"/> + <img class="image" src="{SRC_IMG}" style="width:{WIDTH_IMG}px;height:{HEIGHT_IMG}px;" alt="{ALT_IMG}"/> </a> - </div> - <div class="commentImage">{TITLE}</div> + <div class="nameImage">{TITLE}</div> + <!-- BEGIN legend --> <div class="commentImage">{COMMENT_IMG}</div> + <!-- END legend --> </div> <table style="width:100%;"> <tr align="center" valign="middle"> <td style="width:30%;"> <!-- BEGIN previous --> - <a href="{U_PREV_IMG}" title="{L_PREV_IMG}{PREV_TITLE_IMG}"> - <img style="border:none;" class="imgLink" width="30" height="100" src="template/default/theme/left-arrow.jpg" alt="" /> - <img src="{PREV_IMG}" class="imgLink" style="margin-right:10px;margin-left:5px;" alt="{PREV_TITLE_IMG}"/></a> + <a class="none" href="{U_PREV_IMG}" title="{L_PREV_IMG}{PREV_TITLE_IMG}"> + <img style="border:none;" width="30" height="100" src="template/default/theme/left-arrow.jpg" alt="" /> + <img src="{PREV_IMG}" class="thumbLink" style="margin-right:10px;margin-left:5px;" alt="{PREV_TITLE_IMG}"/> + </a> <!-- END previous --> </td> <td style="width:40%;"> @@ -50,8 +51,10 @@ </td> <td style="width:30%;"> <!-- BEGIN next --> - <a href="{U_NEXT_IMG}" title="{L_NEXT_IMG}{NEXT_TITLE_IMG}"><img src="{NEXT_IMG}" class="imgLink" style="margin-right:10px;margin-left:5px;" alt="{NEXT_TITLE_IMG}"/> - <img style="border:none;" class="imgLink" width="30" height="100" src="template/default/theme/right-arrow.jpg" alt="" /></a> + <a class="none" href="{U_NEXT_IMG}" title="{L_NEXT_IMG}{NEXT_TITLE_IMG}"> + <img class="thumbLink" src="{NEXT_IMG}" style="margin-right:10px;margin-left:5px;" alt="{NEXT_TITLE_IMG}"/> + <img style="border:none;" class="thumbLink" width="30" height="100" src="template/default/theme/right-arrow.jpg" alt="" /> + </a> <!-- END next --> </td> </tr> @@ -74,60 +77,53 @@ </tr> <!-- BEGIN comments --> <tr align="center" valign="middle"> - <td colspan="5"> - {T_START}100%{T_BEGIN} - <table style="width:100%;"> - <tr align="center"> - <td> - <div class="commentsTitle"> + <td colspan="3" class="table2"> + <div class="commentTitle"> [{comments.NB_COMMENT}] {L_COMMENT_TITLE} </div> <div class="commentsNavigationBar">{comments.NAV_BAR}</div> + <table class="tablecompact"> <!-- BEGIN comment --> - <table class="tableComment"> - <tr> - <td rowspan="2" valign="top" class="cellAuthor"> - <div class="commentsAuthor">{comments.comment.COMMENT_AUTHOR}</div> - </td> - <td align="right" class="cellInfo"> - <div class="commentsInfos">{comments.comment.COMMENT_DATE} - <!-- BEGIN delete --> - <a href="{comments.comment.delete.U_COMMENT_DELETE}" title="{L_DELETE_COMMENT}"><img src="{T_DEL_IMG}" style="border:none;margin-left:5px;" alt="[{L_DELETE}]"/></a> - <!-- END delete --> - </div> - </td> - </tr> - <tr> - <td> - <div class="commentsContent">{comments.comment.COMMENT}</div> - </td> - </tr> - </table> + <tr class="throw"> + <td class="throw"> + {comments.comment.COMMENT_AUTHOR} + </td> + <td colspan="2" class="commentDate"> + {comments.comment.COMMENT_DATE} + <!-- BEGIN delete --> + <a href="{comments.comment.delete.U_COMMENT_DELETE}" title="{L_DELETE_COMMENT}"><img src="{T_DEL_IMG}" style="border:none;vertical-align:middle; margin-left:5px;" alt="[{L_DELETE}]"/></a> + <!-- END delete --> + </td> + </tr> + <tr class="row1"> + <td class="comment" colspan="3">{comments.comment.COMMENT}</td> + </tr> <!-- END comment --> - <div class="commentsNavigationBar">{comments.NAV_BAR}</div> - </td> - </tr> - </table> <!-- BEGIN add_comment --> - <form method="post" action="{U_ADD_COMMENT}"> - <table style="width:100%;"> - <tr align="center"> - <td> - <div class="commentsTitle">{L_ADD_COMMENT}</div> + <tr class="throw"> + <td colspan="3">{L_ADD_COMMENT}</td> + </tr> + <form method="post" action="{U_ADD_COMMENT}"> + <tr class="row1"> + <td class="comment" > <!-- BEGIN author_field --> - <div class="menu">{L_AUTHOR} : <input type="text" name="author" style="margin-top:5px;"/></div> + {L_AUTHOR}</td><td colspan="2"><input type="text" name="author" /> + </td></tr> + <tr class="row1"> + <td class="comment" > <!-- END author_field --> <!-- BEGIN author_known --> - <input type="hidden" name="author" value="{comments.add_comment.author_known.KNOWN_AUTHOR}" /> + <input type="hidden" name="author" value="{comments.add_comment.author_known.KNOWN_AUTHOR}" /> <!-- END author_known --> - <textarea name="content" rows="10" cols="50" style="overflow:auto;width:450px;margin:10px;"></textarea><br /> - <input type="submit" value="{L_SUBMIT}" class="bouton" /> - </td> - </tr> - </table> - </form> + {L_COMMENT}</td> + <td style="width:100%;"> + <input name="content" type="text" maxlength="200" style="width:100%;" value="" /></td><td> + <input type="submit" value="{L_SUBMIT}" class="bouton" /> + </td> + </tr> + </form> + </table> <!-- END add_comment --> - {T_END} </td> </tr> <!-- END comments --> diff --git a/template/default/profile.tpl b/template/default/profile.tpl index 8b4e4ce4b..e34ffd0ee 100644 --- a/template/default/profile.tpl +++ b/template/default/profile.tpl @@ -1,95 +1,75 @@ - <table style="width:100%;height:100%"> - <tr align="center" valign="middle"> - <td> - {T_START}1px{T_BEGIN} - <div class="titrePage">{L_TITLE}</div> - {T_END} - <div style="margin-bottom:20px"></div> - {T_START}50%{T_BEGIN} - <form method="post" action="{F_ACTION}"> - <table style="width:100%;margin-top:10px;margin-bottom:10px;"> - <tr align="center" valign="middle"> - <td> - <table width="80%"> - <!-- BEGIN errors --> - <tr> - <td colspan="2"> - <div class="errors"> - <ul> - <!-- BEGIN error --> - <li>{errors.error.ERROR}</li> - <!-- END error --> - </ul> - </div> - </td> - </tr> - <!-- END errors --> - <!-- BEGIN select --> - <tr> - <td class="menu">{select.F_LABEL}</td> - <td class="menu"> - <select name="{select.F_NAME}"> - {select.F_OPTIONS} - </select> - </td> - </tr> - <!-- END select --> - <!-- BEGIN text --> - <tr> - <td class="menu">{text.F_LABEL}</td> - <td class="menu"> - <input type="text" name="{text.F_NAME}" value="{text.F_VALUE}" /> - </td> - </tr> - <!-- END text --> - <!-- BEGIN radio --> - <tr> - <td class="menu">{radio.F_LABEL}</td> - <td class="menu"> - {radio.F_OPTIONS} - </td> - </tr> - <!-- END radio --> - <tr> - <td colspan="2"> </td> - </tr> - <tr> - <td class="menu">{L_NEW} {L_PASSWORD} <input type="checkbox" name="use_new_pwd" value="1" /></td> - <td class="menu"><input type="password" name="password" value="" /></td> - </tr> - <tr> - <td class="menu">{L_CONFIRM}</td> - <td class="menu"><input type="password" name="passwordConf" value="" /></td> - </tr> - <!-- BEGIN cookie --> - <tr> - <td colspan="2"> </td> - </tr> - <tr> - <td class="menu">{L_COOKIE} <input type="checkbox" name="create_cookie" value="1" /></td> - <td class="menu"> - <select name="cookie_expiration"> - <!-- BEGIN expiration_option --> - <option value="{#value}">{#option}</option> - <!-- END expiration_option --> - </select> - </td> - </tr> - <!-- END cookie --> - <tr> - <td colspan="2"> </td> - </tr> - <tr> - <td colspan="2" align="center"> - <input type="submit" name="submit" value="{L_SUBMIT}" style="margin:5px;"/> - </td> - </tr> - </table> - </td> - </tr> - </table> - </form> - {T_END} -</td> - </tr> - </table>
\ No newline at end of file +<div class="titrePage">{L_TITLE}</div> +<form method="post" action="{F_ACTION}"> +<!-- BEGIN errors --> + <div class="errors"> + <ul> + <!-- BEGIN error --> + <li>{errors.error.ERROR}</li> + <!-- END error --> + </ul> + </div> +<!-- END errors --> +<table width="70%" align="center"> + <tr> + <td width="60%">{L_NB_IMAGE_LINE}</td> + <td width="40%"><input type="text" size="3" maxlength="2" name="nb_image_line" value="{NB_IMAGE_LINE}" /></td> + </tr> + <tr> + <td>{L_NB_ROW_PAGE}</td> + <td><input type="text" size="3" maxlength="2" name="nb_line_page" value="{NB_ROW_PAGE}" /></td> + </tr> + <tr> + <td>{L_STYLE_SELECT}</td> + <td>{STYLE_SELECT}</td> + </tr> + <tr> + <td>{L_LANG_SELECT}</td> + <td>{LANG_SELECT}</td> + </tr> + <tr> + <td>{L_SHORT_PERIOD}</td> + <td><input type="text" size="3" maxlength="2" name="short_period" value="{SHORT_PERIOD}" /></td> + </tr> + <tr> + <td>{L_LONG_PERIOD}</td> + <td><input type="text" size="3" maxlength="2" name="long_period" value="{LONG_PERIOD}" /></td> + </tr> + <tr> + <td>{L_EXPAND_TREE}</td> + <td><input type="radio" class="radio" name="expand" value="true" {EXPAND_TREE_YES} />{L_YES} + <input type="radio" class="radio" name="expand" value="false" {EXPAND_TREE_NO} />{L_NO}</td> + </tr> + <tr> + <td>{L_NB_COMMENTS}</td> + <td><input type="radio" class="radio" name="show_nb_comments" value="true" {NB_COMMENTS_YES} />{L_YES} + <input type="radio" class="radio" name="show_nb_comments" value="false" {NB_COMMENTS_NO} />{L_NO}</td> + </tr> + <!-- BEGIN text --> + <tr> + <td class="menu">{text.F_LABEL}</td> + <td class="menu"> + <input type="text" name="{text.F_NAME}" value="{text.F_VALUE}" /> + </td> + </tr> + <!-- END text --> + <tr> + <td colspan="2"> </td> + </tr> + <tr> + <td class="menu">{L_NEW} {L_PASSWORD} <input type="checkbox" name="use_new_pwd" value="1" /></td> + <td class="menu"><input type="password" name="password" value="" /></td> + </tr> + <tr> + <td class="menu">{L_CONFIRM}</td> + <td class="menu"><input type="password" name="passwordConf" value="" /></td> + </tr> + <tr> + <td colspan="2"> </td> + </tr> + <tr> + <td colspan="2" align="center"> + <input type="submit" name="submit" value="{L_SUBMIT}" class="bouton" /> + </td> + </tr> +</table> +</form>
\ No newline at end of file diff --git a/template/default/register.tpl b/template/default/register.tpl index 72e604383..22011103f 100644 --- a/template/default/register.tpl +++ b/template/default/register.tpl @@ -1,67 +1,56 @@ - <table style="width:100%;height:100%"> - <tr align="center" valign="middle"> - <td> - {T_START}1px{T_BEGIN} - <div class="titrePage">{L_TITLE}</div> - {T_END} - <div style="margin-bottom:20px"></div> - {T_START}50%{T_BEGIN} - <form method="post" action="{F_ACTION}"> - <table style="width:80%;margin-top:10px;margin-bottom:10px;margin-left:auto;margin-right:auto;"> - <!-- BEGIN errors --> - <tr> - <td colspan="2"> - <div class="errors"> - <ul> - <!-- BEGIN error --> - <li>{errors.error.ERROR}</li> - <!-- END error --> - </ul> - </div> - </td> - </tr> - <!-- END errors --> - <tr> - <td class="menu">{L_USERNAME}</td> - <td class="menu"> - <input type="text" name="login" value="{F_LOGIN}" /> - </td> - </tr> - <tr> - <td class="menu">{L_PASSWORD}</td> - <td class="menu"> - <input type="password" name="password" /> - </td> - </tr> - <tr> - <td class="menu">{L_CONFIRM_PASSWORD}</td> - <td class="menu"> - <input type="password" name="password_conf" /> - </td> - </tr> - <tr> - <td class="menu">{L_EMAIL}</td> - <td class="menu"> - <input type="text" name="mail_address" value="{F_EMAIL}" /> - </td> - </tr> - <tr> - <td colspan="2"> </td> - </tr> - <tr> - <tr> - <td colspan="2" align="center"> - <input type="submit" name="submit" value="{L_SUBMIT}" style="margin:5px;"/> - </td> - </tr> - <tr> - <td colspan="2" align="center"> - <a href="./category.php">[ {L_GUEST} ]</a> - </td> - </tr> - </table> - </form> - {T_END} - </td> - </tr> - </table>
\ No newline at end of file +<div class="titrePage">{L_TITLE}</div> +<form method="post" action="{F_ACTION}"> + <table style="width:60%;" align="center"> + <!-- BEGIN errors --> + <tr> + <td colspan="2"> + <div class="errors"> + <ul> + <!-- BEGIN error --> + <li>{errors.error.ERROR}</li> + <!-- END error --> + </ul> + </div> + </td> + </tr> + <!-- END errors --> + <tr> + <td width="60%">{L_USERNAME}</td> + <td width="40%"> + <input type="text" name="login" value="{F_LOGIN}" /> + </td> + </tr> + <tr> + <td >{L_PASSWORD}</td> + <td > + <input type="password" name="password" /> + </td> + </tr> + <tr> + <td >{L_CONFIRM_PASSWORD}</td> + <td > + <input type="password" name="password_conf" /> + </td> + </tr> + <tr> + <td >{L_EMAIL}</td> + <td > + <input type="text" name="mail_address" value="{F_EMAIL}" /> + </td> + </tr> + <tr> + <td colspan="2"> </td> + </tr> + <tr> + <tr> + <td colspan="2" align="center"> + <input type="submit" name="submit" value="{L_SUBMIT}" class="bouton" /> + </td> + </tr> + <tr> + <td colspan="2" align="center"> + <a href="./category.php">[ {L_GUEST} ]</a> + </td> + </tr> + </table> +</form>
\ No newline at end of file diff --git a/template/default/search.tpl b/template/default/search.tpl index d5fbdb6b9..1046e433b 100644 --- a/template/default/search.tpl +++ b/template/default/search.tpl @@ -1,59 +1,20 @@ -<table style="width:100%;height:100%"> - <tr align="center" valign="middle"> - <td> - {T_START}1px{T_BEGIN} - <div class="titrePage">{L_TITLE}</div> - {T_END} - <div style="margin-bottom:5px;"> </div> - {T_START}50%{T_BEGIN} - <div style="margin-left:auto;margin-right:auto;text-align:center;"> - <form method="post" action="{F_ACTION}"> - <table style="width:80%;margin-left:auto;margin-right:auto;"> - <!-- BEGIN errors --> - <tr> - <td colspan="2"> - <div class="errors"> - <ul> - <!-- BEGIN error --> - <li>{errors.error.ERROR}</li> - <!-- END error --> - </ul> - </div> - </td> - </tr> - <!-- END errors --> - <tr> - <td colspan="2"> - <div style="margin-bottom:10px;"> </div> - </td> - </tr> - <tr> - <td class="menu">{L_SEARCH}</td> - <td class="menu"> - <input type="text" name="search" size="40" value="{F_TEXT_VALUE}" /><br /> - <input class="radio" type="radio" name="mode" value="OR" checked="checked" /> {L_SEARCH_OR} - <input class="radio" type="radio" name="mode" value="AND" /> {L_SEARCH_AND} - </td> - </tr> - <tr> - <td align="center" colspan="2"> - <input type="submit" name="submit" value="{L_SUBMIT}" class="bouton" style="margin:10px;" /> - </td> - </tr> - <tr> - <td align="center" colspan="2"> - <a href="{U_HOME}">[ {L_RETURN} ]</a> - </td> - </tr> - <tr> - <td colspan="2"> - <div style="margin-top:10px;">* : {L_COMMENTS}</div> - </td> - </tr> - </table> - </form> - </div> - {T_END} - </td> - </tr> -</table>
\ No newline at end of file +<div class="titrePage">{L_TITLE}</div> +<BR /> +<form method="post" action="{F_ACTION}" style="text-align:center"> +<!-- BEGIN errors --> +<div class="errors"> + <ul> + <!-- BEGIN error --> + <li>{errors.error.ERROR}</li> + <!-- END error --> + </ul> + </div> +<!-- END errors --> +{L_SEARCH} +<input type="text" name="search" size="40" value="{F_TEXT_VALUE}" /><br /> +<input class="radio" type="radio" name="mode" value="OR" checked="checked" /> {L_SEARCH_OR} +<input class="radio" type="radio" name="mode" value="AND" /> {L_SEARCH_AND} <BR /> +<input type="submit" name="submit" value="{L_SUBMIT}" class="bouton" /><BR /> +<a href="{U_HOME}">[ {L_RETURN} ]</a><BR /> +<div style="margin-top:10px;">* : {L_COMMENTS}</div> +</form>
\ No newline at end of file diff --git a/template/default/theme/01.gif b/template/default/theme/01.gif Binary files differdeleted file mode 100644 index ba3068d7d..000000000 --- a/template/default/theme/01.gif +++ /dev/null diff --git a/template/default/theme/02.gif b/template/default/theme/02.gif Binary files differdeleted file mode 100644 index 21bb8602a..000000000 --- a/template/default/theme/02.gif +++ /dev/null diff --git a/template/default/theme/03.gif b/template/default/theme/03.gif Binary files differdeleted file mode 100644 index d0b5f766a..000000000 --- a/template/default/theme/03.gif +++ /dev/null diff --git a/template/default/theme/04.gif b/template/default/theme/04.gif Binary files differdeleted file mode 100644 index cd4fe8fc7..000000000 --- a/template/default/theme/04.gif +++ /dev/null diff --git a/template/default/theme/05.gif b/template/default/theme/05.gif Binary files differdeleted file mode 100644 index a42ae0cd6..000000000 --- a/template/default/theme/05.gif +++ /dev/null diff --git a/template/default/theme/06.gif b/template/default/theme/06.gif Binary files differdeleted file mode 100644 index 763fa6a4f..000000000 --- a/template/default/theme/06.gif +++ /dev/null diff --git a/template/default/theme/07.gif b/template/default/theme/07.gif Binary files differdeleted file mode 100644 index 36e1dbd86..000000000 --- a/template/default/theme/07.gif +++ /dev/null diff --git a/template/default/theme/08.gif b/template/default/theme/08.gif Binary files differdeleted file mode 100644 index 39d112d33..000000000 --- a/template/default/theme/08.gif +++ /dev/null diff --git a/template/default/theme/09.gif b/template/default/theme/09.gif Binary files differdeleted file mode 100644 index 828302134..000000000 --- a/template/default/theme/09.gif +++ /dev/null diff --git a/template/default/theme/button_bg.gif b/template/default/theme/button_bg.gif Binary files differnew file mode 100644 index 000000000..442f2469c --- /dev/null +++ b/template/default/theme/button_bg.gif diff --git a/template/default/theme/left-arrow.jpg b/template/default/theme/left-arrow.jpg Binary files differindex c867edec1..44a06bccc 100644 --- a/template/default/theme/left-arrow.jpg +++ b/template/default/theme/left-arrow.jpg diff --git a/template/default/theme/right-arrow.jpg b/template/default/theme/right-arrow.jpg Binary files differindex 359ddfc2a..64e02a51f 100644 --- a/template/default/theme/right-arrow.jpg +++ b/template/default/theme/right-arrow.jpg |