mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-05-02 11:32:52 +02:00
fix: sql query on tags when there are no images
fix: cat_name was not passed to make_index_url in category_subcats.inc.php (subcatify was working) improvement: added some rel="nofollow" git-svn-id: http://piwigo.org/svn/branches/branch-1_6@1134 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -132,7 +132,7 @@ SELECT id, path, tn_ext
|
||||
$thumbnail_src_of[$row['id']] =
|
||||
get_thumbnail_src($row['path'], @$row['tn_ext']);
|
||||
}
|
||||
|
||||
|
||||
if ($conf['subcatify'])
|
||||
{
|
||||
$template->set_filenames(
|
||||
@@ -142,7 +142,7 @@ SELECT id, path, tn_ext
|
||||
);
|
||||
|
||||
$template->assign_block_vars('categories', array());
|
||||
|
||||
|
||||
foreach ($categories as $category)
|
||||
{
|
||||
$template->assign_block_vars(
|
||||
@@ -152,7 +152,7 @@ SELECT id, path, tn_ext
|
||||
'ALT' => $category['name'],
|
||||
'TITLE' => $lang['hint_category'],
|
||||
'ICON' => get_icon(@$category['date_last']),
|
||||
|
||||
|
||||
'URL' => make_index_url(
|
||||
array(
|
||||
'category' => $category['category'],
|
||||
@@ -165,7 +165,7 @@ SELECT id, path, tn_ext
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
$template->assign_var_from_handle('CATEGORIES', 'mainpage_categories');
|
||||
}
|
||||
else
|
||||
@@ -175,7 +175,7 @@ SELECT id, path, tn_ext
|
||||
$template->assign_block_vars('thumbnails.line', array());
|
||||
// current row displayed
|
||||
$row_number = 0;
|
||||
|
||||
|
||||
foreach ($categories as $category)
|
||||
{
|
||||
$template->assign_block_vars(
|
||||
@@ -185,10 +185,11 @@ SELECT id, path, tn_ext
|
||||
'IMAGE_ALT' => $category['name'],
|
||||
'IMAGE_TITLE' => $lang['hint_category'],
|
||||
'IMAGE_TS' => get_icon(@$category['date_last']),
|
||||
|
||||
|
||||
'U_IMG_LINK' => make_index_url(
|
||||
array(
|
||||
'category' => $category['category'],
|
||||
'cat_name' => $category['name'],
|
||||
)
|
||||
),
|
||||
'CLASS' => 'thumbCat',
|
||||
@@ -201,7 +202,7 @@ SELECT id, path, tn_ext
|
||||
'NAME' => $category['name']
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
// create a new line ?
|
||||
if (++$row_number == $user['nb_image_line'])
|
||||
{
|
||||
|
||||
@@ -54,7 +54,10 @@ SELECT DISTINCT image_id
|
||||
WHERE category_id NOT IN ('.implode(',', $forbidden_categories).')
|
||||
;';
|
||||
$image_ids = array_from_query($images_query, 'image_id');
|
||||
|
||||
if ( empty($image_ids) )
|
||||
{
|
||||
return array();
|
||||
}
|
||||
$tags_query.= '
|
||||
WHERE image_id IN ('.
|
||||
wordwrap(
|
||||
@@ -63,13 +66,13 @@ SELECT DISTINCT image_id
|
||||
"\n"
|
||||
).')';
|
||||
}
|
||||
|
||||
|
||||
$tags_query.= '
|
||||
GROUP BY tag_id
|
||||
;';
|
||||
|
||||
$result = pwg_query($tags_query);
|
||||
|
||||
|
||||
$tags = array();
|
||||
|
||||
while ($row = mysql_fetch_array($result))
|
||||
@@ -93,7 +96,7 @@ SELECT id AS tag_id, name, url_name
|
||||
ORDER BY name
|
||||
;';
|
||||
$result = pwg_query($query);
|
||||
|
||||
|
||||
$tags = array();
|
||||
|
||||
while ($row = mysql_fetch_array($result))
|
||||
@@ -123,7 +126,7 @@ function add_level_to_tags($tags)
|
||||
{
|
||||
return $tags;
|
||||
}
|
||||
|
||||
|
||||
$total_count = 0;
|
||||
|
||||
foreach ($tags as $tag)
|
||||
@@ -146,7 +149,7 @@ function add_level_to_tags($tags)
|
||||
foreach (array_keys($tags) as $k)
|
||||
{
|
||||
$tags[$k]['level'] = 1;
|
||||
|
||||
|
||||
// based on threshold, determine current tag level
|
||||
for ($i = $conf['tags_levels'] - 1; $i >= 1; $i--)
|
||||
{
|
||||
@@ -177,7 +180,7 @@ function get_image_ids_for_tags($tag_ids, $mode = 'AND')
|
||||
{
|
||||
// strategy is to list images associated to each tag
|
||||
$tag_images = array();
|
||||
|
||||
|
||||
foreach ($tag_ids as $tag_id)
|
||||
{
|
||||
$query = '
|
||||
|
||||
@@ -630,7 +630,7 @@ if (!empty($picture['current']['date_creation']))
|
||||
'chronology_date' => explode('-', $picture['current']['date_creation'])
|
||||
)
|
||||
);
|
||||
$infos['INFO_CREATION_DATE'] = '<a href="'.$url.'">'.$val.'</a>';
|
||||
$infos['INFO_CREATION_DATE'] = '<a href="'.$url.'" rel="nofollow">'.$val.'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -647,7 +647,7 @@ $url = make_index_URL(
|
||||
'chronology_date'=>explode('-', substr($picture['current']['date_available'],0,10))
|
||||
)
|
||||
);
|
||||
$infos['INFO_POSTED_DATE'] = '<a href="'.$url.'">'.$val.'</a>';
|
||||
$infos['INFO_POSTED_DATE'] = '<a href="'.$url.'" rel="nofollow">'.$val.'</a>';
|
||||
|
||||
// size in pixels
|
||||
if ($picture['current']['is_picture'])
|
||||
@@ -699,7 +699,7 @@ $result = pwg_query($query);
|
||||
if (mysql_num_rows($result) > 0)
|
||||
{
|
||||
$tags = array();
|
||||
|
||||
|
||||
while ($row = mysql_fetch_array($result))
|
||||
{
|
||||
array_push(
|
||||
|
||||
@@ -108,8 +108,8 @@
|
||||
<input type="submit" name="login" value="{lang:submit}">
|
||||
</p>
|
||||
<ul class="actions">
|
||||
<li><a href="{U_LOST_PASSWORD}" title="{lang:Forgot your password?}"><img src="{pwg_root}{themeconf:icon_dir}/lost_password.png" class="button" alt="{lang:Forgot your password?}"></a></li>
|
||||
<li><a href="{U_REGISTER}" title="{lang:Create a new account}"><img src="{pwg_root}{themeconf:icon_dir}/register.png" class="button" alt="{lang:register}"/></a></li>
|
||||
<li><a href="{U_LOST_PASSWORD}" title="{lang:Forgot your password?}" rel="nofollow"><img src="{pwg_root}{themeconf:icon_dir}/lost_password.png" class="button" alt="{lang:Forgot your password?}"></a></li>
|
||||
<li><a href="{U_REGISTER}" title="{lang:Create a new account}" rel="nofollow"><img src="{pwg_root}{themeconf:icon_dir}/register.png" class="button" alt="{lang:register}"/></a></li>
|
||||
</ul>
|
||||
|
||||
</fieldset>
|
||||
@@ -151,10 +151,10 @@
|
||||
<li><a href="{mode_normal.URL}" title="{lang:mode_normal_hint}"><img src="{pwg_root}{themeconf:icon_dir}/normal_mode.png" class="button" alt="{lang:mode_normal_hint}"></a></li>
|
||||
<!-- END mode_normal -->
|
||||
<!-- BEGIN mode_posted -->
|
||||
<li><a href="{mode_posted.URL}" title="{lang:mode_posted_hint}"><img src="{pwg_root}{themeconf:icon_dir}/calendar.png" class="button" alt="{lang:mode_posted_hint}"></a></li>
|
||||
<li><a href="{mode_posted.URL}" title="{lang:mode_posted_hint}" rel="nofollow"><img src="{pwg_root}{themeconf:icon_dir}/calendar.png" class="button" alt="{lang:mode_posted_hint}"></a></li>
|
||||
<!-- END mode_posted -->
|
||||
<!-- BEGIN mode_created -->
|
||||
<li><a href="{mode_created.URL}" title="{lang:mode_created_hint}"><img src="{pwg_root}{themeconf:icon_dir}/calendar_created.png" class="button" alt="{lang:mode_created_hint}"></a></li>
|
||||
<li><a href="{mode_created.URL}" title="{lang:mode_created_hint}" rel="nofollow"><img src="{pwg_root}{themeconf:icon_dir}/calendar_created.png" class="button" alt="{lang:mode_created_hint}"></a></li>
|
||||
<!-- END mode_created -->
|
||||
</ul>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user