Compare commits

...

18 commits
master ... 1.4

Author SHA1 Message Date
plegall
50d99d7f43 Subversion admin: rename branch 1.4 to match new format
git-svn-id: http://piwigo.org/svn/branches/1.4@3249 68402e56-0260-453c-a942-63ccdbb3a9ee
2009-04-23 20:29:42 +00:00
plegall
db2ac75bb6 - merge trunc r933:934 into branch 1.4 (bug 207 fixed)
git-svn-id: http://piwigo.org/svn/branches/branch-1_4@936 68402e56-0260-453c-a942-63ccdbb3a9ee
2005-11-16 21:26:29 +00:00
plegall
f05a541c55 - bug 134 fixed : "Nb of images incorectly rendered in tool tip near
category in category menu". Deletion of a simple line break.


git-svn-id: http://piwigo.org/svn/branches/branch-1_4@830 68402e56-0260-453c-a942-63ccdbb3a9ee
2005-08-18 21:20:04 +00:00
plegall
6615c91e30 - bug 135 : "Count of total number of pictures". Correction reported from
development branch.


git-svn-id: http://piwigo.org/svn/branches/branch-1_4@813 68402e56-0260-453c-a942-63ccdbb3a9ee
2005-08-15 13:05:29 +00:00
plegall
38326b5c93 - bug 133 corrected : Deleting user favorites is too restrictive. Instead of
deleting a favorite because it belongs to at least one forbidden category,
  a favorite is deleted if it belongs to no authorized category (which was
  the expected behaviour).


git-svn-id: http://piwigo.org/svn/branches/branch-1_4@807 68402e56-0260-453c-a942-63ccdbb3a9ee
2005-08-07 18:02:48 +00:00
plegall
ab9097cfec - version moved to 1.4.1
git-svn-id: http://piwigo.org/svn/branches/branch-1_4@789 68402e56-0260-453c-a942-63ccdbb3a9ee
2005-05-14 13:39:00 +00:00
plegall
4647d2281a - bug 114 corrected : webmaster mail address protection. Ability to set an invalid mail address (but not during installation)
git-svn-id: http://piwigo.org/svn/branches/branch-1_4@788 68402e56-0260-453c-a942-63ccdbb3a9ee
2005-05-14 12:56:48 +00:00
plegall
93277f9fbb - bug 101 fixed : "problem with IE search on keywords". Separator character
";" is not officially a supported character for URL. Replaced by "--".


git-svn-id: http://piwigo.org/svn/branches/branch-1_4@785 68402e56-0260-453c-a942-63ccdbb3a9ee
2005-05-02 20:59:47 +00:00
plegall
39e65897dc - bug 107 fixed : "crash when virtual category name contains a quote". In
fact, the problem was in log line insertion. Category name must be
  "addslashed".


git-svn-id: http://piwigo.org/svn/branches/branch-1_4@784 68402e56-0260-453c-a942-63ccdbb3a9ee
2005-05-02 20:44:27 +00:00
plegall
600c108a1f - bug 111 fixed : "Can't add virtual category when cookie disabled". Trivial
correction.


git-svn-id: http://piwigo.org/svn/branches/branch-1_4@783 68402e56-0260-453c-a942-63ccdbb3a9ee
2005-05-01 14:19:38 +00:00
plegall
2e14b0a79f - bug 110 fixed : "return to element view from element edition fails
depending on permissions". Correction is partial for branch 1.4 : a linked
  category is randomly chosen but if no linked category is authorized for
  the admin user, then the link is to the storage category (which can be
  forbidden).


git-svn-id: http://piwigo.org/svn/branches/branch-1_4@782 68402e56-0260-453c-a942-63ccdbb3a9ee
2005-05-01 14:16:43 +00:00
plegall
22b608fd64 - bug 83 fixed : "remove version from footer". Trivial correction.
git-svn-id: http://piwigo.org/svn/branches/branch-1_4@781 68402e56-0260-453c-a942-63ccdbb3a9ee
2005-05-01 07:47:49 +00:00
plegall
65c52a2a20 - bug 106 fixed : "'L_RETURN_HINT' template code missed in
search.php". Trivial correction.


git-svn-id: http://piwigo.org/svn/branches/branch-1_4@780 68402e56-0260-453c-a942-63ccdbb3a9ee
2005-04-30 21:15:53 +00:00
plegall
7b5bb0e3fc - bug 95 fixed : "default maxwidth and maxheight not registered". In fact,
these informations were registered, but not tested and displayed. Tests
  and siplay were added.


git-svn-id: http://piwigo.org/svn/branches/branch-1_4@779 68402e56-0260-453c-a942-63ccdbb3a9ee
2005-04-30 20:37:43 +00:00
plegall
6f269bc035 - bug 109 fixed : disabled "best rated" menu item when rating is not
enabled. Trivial correction.


git-svn-id: http://piwigo.org/svn/branches/branch-1_4@778 68402e56-0260-453c-a942-63ccdbb3a9ee
2005-04-30 15:23:28 +00:00
plegall
b56bd6748a - bug 96 : informations given by uploaders were never used during database
synchronisation. A new block has been added to retrieve "waiting" table
  informations and transfer them to "images" table.


git-svn-id: http://piwigo.org/svn/branches/branch-1_4@765 68402e56-0260-453c-a942-63ccdbb3a9ee
2005-04-20 19:09:50 +00:00
plegall
6b5f3a4a82 - version moved from 1.4.0RC3 to 1.4.0
git-svn-id: http://piwigo.org/svn/branches/branch-1_4@752 68402e56-0260-453c-a942-63ccdbb3a9ee
2005-03-12 14:33:39 +00:00
plegall
0a848308df This commit was manufactured by cvs2svn to create branch 'branch-1_4'.
git-svn-id: http://piwigo.org/svn/branches/branch-1_4@751 68402e56-0260-453c-a942-63ccdbb3a9ee
2005-03-12 10:57:01 +00:00
16 changed files with 177 additions and 42 deletions

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'],

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,

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']);

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 |

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',

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(

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;
?>

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');

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);
}

View file

@ -155,20 +155,30 @@ SELECT name,id,date_last,nb_images,global_rank
return get_html_menu_category($cats);
}
/**
* returns the total number of elements viewable in the gallery by the
* connected user
*
* @return int
*/
function count_user_total_images()
{
global $user;
$query = 'SELECT SUM(nb_images) AS total';
$query.= ' FROM '.CATEGORIES_TABLE;
if ( count( $user['restrictions'] ) > 0 )
$query.= ' WHERE id NOT IN ('.$user['forbidden_categories'].')';
$query.= ';';
$query = '
SELECT COUNT(DISTINCT(image_id)) as total
FROM '.IMAGE_CATEGORY_TABLE;
if (count($user['restrictions']) > 0)
{
$query.= '
WHERE category_id NOT IN ('.$user['forbidden_categories'].')';
}
$query.= '
;';
$row = mysql_fetch_array( pwg_query( $query ) );
$row = mysql_fetch_array(pwg_query($query));
if ( !isset( $row['total'] ) ) $row['total'] = 0;
return $row['total'];
return isset($row['total']) ? $row['total'] : 0;
}
/**
@ -389,7 +399,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);

View file

@ -403,8 +403,7 @@ function get_html_menu_category($categories)
{
$menu.= '
<span class="menuInfoCat"
title="'.$category['nb_images'].'
'.$lang['images_available'].'">
title="'.$category['nb_images'].' '.$lang['images_available'].'">
['.$category['nb_images'].']
</span>
'.get_icon($category['date_last']);

View file

@ -233,26 +233,42 @@ function check_user_favorites()
{
return;
}
// retrieving images allowed : belonging to at least one authorized
// category
$query = '
SELECT f.image_id
SELECT DISTINCT f.image_id
FROM '.FAVORITES_TABLE.' AS f INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic
ON f.image_id = ic.image_id
WHERE f.user_id = '.$user['id'].'
AND ic.category_id IN ('.$user['forbidden_categories'].')
AND ic.category_id NOT IN ('.$user['forbidden_categories'].')
;';
$result = pwg_query($query);
$elements = array();
$authorizeds = array();
while ($row = mysql_fetch_array($result))
{
array_push($elements, $row['image_id']);
array_push($authorizeds, $row['image_id']);
}
if (count($elements) > 0)
$query = '
SELECT image_id
FROM '.FAVORITES_TABLE.'
WHERE user_id = '.$user['id'].'
;';
$result = pwg_query($query);
$favorites = array();
while ($row = mysql_fetch_array($result))
{
array_push($favorites, $row['image_id']);
}
$to_deletes = array_diff($favorites, $authorizeds);
if (count($to_deletes) > 0)
{
$query = '
DELETE FROM '.FAVORITES_TABLE.'
WHERE image_id IN ('.implode(',', $elements).')
WHERE image_id IN ('.implode(',', $to_deletes).')
AND user_id = '.$user['id'].'
;';
pwg_query($query);

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'],

View file

@ -31,6 +31,12 @@ define('PHPWG_ROOT_PATH','./');
include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
//-------------------------------------------------- access authorization check
check_cat_id( $_GET['cat'] );
if (!isset($page['cat']))
{
die($lang['access_forbiden']);
}
check_login_authorization();
if ( isset( $page['cat'] ) and is_numeric( $page['cat'] ) )
{

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'],

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