diff options
Diffstat (limited to 'includes/functions.php')
| -rwxr-xr-x | includes/functions.php | 29 |
1 files changed, 2 insertions, 27 deletions
| diff --git a/includes/functions.php b/includes/functions.php index 7c06077..16de184 100755 --- a/includes/functions.php +++ b/includes/functions.php | |||
| @@ -22,24 +22,6 @@ if (!defined('S_INCLUDE_FILE')) {define('S_INCLUDE_FILE',1);} | |||
| 22 | 22 | ||
| 23 | require('headerproc.php'); | 23 | require('headerproc.php'); |
| 24 | 24 | ||
| 25 | function isLoggedIn() | ||
| 26 | { | ||
| 27 | return sess_exists('uname'); | ||
| 28 | } | ||
| 29 | |||
| 30 | function getUserlevel() | ||
| 31 | { | ||
| 32 | if (isLoggedIn()) | ||
| 33 | { | ||
| 34 | $getuser = "SELECT * FROM users WHERE username = \"" . sess_get('uname') . "\""; | ||
| 35 | $getuser2 = mysql_query($getuser); | ||
| 36 | $getuser3 = mysql_fetch_array($getuser2); | ||
| 37 | return $getuser3['user_group']; | ||
| 38 | } else { | ||
| 39 | return 4; | ||
| 40 | } | ||
| 41 | } | ||
| 42 | |||
| 43 | function countRows($table, $extra = '') | 25 | function countRows($table, $extra = '') |
| 44 | { | 26 | { |
| 45 | $cntrows = "SELECT * FROM " . $table . " " . $extra; | 27 | $cntrows = "SELECT * FROM " . $table . " " . $extra; |
| @@ -62,7 +44,8 @@ function generateError($error) | |||
| 62 | 44 | ||
| 63 | function echoLogData() | 45 | function echoLogData() |
| 64 | { | 46 | { |
| 65 | if (!isLoggedIn()) { | 47 | if (!isLoggedIn()) |
| 48 | { | ||
| 66 | return('in'); | 49 | return('in'); |
| 67 | } else { | 50 | } else { |
| 68 | return('out'); | 51 | return('out'); |
| @@ -212,14 +195,6 @@ function updatePop($id, $area, $plus=1) | |||
| 212 | } | 195 | } |
| 213 | } | 196 | } |
| 214 | 197 | ||
| 215 | function verifyUser($username, $password) | ||
| 216 | { | ||
| 217 | $getuser = 'SELECT * FROM users WHERE username = "' . $username . '" AND user_password = "' . md5($password) . '"'; | ||
| 218 | $getuser2 = mysql_query($getuser); | ||
| 219 | $getuser3 = mysql_fetch_array($getuser2); | ||
| 220 | return (($_POST['username'] != '') && ($getuser3['username'] == $_POST['username'])); | ||
| 221 | } | ||
| 222 | |||
| 223 | function getTags($id, $type = 'published') | 198 | function getTags($id, $type = 'published') |
| 224 | { | 199 | { |
| 225 | $gettags = "SELECT * FROM tags WHERE post_id = " . $id . " AND post_type = \"" . $type . "\""; | 200 | $gettags = "SELECT * FROM tags WHERE post_id = " . $id . " AND post_type = \"" . $type . "\""; |
