Minor cosmetic changes

skala
Julio Montoya 13 years ago
parent c5eb447ee4
commit 502a21ffb8
  1. 4
      main/auth/profile.php
  2. 12
      main/inc/lib/usermanager.lib.php

@ -622,11 +622,11 @@ if ($form->validate()) {
//2. Update the extra fields and user tags if available
if (is_array($extras) && count($extras)> 0) {
if (is_array($extras) && count($extras)> 0) {
foreach ($extras as $key => $value) {
//3. Tags are process in the UserManager::update_extra_field_value by the UserManager::process_tags function
UserManager::update_extra_field_value(api_get_user_id(), $key, $value);
}
}
}
// re-init the system to take new settings into account

@ -2686,7 +2686,7 @@ class UserManager {
* @return int returns 0 if fails otherwise the tag id
*/
public static function get_tag_id($tag, $field_id) {
$table_user_tag = Database::get_main_table(TABLE_MAIN_TAG);
$table_user_tag = Database::get_main_table(TABLE_MAIN_TAG);
$tag = Database::escape_string($tag);
$field_id = intval($field_id);
//with COLLATE latin1_bin to select query in a case sensitive mode
@ -2732,12 +2732,12 @@ class UserManager {
// database table definition
$table_user_tag = Database::get_main_table(TABLE_MAIN_TAG);
$table_user_tag_values = Database::get_main_table(TABLE_MAIN_USER_REL_TAG);
$tag = Database::escape_string($tag);
$tag = trim($tag);
$tag = trim(Database::escape_string($tag));
$user_id = intval($user_id);
$field_id = intval($field_id);
$tag_id = UserManager::get_tag_id($tag,$field_id);
$tag_id = UserManager::get_tag_id($tag, $field_id);
var_dump($tag_id);
/* IMPORTANT
* @todo we don't create tags with numbers
@ -2774,7 +2774,7 @@ class UserManager {
if (!empty($last_insert_id) && ($last_insert_id!=0)) {
//we insert the relationship user-tag
$sql_select ="SELECT tag_id FROM $table_user_tag_values WHERE user_id = $user_id AND tag_id = $last_insert_id ";
$sql_select ="SELECT tag_id FROM $table_user_tag_values WHERE user_id = $user_id AND tag_id = $last_insert_id ";
$result = Database::query($sql_select);
//if the relationship does not exist we create it
if (Database::num_rows($result)==0) {
@ -2818,7 +2818,7 @@ class UserManager {
*/
public static function process_tags($tags, $user_id, $field_id) {
//We loop the tags and add it to the DB
if (is_array($tags)) {
if (is_array($tags)) {
foreach($tags as $tag) {
UserManager::add_tag($tag, $user_id, $field_id);
}

Loading…
Cancel
Save