Changeset 755 for trunk/include


Ignore:
Timestamp:
Mar 25, 2005, 11:10:55 PM (20 years ago)
Author:
plg
Message:
  • new feature : caddie. The purpose is batch management, especially concerning elements to categories associations. This is the very first release, needs many improvements.
  • new function : array_from_query. Firstly used by "caddie" feature, it may be useful in many cases.
Location:
trunk/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/constants.php

    r739 r755  
    2727
    2828// Default settings
    29 define('PHPWG_VERSION', '1.4.0RC3');
     29define('PHPWG_VERSION', '1.4.0');
    3030define('PHPWG_URL', 'http://www.phpwebgallery.net');
    3131define('PHPWG_FORUM_URL', 'http://forum.phpwebgallery.net');
     
    5959define('RATE_TABLE', $prefixeTable.'rate');
    6060define('USER_FORBIDDEN_TABLE', $prefixeTable.'user_forbidden');
     61define('CADDIE_TABLE', $prefixeTable.'caddie');
    6162?>
  • trunk/include/functions.inc.php

    r749 r755  
    619619  die ($error);
    620620}
     621
     622/**
     623 * creates an array based on a query, this function is a very common pattern
     624 * used here
     625 *
     626 * @param string $query
     627 * @param string $fieldname
     628 * @return array
     629 */
     630function array_from_query($query, $fieldname)
     631{
     632  $array = array();
     633 
     634  $result = pwg_query($query);
     635  while ($row = mysql_fetch_array($result))
     636  {
     637    array_push($array, $row[$fieldname]);
     638  }
     639
     640  return $array;
     641}
    621642?>
Note: See TracChangeset for help on using the changeset viewer.