This commit was manufactured by cvs2svn to create tag

'release-1_4_1'.

git-svn-id: http://piwigo.org/svn/tags/release-1_4_1@790 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
plegall
2005-05-14 13:39:00 +00:00
parent 06dbb37901
commit b15c91743d
13 changed files with 129 additions and 25 deletions
+1 -1
View File
@@ -329,7 +329,7 @@ else
$template->assign_vars(array(
'CATEGORIES_NAV'=>$navigation,
'NEXT_RANK'=>$next_rank,
'F_ACTION'=>$form_action,
'F_ACTION'=>add_session_id($form_action),
'L_ADD_VIRTUAL'=>$lang['cat_add'],
'L_SUBMIT'=>$lang['submit'],
+20 -6
View File
@@ -66,12 +66,8 @@ if (isset($_POST['submit']))
{
array_push($errors, $lang['conf_prefix_thumbnail_error']);
}
// mail must be formatted as follows : name@server.com
$pattern = '/^[\w-]+(\.[\w-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$/';
if (!preg_match($pattern, $_POST['mail_webmaster']))
{
array_push($errors, $lang['conf_mail_webmaster_error']);
}
// as webmaster mail address shown on the website, it can be obfuscated
// and no comply with normal mail address pattern
break;
}
case 'comments' :
@@ -94,6 +90,22 @@ if (isset($_POST['submit']))
{
array_push($errors, $lang['periods_error']);
}
// maxwidth
if (isset($_POST['default_maxwidth'])
and !empty($_POST['default_maxwidth'])
and (!preg_match($int_pattern, $_POST['default_maxwidth'])
or $_POST['default_maxwidth'] < 50))
{
array_push($errors, $lang['maxwidth_error']);
}
// maxheight
if (isset($_POST['default_maxheight'])
and !empty($_POST['default_maxheight'])
and (!preg_match($int_pattern, $_POST['default_maxheight'])
or $_POST['default_maxheight'] < 50))
{
array_push($errors, $lang['maxheight_error']);
}
break;
}
case 'upload' :
@@ -255,6 +267,8 @@ switch ($page['section'])
'CONF_STYLE_SELECT'=>style_select($conf['default_template'], 'default_template'),
'CONF_RECENT'=>$conf['recent_period'],
'NB_COMMENTS_PAGE'=>$conf['nb_comment_page'],
'MAXWIDTH'=>$conf['default_maxwidth'],
'MAXHEIGHT'=>$conf['default_maxheight'],
'EXPAND_YES'=>$expand_yes,
'EXPAND_NO'=>$expand_no,
'SHOW_COMMENTS_YES'=>$show_yes,
+27 -1
View File
@@ -159,7 +159,33 @@ else
$thumbnail_url = get_thumbnail_src($row['path'], @$row['tn_ext']);
$url_img = PHPWG_ROOT_PATH.'picture.php?image_id='.$_GET['image_id'];
$url_img .= '&amp;cat='.$row['storage_category_id'];
$query = '
SELECT category_id
FROM '.IMAGE_CATEGORY_TABLE.'
WHERE image_id = '.$_GET['image_id'];
if (isset($user['forbidden_categories'])
and !empty($user['forbidden_categories']))
{
$query.= '
AND category_id NOT IN ('.$user['forbidden_categories'].')';
}
$query.= '
ORDER BY RAND()
;';
$result = pwg_query($query);
if (mysql_num_rows($result) > 0)
{
list($category_id) = mysql_fetch_array($result);
$url_img .= '&amp;cat='.$category_id;
}
else
{
$url_img .= '&amp;cat='.$row['storage_category_id'];
}
$date = isset($_POST['date_creation']) && empty($errors)
?$_POST['date_creation']:date_convert_back(@$row['date_creation']);
+56
View File
@@ -453,6 +453,62 @@ SELECT IF(MAX(id)+1 IS NULL, 1, MAX(id)+1) AS next_element_id
echo '<!-- scanning files : ';
echo get_elapsed_time($start_files, get_moment());
echo ' -->'."\n";
// retrieving informations given by uploaders
if (!$simulate)
{
$query = '
SELECT id,file,storage_category_id,infos
FROM '.WAITING_TABLE.'
WHERE storage_category_id IN (
'.wordwrap(implode(', ', $cat_ids), 80, "\n").')
AND validated = \'true\'
;';
$result = pwg_query($query);
$datas = array();
$fields =
array(
'primary' => array('id'),
'update' => array('date_creation', 'author', 'name', 'comment')
);
$waiting_to_delete = array();
while ($row = mysql_fetch_array($result))
{
$data = array();
$query = '
SELECT id
FROM '.IMAGES_TABLE.'
WHERE storage_category_id = \''.$row['storage_category_id'].'\'
AND file = \''.$row['file'].'\'
;';
list($data['id']) = mysql_fetch_array(pwg_query($query));
foreach ($fields['update'] as $field)
{
$data[$field] = getAttribute($row['infos'], $field);
}
array_push($datas, $data);
array_push($waiting_to_delete, $row['id']);
}
if (count($datas) > 0)
{
mass_updates(IMAGES_TABLE, $fields, $datas);
// delete now useless waiting elements
$query = '
DELETE
FROM '.WAITING_TABLE.'
WHERE id IN ('.implode(',', $waiting_to_delete).')
;';
pwg_query($query);
}
}
}
// +-----------------------------------------------------------------------+
// | template initialization |
+10 -7
View File
@@ -183,13 +183,16 @@ $template->assign_block_vars(
'NAME' => $lang['most_visited_cat']
));
// best rated
$template->assign_block_vars(
'special_cat',
array(
'URL' => add_session_id(PHPWG_ROOT_PATH.'category.php?cat=best_rated'),
'TITLE' => $lang['best_rated_cat_hint'],
'NAME' => $lang['best_rated_cat']
));
if ($conf['rate'])
{
$template->assign_block_vars(
'special_cat',
array(
'URL' => add_session_id(PHPWG_ROOT_PATH.'category.php?cat=best_rated'),
'TITLE' => $lang['best_rated_cat_hint'],
'NAME' => $lang['best_rated_cat']
));
}
// random
$template->assign_block_vars(
'special_cat',
+1 -1
View File
@@ -406,7 +406,7 @@ SELECT file,tn_ext,'.$conf['calendar_datefield'].',path
$url_link.= '&amp;search='.$conf['calendar_datefield'].':'.$_GET['day'];
if ($calendar_category != 0)
{
$url_link.= ';cat:'.$calendar_category.'|AND';
$url_link.= '--cat:'.$calendar_category.'|AND';
}
$template->assign_block_vars(
+4
View File
@@ -191,4 +191,8 @@ $conf['tn_width'] = 128;
// tn_height : default height for thumbnails creation
$conf['tn_height'] = 96;
// show_version : shall the version of PhpWebGallery be displayed at the
// bottom of each page ?
$conf['show_version'] = false;
?>
+1 -1
View File
@@ -26,7 +26,7 @@
// +-----------------------------------------------------------------------+
// Default settings
define('PHPWG_VERSION', '1.4.0RC3');
define('PHPWG_VERSION', '1.4.1');
define('PHPWG_URL', 'http://www.phpwebgallery.net');
define('PHPWG_FORUM_URL', 'http://forum.phpwebgallery.net');
+4 -4
View File
@@ -340,11 +340,11 @@ INSERT INTO '.HISTORY_TABLE.'
(date,login,IP,file,category,picture)
VALUES
(NOW(),
\''.(($user['id'] == 2) ? 'guest' : $user['username']).'\',
\''.(($user['id'] == 2) ? 'guest' : addslashes($user['username'])).'\',
\''.$_SERVER['REMOTE_ADDR'].'\',
\''.$file.'\',
\''.$category.'\',
\''.$picture.'\')
\''.addslashes($file).'\',
\''.addslashes($category).'\',
\''.addslashes($picture).'\')
;';
pwg_query($query);
}
+1 -1
View File
@@ -389,7 +389,7 @@ function initialize_category( $calling_page = 'category' )
$search['mode'] = 'OR';
}
$search_tokens = explode(';', $tokens[0]);
$search_tokens = explode('--', $tokens[0]);
foreach ($search_tokens as $search_token)
{
$tokens = explode(':', $search_token);
+1 -1
View File
@@ -28,7 +28,7 @@ $template->set_filenames(array('tail'=>'footer.tpl'));
$template->assign_vars(
array(
'VERSION' => PHPWG_VERSION,
'VERSION' => $conf['show_version'] ? PHPWG_VERSION : '',
'MAIL'=>$conf['mail_webmaster'],
'L_GEN_TIME' => $lang['generation_time'],
+2 -1
View File
@@ -114,7 +114,7 @@ if (isset($_POST['submit']))
}
array_push($tokens, $token);
}
$search_string.= implode(';', $tokens);
$search_string.= implode('--', $tokens);
if (count($tokens) > 1)
{
$search_string.= '|AND';
@@ -204,6 +204,7 @@ include(PHPWG_ROOT_PATH.'include/page_header.php');
$template->set_filenames( array('search'=>'search.tpl') );
$template->assign_vars(array(
'L_RETURN_HINT' => $lang['home_hint'],
'L_SEARCH_TITLE' => $lang['search_title'],
'L_SEARCH_OPTIONS' => $lang['search_options'],
'L_RETURN' => $lang['home'],
+1 -1
View File
@@ -42,7 +42,7 @@ $conf['picture_ext'] = array('jpg','JPG','png','PNG','gif','GIF');
// $conf['version'] is used to verify the compatibility of the generated
// listing.xml file and the PhpWebGallery version you're running
$conf['version'] = '1.4.0RC3';
$conf['version'] = '1.4.1';
// $conf['use_exif'] set to true if you want to use Exif Date as "creation
// date" for the element, otherwise, set to false