Changeset 642 for trunk/include


Ignore:
Timestamp:
Dec 12, 2004, 10:06:39 PM (20 years ago)
Author:
plg
Message:
  • in admin menu, status option for categories is not "permissions" but "private or public" choice = different language item
  • get_cat_display_name changed : use $conflevel_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
Location:
trunk/include
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/category_calendar.inc.php

    r612 r642  
    364364elseif (isset($page['calendar_day']))
    365365{
     366  $old_level_separator = $conf['level_separator'];
     367  $conf['level_separator'] = '<br />';
    366368  // for each category of this day, display a random picture
    367369  foreach ($calendar_categories as $calendar_category => $nb_pics)
     
    374376    {
    375377      $cat_infos = get_cat_info( $calendar_category );
    376       $name = get_cat_display_name($cat_infos['name'],'<br />','',false);
     378     
     379      $name = get_cat_display_name($cat_infos['name'],'',false);
    377380      $name = '['.$name.']';
    378381    }
     
    427430    }
    428431  }
     432  $conf['level_separator'] = $old_level_separator;
    429433}
    430434?>
  • trunk/include/category_recent_cats.inc.php

    r610 r642  
    6060}
    6161
     62$old_level_separator = $conf['level_separator'];
     63$conf['level_separator'] = '<br />';
    6264// for each category, we have to search a recent picture to display and
    6365// the name to display
     
    9193  }
    9294}
     95$conf['level_separator'] = $old_level_separator;
    9396?>
  • trunk/include/config.inc.php

    r602 r642  
    7777// top_number : number of element to display for "best rated" and "most
    7878// visited" categories
    79 $conf['top_number'] = 10;
     79$conf['top_number'] = 15;
    8080
    8181// anti-flood_time : number of seconds between 2 comments : 0 to disable
     
    169169$conf['show_gt'] = true;
    170170
    171 // Default options for new categories.
    172 //
    173 // Some options for categories (commentable, uploadable, status, visible)
    174 // must be set directly in the database by changing the corresponding
    175 // default values of the column. Examples :
    176 //
    177 // ALTER TABLE phpwebgallery_categories ALTER visible SET DEFAULT 'true';
    178 // ALTER TABLE phpwebgallery_categories ALTER status SET DEFAULT 'private';
    179 // ALTER TABLE phpwebgallery_categories ALTER uploadable SET DEFAULT 'true';
    180 // ALTER TABLE phpwebgallery_categories ALTER commentable SET DEFAULT 'false';
    181 //
    182 // MySQL default values are used when inserting a row and that no value is
    183 // given for the column. In PhpWebGallery, the above columns are not valued
    184 // during categories insertion, so default values are important.
     171// newcat_default_commentable : at creation, must a category be commentable
     172// or not ?
     173$conf['newcat_default_commentable'] = 'true';
     174
     175// newcat_default_uploadable : at creation, must a category be uploadable or
     176// not ?
     177$conf['newcat_default_uploadable'] = 'true';
     178
     179// newcat_default_visible : at creation, must a category be visible or not ?
     180// Warning : if the parent category is invisible, the category is
     181// automatically create invisible. (invisible = locked)
     182$conf['newcat_default_visible'] = 'true';
     183
     184// newcat_default_status : at creation, must a category be public or private
     185// ? Warning : if the parent category is private, the category is
     186// automatically create private.
     187$conf['newcat_default_status'] = 'public';
     188
     189// level_separator : character string used for separating a category level
     190// to the sub level
     191$conf['level_separator'] = ' / ';
    185192?>
  • trunk/include/functions_category.inc.php

    r641 r642  
    349349      $page['title'] =
    350350        get_cat_display_name($page['cat_name'],
    351                              ' &gt; ',
    352351                             'category.php?cat=',
    353352                             false);
     
    759758    {
    760759      $option = get_cat_display_name_cache($category['uppercats'],
    761                                            ' &rarr; ',
    762760                                           '',
    763761                                           false);
  • trunk/include/functions_html.inc.php

    r614 r642  
    160160 */
    161161function get_cat_display_name($cat_informations,
    162                               $separator,
    163162                              $url = 'category.php?cat=',
    164163                              $replace_space = true)
    165164{
     165  global $conf;
     166 
    166167  $output = '';
    167168  $is_first = true;
     
    174175    else
    175176    {
    176       $output.= $separator;
     177      $output.= $conf['level_separator'];
    177178    }
    178179
     
    206207 *
    207208 * @param string uppercats
    208  * @param string separator
    209209 * @param string url
    210210 * @param boolean replace_space
     
    212212 */
    213213function get_cat_display_name_cache($uppercats,
    214                                     $separator,
    215214                                    $url = 'category.php?cat=',
    216215                                    $replace_space = true)
    217216{
    218   global $cat_names;
     217  global $cat_names, $conf;
    219218
    220219  if (!isset($cat_names))
     
    243242    else
    244243    {
    245       $output.= $separator;
     244      $output.= $conf['level_separator'];
    246245    }
    247246
  • trunk/include/functions_xml.inc.php

    r593 r642  
    5252function getAttribute( $element, $attribute )
    5353{
     54//  echo htmlentities($element).'<br /><br />';
    5455  $regex = '/^<\w+[^>]*'.$attribute.'\s*=\s*"('.VAL_REG.')"/i';
    5556  if ( preg_match( $regex, $element, $out ) ) return $out[1];
Note: See TracChangeset for help on using the changeset viewer.