aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/functions_html.inc.php10
-rw-r--r--include/functions_user.inc.php27
-rw-r--r--include/user.inc.php13
3 files changed, 36 insertions, 14 deletions
diff --git a/include/functions_html.inc.php b/include/functions_html.inc.php
index f30523c34..5c642fc30 100644
--- a/include/functions_html.inc.php
+++ b/include/functions_html.inc.php
@@ -192,7 +192,7 @@ function language_select($default, $select_name = "language")
{
$available_lang = get_languages();
- $lang_select = '<select name="' . $select_name . '" onchange="this.form.submit()">';
+ $lang_select = '<select name="' . $select_name . '">';
foreach ($available_lang as $code => $displayname)
{
$selected = ( strtolower($default) == strtolower($code) ) ? ' selected="selected"' : '';
@@ -449,4 +449,12 @@ function parse_comment_content($content)
return $content;
}
+
+function get_cat_display_name_from_id($cat_id,
+ $url = 'category.php?cat=',
+ $replace_space = true)
+{
+ $cat_info = get_cat_info($cat_id);
+ get_cat_display_name($cat_info['id'], $url, $replace_space);
+}
?>
diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php
index 0147dcac5..94bf7b562 100644
--- a/include/functions_user.inc.php
+++ b/include/functions_user.inc.php
@@ -454,4 +454,31 @@ function create_user_infos($user_id)
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
mass_inserts(USER_INFOS_TABLE, array_keys($insert), array($insert));
}
+
+/**
+ * returns the groupname corresponding to the given group identifier if
+ * exists
+ *
+ * @param int group_id
+ * @return mixed
+ */
+function get_groupname($group_id)
+{
+ $query = '
+SELECT name
+ FROM '.GROUPS_TABLE.'
+ WHERE id = '.intval($group_id).'
+;';
+ $result = pwg_query($query);
+ if (mysql_num_rows($result) > 0)
+ {
+ list($groupname) = mysql_fetch_row($result);
+ }
+ else
+ {
+ return false;
+ }
+
+ return $groupname;
+}
?> \ No newline at end of file
diff --git a/include/user.inc.php b/include/user.inc.php
index 4c3e0fb6a..8b51935a0 100644
--- a/include/user.inc.php
+++ b/include/user.inc.php
@@ -25,19 +25,6 @@
// | USA. |
// +-----------------------------------------------------------------------+
-// Dynamic change of language with database persistency
-//
-// FIXME : ce bout de code fait planter l'assignation d'un language a
-// plusieurs users simultanement dans la nouvelle page admin/user_list.php
-//
-// if (isset($_POST['language']))
-// {
-// $query = "UPDATE ".USERS_TABLE." SET language = '";
-// $query.= $_POST['language'];
-// $query.= "' WHERE id = ".$_POST['userid'].";";
-// pwg_query($query);
-// }
-
// retrieving connected user informations
if (isset($_COOKIE['id']))
{