|
|
@ -130,15 +130,9 @@ function encryptPassword($password){
|
|
|
|
|
|
|
|
|
|
|
|
function getUserMetaData($userid) {
|
|
|
|
function getUserMetaData($userid) {
|
|
|
|
$sql = 'SELECT * FROM user_meta_data WHERE user_id = ' . $userid;
|
|
|
|
$sql = 'SELECT * FROM user_meta_data WHERE user_id = ' . $userid;
|
|
|
|
$qry = silent_query($sql);
|
|
|
|
$qry = db_query($sql);
|
|
|
|
|
|
|
|
|
|
|
|
$result = array();
|
|
|
|
$result = array();
|
|
|
|
if(!$qry)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
echo $sql .'<br>';
|
|
|
|
|
|
|
|
return $result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while ($row = mysqli_fetch_assoc($qry)) {
|
|
|
|
while ($row = mysqli_fetch_assoc($qry)) {
|
|
|
|
$result[$row['key']] = $row['value'];
|
|
|
|
$result[$row['key']] = $row['value'];
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -154,8 +148,13 @@ function setUserMetaDataEntry($userid, $key, $value) {
|
|
|
|
if(db_affected_rows() > 0)
|
|
|
|
if(db_affected_rows() > 0)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
$sql = 'INSERT INTO user_meta_data(user_id, `key`, `value`) values (\''.$userid.'\',\''.$key.'\',\''.$value.'\')';
|
|
|
|
|
|
|
|
$qry = db_query($sql);
|
|
|
|
$sql = 'SELECT `value` FROM user_meta_data WHERE user_id = \''.$userid.'\' and `key` = \''.$key.'\'';
|
|
|
|
|
|
|
|
if ( mysqli_num_rows(db_query($sql)) == 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$sql = 'INSERT INTO user_meta_data(user_id, `key`, `value`) values (\''.$userid.'\',\''.$key.'\',\''.$value.'\')';
|
|
|
|
|
|
|
|
$qry = db_query($sql);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|