Changeset 1719


Ignore:
Timestamp:
Jan 13, 2007, 4:13:40 AM (17 years ago)
Author:
rvelices
Message:

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%
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions.php

    r1717 r1719  
    529529    ('.implode(',', $dbfields).')
    530530     VALUES';
    531     foreach ($datas as $insert_id => $insert)
     531    $first = 1;
     532    foreach ($datas as $insert)
    532533    {
    533534      $query.= '
    534535    ';
    535       if ($insert_id > 0)
     536      if ($first)
     537      {
     538        $first = 0;
     539      }
     540      else
    536541      {
    537542        $query.= ',';
     
    18911896  global $conf, $header_notes;
    18921897  $count = 0;
    1893  
     1898
    18941899  if (($conf['show_exif']) and (!function_exists('read_exif_data')))
    18951900  {
  • trunk/include/category_cats.inc.php

    r1677 r1719  
    33// | PhpWebGallery - a PHP based picture gallery                           |
    44// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
    5 // | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net |
     5// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
    66// +-----------------------------------------------------------------------+
    77// | branch        : BSF (Best So Far)
     
    3838SELECT
    3939  id,name, representative_picture_id, comment, nb_images, uppercats,
    40   date_last, max_date_last, count_images, count_categories
     40  date_last, max_date_last, count_images, count_categories, global_rank
    4141  FROM '.CATEGORIES_TABLE.' INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.'
    4242  ON id = cat_id and user_id = '.$user['id'].'
     
    152152}
    153153
     154if ($page['section']=='recent_cats')
     155{
     156  usort($categories, 'global_rank_compare');
     157}
    154158if (count($categories) > 0)
    155159{
  • trunk/include/page_header.php

    r1703 r1719  
    6363
    6464// Header notes
    65 if (count($header_notes) > 0)
     65if ( isset($header_notes) and count($header_notes)>0)
    6666{
    6767  foreach ($header_notes as $header_note)
  • trunk/include/template.php

    r1589 r1719  
    33// | PhpWebGallery - a PHP based picture gallery                           |
    44// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
    5 // | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net |
     5// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
    66// +-----------------------------------------------------------------------+
    77// | branch        : BSF (Best So Far)
    8 // | file          : $RCSfile$
     8// | file          : $Id$
    99// | last update   : $Date$
    1010// | last modifier : $Author$
     
    294294    {
    295295      $this->_tpldata['.'][0][$varname] = $varval;
    296 
    297       return true;
    298     }
    299 
     296      return true;
     297    }
     298
     299  /**
     300   * Root-level variable concatenation. Appends a  string to an existing
     301   * variable assignment with the same name.
     302   */
     303  function concat_var($varname, $varval)
     304    {
     305      if ( isset($this->_tpldata['.'][0][$varname]) )
     306      {
     307        $this->_tpldata['.'][0][$varname] .= $varval;
     308      }
     309      else
     310      {
     311        $this->_tpldata['.'][0][$varname] = $varval;
     312      }
     313      return true;
     314    }
     315
     316  /**
     317   * Returns a root-level variable value
     318   */
     319  function get_var($varname, $default=null)
     320    {
     321      if ( isset($this->_tpldata['.'][0][$varname]) )
     322      {
     323        return $this->_tpldata['.'][0][$varname];
     324      }
     325      return $default;
     326    }
    300327
    301328  /**
  • trunk/profile.php

    r1620 r1719  
    33// | PhpWebGallery - a PHP based picture gallery                           |
    44// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
    5 // | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net |
     5// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
    66// +-----------------------------------------------------------------------+
    77// | branch        : BSF (Best So Far)
    8 // | file          : $RCSfile$
     8// | file          : $Id$
    99// | last update   : $Date$
    1010// | last modifier : $Author$
     
    3939check_status(ACCESS_CLASSIC);
    4040
    41 if ($user['is_the_guest'] and !$guest_allowed)
    42 {
    43   echo '<div style="text-align:center;">'.$lang['only_members'].'<br />';
    44   echo '<a href="./identification.php">'.$lang['ident_title'].'</a></div>';
    45   exit();
    46 }
    47 
    4841$userdata = $user;
    4942
  • trunk/template/yoga/default-layout.css

    r1708 r1719  
    234234
    235235UL.tagSelection {
    236   width: 40em;
     236  width: 99%;
    237237  margin: 1em 0 1em 0;
    238238  padding: 0;
Note: See TracChangeset for help on using the changeset viewer.