mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 05:43:55 -07:00
Minor improvements (#843)
This commit is contained in:
parent
742b51cc45
commit
ab0d2133d4
2 changed files with 11 additions and 5 deletions
|
@ -34,8 +34,8 @@ function get_attach_path($id, $ext_id = '', $base_path = null, $first_div = 1000
|
|||
|
||||
function delete_avatar($user_id, $avatar_ext_id)
|
||||
{
|
||||
$avatar_file = $avatar_ext_id ? get_avatar_path($user_id, $avatar_ext_id) : '';
|
||||
return ($avatar_file && file_exists($avatar_file)) ? @unlink($avatar_file) : false;
|
||||
$avatar_file = $avatar_ext_id ? get_avatar_path($user_id, $avatar_ext_id) : false;
|
||||
return ($avatar_file && file_exists($avatar_file) && unlink($avatar_file));
|
||||
}
|
||||
|
||||
function get_tracks($type)
|
||||
|
@ -739,8 +739,12 @@ function get_user_id($username)
|
|||
if (empty($username)) {
|
||||
return false;
|
||||
}
|
||||
$row = DB()->fetch_row("SELECT user_id FROM " . BB_USERS . " WHERE username = '" . DB()->escape($username) . "' LIMIT 1");
|
||||
return $row['user_id'];
|
||||
|
||||
if ($row = DB()->fetch_row("SELECT user_id FROM " . BB_USERS . " WHERE username = '" . DB()->escape($username) . "' LIMIT 1")) {
|
||||
return $row['user_id'];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function str_short($text, $max_length, $space = ' ')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue