aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2004-12-12 21:06:39 +0000
committerplegall <plg@piwigo.org>2004-12-12 21:06:39 +0000
commit391fac78a80c9317e764a13d742c88d8fe0866fc (patch)
tree178c3f72dd0356c4c6ad05adae9d974dedbfa506 /include
parent9037726f5a658dc156ef444f2d90271ee2102711 (diff)
- in admin menu, status option for categories is not "permissions" but
"private or public" choice = different language item - get_cat_display_name changed : use $conf['level_separator'] to unify presentation - default values for category properties commentable, uploadable, status and visible (set in include/config.inc.php) used for category creation (admin/update, admin/remote_site, admin/cat_list) - use mass_inserts in admin/update for inserting new categories - only one query for counting the number of sub categories in admin/cat_list git-svn-id: http://piwigo.org/svn/trunk@642 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/category_calendar.inc.php6
-rw-r--r--include/category_recent_cats.inc.php3
-rw-r--r--include/config.inc.php37
-rw-r--r--include/functions_category.inc.php2
-rw-r--r--include/functions_html.inc.php11
-rw-r--r--include/functions_xml.inc.php1
6 files changed, 36 insertions, 24 deletions
diff --git a/include/category_calendar.inc.php b/include/category_calendar.inc.php
index b318c7c25..e718928ce 100644
--- a/include/category_calendar.inc.php
+++ b/include/category_calendar.inc.php
@@ -363,6 +363,8 @@ SELECT file,tn_ext,'.$conf['calendar_datefield'].',path
}
elseif (isset($page['calendar_day']))
{
+ $old_level_separator = $conf['level_separator'];
+ $conf['level_separator'] = '<br />';
// for each category of this day, display a random picture
foreach ($calendar_categories as $calendar_category => $nb_pics)
{
@@ -373,7 +375,8 @@ elseif (isset($page['calendar_day']))
else
{
$cat_infos = get_cat_info( $calendar_category );
- $name = get_cat_display_name($cat_infos['name'],'<br />','',false);
+
+ $name = get_cat_display_name($cat_infos['name'],'',false);
$name = '['.$name.']';
}
$name.= ' ('.$nb_pics.')';
@@ -426,5 +429,6 @@ SELECT file,tn_ext,'.$conf['calendar_datefield'].',path
$row_number = 0;
}
}
+ $conf['level_separator'] = $old_level_separator;
}
?> \ No newline at end of file
diff --git a/include/category_recent_cats.inc.php b/include/category_recent_cats.inc.php
index ed193e380..ab4732a81 100644
--- a/include/category_recent_cats.inc.php
+++ b/include/category_recent_cats.inc.php
@@ -59,6 +59,8 @@ if (mysql_num_rows($result) > 0)
$row_number = 0;
}
+$old_level_separator = $conf['level_separator'];
+$conf['level_separator'] = '<br />';
// for each category, we have to search a recent picture to display and
// the name to display
while ( $row = mysql_fetch_array( $result ) )
@@ -90,4 +92,5 @@ while ( $row = mysql_fetch_array( $result ) )
$row_number = 0;
}
}
+$conf['level_separator'] = $old_level_separator;
?> \ No newline at end of file
diff --git a/include/config.inc.php b/include/config.inc.php
index 4d9d0428d..9b6a552ee 100644
--- a/include/config.inc.php
+++ b/include/config.inc.php
@@ -76,7 +76,7 @@ $conf['picture_ext'] = array('jpg','JPG','png','PNG','gif','GIF');
// top_number : number of element to display for "best rated" and "most
// visited" categories
-$conf['top_number'] = 10;
+$conf['top_number'] = 15;
// anti-flood_time : number of seconds between 2 comments : 0 to disable
$conf['anti-flood_time'] = 60;
@@ -168,18 +168,25 @@ $conf['show_queries'] = false;
// show_gt : display generation time at the bottom of each page
$conf['show_gt'] = true;
-// Default options for new categories.
-//
-// Some options for categories (commentable, uploadable, status, visible)
-// must be set directly in the database by changing the corresponding
-// default values of the column. Examples :
-//
-// ALTER TABLE phpwebgallery_categories ALTER visible SET DEFAULT 'true';
-// ALTER TABLE phpwebgallery_categories ALTER status SET DEFAULT 'private';
-// ALTER TABLE phpwebgallery_categories ALTER uploadable SET DEFAULT 'true';
-// ALTER TABLE phpwebgallery_categories ALTER commentable SET DEFAULT 'false';
-//
-// MySQL default values are used when inserting a row and that no value is
-// given for the column. In PhpWebGallery, the above columns are not valued
-// during categories insertion, so default values are important.
+// newcat_default_commentable : at creation, must a category be commentable
+// or not ?
+$conf['newcat_default_commentable'] = 'true';
+
+// newcat_default_uploadable : at creation, must a category be uploadable or
+// not ?
+$conf['newcat_default_uploadable'] = 'true';
+
+// newcat_default_visible : at creation, must a category be visible or not ?
+// Warning : if the parent category is invisible, the category is
+// automatically create invisible. (invisible = locked)
+$conf['newcat_default_visible'] = 'true';
+
+// newcat_default_status : at creation, must a category be public or private
+// ? Warning : if the parent category is private, the category is
+// automatically create private.
+$conf['newcat_default_status'] = 'public';
+
+// level_separator : character string used for separating a category level
+// to the sub level
+$conf['level_separator'] = ' / ';
?>
diff --git a/include/functions_category.inc.php b/include/functions_category.inc.php
index 4efbb0d62..2fd502120 100644
--- a/include/functions_category.inc.php
+++ b/include/functions_category.inc.php
@@ -348,7 +348,6 @@ function initialize_category( $calling_page = 'category' )
$page['uppercats'] = $result['uppercats'];
$page['title'] =
get_cat_display_name($page['cat_name'],
- ' &gt; ',
'category.php?cat=',
false);
$page['where'] = ' WHERE category_id = '.$page['cat'];
@@ -758,7 +757,6 @@ function display_select_categories($categories,
if ($fullname)
{
$option = get_cat_display_name_cache($category['uppercats'],
- ' &rarr; ',
'',
false);
}
diff --git a/include/functions_html.inc.php b/include/functions_html.inc.php
index f1a8610db..2ff918ae4 100644
--- a/include/functions_html.inc.php
+++ b/include/functions_html.inc.php
@@ -159,10 +159,11 @@ function style_select($default_style, $select_name = "style")
* @return string
*/
function get_cat_display_name($cat_informations,
- $separator,
$url = 'category.php?cat=',
$replace_space = true)
{
+ global $conf;
+
$output = '';
$is_first = true;
foreach ($cat_informations as $id => $name)
@@ -173,7 +174,7 @@ function get_cat_display_name($cat_informations,
}
else
{
- $output.= $separator;
+ $output.= $conf['level_separator'];
}
if ($url == '')
@@ -205,17 +206,15 @@ function get_cat_display_name($cat_informations,
* the categories name without links.
*
* @param string uppercats
- * @param string separator
* @param string url
* @param boolean replace_space
* @return string
*/
function get_cat_display_name_cache($uppercats,
- $separator,
$url = 'category.php?cat=',
$replace_space = true)
{
- global $cat_names;
+ global $cat_names, $conf;
if (!isset($cat_names))
{
@@ -242,7 +241,7 @@ SELECT id,name
}
else
{
- $output.= $separator;
+ $output.= $conf['level_separator'];
}
if ($url == '')
diff --git a/include/functions_xml.inc.php b/include/functions_xml.inc.php
index ca2f1b7e1..903ec02fd 100644
--- a/include/functions_xml.inc.php
+++ b/include/functions_xml.inc.php
@@ -51,6 +51,7 @@ function getContent( $element )
// attribute $attribute for the tag $element.
function getAttribute( $element, $attribute )
{
+// echo htmlentities($element).'<br /><br />';
$regex = '/^<\w+[^>]*'.$attribute.'\s*=\s*"('.VAL_REG.')"/i';
if ( preg_match( $regex, $element, $out ) ) return $out[1];
else return '';