mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-18 23:53:39 +02:00
- apply category name and element name separation in calendar special
category - change method of counting total number of viewable pictures : pictures linked to more than one category are not counted twice. git-svn-id: http://piwigo.org/svn/trunk@761 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
2005-03-31 Pierrick LE GALL <pierrick at phpwebgallery dot net>
|
||||
|
||||
* apply category name and element name separation in calendar
|
||||
special category
|
||||
|
||||
* change method of counting total number of viewable pictures :
|
||||
pictures linked to more than one category are not counted twice.
|
||||
|
||||
2005-03-26 Pierrick LE GALL <pierrick at phpwebgallery dot net>
|
||||
|
||||
* "add to caddie" link is visible only when categories contains
|
||||
|
||||
@@ -245,12 +245,18 @@ SELECT file,tn_ext,'.$conf['calendar_datefield'].',path
|
||||
'IMAGE'=>$thumbnail_src,
|
||||
'IMAGE_ALT'=>$row['file'],
|
||||
'IMAGE_TITLE'=>$thumbnail_title,
|
||||
'IMAGE_NAME'=>$name,
|
||||
|
||||
'U_IMG_LINK'=>add_session_id($url_link)
|
||||
)
|
||||
);
|
||||
|
||||
$template->assign_block_vars(
|
||||
'thumbnails.line.thumbnail.category_name',
|
||||
array(
|
||||
'NAME' => $name
|
||||
)
|
||||
);
|
||||
|
||||
// create a new line ?
|
||||
if (++$row_number == $user['nb_image_line'])
|
||||
{
|
||||
@@ -299,12 +305,18 @@ SELECT file,tn_ext,'.$conf['calendar_datefield'].',path
|
||||
'IMAGE'=>$thumbnail_src,
|
||||
'IMAGE_ALT'=>$row['file'],
|
||||
'IMAGE_TITLE'=>$thumbnail_title,
|
||||
'IMAGE_NAME'=>$name,
|
||||
|
||||
'U_IMG_LINK'=>add_session_id($url_link)
|
||||
)
|
||||
);
|
||||
|
||||
$template->assign_block_vars(
|
||||
'thumbnails.line.thumbnail.category_name',
|
||||
array(
|
||||
'NAME' => $name
|
||||
)
|
||||
);
|
||||
|
||||
// create a new line ?
|
||||
if (++$row_number == $user['nb_image_line'])
|
||||
{
|
||||
@@ -347,12 +359,18 @@ SELECT file,tn_ext,'.$conf['calendar_datefield'].',path
|
||||
'IMAGE'=>$thumbnail_src,
|
||||
'IMAGE_ALT'=>$row['file'],
|
||||
'IMAGE_TITLE'=>$thumbnail_title,
|
||||
'IMAGE_NAME'=>$name,
|
||||
|
||||
'U_IMG_LINK'=>add_session_id($url_link)
|
||||
)
|
||||
);
|
||||
|
||||
$template->assign_block_vars(
|
||||
'thumbnails.line.thumbnail.category_name',
|
||||
array(
|
||||
'NAME' => $name
|
||||
)
|
||||
);
|
||||
|
||||
// create a new line ?
|
||||
if (++$row_number == $user['nb_image_line'])
|
||||
{
|
||||
@@ -415,12 +433,17 @@ SELECT file,tn_ext,'.$conf['calendar_datefield'].',path
|
||||
'IMAGE'=>$thumbnail_src,
|
||||
'IMAGE_ALT'=>$row['file'],
|
||||
'IMAGE_TITLE'=>$thumbnail_title,
|
||||
'IMAGE_NAME'=>$name,
|
||||
|
||||
'U_IMG_LINK'=>add_session_id($url_link)
|
||||
)
|
||||
);
|
||||
$template->assign_block_vars('thumbnails.line.thumbnail.bullet',array());
|
||||
|
||||
$template->assign_block_vars(
|
||||
'thumbnails.line.thumbnail.category_name',
|
||||
array(
|
||||
'NAME' => $name
|
||||
)
|
||||
);
|
||||
|
||||
// create a new line ?
|
||||
if (++$row_number == $user['nb_image_line'])
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user