aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2005-03-25 22:10:55 +0000
committerplegall <plg@piwigo.org>2005-03-25 22:10:55 +0000
commitef080278bf4d0e073daa5f6a6f6d3b8ae4c29d9c (patch)
tree243d94d5b810325c43ea9e6998b7929319bc1e3e /include
parent333d44c398e31dd7f24efbcf50d53c1ce2a754ba (diff)
- 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. git-svn-id: http://piwigo.org/svn/trunk@755 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include')
-rw-r--r--include/constants.php3
-rw-r--r--include/functions.inc.php21
2 files changed, 23 insertions, 1 deletions
diff --git a/include/constants.php b/include/constants.php
index 944bacca6..c47ecf9a2 100644
--- a/include/constants.php
+++ b/include/constants.php
@@ -26,7 +26,7 @@
// +-----------------------------------------------------------------------+
// Default settings
-define('PHPWG_VERSION', '1.4.0RC3');
+define('PHPWG_VERSION', '1.4.0');
define('PHPWG_URL', 'http://www.phpwebgallery.net');
define('PHPWG_FORUM_URL', 'http://forum.phpwebgallery.net');
@@ -58,4 +58,5 @@ define('WAITING_TABLE', $prefixeTable.'waiting');
define('IMAGE_METADATA_TABLE', $prefixeTable.'image_metadata');
define('RATE_TABLE', $prefixeTable.'rate');
define('USER_FORBIDDEN_TABLE', $prefixeTable.'user_forbidden');
+define('CADDIE_TABLE', $prefixeTable.'caddie');
?>
diff --git a/include/functions.inc.php b/include/functions.inc.php
index edc9f2062..282c196ac 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -618,4 +618,25 @@ function my_error($header)
$error.= '</pre>';
die ($error);
}
+
+/**
+ * creates an array based on a query, this function is a very common pattern
+ * used here
+ *
+ * @param string $query
+ * @param string $fieldname
+ * @return array
+ */
+function array_from_query($query, $fieldname)
+{
+ $array = array();
+
+ $result = pwg_query($query);
+ while ($row = mysql_fetch_array($result))
+ {
+ array_push($array, $row[$fieldname]);
+ }
+
+ return $array;
+}
?>