mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
feature 657: permalinks for categories
git-svn-id: http://piwigo.org/svn/trunk@1866 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -1174,6 +1174,26 @@ function simple_hash_from_query($query, $keyname, $valuename)
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* creates an hashed based on a query, this function is a very common
|
||||
* pattern used here. The key is given as parameter, the value is an associative
|
||||
* array.
|
||||
*
|
||||
* @param string $query
|
||||
* @param string $keyname
|
||||
* @return array
|
||||
*/
|
||||
function hash_from_query($query, $keyname)
|
||||
{
|
||||
$array = array();
|
||||
$result = pwg_query($query);
|
||||
while ($row = mysql_fetch_assoc($result))
|
||||
{
|
||||
$array[ $row[$keyname] ] = $row;
|
||||
}
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return basename of the current script
|
||||
* Lower case convertion is applied on return value
|
||||
|
||||
Reference in New Issue
Block a user