summary refs log tree commit diff stats
path: root/includes/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/functions.php')
-rwxr-xr-xincludes/functions.php29
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
23require('headerproc.php'); 23require('headerproc.php');
24 24
25function isLoggedIn()
26{
27 return sess_exists('uname');
28}
29
30function 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
43function countRows($table, $extra = '') 25function 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
63function echoLogData() 45function 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
215function 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
223function getTags($id, $type = 'published') 198function 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 . "\"";