very small improvements:
- mass_inserts does not requires keys to start at 0 - recent_cats categories are sorted by global_rank (consistency) - removed warning from page_header.php (when included from redirect) - added 2 template functions for plugins (get_var and concat_var) - removed unused code from profile.php - changed css width for tag selection (search page) from 55em to almost 100% git-svn-id: http://piwigo.org/svn/trunk@1719 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
ed6d397aa1
commit
80754de172
6 changed files with 47 additions and 18 deletions
|
|
@ -528,11 +528,16 @@ function mass_inserts($table_name, $dbfields, $datas)
|
||||||
INSERT INTO '.$table_name.'
|
INSERT INTO '.$table_name.'
|
||||||
('.implode(',', $dbfields).')
|
('.implode(',', $dbfields).')
|
||||||
VALUES';
|
VALUES';
|
||||||
foreach ($datas as $insert_id => $insert)
|
$first = 1;
|
||||||
|
foreach ($datas as $insert)
|
||||||
{
|
{
|
||||||
$query.= '
|
$query.= '
|
||||||
';
|
';
|
||||||
if ($insert_id > 0)
|
if ($first)
|
||||||
|
{
|
||||||
|
$first = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
$query.= ',';
|
$query.= ',';
|
||||||
}
|
}
|
||||||
|
|
@ -1890,7 +1895,7 @@ function check_conf()
|
||||||
{
|
{
|
||||||
global $conf, $header_notes;
|
global $conf, $header_notes;
|
||||||
$count = 0;
|
$count = 0;
|
||||||
|
|
||||||
if (($conf['show_exif']) and (!function_exists('read_exif_data')))
|
if (($conf['show_exif']) and (!function_exists('read_exif_data')))
|
||||||
{
|
{
|
||||||
$header_notes[] = sprintf(l10n('note_check_exif'), '$conf[\'show_exif\']');
|
$header_notes[] = sprintf(l10n('note_check_exif'), '$conf[\'show_exif\']');
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
// | PhpWebGallery - a PHP based picture gallery |
|
// | PhpWebGallery - a PHP based picture gallery |
|
||||||
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
|
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
|
||||||
// | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net |
|
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
// | branch : BSF (Best So Far)
|
// | branch : BSF (Best So Far)
|
||||||
// | file : $Id$
|
// | file : $Id$
|
||||||
|
|
@ -37,7 +37,7 @@ if ($page['section']=='recent_cats')
|
||||||
$query = '
|
$query = '
|
||||||
SELECT
|
SELECT
|
||||||
id,name, representative_picture_id, comment, nb_images, uppercats,
|
id,name, representative_picture_id, comment, nb_images, uppercats,
|
||||||
date_last, max_date_last, count_images, count_categories
|
date_last, max_date_last, count_images, count_categories, global_rank
|
||||||
FROM '.CATEGORIES_TABLE.' INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.'
|
FROM '.CATEGORIES_TABLE.' INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.'
|
||||||
ON id = cat_id and user_id = '.$user['id'].'
|
ON id = cat_id and user_id = '.$user['id'].'
|
||||||
WHERE date_last > SUBDATE(
|
WHERE date_last > SUBDATE(
|
||||||
|
|
@ -151,6 +151,10 @@ SELECT representative_picture_id
|
||||||
unset($image_id);
|
unset($image_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($page['section']=='recent_cats')
|
||||||
|
{
|
||||||
|
usort($categories, 'global_rank_compare');
|
||||||
|
}
|
||||||
if (count($categories) > 0)
|
if (count($categories) > 0)
|
||||||
{
|
{
|
||||||
$thumbnail_src_of = array();
|
$thumbnail_src_of = array();
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ if (isset($header_infos))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Header notes
|
// Header notes
|
||||||
if (count($header_notes) > 0)
|
if ( isset($header_notes) and count($header_notes)>0)
|
||||||
{
|
{
|
||||||
foreach ($header_notes as $header_note)
|
foreach ($header_notes as $header_note)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
// | PhpWebGallery - a PHP based picture gallery |
|
// | PhpWebGallery - a PHP based picture gallery |
|
||||||
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
|
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
|
||||||
// | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net |
|
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
// | branch : BSF (Best So Far)
|
// | branch : BSF (Best So Far)
|
||||||
// | file : $RCSfile$
|
// | file : $Id$
|
||||||
// | last update : $Date$
|
// | last update : $Date$
|
||||||
// | last modifier : $Author$
|
// | last modifier : $Author$
|
||||||
// | revision : $Revision$
|
// | revision : $Revision$
|
||||||
|
|
@ -293,10 +293,37 @@ class Template {
|
||||||
function assign_var($varname, $varval)
|
function assign_var($varname, $varval)
|
||||||
{
|
{
|
||||||
$this->_tpldata['.'][0][$varname] = $varval;
|
$this->_tpldata['.'][0][$varname] = $varval;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Root-level variable concatenation. Appends a string to an existing
|
||||||
|
* variable assignment with the same name.
|
||||||
|
*/
|
||||||
|
function concat_var($varname, $varval)
|
||||||
|
{
|
||||||
|
if ( isset($this->_tpldata['.'][0][$varname]) )
|
||||||
|
{
|
||||||
|
$this->_tpldata['.'][0][$varname] .= $varval;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->_tpldata['.'][0][$varname] = $varval;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a root-level variable value
|
||||||
|
*/
|
||||||
|
function get_var($varname, $default=null)
|
||||||
|
{
|
||||||
|
if ( isset($this->_tpldata['.'][0][$varname]) )
|
||||||
|
{
|
||||||
|
return $this->_tpldata['.'][0][$varname];
|
||||||
|
}
|
||||||
|
return $default;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates a full path+filename for the given filename, which can either
|
* Generates a full path+filename for the given filename, which can either
|
||||||
|
|
|
||||||
11
profile.php
11
profile.php
|
|
@ -2,10 +2,10 @@
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
// | PhpWebGallery - a PHP based picture gallery |
|
// | PhpWebGallery - a PHP based picture gallery |
|
||||||
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
|
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
|
||||||
// | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net |
|
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
// | branch : BSF (Best So Far)
|
// | branch : BSF (Best So Far)
|
||||||
// | file : $RCSfile$
|
// | file : $Id$
|
||||||
// | last update : $Date$
|
// | last update : $Date$
|
||||||
// | last modifier : $Author$
|
// | last modifier : $Author$
|
||||||
// | revision : $Revision$
|
// | revision : $Revision$
|
||||||
|
|
@ -38,13 +38,6 @@ include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
check_status(ACCESS_CLASSIC);
|
check_status(ACCESS_CLASSIC);
|
||||||
|
|
||||||
if ($user['is_the_guest'] and !$guest_allowed)
|
|
||||||
{
|
|
||||||
echo '<div style="text-align:center;">'.$lang['only_members'].'<br />';
|
|
||||||
echo '<a href="./identification.php">'.$lang['ident_title'].'</a></div>';
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
$userdata = $user;
|
$userdata = $user;
|
||||||
|
|
||||||
//------------------------------------------------------ update & customization
|
//------------------------------------------------------ update & customization
|
||||||
|
|
|
||||||
|
|
@ -233,7 +233,7 @@ UL.actions A {
|
||||||
}
|
}
|
||||||
|
|
||||||
UL.tagSelection {
|
UL.tagSelection {
|
||||||
width: 40em;
|
width: 99%;
|
||||||
margin: 1em 0 1em 0;
|
margin: 1em 0 1em 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue