aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--admin/configuration.php2
-rw-r--r--admin/include/functions.php24
-rw-r--r--admin/user_list.php2
-rw-r--r--include/functions.inc.php14
4 files changed, 21 insertions, 21 deletions
diff --git a/admin/configuration.php b/admin/configuration.php
index 1a7850368..fdcbabcc4 100644
--- a/admin/configuration.php
+++ b/admin/configuration.php
@@ -253,7 +253,7 @@ switch ($page['section'])
$blockname = 'default.template_option';
- foreach (get_themes() as $pwg_template)
+ foreach (get_pwg_themes() as $pwg_template)
{
if (isset($_POST['submit']))
{
diff --git a/admin/include/functions.php b/admin/include/functions.php
index 25bbadf84..1ed30f3c6 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -1316,8 +1316,6 @@ UPDATE '.IMAGES_TABLE.'
*/
function update_average_rate( $element_id=-1 )
{
- $average_rates = array();
-
$query = '
SELECT element_id,
ROUND(AVG(rate),2) AS average_rate
@@ -1329,24 +1327,28 @@ SELECT element_id,
$query .= ' GROUP BY element_id;';
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
- {
- array_push($average_rates, $row);
- }
$datas = array();
- foreach ($average_rates as $item)
+
+ while ($row = mysql_fetch_array($result))
{
array_push(
$datas,
array(
- 'id' => $item['element_id'],
- 'average_rate' => $item['average_rate']
+ 'id' => $row['element_id'],
+ 'average_rate' => $row['average_rate']
)
);
}
- $fields = array('primary' => array('id'), 'update' => array('average_rate'));
- mass_updates(IMAGES_TABLE, $fields, $datas);
+
+ mass_updates(
+ IMAGES_TABLE,
+ array(
+ 'primary' => array('id'),
+ 'update' => array('average_rate')
+ ),
+ $datas
+ );
$query='
UPDATE '.IMAGES_TABLE .'
diff --git a/admin/user_list.php b/admin/user_list.php
index ea1748a2d..64890e06b 100644
--- a/admin/user_list.php
+++ b/admin/user_list.php
@@ -591,7 +591,7 @@ else
$blockname = 'template_option';
-foreach (get_themes() as $pwg_template)
+foreach (get_pwg_themes() as $pwg_template)
{
if (isset($_POST['pref_submit']))
{
diff --git a/include/functions.inc.php b/include/functions.inc.php
index 1c106233b..5dc764193 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -546,19 +546,17 @@ function url_is_remote($url)
}
/**
- * returns available templates/themes
+ * returns available template/theme
*/
-function get_templates()
-{
- return get_dirs(PHPWG_ROOT_PATH.'theme');
-}
-function get_themes()
+function get_pwg_themes()
{
$themes = array();
- foreach (get_dirs(PHPWG_ROOT_PATH.'template') as $template)
+ $template_dir = PHPWG_ROOT_PATH.'template';
+
+ foreach (get_dirs($template_dir) as $template)
{
- foreach (get_dirs(PHPWG_ROOT_PATH.'template/'.$template.'/theme') as $theme)
+ foreach (get_dirs($template_dir.'/'.$template.'/theme') as $theme)
{
array_push($themes, $template.'/'.$theme);
}