- "add to caddie" link is visible only when categories contains
elements. Only admin users can see this link - elements batch management : impossible to create a link between category and element that already exists - logical separation of category name under thumbnail and element name git-svn-id: http://piwigo.org/svn/trunk@760 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
03b8e7bb35
commit
26b44267d5
7 changed files with 60 additions and 12 deletions
|
|
@ -91,16 +91,26 @@ SELECT element_id
|
|||
if ($_POST['associate'] != 0)
|
||||
{
|
||||
$datas = array();
|
||||
|
||||
$query = '
|
||||
SELECT image_id
|
||||
FROM '.IMAGE_CATEGORY_TABLE.'
|
||||
WHERE category_id = '.$_POST['associate'].'
|
||||
;';
|
||||
$associated = array_from_query($query, 'image_id');
|
||||
|
||||
$associable = array_diff($collection, $associated);
|
||||
|
||||
foreach ($collection as $item)
|
||||
foreach ($associable as $item)
|
||||
{
|
||||
array_push($datas,
|
||||
array('category_id'=>$_POST['associate'],
|
||||
'image_id'=>$item));
|
||||
}
|
||||
|
||||
// TODO : inserting an existing PK will fail
|
||||
mass_inserts(IMAGE_CATEGORY_TABLE, array('image_id', 'category_id'), $datas);
|
||||
mass_inserts(IMAGE_CATEGORY_TABLE,
|
||||
array('image_id', 'category_id'),
|
||||
$datas);
|
||||
update_category(array($_POST['associate']));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -310,6 +310,11 @@ if (isset($page['cat'])
|
|||
))))
|
||||
{
|
||||
include(PHPWG_ROOT_PATH.'include/category_default.inc.php');
|
||||
|
||||
if ('admin' == $user['status'])
|
||||
{
|
||||
$template->assign_block_vars('caddie', array());
|
||||
}
|
||||
}
|
||||
elseif (isset($page['cat']) and $page['cat'] == 'calendar')
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,3 +1,14 @@
|
|||
2005-03-26 Pierrick LE GALL <pierrick at phpwebgallery dot net>
|
||||
|
||||
* "add to caddie" link is visible only when categories contains
|
||||
elements. Only admin users can see this link
|
||||
|
||||
* elements batch management : impossible to create a link between
|
||||
category and element that already exists
|
||||
|
||||
* logical separation of category name under thumbnail and element
|
||||
name
|
||||
|
||||
2005-03-25 Pierrick LE GALL <pierrick at phpwebgallery dot net>
|
||||
|
||||
* application version is defined at build or release
|
||||
|
|
|
|||
|
|
@ -106,13 +106,18 @@ while ($row = mysql_fetch_array($result))
|
|||
'IMAGE' => $thumbnail_url,
|
||||
'IMAGE_ALT' => $row['file'],
|
||||
'IMAGE_TITLE' => $thumbnail_title,
|
||||
'IMAGE_NAME' => $name,
|
||||
'IMAGE_TS' => get_icon($row['date_available']),
|
||||
'IMAGE_STYLE' => 'thumb_picture',
|
||||
|
||||
'U_IMG_LINK' => add_session_id($url_link)
|
||||
)
|
||||
);
|
||||
|
||||
$template->assign_block_vars(
|
||||
'thumbnails.line.thumbnail.element_name',
|
||||
array(
|
||||
'NAME' => $name
|
||||
)
|
||||
);
|
||||
|
||||
if ($user['show_nb_comments']
|
||||
and is_numeric($page['cat'])
|
||||
|
|
|
|||
|
|
@ -77,14 +77,18 @@ while ( $row = mysql_fetch_array( $result ) )
|
|||
'IMAGE' => $thumbnail_src,
|
||||
'IMAGE_ALT' => $row['file'],
|
||||
'IMAGE_TITLE' => $lang['hint_category'],
|
||||
'IMAGE_NAME' => '['.$name.']',
|
||||
'IMAGE_STYLE' => 'thumb_category',
|
||||
|
||||
'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'])
|
||||
{
|
||||
|
|
|
|||
|
|
@ -100,14 +100,18 @@ SELECT path, tn_ext
|
|||
'IMAGE' => $thumbnail_link,
|
||||
'IMAGE_ALT' => $row['name'],
|
||||
'IMAGE_TITLE' => $thumbnail_title,
|
||||
'IMAGE_NAME' => '['.$row['name'].']',
|
||||
'IMAGE_TS' => get_icon(@$row['date_last']),
|
||||
'IMAGE_STYLE' => 'thumb_category',
|
||||
|
||||
'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' => $row['name']
|
||||
)
|
||||
);
|
||||
|
||||
// create a new line ?
|
||||
if (++$row_number == $user['nb_image_line'])
|
||||
|
|
|
|||
|
|
@ -80,8 +80,15 @@
|
|||
alt="{thumbnails.line.thumbnail.IMAGE_ALT}"
|
||||
title="{thumbnails.line.thumbnail.IMAGE_TITLE}"
|
||||
class="thumbLink" />
|
||||
<!-- BEGIN element_name -->
|
||||
<br />
|
||||
<span class="{thumbnails.line.thumbnail.IMAGE_STYLE}">{thumbnails.line.thumbnail.IMAGE_NAME}</span></a>
|
||||
<span class="thumb_picture">{thumbnails.line.thumbnail.element_name.NAME}</span>
|
||||
<!-- END element_name -->
|
||||
<!-- BEGIN category_name -->
|
||||
<br />
|
||||
<span class="thumb_category">[{thumbnails.line.thumbnail.category_name.NAME}]</span>
|
||||
<!-- END ategory_name -->
|
||||
</a>
|
||||
{thumbnails.line.thumbnail.IMAGE_TS}
|
||||
<!-- BEGIN nb_comments -->
|
||||
<br />{thumbnails.line.thumbnail.nb_comments.NB_COMMENTS} {L_COMMENT}
|
||||
|
|
@ -92,8 +99,10 @@
|
|||
<!-- END line -->
|
||||
</table>
|
||||
<!-- END thumbnails -->
|
||||
<!-- BEGIN caddie -->
|
||||
<br />
|
||||
<div class="navigationBar"><a href="{U_CADDIE}">add to caddie</a></div>
|
||||
<!-- END caddie -->
|
||||
<!-- BEGIN cat_infos -->
|
||||
<!-- BEGIN navigation -->
|
||||
<div class="navigationBar">{cat_infos.navigation.NAV_BAR}</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue