From c2ba3eb804f75485bd43e4724124ea9816c0cd37 Mon Sep 17 00:00:00 2001 From: pioder Date: Sun, 3 May 2009 21:00:21 +0000 Subject: [PATCH] + Changed generating last post and post count in forum and topic.php + Deleted not used template file: post_add_body.tpl + Replaced MCP images git-svn-id: https://svn.pioder.pl/uf-svn/uF@21 72ec579a-5ced-4fa4-82f3-afba5d98df2f --- admin/admin_forums.php | 96 ++++++++--------- admin/admin_groups.php | 34 +++--- admin/admin_script.php | 4 +- admin/admin_users.php | 18 ++-- admin/banlist.php | 28 ++--- admin/censorlist.php | 20 ++-- admin/check_script.php | 4 +- admin/smilelist.php | 20 ++-- admin/styles.php | 8 +- common.php | 6 +- config.php | 4 +- forum.php | 7 +- groups.php | 6 +- includes/admin/class_forum.php | 2 +- includes/admin/class_main.php | 10 +- includes/cache/cache_forums.php | 12 +-- includes/cache/cache_index.php | 4 +- includes/cache/cache_topic.php | 8 +- includes/classes/class_forum.php | 6 +- includes/classes/class_mod.php | 28 ++--- includes/classes/class_pms.php | 8 +- includes/classes/class_posting.php | 30 +++--- includes/classes/class_topic.php | 22 ++-- includes/classes/class_user.php | 24 ++--- includes/classes/secure.php | 26 ++--- includes/constants.php | 23 +--- includes/db.php | 20 ++-- includes/emailer.php | 4 +- includes/errors.php | 4 +- includes/misc_functions.php | 99 ++++++++++++------ includes/pms/pms_folder.php | 4 +- includes/pms/pms_view.php | 8 +- includes/pms/pms_write.php | 2 +- includes/sessions.php | 10 +- index.php | 4 +- {install => install1}/config.php | 0 {install => install1}/functions_add.php | 2 +- {install => install1}/index.php | 18 ++-- {install => install1}/licence.html | 0 {install => install1}/tpls/index.html | 0 .../tpls/install_check_script.tpl | 0 {install => install1}/tpls/install_step4.tpl | 0 {install => install1}/tpls/install_step6.tpl | 0 {install => install1}/tpls/install_step8.tpl | 0 .../tpls/invalidfile_body.tpl | 0 {install => install1}/uf_tables.sql | 0 lngs/Polish/main.php | 1 + login.php | 8 +- moderate.php | 5 + posting.php | 2 +- register.php | 2 +- search.php | 10 +- shoutbox.php | 8 +- skins/subPurple/forum_body.tpl | 8 +- skins/subPurple/images/Thumbs.db | Bin 38912 -> 40448 bytes skins/subPurple/images/delete.gif | Bin 911 -> 1024 bytes skins/subPurple/images/lng_Polish/Thumbs.db | Bin 39936 -> 39936 bytes skins/subPurple/images/lock.gif | Bin 900 -> 1030 bytes skins/subPurple/images/move.gif | Bin 881 -> 1030 bytes skins/subPurple/images/stick.gif | Bin 910 -> 1061 bytes skins/subPurple/images/unlock.gif | Bin 890 -> 1031 bytes skins/subPurple/images/unstick.gif | Bin 899 -> 1099 bytes skins/subPurple/images/wyzz/Thumbs.db | Bin 8192 -> 8192 bytes skins/subPurple/post_add_body.tpl | 61 ----------- skins/subPurple/topic_mod_body.tpl | 4 +- skins/subPurple/topic_post_body.tpl | 7 +- topic.php | 3 +- user.php | 6 +- users.php | 4 +- warns.php | 4 +- 70 files changed, 371 insertions(+), 395 deletions(-) rename {install => install1}/config.php (100%) rename {install => install1}/functions_add.php (93%) rename {install => install1}/index.php (90%) rename {install => install1}/licence.html (100%) rename {install => install1}/tpls/index.html (100%) rename {install => install1}/tpls/install_check_script.tpl (100%) rename {install => install1}/tpls/install_step4.tpl (100%) rename {install => install1}/tpls/install_step6.tpl (100%) rename {install => install1}/tpls/install_step8.tpl (100%) rename {install => install1}/tpls/invalidfile_body.tpl (100%) rename {install => install1}/uf_tables.sql (100%) delete mode 100644 skins/subPurple/post_add_body.tpl diff --git a/admin/admin_forums.php b/admin/admin_forums.php index 2887aff..d894824 100644 --- a/admin/admin_forums.php +++ b/admin/admin_forums.php @@ -35,7 +35,7 @@ function GenerateDefaultDisplay() //cache forums --don't modify!!! $cache_id=1; $sql = "SELECT * FROM ".FORUMS_TABLE." ORDER BY `c_id`, `sort`"; - $query = DataBase::sql_query($sql,'CRITICAL','Could not obtain forum information.'); + $query = DataBase::sql_query($sql,CRITICAL,'Could not obtain forum information.'); while($result = DataBase::fetch($query)) { $forum[$cache_id]['f_id'] = $result['f_id']; @@ -58,7 +58,7 @@ function GenerateDefaultDisplay() include('./template/forums_beam_body.tpl'); //add forums and categories $sql = "SELECT * FROM `".CATS_TABLE."` ORDER BY `sort`"; - $query = DataBase::sql_query($sql,'CRITICAL','Could not obtain categories information.'); + $query = DataBase::sql_query($sql,CRITICAL,'Could not obtain categories information.'); while($result = DataBase::fetch($query)) { $skin = array( @@ -115,15 +115,15 @@ switch($_GET['mode']) { $cat_name = strip_tags($_POST['cat_name']); $sql = "SELECT `sort` FROM `".CATS_TABLE."` ORDER BY `sort` DESC LIMIT 1"; - $last = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain last category sort id')); + $last = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain last category sort id')); $sort = $last ['sort']; $sort = $sort+1; $sql = "SELECT `c_id` FROM `".CATS_TABLE."` ORDER BY `c_id` DESC LIMIT 1"; - $last = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain last category id')); + $last = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain last category id')); $last = $last['c_id']; $last = $last +1; $sql = "INSERT INTO `".CATS_TABLE."` VALUES ('$last','$cat_name','$sort')"; - DataBase::sql_query($sql,'GENERAL','Could not add category'); + DataBase::sql_query($sql,GENERAL,'Could not add category'); $msg='./template/blank.tpl'; admin_message_forum($lng['cat_saved'],'admin_forums.php'); } @@ -169,15 +169,15 @@ switch($_GET['mode']) $forum_lock = (isset($_POST['forum_locked'])) ? 1 : 0; $allow_moderate = (isset($_POST['allow_moderate'])) ? 1 : 0; $sql = "SELECT `sort`, `c_id` FROM `".FORUMS_TABLE."` WHERE `c_id`='$forum_cat' ORDER BY `sort` DESC LIMIT 1"; - $last = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain last forum sort id')); + $last = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain last forum sort id')); $sort = $last ['sort']; $sort = $sort+1; $sql = "SELECT `f_id` FROM `".FORUMS_TABLE."` ORDER BY `f_id` DESC LIMIT 1"; - $last = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain last forum id')); + $last = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain last forum id')); $last = $last['f_id']; $last = $last +1; - $sql = "INSERT INTO `".FORUMS_TABLE."` VALUES ('$last','$forum_lock','$allow_moderate', '$forum_name', '$forum_desc','$forum_cat','$sort')"; - DataBase::sql_query($sql,'GENERAL','Could not add forum'); + $sql = "INSERT INTO `".FORUMS_TABLE."` VALUES ('$last','$forum_lock','$allow_moderate', '$forum_name', '$forum_desc', '0', '','$forum_cat','$sort')"; + DataBase::sql_query($sql,GENERAL,'Could not add forum'); $msg='./../skins/'.$default_skin.'/blank.tpl'; admin_message_forum($lng['forum_saved'],'admin_forums.php'); } @@ -243,19 +243,19 @@ switch($_GET['mode']) { $i1 = $_GET['c']; $sql = "SELECT `sort`, `c_id` FROM ".CATS_TABLE." WHERE `c_id`='$i1'"; - $s1 = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain category information.')); + $s1 = DataBase::fetch(DataBase::sql_query($sql,CRITICAL,'Could not obtain category information.')); $s1 = $s1['sort']; $s2 = $s1 -1; if ($s1>1) { $sql = "SELECT `sort`, `c_id` FROM ".CATS_TABLE." WHERE `sort`='$s2'"; - $s2 = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain category information.')); + $s2 = DataBase::fetch(DataBase::sql_query($sql,CRITICAL,'Could not obtain category information.')); $i2 = $s2['c_id']; $s2 = $s2['sort']; $sql = "UPDATE ".CATS_TABLE." SET `sort`='$s2' WHERE `c_id`='$i1'"; - DataBase::sql_query($sql,'GENERAL','Could not update category position'); + DataBase::sql_query($sql,GENERAL,'Could not update category position'); $sql = "UPDATE ".CATS_TABLE." SET `sort`='$s1' WHERE `c_id`='$i2'"; - DataBase::sql_query($sql,'GENERAL','Could not update category position'); + DataBase::sql_query($sql,GENERAL,'Could not update category position'); } } break; @@ -266,20 +266,20 @@ switch($_GET['mode']) { $i1 = $_GET['f']; $sql = "SELECT `sort`, `c_id`, `f_id` FROM ".FORUMS_TABLE." WHERE `f_id`='$i1'"; - $s1 = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain forum information.')); + $s1 = DataBase::fetch(DataBase::sql_query($sql,CRITICAL,'Could not obtain forum information.')); $cid = $s1['c_id']; $s1 = $s1['sort']; $s2 = $s1 -1; if ($s1>1) { $sql = "SELECT `sort`, `c_id`, `f_id` FROM ".FORUMS_TABLE." WHERE `sort`='$s2' AND `c_id`='$cid'"; - $s2 = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not forum forum information.')); + $s2 = DataBase::fetch(DataBase::sql_query($sql,CRITICAL,'Could not forum forum information.')); $i2 = $s2['f_id']; $s2 = $s2['sort']; $sql = "UPDATE ".FORUMS_TABLE." SET `sort`='$s2' WHERE `f_id`='$i1'"; - DataBase::sql_query($sql,'GENERAL','Could not update forum position'); + DataBase::sql_query($sql,GENERAL,'Could not update forum position'); $sql = "UPDATE ".FORUMS_TABLE." SET `sort`='$s1' WHERE `f_id`='$i2'"; - DataBase::sql_query($sql,'GENERAL','Could not update forum position'); + DataBase::sql_query($sql,GENERAL,'Could not update forum position'); } } break; @@ -306,21 +306,21 @@ switch($_GET['mode']) $i1 = $_GET['c']; $i2 = $i1 +1; $sql = "SELECT `sort`, `c_id` FROM ".CATS_TABLE." WHERE `c_id`='$i1'"; - $s1 = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain category information.')); + $s1 = DataBase::fetch(DataBase::sql_query($sql,CRITICAL,'Could not obtain category information.')); $s1 = $s1['sort']; $s2 = $s1 +1; $sql = "SELECT `c_id` FROM ".CATS_TABLE; - $count = DataBase::num_rows(DataBase::sql_query($sql,'CRITICAL','Could not obtain category information.')); + $count = DataBase::num_rows(DataBase::sql_query($sql,CRITICAL,'Could not obtain category information.')); if ($s1<$count) { $sql = "SELECT `sort`, `c_id` FROM ".CATS_TABLE." WHERE `sort`='$s2'"; - $s2 = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain category information.')); + $s2 = DataBase::fetch(DataBase::sql_query($sql,CRITICAL,'Could not obtain category information.')); $i2 = $s2['c_id']; $s2 = $s2['sort']; $sql = "UPDATE ".CATS_TABLE." SET `sort`='$s2' WHERE `c_id`='$i1'"; - DataBase::sql_query($sql,'GENERAL','Could not update category position'); + DataBase::sql_query($sql,GENERAL,'Could not update category position'); $sql = "UPDATE ".CATS_TABLE." SET `sort`='$s1' WHERE `c_id`='$i2'"; - DataBase::sql_query($sql,'GENERAL','Could not update category position'); + DataBase::sql_query($sql,GENERAL,'Could not update category position'); } } break; @@ -332,22 +332,22 @@ switch($_GET['mode']) $i1 = $_GET['f']; $i2 = $i1 +1; $sql = "SELECT `sort`, `c_id`, `f_id` FROM ".FORUMS_TABLE." WHERE `f_id`='$i1'"; - $s1 = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain forum information.')); + $s1 = DataBase::fetch(DataBase::sql_query($sql,CRITICAL,'Could not obtain forum information.')); $cid = $s1['c_id']; $s1 = $s1['sort']; $s2 = $s1 +1; $sql = "SELECT `f_id` FROM ".FORUMS_TABLE." WHERE `c_id`='$cid'"; - $count = DataBase::num_rows(DataBase::sql_query($sql,'CRITICAL','Could not obtain forum information.')); + $count = DataBase::num_rows(DataBase::sql_query($sql,CRITICAL,'Could not obtain forum information.')); if ($s1<$count) { $sql = "SELECT `sort`, `f_id` FROM ".FORUMS_TABLE." WHERE `sort`='$s2'"; - $s2 = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain forum information.')); + $s2 = DataBase::fetch(DataBase::sql_query($sql,CRITICAL,'Could not obtain forum information.')); $i2 = $s2['f_id']; $s2 = $s2['sort']; $sql = "UPDATE ".FORUMS_TABLE." SET `sort`='$s2' WHERE `f_id`='$i1'"; - DataBase::sql_query($sql,'GENERAL','Could not update forum position'); + DataBase::sql_query($sql,GENERAL,'Could not update forum position'); $sql = "UPDATE ".FORUMS_TABLE." SET `sort`='$s1' WHERE `f_id`='$i2'"; - DataBase::sql_query($sql,'GENERAL','Could not update forum position'); + DataBase::sql_query($sql,GENERAL,'Could not update forum position'); } } break; @@ -368,32 +368,32 @@ switch($_GET['mode']) { $cid = intval($_GET['c']); $sql = "SELECT * FROM `".CATS_TABLE."` WHERE `c_id`='$cid'"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain category information'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain category information'); $result = DataBase::fetch($query); $sort = $result['sort']; $sql = "SELECT * FROM `".CATS_TABLE."` WHERE `sort`>'$sort'"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain categories information'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain categories information'); while($item = DataBase::fetch($query)) { $new_sort = $item['sort']-1; $cid2 = $item['c_id']; $sql2 = "UPDATE `".CATS_TABLE."` SET `sort`='$new_sort' WHERE `c_id`='$cid2'"; - DataBase::sql_query($sql,'GENERAL','Could not update category'); + DataBase::sql_query($sql,GENERAL,'Could not update category'); } $sql = "SELECT `f_id` FROM `".FORUMS_TABLE."` WHERE `c_id`='$cid'"; - $query = DataBase::sql_query($sql, 'GENERAL','Could not obtain forum information.'); + $query = DataBase::sql_query($sql, GENERAL,'Could not obtain forum information.'); while($item = DataBase::fetch($query)) { $fid = $item['f_id']; $sql="DELETE FROM `".POSTS_TABLE."` WHERE `f_id`='$fid'"; - DataBase::sql_query($sql, 'GENERAL','Could not delete post.'); + DataBase::sql_query($sql, GENERAL,'Could not delete post.'); $sql = "DELETE FROM `".TOPICS_TABLE."` WHERE `f_id`='$fid'"; - DataBase::sql_query($sql, 'GENERAL','Could not delete topic'); + DataBase::sql_query($sql, GENERAL,'Could not delete topic'); } $sql = "DELETE FROM `".FORUMS_TABLE."` WHERE `c_id`='$cid'"; - DataBase::sql_query($sql, 'GENERAL','Could not delete topic'); + DataBase::sql_query($sql, GENERAL,'Could not delete topic'); $sql = "DELETE FROM `".CATS_TABLE."` WHERE `c_id`='$cid'"; - DataBase::sql_query($sql,'GENERAL','Could not delete category.'); + DataBase::sql_query($sql,GENERAL,'Could not delete category.'); } } case 'forum': @@ -402,24 +402,24 @@ switch($_GET['mode']) { $fid = intval($_GET['f']); $sql = "SELECT * FROM `".FORUMS_TABLE."` WHERE `f_id`='$fid'"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain forum information'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain forum information'); $result = DataBase::fetch($query); $sort = $result['sort']; $sql = "SELECT * FROM `".FORUMS_TABLE."` WHERE `sort`>'$sort'"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain forums information'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain forums information'); while($item = DataBase::fetch($query)) { $new_sort = $item['sort']-1; $fid1 = $item['f_id']; $sql2 = "UPDATE `".FORUMS_TABLE."` SET `sort`='$new_sort' WHERE `f_id`='$fid1'"; - DataBase::sql_query($sql,'GENERAL','Could not update forum'); + DataBase::sql_query($sql,GENERAL,'Could not update forum'); } $sql="DELETE FROM `".POSTS_TABLE."` WHERE `f_id`='$fid'"; - DataBase::sql_query($sql, 'GENERAL','Could not delete post.'); + DataBase::sql_query($sql, GENERAL,'Could not delete post.'); $sql = "DELETE FROM `".TOPICS_TABLE."` WHERE `f_id`='$fid'"; - DataBase::sql_query($sql, 'GENERAL','Could not delete topic'); + DataBase::sql_query($sql, GENERAL,'Could not delete topic'); $sql = "DELETE FROM `".FORUMS_TABLE."` WHERE `f_id`='$fid'"; - DataBase::sql_query($sql, 'GENERAL','Could not delete forum'); + DataBase::sql_query($sql, GENERAL,'Could not delete forum'); } } } @@ -439,11 +439,11 @@ switch($_GET['mode']) { $cat_name = strip_tags($_POST['cat_name']); $sql = "SELECT `sort`, `c_id` FROM `".FORUMS_TABLE."` WHERE `c_id`='$cat_name' ORDER BY `sort` DESC LIMIT 1"; - $last = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain last forum sort id')); + $last = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain last forum sort id')); $sort = $last ['sort']; $sort = $sort+1; $sql = "UPDATE `".CATS_TABLE."` SET `name`='$cat_name', `sort`='$sort' WHERE `c_id`='$cid'"; - DataBase::sql_query($sql,'GENERAL','Could not update category'); + DataBase::sql_query($sql,GENERAL,'Could not update category'); $msg='./../skins/'.$default_skin.'/blank.tpl'; admin_message_forum($lng['cat_saved'],'admin_forums.php'); } @@ -455,7 +455,7 @@ switch($_GET['mode']) } else { - $tmp = DataBase::fetch(DataBase::sql_query("SELECT `name` FROM `".CATS_TABLE."` WHERE `c_id`='$cid'",'GENERAL','Could not obtain category information')); + $tmp = DataBase::fetch(DataBase::sql_query("SELECT `name` FROM `".CATS_TABLE."` WHERE `c_id`='$cid'",GENERAL,'Could not obtain category information')); $tmp = $tmp['name']; $_POST['cat_name'] = $tmp; if($tmp['name']=='') @@ -495,14 +495,14 @@ switch($_GET['mode']) $forum_desc = strip_tags($_POST['forum_desc']); $forum_cat = $_POST['forum_cat']; $sql = "SELECT * FROM `".FORUMS_TABLE."` WHERE `f_id`='$fid'"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain forum information'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain forum information'); $result = DataBase::fetch($query); $actual_cid = $result['c_id']; $sort = $result['sort']; if ($actual_cid != $forum_cat) { $sql = "SELECT * FROM `".FORUMS_TABLE."` WHERE `c_id`='$forum_cat' ORDER BY `sort` DESC LIMIT 1"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain forums information'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain forums information'); $result = DataBase::fetch($query); $sort = $result['sort']+1; } @@ -517,7 +517,7 @@ switch($_GET['mode']) `c_id`='$forum_cat', `sort`='$sort' WHERE `f_id`='$fid'"; - DataBase::sql_query($sql,'GENERAL','Could not update forum'); + DataBase::sql_query($sql,GENERAL,'Could not update forum'); $msg='./../skins/'.$default_skin.'/blank.tpl'; admin_message_forum($lng['forum_saved'],'admin_forums.php'); } @@ -535,7 +535,7 @@ switch($_GET['mode']) } else { - $tmp = DataBase::fetch(DataBase::sql_query("SELECT `name`, `desc` FROM `".FORUMS_TABLE."` WHERE `f_id`='$fid'",'GENERAL','Could not obtain forum information')); + $tmp = DataBase::fetch(DataBase::sql_query("SELECT `name`, `desc` FROM `".FORUMS_TABLE."` WHERE `f_id`='$fid'",GENERAL,'Could not obtain forum information')); $_POST['forum_name'] = $tmp['name']; $msg='./../skins/'.$default_skin.'/blank.tpl'; $_POST['forum_desc'] = $tmp['desc']; diff --git a/admin/admin_groups.php b/admin/admin_groups.php index 8c995e9..fb69724 100644 --- a/admin/admin_groups.php +++ b/admin/admin_groups.php @@ -41,7 +41,7 @@ function GenerateDefaultDisplay() Admin_Over::GenerateHeader(); include('./template/groups_beam_body.tpl'); $sql = "SELECT `g_id`, `name`, `desc` FROM `".GROUPS_TABLE."` ORDER BY `sort`"; - $query = DataBase::sql_query($sql, 'GENERAL', 'Could not obtain groups information.'); + $query = DataBase::sql_query($sql, GENERAL, 'Could not obtain groups information.'); while($item = DataBase::fetch($query)) { $skin = array( @@ -69,9 +69,9 @@ switch($_GET['mode']) $gid = $_GET['id']; Secure::group_exists($gid); $sql = "DELETE FROM ".GROUPS_TABLE." WHERE `g_id`='$gid'"; - DataBase::sql_query($sql,'GENERAL','Could not delete group.'); + DataBase::sql_query($sql,GENERAL,'Could not delete group.'); $sql = "DELETE FROM ".USERS_GROUP_TABLE." WHERE `g_id`='$gid'"; - DataBase::sql_query($sql,'GENERAL','Could users in group.'); + DataBase::sql_query($sql,GENERAL,'Could users in group.'); GenerateDefaultDisplay(); break; } @@ -88,15 +88,15 @@ switch($_GET['mode']) $group_desc = htmlspecialchars($_POST['group_desc']); $group_mod = User::UserIdByNick(htmlspecialchars($_POST['group_mod'])); $result = DataBase::fetch(DataBase::sql_query("SELECT `sort` FROM `".GROUPS_TABLE."` - ORDER BY `sort` DESC LIMIT 1",'GENERAL','Could not obtain last category sort id')); + ORDER BY `sort` DESC LIMIT 1",GENERAL,'Could not obtain last category sort id')); $group_sort = $result['sort']; $group_sort = $group_sort+1; $result = DataBase::fetch(DataBase::sql_query("SELECT - `g_id` FROM ".GROUPS_TABLE." ORDER BY `g_id` DESC LIMIT 1",'GENERAL','Could not obtain last group id.')); + `g_id` FROM ".GROUPS_TABLE." ORDER BY `g_id` DESC LIMIT 1",GENERAL,'Could not obtain last group id.')); $group_id = $result['g_id']; $group_id = $group_id+1; $sql = "INSERT INTO ".GROUPS_TABLE." VALUES ('$group_id', '$group_name', '$group_desc', '$group_mod', '$group_sort')"; - DataBase::sql_query($sql, 'GENERAL', 'Could not add group'); + DataBase::sql_query($sql, GENERAL, 'Could not add group'); unset($group_name, $group_desc, $group_mod, $group_id); admin_message_forum($lng['group_saved'],'admin_groups.php'); } @@ -148,7 +148,7 @@ switch($_GET['mode']) `desc` = '$group_desc', `m_id` = '$group_mod' WHERE `g_id` = '$group_id'"; - DataBase::sql_query($sql, 'GENERAL', 'Could not update group'); + DataBase::sql_query($sql, GENERAL, 'Could not update group'); unset($group_name, $group_desc, $group_mod, $group_id); admin_message_forum($lng['group_saved'],'admin_groups.php'); } @@ -161,7 +161,7 @@ switch($_GET['mode']) else { $sql = "SELECT * FROM `".GROUPS_TABLE."` WHERE `g_id`='$gid'"; - $g = DataBase::fetch(DataBase::sql_query($sql, 'GENERAL','Could not obtain group information.')); + $g = DataBase::fetch(DataBase::sql_query($sql, GENERAL,'Could not obtain group information.')); $_POST['group_name'] = $g['name']; $_POST['group_desc'] = $g['desc']; $_POST['group_mod'] = User::UserInformation($g['m_id'],'nick'); @@ -188,19 +188,19 @@ switch($_GET['mode']) { $i1 = intval($_GET['id']); $sql = "SELECT `sort`, `g_id` FROM ".GROUPS_TABLE." WHERE `g_id`='$i1'"; - $s1 = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain group information.')); + $s1 = DataBase::fetch(DataBase::sql_query($sql,CRITICAL,'Could not obtain group information.')); $s1 = $s1['sort']; $s2 = $s1 -1; if ($s1>1) { $sql = "SELECT `sort`, `g_id` FROM ".GROUPS_TABLE." WHERE `sort`='$s2'"; - $s2 = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain group information.')); + $s2 = DataBase::fetch(DataBase::sql_query($sql,CRITICAL,'Could not obtain group information.')); $i2 = $s2['g_id']; $s2 = $s2['sort']; $sql = "UPDATE ".GROUPS_TABLE." SET `sort`='$s2' WHERE `g_id`='$i1'"; - DataBase::sql_query($sql,'GENERAL','Could not update group position'); + DataBase::sql_query($sql,GENERAL,'Could not update group position'); $sql = "UPDATE ".GROUPS_TABLE." SET `sort`='$s1' WHERE `g_id`='$i2'"; - DataBase::sql_query($sql,'GENERAL','Could not update group position'); + DataBase::sql_query($sql,GENERAL,'Could not update group position'); } } GenerateDefaultDisplay(); @@ -213,21 +213,21 @@ switch($_GET['mode']) $i1 = intval($_GET['id']); $i2 = $i1 +1; $sql = "SELECT `sort`, `g_id` FROM ".GROUPS_TABLE." WHERE `g_id`='$i1'"; - $s1 = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain group information.')); + $s1 = DataBase::fetch(DataBase::sql_query($sql,CRITICAL,'Could not obtain group information.')); $s1 = $s1['sort']; $s2 = $s1 +1; $sql = "SELECT `g_id` FROM ".GROUPS_TABLE; - $count = DataBase::num_rows(DataBase::sql_query($sql,'CRITICAL','Could not obtain group information.')); + $count = DataBase::num_rows(DataBase::sql_query($sql,CRITICAL,'Could not obtain group information.')); if ($s1<$count) { $sql = "SELECT `sort`, `g_id` FROM ".GROUPS_TABLE." WHERE `sort`='$s2'"; - $s2 = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain group information.')); + $s2 = DataBase::fetch(DataBase::sql_query($sql,CRITICAL,'Could not obtain group information.')); $i2 = $s2['g_id']; $s2 = $s2['sort']; $sql = "UPDATE ".GROUPS_TABLE." SET `sort`='$s2' WHERE `g_id`='$i1'"; - DataBase::sql_query($sql,'GENERAL','Could not update group position'); + DataBase::sql_query($sql,GENERAL,'Could not update group position'); $sql = "UPDATE ".GROUPS_TABLE." SET `sort`='$s1' WHERE `g_id`='$i2'"; - DataBase::sql_query($sql,'GENERAL','Could not update group position'); + DataBase::sql_query($sql,GENERAL,'Could not update group position'); } } GenerateDefaultDisplay(); diff --git a/admin/admin_script.php b/admin/admin_script.php index 6e27bf2..7da8154 100644 --- a/admin/admin_script.php +++ b/admin/admin_script.php @@ -33,7 +33,7 @@ function AddSkins() { global $forum_config; $all=''; - $query = DataBase::sql_query("SELECT `name`, `s_id` FROM `".SKINS_TABLE."`",'GENERAL','Could not obtain skins information'); + $query = DataBase::sql_query("SELECT `name`, `s_id` FROM `".SKINS_TABLE."`",GENERAL,'Could not obtain skins information'); while($t = DataBase::fetch($query)) { @@ -294,7 +294,7 @@ if (isset($_POST['forum_path'])) for($i=0;$i<$count_o;$i++) { $sql = "UPDATE `".CONFIG_TABLE."` SET `value`='".$value[$i]."' WHERE `name`='".$name[$i]."'"; - DataBase::sql_query($sql, 'GENERAL', 'Could not update script config'); + DataBase::sql_query($sql, GENERAL, 'Could not update script config'); } //end... unset($name, $value, $count_o, $sql); diff --git a/admin/admin_users.php b/admin/admin_users.php index d6f3c2f..dbc6ece 100644 --- a/admin/admin_users.php +++ b/admin/admin_users.php @@ -44,27 +44,27 @@ switch($_GET['mode']) //delete from users table $sql = "DELETE FROM ".USERS_TABLE." WHERE `u_id`='$uid'"; - DataBase::sql_query($sql,'GENERAL','Could not delete user.'); + DataBase::sql_query($sql,GENERAL,'Could not delete user.'); //delete from PM SentBox table $sql = "DELETE FROM ".PM_SENTBOX_TABLE." WHERE `u_n_id`='$uid'"; - DataBase::sql_query($sql,'GENERAL','Could not delete user sentbox messages.'); + DataBase::sql_query($sql,GENERAL,'Could not delete user sentbox messages.'); //update PM InBox table -> change u_n_id to Anonymous $sql = "UPDATE ".PM_INBOX_TABLE." SET `u_n_id`='-1' WHERE `u_n_id`='$uid'"; - DataBase::sql_query($sql,'GENERAL','Could not update user inbox messages.'); + DataBase::sql_query($sql,GENERAL,'Could not update user inbox messages.'); //update user posts -> change u_id to Anonymous $sql = "UPDATE ".POSTS_TABLE." SET `u_id`='-1' WHERE `u_id`='$uid'"; - DataBase::sql_query($sql,'GENERAL','Could edit post.'); + DataBase::sql_query($sql,GENERAL,'Could edit post.'); //update shoutbox messages -> change u_id to Anonymous $sql = "UPDATE ".SHOUTBOX_TABLE." SET `u_id`='-1' WHERE `u_id`='$uid'"; - DataBase::sql_query($sql,'GENERAL','Could edit shoutbox messages.'); + DataBase::sql_query($sql,GENERAL,'Could edit shoutbox messages.'); //update user topics -> change u_id to Anonymous $sql = "UPDATE ".TOPICS_TABLE." SET `author`='-1' WHERE `author`='$uid'"; - DataBase::sql_query($sql,'GENERAL','Could edit post.'); + DataBase::sql_query($sql,GENERAL,'Could edit post.'); //back to admin users admin_message_forum($lng['user_deleted'],'admin_users.php'); @@ -196,7 +196,7 @@ switch($_GET['mode']) } } $sql = "SELECT * FROM ".USERS_TABLE." WHERE `u_id`='$uid'"; - $userinfo = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain user information')); + $userinfo = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain user information')); if ($userinfo['rank']=='') { admin_message_forum($lng['no_user'],'admin_users.php?mode=view'); @@ -297,7 +297,7 @@ switch($_GET['mode']) $page=1; } $count = DataBase::fetch(DataBase::sql_query("SELECT COUNT(`u_id`) as `u_id` - FROM ".USERS_TABLE,'GENERAL','Could not obtain count amout of users')); + FROM ".USERS_TABLE,GENERAL,'Could not obtain count amout of users')); $count = $count['u_id']; $count = ceil($count /30); if(isset($_GET['page']) && ($_GET['page']>$count)) @@ -428,7 +428,7 @@ switch($_GET['mode']) break; } } - $query = DataBase::sql_query($sql,'CRITICAL','Could not obtain user information.'); + $query = DataBase::sql_query($sql,CRITICAL,'Could not obtain user information.'); while($result = DataBase::fetch($query)) { $skin = array( diff --git a/admin/banlist.php b/admin/banlist.php index 5af7d2b..7ab6712 100644 --- a/admin/banlist.php +++ b/admin/banlist.php @@ -67,7 +67,7 @@ switch($_GET['mode']) } $ban_motive = strip_tags($_POST['motive']); $sql = "INSERT INTO ".BANLIST_TABLE." VALUES ('', '$ban_uid', '$ban_ip', '$ban_motive')"; - DataBase::sql_query($sql,'GENERAL','Could not update add ban.'); + DataBase::sql_query($sql,GENERAL,'Could not update add ban.'); admin_message_forum($lng['ban_added'],'banlist.php?mode=view'); } else @@ -114,12 +114,12 @@ switch($_GET['mode']) message_forum($lng['no_ban_me'],'banlist.php?mode=view'); } $bid =$bid = DataBase::fetch(DataBase::sql_query("SELECT - `b_id` FROM ".BANLIST_TABLE." ORDER BY `b_id` DESC",'GENERAL', + `b_id` FROM ".BANLIST_TABLE." ORDER BY `b_id` DESC",GENERAL, 'Could not obtain last ban id')); $bid = $bid['b_id']; $bid = $bid +1; $sql = "INSERT INTO ".BANLIST_TABLE." VALUES ('$bid', '$ban_uid', '$ban_ip', '$ban_motive')"; - DataBase::sql_query($sql,'GENERAL','Could not update add ban.'); + DataBase::sql_query($sql,GENERAL,'Could not update add ban.'); admin_message_forum($lng['ban_added'],'banlist.php?mode=view'); } else @@ -168,12 +168,12 @@ switch($_GET['mode']) message_forum($lng['no_ban_me'],'banlist.php?mode=view'); } $bid =$bid = DataBase::fetch(DataBase::sql_query("SELECT - `b_id` FROM ".BANLIST_TABLE." ORDER BY `b_id` DESC",'GENERAL', + `b_id` FROM ".BANLIST_TABLE." ORDER BY `b_id` DESC",GENERAL, 'Could not obtain last ban id')); $bid = $bid['b_id']; $bid = $bid +1; $sql = "INSERT INTO ".BANLIST_TABLE." VALUES ('$bid', '$ban_uid', '$ban_ip', '$ban_motive')"; - DataBase::sql_query($sql,'GENERAL','Could not update add ban.'); + DataBase::sql_query($sql,GENERAL,'Could not update add ban.'); admin_message_forum($lng['ban_added'],'banlist.php?mode=view'); } else @@ -209,13 +209,13 @@ switch($_GET['mode']) $catalog = '../tmp/'; if(!move_uploaded_file($_FILES['file']['tmp_name'], $catalog.$_FILES['file']['name'])) { - message_die('GENERAL','Could not upload file.',''); + message_die(GENERAL,'Could not upload file.',''); } $open = fopen($catalog.$_FILES['file']['name'],'r'); $file = fread($open, filesize($catalog.$_FILES['file']['name'])); $item = @explode("\n",$file); $bid = $bid = DataBase::fetch(DataBase::sql_query("SELECT - `b_id` FROM ".BANLIST_TABLE." ORDER BY `b_id` DESC",'GENERAL', + `b_id` FROM ".BANLIST_TABLE." ORDER BY `b_id` DESC",GENERAL, 'Could not obtain last ban id')); $bid = $bid['b_id']; $bid = $bid +1; @@ -223,7 +223,7 @@ switch($_GET['mode']) { $ban_ip = $item[$i]; $sql = "INSERT INTO ".BANLIST_TABLE." VALUES ('$bid', '$ban_uid', '$ban_ip', '$ban_motive')"; - DataBase::sql_query($sql,'GENERAL','Could not update add ban.'); + DataBase::sql_query($sql,GENERAL,'Could not update add ban.'); $bid = $bid +1; } admin_message_forum($lng['ban_added'],'banlist.php?mode=view'); @@ -255,7 +255,7 @@ switch($_GET['mode']) { $bid = $_GET['id']; $sql = "DELETE FROM ".BANLIST_TABLE." WHERE `b_id`='$bid'"; - DataBase::sql_query($sql,'GENERAL','Could not delete banlist item.'); + DataBase::sql_query($sql,GENERAL,'Could not delete banlist item.'); admin_message_forum($lng['ban_deleted'],'banlist.php?mode=view'); break; } @@ -288,14 +288,14 @@ switch($_GET['mode']) `u_id`='$ban_uid', `motive`='$ban_motive' WHERE `b_id`='$bid'"; - DataBase::sql_query($sql,'GENERAL','Could not update ban.'); + DataBase::sql_query($sql,GENERAL,'Could not update ban.'); admin_message_forum($lng['ban_edited'],'banlist.php?mode=view'); } else { $bid = $_GET['id']; $sql = "SELECT * FROM ".BANLIST_TABLE." WHERE `b_id`='$bid'"; - $query = DataBase::sql_query($sql,'CRITICAL','Could not obtain banlist item information'); + $query = DataBase::sql_query($sql,CRITICAL,'Could not obtain banlist item information'); $result = DataBase::fetch($query); $_POST['ip']=$result['IP']; $_POST['motive'] = $result['motive']; @@ -321,18 +321,18 @@ switch($_GET['mode']) case 'clear': { $sql = "TRUNCATE `".BANLIST_TABLE."`"; - DataBase::sql_query($sql, 'GENERAL','Could not empty banlist'); + DataBase::sql_query($sql, GENERAL,'Could not empty banlist'); admin_message_forum($lng['banlist_cleanout'],'banlist.php?mode=view'); } case 'view': { - $query = DataBase::sql_query("SELECT `u_id`, `nick` FROM ".USERS_TABLE,'GENERAL','Could not obtain user information'); + $query = DataBase::sql_query("SELECT `u_id`, `nick` FROM ".USERS_TABLE,GENERAL,'Could not obtain user information'); while($result = DataBase::fetch($query)) { $user[$result['u_id']]['nick'] = $result['nick']; } $sql = "SELECT * FROM ".BANLIST_TABLE.""; - $query = DataBase::sql_query($sql,'CRITICAL','Could not obtain banlist items'); + $query = DataBase::sql_query($sql,CRITICAL,'Could not obtain banlist items'); $skin=array( 'L.banlist'=>$lng['admin_banlist'], 'L.select_mode'=>$lng['what_do_you_want'], diff --git a/admin/censorlist.php b/admin/censorlist.php index 128da68..4576255 100644 --- a/admin/censorlist.php +++ b/admin/censorlist.php @@ -45,19 +45,19 @@ switch($_GET['mode']) $catalog = '../tmp/'; if(!move_uploaded_file($_FILES['file']['tmp_name'], $catalog.$_FILES['file']['name'])) { - message_die('GENERAL','Could not upload file.',''); + message_die(GENERAL,'Could not upload file.',''); } $open = fopen($catalog.$_FILES['file']['name'],'r'); $file = fread($open, filesize($catalog.$_FILES['file']['name'])); $item = @explode(',',$file); $sql = "SELECT `w_id` FROM ".CENSORLIST_TABLE." ORDER BY `w_id` DESC"; - $last = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain last word id')); + $last = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain last word id')); $last = $last['w_id']; $last= $last +1; for($i=0;$i$lng['admin_censorlist'], 'L.view_all_words'=>$lng['view_all_words'] diff --git a/admin/check_script.php b/admin/check_script.php index 7ab980f..d619550 100644 --- a/admin/check_script.php +++ b/admin/check_script.php @@ -47,7 +47,7 @@ function check_size_md5($file) function mysqlversion() { $temp = ''; - $result = DataBase::fetch(DataBase::sql_query("SELECT VERSION() AS mysql_version",'GENERAL','Could not read mysql version.')); + $result = DataBase::fetch(DataBase::sql_query("SELECT VERSION() AS mysql_version",GENERAL,'Could not read mysql version.')); $result = $result['mysql_version']; for($i=0;$i<5;$i++) { @@ -62,7 +62,7 @@ function db_size() { $sql = "SHOW TABLE STATUS"; $db_size = 0; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain database size'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain database size'); while ($result = DataBase::fetch($query)) { $db_size += $result['Index_length']; diff --git a/admin/smilelist.php b/admin/smilelist.php index e536392..c8f2a74 100644 --- a/admin/smilelist.php +++ b/admin/smilelist.php @@ -48,14 +48,14 @@ switch($_GET['mode']) if (isset($_POST['word'],$_POST['url'])) { $sql = "SELECT * FROM ".SMILES_TABLE." ORDER BY `s_id` DESC LIMIT 1"; - $query = DataBase::sql_query($sql,'CRITICAL','Could not obtain smilelist item information'); + $query = DataBase::sql_query($sql,CRITICAL,'Could not obtain smilelist item information'); $result = DataBase::fetch($query); $smile_id = $result['s_id']; $smile_id = $smile_id +1; $smile_word = strip_tags($_POST['word']); $smile_url = strip_tags($_POST['url']); $sql = "INSERT INTO ".SMILES_TABLE." VALUES('$smile_id','$smile_word','$smile_url')"; - DataBase::sql_query($sql,'GENERAL','Could not add smile.'); + DataBase::sql_query($sql,GENERAL,'Could not add smile.'); admin_message_forum($lng['smile_added'],'smilelist.php?mode=view'); } else @@ -87,13 +87,13 @@ switch($_GET['mode']) $catalog = '../tmp/'; if(!move_uploaded_file($_FILES['file']['tmp_name'], $catalog.$_FILES['file']['name'])) { - message_die('GENERAL','Could not upload file.',''); + message_die(GENERAL,'Could not upload file.',''); } $open = @fopen($catalog.$_FILES['file']['name'],'r'); $file = @fread($open, filesize($catalog.$_FILES['file']['name'])); $item = @explode("\n",$file); $bid = $bid = DataBase::fetch(DataBase::sql_query("SELECT - `s_id` FROM ".SMILES_TABLE." ORDER BY `s_id` DESC",'GENERAL', + `s_id` FROM ".SMILES_TABLE." ORDER BY `s_id` DESC",GENERAL, 'Could not obtain last smile id')); $sid = $sid['s_id']; $sid = $sid +1; @@ -103,7 +103,7 @@ switch($_GET['mode']) $smile_word = $subitem[0]; $smile_url = $subitem[1]; $sql = "INSERT INTO ".SMILES_TABLE." VALUES ('$sid', '$smile_word', '$smile_url')"; - DataBase::sql_query($sql,'GENERAL','Could not add smile.'); + DataBase::sql_query($sql,GENERAL,'Could not add smile.'); $sid = $bid +1; } admin_message_forum($lng['smiles_added'],'smilelist.php?mode=view'); @@ -133,7 +133,7 @@ switch($_GET['mode']) { $sid = $_GET['id']; $sql = "DELETE FROM ".SMILES_TABLE." WHERE `s_id`='$sid'"; - DataBase::sql_query($sql,'GENERAL','Could not delete smilelist item.'); + DataBase::sql_query($sql,GENERAL,'Could not delete smilelist item.'); admin_message_forum($lng['smile_deleted'],'smilelist.php?mode=view'); break; } @@ -149,14 +149,14 @@ switch($_GET['mode']) `smile`='$smile_word', `url`='$smile_url' WHERE `s_id`='$smile_id'"; - DataBase::sql_query($sql,'GENERAL','Could not update smile.'); + DataBase::sql_query($sql,GENERAL,'Could not update smile.'); admin_message_forum($lng['smile_edited'],'smilelist.php?mode=view'); } else { $sid = intval($_GET['id']); $sql = "SELECT * FROM ".SMILES_TABLE." WHERE `s_id`='$sid'"; - $query = DataBase::sql_query($sql,'CRITICAL','Could not obtain smilelist item information'); + $query = DataBase::sql_query($sql,CRITICAL,'Could not obtain smilelist item information'); $result = DataBase::fetch($query); if ($result['s_id']=='') { @@ -182,13 +182,13 @@ switch($_GET['mode']) case 'clear': { $sql = "TRUNCATE `".SMILES_TABLE."`"; - DataBase::sql_query($sql, 'GENERAL','Could not empty smilelist'); + DataBase::sql_query($sql, GENERAL,'Could not empty smilelist'); admin_message_forum($lng['smilelist_cleanout'],'smilelist.php?mode=view'); } case 'view': { $sql = "SELECT * FROM ".SMILES_TABLE.""; - $query = DataBase::sql_query($sql,'CRITICAL','Could not obtain smilelist items'); + $query = DataBase::sql_query($sql,CRITICAL,'Could not obtain smilelist items'); $skin=array( 'L.smilelist'=>$lng['admin_smilelist'], 'L.select_mode'=>$lng['what_do_you_want'], diff --git a/admin/styles.php b/admin/styles.php index d2523fe..12a843e 100644 --- a/admin/styles.php +++ b/admin/styles.php @@ -44,9 +44,9 @@ switch($_GET['mode']) if ($sid!=$forum_config['defaultskin']) { $sql = "DELETE FROM ".SKINS_TABLE." WHERE `s_id`='$sid'"; - DataBase::sql_query($sql,'GENERAL','Could not delete skin'); + DataBase::sql_query($sql,GENERAL,'Could not delete skin'); $sql = "UPDATE ".USERS_TABLE." SET `skin`='".$forum_config['defaultskin']."' WHERE `skin`='$sid'"; - DataBase::sql_query($sql,'GENERAL','Could not update user'); + DataBase::sql_query($sql,GENERAL,'Could not update user'); admin_message_forum($lng['skins_deleted'],'styles.php?mode=view'); } else @@ -64,7 +64,7 @@ switch($_GET['mode']) if (is_dir('./../skins/'.$_POST['skin'])) { $last = DataBase::new_id(SKINS_TABLE); - DataBase::sql_query("INSERT INTO ".SKINS_TABLE." VALUES ('$last','".strip_tags($_POST['skin'])."')",'GENERAL','Could not add skin'); + DataBase::sql_query("INSERT INTO ".SKINS_TABLE." VALUES ('$last','".strip_tags($_POST['skin'])."')",GENERAL,'Could not add skin'); $_POST['skin']=''; admin_message_forum($lng['skins_added'],'styles.php?mode=view'); } @@ -89,7 +89,7 @@ switch($_GET['mode']) Admin_Over::GenerateHeader(); include('./template/skins_beam_body.tpl'); $sql = "SELECT * FROM ".SKINS_TABLE; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain skins information'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain skins information'); while ($item = DataBase::fetch($query)) { $skin=array( diff --git a/common.php b/common.php index dcf61e3..999721c 100644 --- a/common.php +++ b/common.php @@ -19,7 +19,7 @@ if (phpversion()<'5.0.7') } //set global preferences from DataBase $sql="SELECT * FROM ".CONFIG_TABLE.""; -$query=DataBase::sql_query($sql,'CRITICAL','Could not obtain config information'); +$query=DataBase::sql_query($sql,CRITICAL,'Could not obtain config information'); while($result=DataBase::fetch($query)) { if (($result['name']=='') or ($result['name']=='0')) @@ -53,7 +53,7 @@ if ($_SESSION['uid']>0) $ip = $_SERVER['REMOTE_ADDR']; $uid = $_SESSION['uid']; $sql = "SELECT `IP`, `u_id`, `motive` FROM ".BANLIST_TABLE." WHERE `IP`='$ip' OR `u_id`='$uid'"; - $result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain ban information')); + $result = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain ban information')); $motive = $result['motive']; $db_ip = $result['IP']; $db_uid = $result['u_id']; @@ -76,7 +76,7 @@ else { $sql = "SELECT * FROM ".USERS_TABLE." WHERE `u_id`='-1'"; } -$query = DataBase::sql_query($sql, 'GENERAL','Could not obtain loged user information'); +$query = DataBase::sql_query($sql, GENERAL,'Could not obtain loged user information'); $userdata = DataBase::fetch($query); define('RANK', $userdata['rank']); diff --git a/config.php b/config.php index b9668fd..0238d4b 100644 --- a/config.php +++ b/config.php @@ -7,12 +7,12 @@ if ( !defined('IN_uF') ) { die('Hacking attempt'); } -@ini_set('display_errors', '1'); +ini_set('display_errors', '1'); define('DB_HOST','localhost'); define('DB_USER','root'); define('DB_PASS',''); define('DB_NAME','uf'); define('DB_PREFIX','uf_'); -define('VERSION','9.5.1'); +define('VERSION','9.5.3'); define('UF_INSTALLED',true); ?> diff --git a/forum.php b/forum.php index 5dee762..8ddbe70 100644 --- a/forum.php +++ b/forum.php @@ -52,18 +52,19 @@ $skin = array_push_associative($skin,GenerateHeader($lng['showforum'].': '.$foru //do it! include('./skins/'.$default_skin.'/overall_header.tpl'); include('./skins/'.$default_skin.'/forum_body.tpl'); -$sql = "SELECT ".TOPICS_TABLE.".*, ".USERS_TABLE.".* FROM ".TOPICS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".TOPICS_TABLE.".author = ".USERS_TABLE.".u_id WHERE f_id='$fid' ORDER BY `sticky` DESC, `lastpost_time` DESC $limit;"; -$query = DataBase::sql_query($sql,'GENERAL','Could not obtain topics information'); +$sql = "SELECT ".TOPICS_TABLE.".*, ".USERS_TABLE.".*, ".TOPICS_TABLE.".posts AS `postcount`, ".TOPICS_TABLE.".lastpost AS `topic_lastpost` FROM ".TOPICS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".TOPICS_TABLE.".author = ".USERS_TABLE.".u_id WHERE f_id='$fid' ORDER BY `sticky` DESC, `lastpost_time` DESC $limit;"; +$query = DataBase::sql_query($sql,GENERAL,'Could not obtain topics information'); $value = DataBase::num_rows($query); if ($value>0) { while($record = DataBase::fetch($query)) { + $last_post = explode(':', $record['topic_lastpost']); $skin = array( 't_id'=>$record['t_id'], 'fname'=>($record['sticky']=='1') ? ''.$lng['sticky'].''.$record['name'] : $record['name'], 'author'=>Topic::TopicAuthor($record['author']), - 'tposts'=>$count_topic[$record['t_id']], + 'tposts'=>$record['postcount'], 'new_post'=>Topic::LastPostImg(), 'lastpost'=>Topic::LastPostInTopic($record['t_id']) ); diff --git a/groups.php b/groups.php index 24bc67f..2bef748 100644 --- a/groups.php +++ b/groups.php @@ -69,7 +69,7 @@ if(isset($_GET['mode'])) $_POST['delnick']=''; } $sql = "SELECT `g_id`, `name`, `desc`, `m_id` FROM `".GROUPS_TABLE."` WHERE `g_id`='$gid'"; - $group = DataBase::fetch(DataBase::sql_query($sql, 'GENERAL', 'Could not obtain groups information.')); + $group = DataBase::fetch(DataBase::sql_query($sql, GENERAL, 'Could not obtain groups information.')); if ($group['g_id']=='') { message_forum($lng['no_group'], 'index.php'); @@ -89,7 +89,7 @@ if(isset($_GET['mode'])) ); include('./skins/'.$default_skin.'/group_view_head_body.tpl'); $sql = "SELECT ".USERS_GROUP_TABLE.".*, ".USERS_TABLE.".* FROM `".USERS_GROUP_TABLE."` LEFT JOIN ".USERS_TABLE." ON ".USERS_TABLE.".u_id =".USERS_GROUP_TABLE.".u_id WHERE `g_id`='$gid'"; - $query = DataBase::sql_query($sql, 'GENERAL', 'Could not obtain users in groups information.'); + $query = DataBase::sql_query($sql, GENERAL, 'Could not obtain users in groups information.'); $amout = DataBase::num_rows($query); if ($amout>0) { @@ -142,7 +142,7 @@ else $skin = GenerateHeader($lng['lgroups'], '> '.$lng['lgroups']); include('./skins/'.$default_skin.'/overall_header.tpl'); $sql = "SELECT `g_id`, `name`, `desc` FROM `".GROUPS_TABLE."` ORDER BY `sort`"; - $query = DataBase::sql_query($sql, 'GENERAL', 'Could not obtain groups information.'); + $query = DataBase::sql_query($sql, GENERAL, 'Could not obtain groups information.'); if (DataBase::num_rows($query)>0) { while($item = DataBase::fetch($query)) diff --git a/includes/admin/class_forum.php b/includes/admin/class_forum.php index 478d791..128811d 100644 --- a/includes/admin/class_forum.php +++ b/includes/admin/class_forum.php @@ -18,7 +18,7 @@ class Admin_Forum global $forum_config; $cat = Forum::ForumInformation($fid,'c_id'); $all=''; - $query = DataBase::sql_query("SELECT `name`, `c_id` FROM `".CATS_TABLE."`",'GENERAL','Could not obtain category information'); + $query = DataBase::sql_query("SELECT `name`, `c_id` FROM `".CATS_TABLE."`",GENERAL,'Could not obtain category information'); while($t = DataBase::fetch($query)) { diff --git a/includes/admin/class_main.php b/includes/admin/class_main.php index 4bcc81b..6411686 100644 --- a/includes/admin/class_main.php +++ b/includes/admin/class_main.php @@ -37,7 +37,7 @@ class Admin_Over global $forum_config; global $default_skin; $all=''; - $query = DataBase::sql_query("SELECT `name`, `s_id` FROM `".SKINS_TABLE."`",'GENERAL','Could not obtain skins information'); + $query = DataBase::sql_query("SELECT `name`, `s_id` FROM `".SKINS_TABLE."`",GENERAL,'Could not obtain skins information'); while($t = DataBase::fetch($query)) { @@ -104,14 +104,14 @@ class Admin_Over { $result = User::UserInformation($_SESSION['uid'],'skin'); $sql = "SELECT * FROM `".SKINS_TABLE."` WHERE `s_id`='$result'"; - $result = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain skin information.')); + $result = DataBase::fetch(DataBase::sql_query($sql,CRITICAL,'Could not obtain skin information.')); return $result['name']; } else { $result = $forum_config['defaultskin']; $sql = "SELECT * FROM `".SKINS_TABLE."` WHERE `s_id`='$result'"; - $result = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain skin information.')); + $result = DataBase::fetch(DataBase::sql_query($sql,CRITICAL,'Could not obtain skin information.')); return $result['name']; } } @@ -130,14 +130,14 @@ class Admin_Over function TotalTopics() { $sql = "SELECT `t_id` FROM ".TOPICS_TABLE.";"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain total posts information'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain total posts information'); $result = DataBase::num_rows($query); return($result); } function TotalPosts() { $sql = "SELECT `p_id` FROM ".POSTS_TABLE.";"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain total posts information'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain total posts information'); $result = DataBase::num_rows($query); return($result); } diff --git a/includes/cache/cache_forums.php b/includes/cache/cache_forums.php index ee23c29..71270dc 100644 --- a/includes/cache/cache_forums.php +++ b/includes/cache/cache_forums.php @@ -14,7 +14,7 @@ if(!defined('IN_uF')) //cache forums and posts - version v1.0 Alpha 2--------------------------------- $default_skin = ViewSkinName(); $sql = "SELECT `name`,`lock` FROM ".FORUMS_TABLE." WHERE `f_id`='$fid' LIMIT 1"; -$result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain forum information')); +$result = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain forum information')); if ($result['name']=='') { message_forum($lng['no_forum'],'index.php'); @@ -23,14 +23,14 @@ $forum = array( 'name'=>$result['name'], 'lock'=>$result['lock'] ); -$sql = "SELECT COUNT(*) as `p_id`, `t_id` FROM ".POSTS_TABLE." GROUP BY `t_id`"; -$query = DataBase::sql_query($sql,'GENERAL', 'Could not obtain amout of posts in forum'); +/*$sql = "SELECT COUNT(*) as `p_id`, `t_id` FROM ".POSTS_TABLE." GROUP BY `t_id`"; +$query = DataBase::sql_query($sql,GENERAL, 'Could not obtain amout of posts in forum'); while($result = DataBase::fetch($query)) { $count_topic[$result['t_id']]=$result['p_id']; -} +}*/ /*$sql = "SELECT ".POSTS_TABLE.".*, ".USERS_TABLE.".* FROM ".POSTS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".USERS_TABLE.".u_id = ".POSTS_TABLE.".u_id WHERE `f_id`='$fid' ORDER BY `ptime`"; -$query = DataBase::sql_query($sql,'GENERAL', 'Could not obtain amout of posts in forum'); +$query = DataBase::sql_query($sql,GENERAL, 'Could not obtain amout of posts in forum'); while($result = DataBase::fetch($query)) { $lastpost[$result['t_id']]['tp_id']=$result['tp_id']; @@ -66,7 +66,7 @@ else $page=1; } $count = DataBase::fetch(DataBase::sql_query("SELECT COUNT(`t_id`) as `t_id` -FROM ".TOPICS_TABLE." WHERE `f_id`='$fid'",'GENERAL','Could not obtain count amout of topics')); +FROM ".TOPICS_TABLE." WHERE `f_id`='$fid'",GENERAL,'Could not obtain count amout of topics')); $count = $count['t_id']; $count = ceil($count / $limiter); if ($count==0) diff --git a/includes/cache/cache_index.php b/includes/cache/cache_index.php index de6a887..762b327 100644 --- a/includes/cache/cache_index.php +++ b/includes/cache/cache_index.php @@ -18,7 +18,7 @@ if(!defined('IN_uF')) //cache forums --don't modify!!! $cache_id=1; $sql = "SELECT ".FORUMS_TABLE.".*, COUNT(".POSTS_TABLE.".p_id) as amout, ".POSTS_TABLE.".f_id AS count FROM ".FORUMS_TABLE." LEFT JOIN ".POSTS_TABLE." ON ".FORUMS_TABLE.".f_id= ".POSTS_TABLE.".f_id GROUP BY `f_id` ORDER BY `c_id`, `sort`"; -$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain forum information.'); +$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain forum information.'); while($result = DataBase::fetch($query)) { $forum[$cache_id]['f_id'] = $result['f_id']; @@ -31,7 +31,7 @@ while($result = DataBase::fetch($query)) $cache_id+=1; } $sql = "SELECT `u_id`,`nick`, `regdate` AS count FROM ".USERS_TABLE." ORDER BY `regdate` DESC"; -$query = DataBase::sql_query($sql,'GENERAL','Could not obtain amout of count users information'); +$query = DataBase::sql_query($sql,GENERAL,'Could not obtain amout of count users information'); $lastuser = DataBase::fetch($query); $count_users = DataBase::num_rows($query) -1; ?> diff --git a/includes/cache/cache_topic.php b/includes/cache/cache_topic.php index 4f1f66e..5d5aa5f 100644 --- a/includes/cache/cache_topic.php +++ b/includes/cache/cache_topic.php @@ -13,7 +13,7 @@ if(!defined('IN_uF')) } //||topic.php script cache ------------------------------------------------------------------------------ $sql = "SELECT ".TOPICS_TABLE.".*, ".TOPICS_TABLE.".name AS topic_name, ".TOPICS_TABLE.".lock AS topic_lock, ".FORUMS_TABLE.".* FROM ".TOPICS_TABLE." LEFT JOIN ".FORUMS_TABLE." ON ".TOPICS_TABLE.".f_id = ".FORUMS_TABLE.".f_id WHERE `t_id`='$tid' LIMIT 1"; -$result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain forum information')); +$result = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain forum information')); if ($result['t_id']=='') { message_forum($lng['no_topic'], 'index.php'); @@ -29,7 +29,7 @@ $forum['moderate']=$result['moderate']; $sql = "SELECT `u_id`,`value` FROM `".WARNINGS_TABLE."`"; -$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user warns information'); +$query = DataBase::sql_query($sql,GENERAL,'Could not obtain user warns information'); $result = DataBase::num_rows($query); while ($result = DataBase::fetch($query)) { @@ -49,7 +49,7 @@ while ($result = DataBase::fetch($query)) //check online for user $sql = "SELECT `s_id`, `u_id`, `time` FROM ".SESSIONS_TABLE." WHERE time+1250>".time(); -$query = DataBase::sql_query($sql, 'GENERAL', 'Could not read user active.'); +$query = DataBase::sql_query($sql, GENERAL, 'Could not read user active.'); while($result = DataBase::fetch($query)) { $user[$result['u_id']]['online']='1'; @@ -82,7 +82,7 @@ else $page=1; } $count = DataBase::fetch(DataBase::sql_query("SELECT COUNT(`p_id`) as `p_id` -FROM ".POSTS_TABLE." WHERE `t_id`='$tid'",'GENERAL','Could not obtain count amout of posts')); +FROM ".POSTS_TABLE." WHERE `t_id`='$tid'",GENERAL,'Could not obtain count amout of posts')); $count = $count['p_id']; $count = ceil($count / $limiter); if(isset($_GET['page']) && ($_GET['page']>$count)) diff --git a/includes/classes/class_forum.php b/includes/classes/class_forum.php index c0f3aec..623941f 100644 --- a/includes/classes/class_forum.php +++ b/includes/classes/class_forum.php @@ -18,7 +18,7 @@ class Forum global $forum_config; $forum = Topic::TopicInformation($tid,'f_id'); $all=''; - $query = DataBase::sql_query("SELECT `name`, `f_id` FROM `".FORUMS_TABLE."` ORDER BY `f_id`",'GENERAL','Could not obtain forum information'); + $query = DataBase::sql_query("SELECT `name`, `f_id` FROM `".FORUMS_TABLE."` ORDER BY `f_id`",GENERAL,'Could not obtain forum information'); while($t = DataBase::fetch($query)) { @@ -38,7 +38,7 @@ class Forum function PostsInForum($forum_name) { $sql = "SELECT count(*) as `p_id` FROM ".POSTS_TABLE." WHERE f_id='$forum_name'"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain posts information.'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain posts information.'); $result = DataBase::fetch($query); return $result['p_id']; } @@ -132,7 +132,7 @@ class Forum function ForumInformation($fid, $inf) { $sql = "SELECT `f_id`, `$inf` FROM ".FORUMS_TABLE." WHERE f_id='$fid';"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain forum information.'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain forum information.'); $result = DataBase::fetch($query); $result = $result[$inf]; return $result; diff --git a/includes/classes/class_mod.php b/includes/classes/class_mod.php index d4fafea..5f6ed12 100644 --- a/includes/classes/class_mod.php +++ b/includes/classes/class_mod.php @@ -16,9 +16,9 @@ class Mod function MoveTopic($tid, $fid) { $sql = "UPDATE `".TOPICS_TABLE."` SET `f_id`='$fid' WHERE `t_id`='$tid'"; - DataBase::sql_query($sql,'GENERAL','Could not update topic'); + DataBase::sql_query($sql,GENERAL,'Could not update topic'); $sql = "UPDATE `".POSTS_TABLE."` SET `f_id`='$fid' WHERE `t_id`='$tid'"; - DataBase::sql_query($sql,'GENERAL','Could not update post'); + DataBase::sql_query($sql,GENERAL,'Could not update post'); } function TopicLocked($tid) @@ -39,37 +39,37 @@ class Mod function DeleteTopic($topicid) { $sql="SELECT * FROM ".POSTS_TABLE." WHERE `t_id`='$topicid'"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain post information'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain post information'); while($item = DataBase::fetch($query)) { $uid = Topic::PostInformation($item['p_id'],'u_id'); $posts = User::UserInformation($uid,'posts'); $posts = $posts -1; $sql = "UPDATE `".USERS_TABLE."` SET `posts`='$posts' WHERE `u_id`='$uid'"; - DataBase::sql_query($sql,'GENERAL','Could not update user amout of posts'); + DataBase::sql_query($sql,GENERAL,'Could not update user amout of posts'); } $sql = "DELETE FROM ".POSTS_TABLE." WHERE t_id='$topicid';"; - DataBase::sql_query($sql,'GENERAL','Could not delete topic posts.'); + DataBase::sql_query($sql,GENERAL,'Could not delete topic posts.'); $sql = "DELETE FROM ".TOPICS_TABLE." WHERE t_id='$topicid';"; - DataBase::sql_query($sql,'GENERAL','Could not delete topic posts.'); + DataBase::sql_query($sql,GENERAL,'Could not delete topic posts.'); } function LockTopic($topicid) { $sql = "UPDATE `".TOPICS_TABLE."` SET `lock` = '1' WHERE `t_id` =$topicid;"; - DataBase::sql_query($sql,'GENERAL','Could not lock topic.'); + DataBase::sql_query($sql,GENERAL,'Could not lock topic.'); } function StickTopic($topicid, $mode) { $sql = "UPDATE `".TOPICS_TABLE."` SET `sticky` = '$mode' WHERE `t_id` =$topicid;"; - DataBase::sql_query($sql,'GENERAL','Could not stick topic.'); + DataBase::sql_query($sql,GENERAL,'Could not stick topic.'); } function UnlockTopic($topicid) { $sql = "UPDATE `".TOPICS_TABLE."` SET `lock` = '0' WHERE `t_id` =$topicid;"; - DataBase::sql_query($sql,'GENERAL','Could not unlock topic.'); + DataBase::sql_query($sql,GENERAL,'Could not unlock topic.'); } function DeletePost($postid) @@ -79,25 +79,25 @@ class Mod $posts = User::UserInformation($uid,'posts'); $posts = $posts -1; $sql = "UPDATE `".USERS_TABLE."` SET `posts`='$posts' WHERE `u_id`='$uid'"; - DataBase::sql_query($sql,'GENERAL','Could not update user amout of posts'); + DataBase::sql_query($sql,GENERAL,'Could not update user amout of posts'); $sql2 = "DELETE FROM ".POSTS_TABLE." WHERE p_id='$postid';"; - DataBase::sql_query($sql2,'GENERAL','Could not delete post.'); + DataBase::sql_query($sql2,GENERAL,'Could not delete post.'); $sql = "SELECT * FROM ".POSTS_TABLE." WHERE p_id>'$postid' AND `t_id`='$tid';"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain post information.'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain post information.'); while($item=DataBase::fetch($query)) { $number = $item['tp_id']; $number = $number-1; $number2 = $item['p_id']; $sql3 = "UPDATE `".POSTS_TABLE."` SET `tp_id` = '$number' WHERE `p_id` =$number2;"; - DataBase::sql_query($sql3,'GENERAL','Could not update post.'); + DataBase::sql_query($sql3,GENERAL,'Could not update post.'); } } function AcceptPost($postid) { $sql = "UPDATE `".POSTS_TABLE."` SET `moderated`='0' WHERE `p_id`='$postid'"; - DataBase::sql_query($sql, 'GENERAL', 'Could not accept post'); + DataBase::sql_query($sql, GENERAL, 'Could not accept post'); } } ?> diff --git a/includes/classes/class_pms.php b/includes/classes/class_pms.php index 0a03f27..b79b7f8 100644 --- a/includes/classes/class_pms.php +++ b/includes/classes/class_pms.php @@ -50,12 +50,12 @@ class Pms function DeleteMsgUser($mid) { $sql = "DELETE FROM `".PM_INBOX_TABLE."` WHERE `m_id`='$mid'"; - DataBase::sql_query($sql,'GENERAL','Could not delete message in inbox'); + DataBase::sql_query($sql,GENERAL,'Could not delete message in inbox'); } function DeleteMsgAuthor($mid) { $sql = "DELETE FROM `".PM_SENTBOX_TABLE."` WHERE `m_id`='$mid'"; - DataBase::sql_query($sql,'GENERAL','Could not delete message in sentbox'); + DataBase::sql_query($sql,GENERAL,'Could not delete message in sentbox'); } } @@ -66,14 +66,14 @@ class NewMessage $last = DataBase::new_id(PM_INBOX_TABLE); $time = time(); $sql = "INSERT INTO `".PM_INBOX_TABLE."` VALUES ('$last', '$uid', '$name', '$text', '$time', '$unid','0')"; - DataBase::sql_query($sql,'GENERAL','Could not add new message at inbox'); + DataBase::sql_query($sql,GENERAL,'Could not add new message at inbox'); } function AddToSentbox($text, $name, $unid, $uid) { $last=DataBase::new_id(PM_SENTBOX_TABLE); $time = time(); $sql = "INSERT INTO `".PM_SENTBOX_TABLE."` VALUES ('$last', '$uid', '$name', '$text', '$time', '$unid')"; - DataBase::sql_query($sql,'GENERAL','Could not add new message at inbox'); + DataBase::sql_query($sql,GENERAL,'Could not add new message at inbox'); } } ?> diff --git a/includes/classes/class_posting.php b/includes/classes/class_posting.php index 0bc1a3e..7894be3 100644 --- a/includes/classes/class_posting.php +++ b/includes/classes/class_posting.php @@ -19,7 +19,7 @@ class Post $last = DataBase::new_id(POSTS_TABLE); #read last post in topic $sql = "SELECT * FROM ".POSTS_TABLE." WHERE t_id='$tid' ORDER BY tp_id DESC LIMIT 1;"; - $query = DataBase::sql_query($sql,'GENERAL','Could not last post information.'); + $query = DataBase::sql_query($sql,GENERAL,'Could not last post information.'); $result = DataBase::fetch($query); $forum = $result['f_id'];//forum id $moderate = Forum::ForumInformation($forum,'moderate'); @@ -29,20 +29,20 @@ class Post $time = time(); #add new post $sql = "INSERT INTO `".POSTS_TABLE."` VALUES ('$last','$tid', '$uid', '$post', '".$_SERVER['HTTP_USER_AGENT']."', '$time', '$tpid', '$forum','$moderate','".$_SERVER['REMOTE_ADDR']."')"; - $query = DataBase::sql_query($sql,'GENERAL','Could not add new post.'); + $query = DataBase::sql_query($sql,GENERAL,'Could not add new post.'); $result=User::UserInformation($uid,'posts'); $result = $result+1; - $sql="UPDATE ".TOPICS_TABLE." SET lastpost_time='$time' WHERE t_id='$tid' "; - $query = DataBase::sql_query($sql,'GENERAL','Could not update user information.'); + TriggerStats($forum, 1); + TriggerStats($tid, 2); $sql="UPDATE ".USERS_TABLE." SET posts='$result' WHERE u_id='$uid' "; - $query = DataBase::sql_query($sql,'GENERAL','Could not update user information.'); + $query = DataBase::sql_query($sql,GENERAL,'Could not update user information.'); return $tpid; } function EditPost($postid, $text) { $sql = "UPDATE `".POSTS_TABLE."` SET text='$text' WHERE `p_id`='$postid';"; - $query = DataBase::sql_query($sql,'GENERAL','Could not edit post.'); + $query = DataBase::sql_query($sql,GENERAL,'Could not edit post.'); } function NewTopic($posttext, $ntopic, $forum, $uid, $sticky) @@ -51,21 +51,25 @@ class Post $moderate = Forum::ForumInformation($forum,'moderate'); $time = time(); $lastt=DataBase::new_id(TOPICS_TABLE); - $sql = "INSERT INTO ".TOPICS_TABLE." VALUES ('$lastt', '$forum', '0', '$sticky', '$ntopic', '$uid','$time')"; - $query = DataBase::sql_query($sql,'GENERAL','Could not add new topic'); + $sql = "INSERT INTO ".TOPICS_TABLE." VALUES ('$lastt', '$forum', '0', '$sticky', '$ntopic', '$uid','$time', '', '')"; + $query = DataBase::sql_query($sql,GENERAL,'Could not add new topic'); //add post //select last post $last = DataBase::new_id(POSTS_TABLE); //add post $sql = "INSERT INTO ".POSTS_TABLE." VALUES ('$last','$lastt', '$uid', '$posttext','".$_SERVER['HTTP_USER_AGENT']."', '$time', '1', '$forum', '$moderate','".$_SERVER['REMOTE_ADDR']."');"; - $query = DataBase::sql_query($sql,'GENERAL','Could not add new post.'); + $query = DataBase::sql_query($sql,GENERAL,'Could not add new post.'); $sql = "SELECT * FROM ".USERS_TABLE." WHERE u_id='$uid';"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain user information.'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain user information.'); $result = DataBase::fetch($query); $result = $result['posts']; $result = $result+1; + + TriggerStats($forum, 1); + TriggerStats($lastt, 2); + $sql = "UPDATE ".USERS_TABLE." SET posts='$result' WHERE u_id='$uid' "; - $query = DataBase::sql_query($sql,'GENERAL','Could not update user information.'); + $query = DataBase::sql_query($sql,GENERAL,'Could not update user information.'); return $lastt; } @@ -74,7 +78,7 @@ class Post $text =''; $result=''; $sql = "SELECT * FROM ".SMILES_TABLE.""; - $query = DataBase::sql_query($sql,'GENERAL','Cold not obtain smiles information.'); + $query = DataBase::sql_query($sql,GENERAL,'Cold not obtain smiles information.'); $i = 1; while($smile = DataBase::fetch($query)) { @@ -98,7 +102,7 @@ class Post function SmilesReplace($text) { $sql = "SELECT * FROM ".SMILES_TABLE.""; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain emoticons information.'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain emoticons information.'); $i = 1; while($result = DataBase::fetch($query)) { diff --git a/includes/classes/class_topic.php b/includes/classes/class_topic.php index 99b07be..5d6b0bd 100644 --- a/includes/classes/class_topic.php +++ b/includes/classes/class_topic.php @@ -16,13 +16,15 @@ class Topic function LastPostInTopic($topic) { global $lng; - global $lastpost; + global $last_post; global $forum_config; global $userdata; - $id = $lastpost[$topic]['tp_id']; - $userid = $lastpost[$topic]['u_id']; - $un = $lastpost[$topic]['user_nick']; - $rank = $lastpost[$topic]['user_rank']; + + $id = $last_post[0]; + $userid = $last_post[1]; + $un = $last_post[4]; + $rank = $last_post[3]; + switch($rank) { case '0': @@ -58,18 +60,18 @@ class Topic { $page=''; } - return '

'.GenerateTime($lastpost[$topic]['time']).'
Post #'.$id.': '.$user_color_name.'

'; + return '

'.GenerateTime($last_post[2]).'
Post #'.$id.': '.$user_color_name.'

'; } function LastPostImg() { - global $lastpost; + global $last_post; global $record; global $default_skin; $time = time()-129600; if ($_SESSION['uid']>0) { - if ($lastpost[$record['t_id']]['time']>$time) + if ($last_post[2]>$time) { return 'folder_new_posts'; } @@ -115,7 +117,7 @@ class Topic function TopicInformation($tid, $mode) { $sql = "SELECT * FROM ".TOPICS_TABLE." WHERE t_id='$tid';"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain topic information'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain topic information'); $result = DataBase::fetch($query); $result = $result[$mode]; return $result; @@ -124,7 +126,7 @@ class Topic function PostInformation($pid, $mode) { $sql = "SELECT * FROM ".POSTS_TABLE." WHERE p_id='$pid';"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain topic information'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain topic information'); $result = DataBase::fetch($query); $result = $result[$mode]; return $result; diff --git a/includes/classes/class_user.php b/includes/classes/class_user.php index f541403..35661cc 100644 --- a/includes/classes/class_user.php +++ b/includes/classes/class_user.php @@ -24,7 +24,7 @@ class User function UserInformation($uid, $inf) { $sql = "SELECT `$inf` FROM ".USERS_TABLE." WHERE u_id='$uid';"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain user information.'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain user information.'); $result = DataBase::fetch($query); $result = $result[$inf]; return $result; @@ -33,7 +33,7 @@ class User function UserIdByNick($nick) { $sql = "SELECT * FROM `".USERS_TABLE."` WHERE `nick`='$nick';"; - $result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain user information.')); + $result = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain user information.')); $result = $result['u_id']; /*if ($result=='') { @@ -46,13 +46,13 @@ class User { $last= DataBase::new_id(USERS_GROUP_TABLE); $sql = "INSERT INTO `".USERS_GROUP_TABLE."` VALUES ('$last','$uid', '$gid')"; - DataBase::sql_query($sql,'GENERAL','Could not add user to group.'); + DataBase::sql_query($sql,GENERAL,'Could not add user to group.'); } function DeleteFromGroup($uid, $gid) { $sql = "DELETE FROM `".USERS_GROUP_TABLE."` WHERE `u_id`='$uid' AND `g_id`='$gid'"; - DataBase::sql_query($sql,'GENERAL','Could not delete user for group.'); + DataBase::sql_query($sql,GENERAL,'Could not delete user for group.'); } function LogedAs($sid, $uid) @@ -119,7 +119,7 @@ class User if ($uid>0) { $sql = "SELECT * FROM ".USERS_TABLE." WHERE u_id='$uid'"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain user`s rank information.'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain user`s rank information.'); $result = DataBase::fetch($query); $rank = $result['rank']; if (($rank=='1') or ($rank=='2')) @@ -156,7 +156,7 @@ class User `view_shoutbox` = '$allow_shoutbox', `limit_users` = '$limit_users' WHERE `u_id` ='$uid' LIMIT 1 ;"; - DataBase::sql_query($sql,'CRITICAL','Could not update user information'); + DataBase::sql_query($sql,CRITICAL,'Could not update user information'); } function UpdateAdminPools($uid, $posts, $rank, $active, $nick) @@ -167,7 +167,7 @@ class User `active` = '$active', `nick` = '$nick' WHERE `u_id` ='$uid' LIMIT 1 ;"; - DataBase::sql_query($sql,'CRITICAL','Could not update user information'); + DataBase::sql_query($sql,CRITICAL,'Could not update user information'); } function UpdatePassword($uid, $pass) @@ -175,7 +175,7 @@ class User $sql ="UPDATE `".USERS_TABLE."` SET `pass` = '$pass' WHERE `u_id` ='$uid' LIMIT 1 ;"; - DataBase::sql_query($sql,'CRITICAL','Could not update user information'); + DataBase::sql_query($sql,CRITICAL,'Could not update user information'); } function CreateProfile($nick, $pass, $email, $gg, $allow_gg, $allow_email, $allow_qr, $sig, $av, $interests) @@ -185,7 +185,7 @@ class User $time = time(); $sql = "INSERT INTO ".USERS_TABLE." VALUES ('$last', '$nick', '$pass', '$email', '0', '$time', '0', '$gg', '$allow_gg', '$allow_email', '$allow_qr', '".$forum_config['view_shoutbox']."', '".$forum_config['defaultskin']."', '".$forum_config['defaultlang']."','".$forum_config['limit_tpid']."', '".$forum_config['limit_ftid']."', '".$forum_config['limit_users']."', '$sig', '$av', '1','0','$interests');"; - DataBase::sql_query($sql,'CRITICAL','Could not create new user'); + DataBase::sql_query($sql,CRITICAL,'Could not create new user'); } function UserMsgs() @@ -194,7 +194,7 @@ class User if($uid>0) { $sql = "SELECT count(*) as `m_id` FROM ".PM_INBOX_TABLE." WHERE `u_id`='$uid' AND `read`='0'"; - $result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain amounts PM of User.')); + $result = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain amounts PM of User.')); $result = $result['m_id']; if ($result>0) { @@ -210,14 +210,14 @@ class User function UserAddWarn($uid, $value, $motive) { $sql = "INSERT INTO `".WARNINGS_TABLE."` ( `w_id` , `u_id` , `value` , `motive` ) VALUES('','$uid','$value','$motive');"; - DataBase::sql_query($sql,'GENERAL','Could not add new warn.'); + DataBase::sql_query($sql,GENERAL,'Could not add new warn.'); if (User::UserLevelWarns($uid)==100) { $ban_ip = '0.0.0.0'; $ban_uid = $uid; $ban_motive = $lng['warns_ban']; $sql = "INSERT INTO ".BANLIST_TABLE." VALUES ('', '$ban_uid', '$ban_ip', '$ban_motive')"; - DataBase::sql_query($sql,'GENERAL','Could not update add ban.'); + DataBase::sql_query($sql,GENERAL,'Could not update add ban.'); } } } diff --git a/includes/classes/secure.php b/includes/classes/secure.php index d26759d..3f3dbd0 100644 --- a/includes/classes/secure.php +++ b/includes/classes/secure.php @@ -17,7 +17,7 @@ class Secure { global $lng; $sql = "SELECT * FROM ".FORUMS_TABLE." WHERE f_id='$fid'"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain forum information.'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain forum information.'); $result = DataBase::fetch($query); $result = $result['f_id']; if ($result=='') @@ -31,7 +31,7 @@ class Secure if ($forum_config['use_censorlist']) { $sql = "SELECT * FROM ".CENSORLIST_TABLE.";"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain censorlist information.'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain censorlist information.'); while($word = DataBase::fetch($query)) { $text = str_replace($word['word'],'[censored]', $text); @@ -68,7 +68,7 @@ class Secure { global $lng; $sql = "SELECT * FROM ".PM_INBOX_TABLE." WHERE m_id='$mid'"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain user information.'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain user information.'); $result = DataBase::fetch($query); $result = $result['m_id']; if ($result=='') @@ -80,7 +80,7 @@ class Secure { global $lng; $sql = "SELECT * FROM ".PM_SENTBOX_TABLE." WHERE m_id='$mid'"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain user information.'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain user information.'); $result = DataBase::fetch($query); $result = $result['u_n_id']; if ($result!=$_SESSION['uid']) @@ -92,7 +92,7 @@ class Secure { global $lng; $sql = "SELECT * FROM ".PM_INBOX_TABLE." WHERE m_id='$mid'"; - $result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain user information.')); + $result = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain user information.')); $result = $result['u_id']; if ($result!=$_SESSION['uid']) { @@ -103,7 +103,7 @@ class Secure { global $lng; $sql = "SELECT * FROM ".PM_SENTBOX_TABLE." WHERE m_id='$mid'"; - $result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain user information.')); + $result = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain user information.')); $result = $result['m_id']; if ($result=='') { @@ -114,7 +114,7 @@ class Secure { global $lng; $sql = "SELECT * FROM `".TOPICS_TABLE."` WHERE `t_id`='$tid'"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain topic information.'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain topic information.'); $result = DataBase::fetch($query); $result = $result['t_id']; if ($result=='') @@ -126,7 +126,7 @@ class Secure { global $lng; $sql = "SELECT * FROM ".POSTS_TABLE." WHERE p_id='$pid'"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain topic information.'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain topic information.'); $result = DataBase::fetch($query); $result = $result['p_id']; if ($result=='') @@ -138,7 +138,7 @@ class Secure { global $lng; $sql = "SELECT * FROM ".USERS_TABLE." WHERE u_id='$uid'"; - $result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain user information.')); + $result = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain user information.')); $result = $result['u_id']; if (($result=='') or ($result=='-1')) { @@ -149,7 +149,7 @@ class Secure { global $lng; $sql = "SELECT `g_id` FROM `".GROUPS_TABLE."` WHERE g_id='$gid'"; - $result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain group information.')); + $result = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain group information.')); $result = $result['g_id']; if ($result=='') { @@ -170,10 +170,10 @@ class Secure { global $lng; $sql = "SELECT `f_id`,`lock` FROM `".TOPICS_TABLE."` WHERE `t_id`='$tid'"; - $result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain topic information')); + $result = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain topic information')); $fid = $result['f_id']; $sql2 = "SELECT `lock` FROM `".FORUMS_TABLE."` WHERE `f_id`='$fid'"; - $result2 = DataBase::fetch(DataBase::sql_query($sql2,'GENERAL','Could not obtain forum information')); + $result2 = DataBase::fetch(DataBase::sql_query($sql2,GENERAL,'Could not obtain forum information')); if (($result['lock']=='1') or ($result2['lock']=='1')) { message_forum($lng['no_posting_topic_locked'],'topic.php?t='.$tid); @@ -183,7 +183,7 @@ class Secure { global $lng; $sql = "SELECT `lock` FROM `".FORUMS_TABLE."` WHERE `f_id`='$fid'"; - $result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain forum information')); + $result = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain forum information')); if ($result['lock']=='1') { message_forum($lng['no_posting_forum_locked'],'forum.php?f='.$fid); diff --git a/includes/constants.php b/includes/constants.php index 9302402..4150ce1 100644 --- a/includes/constants.php +++ b/includes/constants.php @@ -44,25 +44,6 @@ define('FOOTER_TEXT','Powered by µForum $value) - { - $arr[$key] = $value; - $ret++; - } - } - else - { - $arr[$arg] = ""; - } - } - return $arr; -} +define('CRITICAL', 'Critical Error'); +define('GENERAL', 'General Error'); ?> diff --git a/includes/db.php b/includes/db.php index 01bd14e..87c614e 100644 --- a/includes/db.php +++ b/includes/db.php @@ -23,16 +23,16 @@ class DataBase $db = new mysqli(DB_HOST, DB_USER, DB_PASS); if (mysqli_connect_errno() != 0) { - message_die('CRITICAL',' Could not connect to database server.',$db->error); + message_die(CRITICAL,' Could not connect to database server.',$db->error); } if (!$db->set_charset("UTF8")) { - message_die('CRITICAL', 'Could not set character set UTF-8', $db->error); + message_die(CRITICAL, 'Could not set character set UTF-8', $db->error); } if (!$db->select_db(DB_NAME)) { - message_die('CRITICAL',' Could not select database.', $db->error); + message_die(CRITICAL,' Could not select database.', $db->error); } } @@ -59,12 +59,20 @@ class DataBase function fetch($query) { - return $query->fetch_array(); + return $query->fetch_assoc(); } function num_rows($query) { - return $query->num_rows; + // return $query->num_rows; + if ($query===true || $query===false) + { + return 0; + } + else + { + return mysqli_num_rows($query); + } } function new_id($table) @@ -91,7 +99,7 @@ class DataBase case WARNINGS_TABLE: { $id = 'w_id'; break; } } $sql = "SELECT `$id` FROM $table ORDER BY `$id` DESC LIMIT 1"; - $return_id = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Error with obtain last id.
File: db.php, Line: '.__LINE__)); + $return_id = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Error with obtain last id.
File: db.php, Line: '.__LINE__)); $return_id = $return_id[$id]; $return_id = $return_id+1; return $return_id; diff --git a/includes/emailer.php b/includes/emailer.php index e3b5e36..27bf3ab 100644 --- a/includes/emailer.php +++ b/includes/emailer.php @@ -38,7 +38,7 @@ function SendEmail($email, $title, $content) #send email - do it! if ( !mail($email, $title, $email_content, $email_headers )) { - message_die('GENERAL','Could not send email from: '.$email.'. sorry :(',''); + message_die(GENERAL,'Could not send email from: '.$email.'. sorry :(',''); } } @@ -78,7 +78,7 @@ function SendForgotPassEmail($newpass) function SendMassEmail($title,$content) { $sql = "SELECT `email`,`u_id` FROM ".USERS_TABLE." WHERE `u_id`>0"; - $query = DataBase::sql_query($sql,'CRITICAL','Could not read users table'); + $query = DataBase::sql_query($sql,CRITICAL,'Could not read users table'); while($item = DataBase::fetch($query)) { SendEmail($item['email'], $title, $content); diff --git a/includes/errors.php b/includes/errors.php index 2b4a679..cc4d561 100644 --- a/includes/errors.php +++ b/includes/errors.php @@ -19,8 +19,8 @@ function message_die($type, $msm, $sql) diff --git a/includes/misc_functions.php b/includes/misc_functions.php index 8f13df4..75a43bd 100644 --- a/includes/misc_functions.php +++ b/includes/misc_functions.php @@ -19,7 +19,7 @@ function SetCounter() { setcookie('forum_visited','1'); $visit_count = $forum_config['forum_counter'] +1; - DataBase::sql_query("UPDATE `".CONFIG_TABLE."` SET `value`='$visit_count' WHERE `name`='forum_counter'",'GENERAL','Could not update forum counter'); + DataBase::sql_query("UPDATE `".CONFIG_TABLE."` SET `value`='$visit_count' WHERE `name`='forum_counter'",GENERAL,'Could not update forum counter'); } else { @@ -201,7 +201,7 @@ function AddSkins() global $forum_config; global $default_skin; $all=''; - $query = DataBase::sql_query("SELECT `name`, `s_id` FROM `".SKINS_TABLE."`",'GENERAL','Could not obtain skins information'); + $query = DataBase::sql_query("SELECT `name`, `s_id` FROM `".SKINS_TABLE."`",GENERAL,'Could not obtain skins information'); while($t = DataBase::fetch($query)) { @@ -277,7 +277,7 @@ function IfModGroup($guid) function TotalPosts() { $sql = "SELECT count(*) as `p_id` FROM ".POSTS_TABLE.""; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain total posts information'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain total posts information'); $result = DataBase::fetch($query); $result = $result['p_id']; @@ -338,13 +338,15 @@ function ViewSkinName() $result = $forum_config['defaultskin']; } $sql = "SELECT * FROM `".SKINS_TABLE."` WHERE `s_id`='$result'"; - $result = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain skin information.')); + $result = DataBase::fetch(DataBase::sql_query($sql,CRITICAL,'Could not obtain skin information.')); return $result['name']; } function GenerateLastPost($id, $type) { + $last_post = ''; + switch ($type) { /** field lastpost in forum format @@ -352,8 +354,8 @@ function GenerateLastPost($id, $type) */ case 1: //for forum { - $sql = "SELECT ".POSTS_TABLE.".*, ".USERS_TABLE.".* FROM ".POSTS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".POSTS_TABLE.".u_id = ".USERS_TABLE.".u_id WHERE `f_id`='$id' ORDER BY `ptime` LIMIT 1"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain last post in forum', true); + $sql = "SELECT ".POSTS_TABLE.".*, ".USERS_TABLE.".* FROM ".POSTS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".POSTS_TABLE.".u_id = ".USERS_TABLE.".u_id WHERE `f_id`='$id' ORDER BY `ptime` DESC LIMIT 1"; + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain last post in forum', true); $post_count = DataBase::num_rows($query); $result = DataBase::fetch($query); @@ -372,7 +374,7 @@ function GenerateLastPost($id, $type) $sql = "UPDATE ".FORUMS_TABLE." SET `lastpost`='$last_post' WHERE `f_id`='$id'"; - DataBase::sql_query($sql,'GENERAL','Could not update lastpost in forum'); + DataBase::sql_query($sql,GENERAL,'Could not update lastpost in forum'); break; } @@ -381,8 +383,8 @@ function GenerateLastPost($id, $type) */ case 2: //for topic { - $sql = "SELECT ".POSTS_TABLE.".*, ".USERS_TABLE.".* FROM ".POSTS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".USERS_TABLE.".u_id = ".POSTS_TABLE.".u_id WHERE `t_id`='$id' ORDER BY `ptime` LIMIT 1"; - $query = DataBase::sql_query($sql,'GENERAL', 'Could not obtain amout of posts in topic'); + $sql = "SELECT ".POSTS_TABLE.".*, ".USERS_TABLE.".* FROM ".POSTS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".USERS_TABLE.".u_id = ".POSTS_TABLE.".u_id WHERE `t_id`='$id' ORDER BY `ptime` DESC LIMIT 1"; + $query = DataBase::sql_query($sql,GENERAL, 'Could not obtain amout of posts in topic'); $result = DataBase::fetch($query); $last_post .= $result['tp_id']; @@ -396,60 +398,93 @@ function GenerateLastPost($id, $type) $last_post .= $result['nick']; $sql = "UPDATE ".TOPICS_TABLE." SET + `lastpost_time`='".$result['ptime']."', `lastpost`='$last_post' WHERE `t_id`='$id'"; - DataBase::sql_query($sql,'GENERAL','Could not update lastpost in topic'); + DataBase::sql_query($sql,GENERAL,'Could not update lastpost in topic'); break; } } } function GeneratePosts($id, $type) -{ +{ switch ($type) { case 1: //for forum { - $sql = "SELECT COUNT (`p_id`) AS 'count', `f_id` FROM ".POSTS_TABLE." WHERE `f_id`='$id'"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain posts in forum', true); + $sql = "SELECT COUNT(p_id) AS cnt, `f_id` FROM ".POSTS_TABLE." WHERE `f_id`='$id'"; + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain posts in forum', true); $post_count = DataBase::num_rows($query); $result = DataBase::fetch($query); - $posts = $result['count']; + $posts = $result['cnt']; $sql = "UPDATE ".FORUMS_TABLE." SET - `posts`='$last_post' + `posts`='$posts' WHERE `f_id`='$id'"; - DataBase::sql_query($sql,'GENERAL','Could not update lastpost in forum'); + DataBase::sql_query($sql,GENERAL,'Could not update lastpost in forum'); break; } - /** field lastpost in topic format - tp_id:u_id:ptime:rank:nick - */ case 2: //for topic { - $sql = "SELECT ".POSTS_TABLE.".*, ".USERS_TABLE.".* FROM ".POSTS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".USERS_TABLE.".u_id = ".POSTS_TABLE.".u_id WHERE `t_id`='$id' ORDER BY `ptime` LIMIT 1"; - $query = DataBase::sql_query($sql,'GENERAL', 'Could not obtain amout of posts in topic'); + $sql = "SELECT COUNT(p_id) AS cnt, t_id FROM ".POSTS_TABLE." WHERE `t_id`='$id'"; + $query = DataBase::sql_query($sql,GENERAL, 'Could not obtain posts count in topic'); $result = DataBase::fetch($query); - $last_post .= $result['tp_id']; - $last_post .= ':'; - $last_post .= $result['u_id']; - $last_post .= ':'; - $last_post .= $result['ptime']; - $last_post .= ':'; - $last_post .= $result['rank']; - $last_post .= ':'; - $last_post .= $result['nick']; + $posts = $result['cnt']; $sql = "UPDATE ".TOPICS_TABLE." SET - `lastpost`='$last_post' + `posts`='$posts' WHERE `t_id`='$id'"; - DataBase::sql_query($sql,'GENERAL','Could not update lastpost in topic'); + DataBase::sql_query($sql,GENERAL,'Could not update post count in topic'); break; } } } + +function UpdateConfigPosts() +{ + $sql = "SELECT count(`p_id`) AS `count` FROM ".POSTS_TABLE; + $query = DataBase::sql_query($sql, GENERAL, 'Could not obtain posts count.'); + $result = DataBase::fetch($query); + $cnt = $result['count']; + + unset ($sql, $query, $result); + + $sql = "UPDATE ".CONFIG_TABLE." SET + `value`='$cnt' + WHERE `name`='posts'"; + DataBase::sql_query($sql, GENERAL, 'Could not update posts count in config table'); +} +function TriggerStats($id, $type) +{ + GeneratePosts($id, $type); + GenerateLastPost($id, $type); + UpdateConfigPosts(); +} + +function array_push_associative(&$arr) +{ + $ret = ''; + $args = func_get_args(); + foreach ($args as $arg) + { + if (is_array($arg)) + { + foreach ($arg as $key => $value) + { + $arr[$key] = $value; + $ret++; + } + } + else + { + $arr[$arg] = ""; + } + } + return $arr; +} ?> diff --git a/includes/pms/pms_folder.php b/includes/pms/pms_folder.php index 07da0e7..2526ca3 100644 --- a/includes/pms/pms_folder.php +++ b/includes/pms/pms_folder.php @@ -4,7 +4,7 @@ //private messsages cache - v1.0 Alpha 2 // $sql = "SELECT `u_id`,`nick`,`rank` FROM `".USERS_TABLE."`"; -$query = DataBase::sql_query($sql,'GENERAL','Could not obtain forums information'); +$query = DataBase::sql_query($sql,GENERAL,'Could not obtain forums information'); $user['count']= DataBase::num_rows($query); while($result = DataBase::fetch($query)) @@ -52,7 +52,7 @@ switch($_GET['submode']) } } -$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain messages information'); +$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain messages information'); $count = DataBase::num_rows($query); if ($count==0) diff --git a/includes/pms/pms_view.php b/includes/pms/pms_view.php index 8eeadeb..a5ca2a3 100644 --- a/includes/pms/pms_view.php +++ b/includes/pms/pms_view.php @@ -2,7 +2,7 @@ //smiles cache $sql = "SELECT * FROM ".SMILES_TABLE.""; -$query = DataBase::sql_query($sql,'GENERAL','Could not obtain emoticons information.'); +$query = DataBase::sql_query($sql,GENERAL,'Could not obtain emoticons information.'); $i = 1; while($result = DataBase::fetch($query)) { @@ -33,7 +33,7 @@ switch($_GET['submode']) break; } } -$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain messages information'); +$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain messages information'); $result = DataBase::fetch($query); //if message exist.... if ($result['m_id']=='') @@ -63,12 +63,12 @@ switch($_GET['submode']) } if ($_GET['submode']=='user') { - DataBase::sql_query("UPDATE ".PM_INBOX_TABLE." SET `read`='1' WHERE `m_id`='$mid'", 'GENERAL', 'Could not update message.'); + DataBase::sql_query("UPDATE ".PM_INBOX_TABLE." SET `read`='1' WHERE `m_id`='$mid'", GENERAL, 'Could not update message.'); } $sql = "SELECT * FROM ".USERS_TABLE." WHERE `u_id`='".$result['u_n_id']."'"; -$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user information'); +$query = DataBase::sql_query($sql,GENERAL,'Could not obtain user information'); $user = DataBase::fetch($query); $folder = ($_GET['submode']=='author') ? ''.$lng['sentbox'].'' : ''.$lng['inbox'].''; diff --git a/includes/pms/pms_write.php b/includes/pms/pms_write.php index 4db6e39..617d6fa 100644 --- a/includes/pms/pms_write.php +++ b/includes/pms/pms_write.php @@ -8,7 +8,7 @@ if ((isset($_POST['textedit'])) and (isset($_POST['nmsg'])) and (isset($_POST['u { $nick = strip_tags($_POST['username']); $sql = "SELECT * FROM `".USERS_TABLE."` WHERE `nick`='$nick'"; - $result = DataBase::fetch(DataBase::sql_query($sql, 'CRITICAL','Could not obtain user information.')); + $result = DataBase::fetch(DataBase::sql_query($sql, CRITICAL,'Could not obtain user information.')); if ($result['u_id']!='') { $_POST['textedit'] = Secure::TagsReplace($_POST['textedit']); diff --git a/includes/sessions.php b/includes/sessions.php index e3e1c62..a884292 100644 --- a/includes/sessions.php +++ b/includes/sessions.php @@ -58,7 +58,7 @@ function SessRegister() SessDelete($uid); $time = time(); $sql = "INSERT INTO ".SESSIONS_TABLE." VALUES ('', '".$_COOKIE[SESS_NAME]."','$uid','$time')"; - $query = DataBase::sql_query($sql,'GENERAL','Could not add new session.',true); + $query = DataBase::sql_query($sql,GENERAL,'Could not add new session.',true); if (DataBase::num_rows($query)>0) { $result = DataBase::fetch(); @@ -75,7 +75,7 @@ function SessDeleteOld() { $time = time(); $sql = "DELETE FROM ".SESSIONS_TABLE." WHERE time+129600<$time;"; - DataBase::sql_query($sql, 'GENERAL','Could not delete session',true); + DataBase::sql_query($sql, GENERAL,'Could not delete session',true); } function SessDelInvalid() @@ -83,7 +83,7 @@ function SessDelInvalid() if ($_SESSION['uid']>0) { $sql = "SELECT `session_id`, `u_id` FROM ".SESSIONS_TABLE." WHERE `u_id`='".$_SESSION['uid']."'"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain session information',true); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain session information',true); $result = DataBase::fetch($query); $result = $result['session_id']; if ($_COOKIE[SESS_NAME]!=$result) @@ -98,7 +98,7 @@ function SessDelete($uid) { $time = time(); $sql = "DELETE FROM ".SESSIONS_TABLE." WHERE u_id='$uid'"; - $query = DataBase::sql_query($sql, 'GENERAL','Could not delete session',true); + $query = DataBase::sql_query($sql, GENERAL,'Could not delete session',true); if (DataBase::num_rows($query)>0) { $result = DataBase::fetch($query); @@ -115,7 +115,7 @@ function SessView() $name = ''; $time = time(); $sql = "SELECT ".SESSIONS_TABLE.".*, ".USERS_TABLE.".*, ".SESSIONS_TABLE.".u_id AS u_id FROM ".SESSIONS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".SESSIONS_TABLE.".u_id = ".USERS_TABLE.".u_id WHERE time+1250>$time;"; - $query = DataBase::sql_query($sql, 'GENERAL','Could not obtain sessions information.'); + $query = DataBase::sql_query($sql, GENERAL,'Could not obtain sessions information.'); if (DataBase::num_rows($query)>0) { while($result = DataBase::fetch($query)) diff --git a/index.php b/index.php index 22809b5..1f8c809 100644 --- a/index.php +++ b/index.php @@ -54,7 +54,7 @@ include('./skins/'.$default_skin.'/index_body.tpl'); // $isset_forum = array(); $sql = "SELECT * FROM `".CATS_TABLE."` ORDER BY `sort`"; -$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain categories information.'); +$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain categories information.'); while($result = DataBase::fetch($query)) { $skin = array( @@ -93,7 +93,7 @@ $skin =array( 'last_user' => $lng['last_user'] . ': ' . User::LastUser() . '', 'stat' => $lng['statistics'], 'showlastposts'=>$lng['showlastposts'], -'total_posts'=> str_replace('%x%', $post_count ,$lng['total_posts']), +'total_posts'=> str_replace('%x%', $forum_config['posts'] ,$lng['total_posts']), 'lforum_counter'=> str_replace('%x%',$visit_count, $lng['forum_counter']), 'logged_users' => str_replace('%x%', $sess[1] , $lng['logged_users']), 'group_users' => $lng['users_groups'], diff --git a/install/config.php b/install1/config.php similarity index 100% rename from install/config.php rename to install1/config.php diff --git a/install/functions_add.php b/install1/functions_add.php similarity index 93% rename from install/functions_add.php rename to install1/functions_add.php index e910114..bf98bad 100644 --- a/install/functions_add.php +++ b/install1/functions_add.php @@ -2,7 +2,7 @@ /** * @package uForum * @file install/functions_add.php -* @version $Id$3:26 +* @version $Id$ * @copyright 2009(c) PioDer * @link http://pioder.gim2przemysl.int.pl// * @license GNU GPL v3 diff --git a/install/index.php b/install1/index.php similarity index 90% rename from install/index.php rename to install1/index.php index a769680..2150833 100644 --- a/install/index.php +++ b/install1/index.php @@ -190,10 +190,10 @@ switch($_GET['page']) $config_file = str_replace('%pass%',strip_tags($_POST['mysql_pass']),$config_file); $config_file = str_replace('%dbname%',strip_tags($_POST['database']),$config_file); $config_file = str_replace('%dbprefix%',strip_tags($_POST['mysql_prefix']),$config_file); - $connect = @mysql_connect($_POST['mysql_host'],$_POST['mysql_user'],$_POST['mysql_pass']) or message_die('GENERAL','Could not connect to database server. Error with installation!',@mysql_error()); - @fwrite(@fopen('../config.php','w'),$config_file) or message_die('GENERAL','Could not write config file. Error with installation!',''); + $connect = @mysql_connect($_POST['mysql_host'],$_POST['mysql_user'],$_POST['mysql_pass']) or message_die(GENERAL,'Could not connect to database server. Error with installation!',@mysql_error()); + @fwrite(@fopen('../config.php','w'),$config_file) or message_die(GENERAL,'Could not write config file. Error with installation!',''); @mysql_query("SET NAMES 'utf8'",$connect); - @mysql_select_db($_POST['database'],$connect) or message_die('GENERAL','Could not connect to database. Error with installation!',@mysql_error()); + @mysql_select_db($_POST['database'],$connect) or message_die(GENERAL,'Could not connect to database. Error with installation!',@mysql_error()); include('./../includes/sql_parse.php'); $sql = @fread(@fopen('uf_tables.sql','r'),@filesize('uf_tables.sql')); $sql = preg_replace('/uf_/', $_POST['mysql_prefix'], $sql); @@ -203,9 +203,9 @@ switch($_GET['page']) { DataBase::sql_query($sql[$i],'ERROR','Error of SQL Query: '.$sql[$i].' Error with install script!'); } - DataBase::sql_query("UPDATE `".$_POST['mysql_prefix']."config` SET `value`='".time()."' WHERE `name`='date_install'",'GENERAL','Could not update date install information'); + DataBase::sql_query("UPDATE `".$_POST['mysql_prefix']."config` SET `value`='".time()."' WHERE `name`='date_install'",GENERAL,'Could not update date install information'); $patch = substr('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'],0 ,-strlen('install/index.php?page=step4')); - DataBase::sql_query("UPDATE `".$_POST['mysql_prefix']."config` SET `value`='".$patch."' WHERE `name`='forumpatch'",'GENERAL','Could not update date install information'); + DataBase::sql_query("UPDATE `".$_POST['mysql_prefix']."config` SET `value`='".$patch."' WHERE `name`='forumpatch'",GENERAL,'Could not update date install information'); header('Location: index.php?page=step5'); @@ -250,11 +250,11 @@ switch($_GET['page']) `regdate`='".time()."', `lastvisit`='".time()."' WHERE `u_id`='1';"; - DataBase::sql_query($sql,'CRITICAL','Could not update user. Error with install script!'); + DataBase::sql_query($sql,CRITICAL,'Could not update user. Error with install script!'); $sql = "UPDATE `".POSTS_TABLE."` SET `ptime`='".time()."' WHERE `p_id`='1'"; - DataBase::sql_query($sql,'CRITICAL','Could not update post. Error with install script!'); + DataBase::sql_query($sql,CRITICAL,'Could not update post. Error with install script!'); $sql = "UPDATE `".TOPICS_TABLE."` SET `lastpost_time`='".time()."' WHERE `t_id`='1'"; - DataBase::sql_query($sql,'CRITICAL','Could not update topic. Error with install script!'); + DataBase::sql_query($sql,CRITICAL,'Could not update topic. Error with install script!'); header('Location: index.php?page=step7'); } else @@ -290,7 +290,7 @@ switch($_GET['page']) $open = @fopen('../config.php','a+'); $config_file = @fread($open,@filesize('../config.php')); $config_file = str_replace('false','true',$config_file); - @fwrite(@fopen('../config.php','w'),$config_file) or message_die('GENERAL','Could not write config file. Error with installation!',''); + @fwrite(@fopen('../config.php','w'),$config_file) or message_die(GENERAL,'Could not write config file. Error with installation!',''); echo $header.'
- DSF v'.VERSION.' - '; - $msg .= ($type='CRITICAL') ? 'CRITICAL ERROR' : 'GENERAL ERROR' ; + µForum v'.VERSION.' - '; + $msg .= $type; $msg .= '
'.$lng['info_2'].'
'; break; } diff --git a/install/licence.html b/install1/licence.html similarity index 100% rename from install/licence.html rename to install1/licence.html diff --git a/install/tpls/index.html b/install1/tpls/index.html similarity index 100% rename from install/tpls/index.html rename to install1/tpls/index.html diff --git a/install/tpls/install_check_script.tpl b/install1/tpls/install_check_script.tpl similarity index 100% rename from install/tpls/install_check_script.tpl rename to install1/tpls/install_check_script.tpl diff --git a/install/tpls/install_step4.tpl b/install1/tpls/install_step4.tpl similarity index 100% rename from install/tpls/install_step4.tpl rename to install1/tpls/install_step4.tpl diff --git a/install/tpls/install_step6.tpl b/install1/tpls/install_step6.tpl similarity index 100% rename from install/tpls/install_step6.tpl rename to install1/tpls/install_step6.tpl diff --git a/install/tpls/install_step8.tpl b/install1/tpls/install_step8.tpl similarity index 100% rename from install/tpls/install_step8.tpl rename to install1/tpls/install_step8.tpl diff --git a/install/tpls/invalidfile_body.tpl b/install1/tpls/invalidfile_body.tpl similarity index 100% rename from install/tpls/invalidfile_body.tpl rename to install1/tpls/invalidfile_body.tpl diff --git a/install/uf_tables.sql b/install1/uf_tables.sql similarity index 100% rename from install/uf_tables.sql rename to install1/uf_tables.sql diff --git a/lngs/Polish/main.php b/lngs/Polish/main.php index d29bde1..17b4bef 100644 --- a/lngs/Polish/main.php +++ b/lngs/Polish/main.php @@ -142,6 +142,7 @@ $lng['sticky']='Przyklejony: '; $lng['visible_of_post']='Kliknij tutaj, aby zatwierdzić post'; $lng['post_moderated']='Ten post nie zostaÅ‚ jeszcze zatwierdzony u moderatora'; $lng['moderated_post_text']='Treść nie zatwierdzonego postu'; +$lng['post'] = 'Post'; // //on private messages.....-------------------------------------------- // diff --git a/login.php b/login.php index 94c2e8d..28f1996 100644 --- a/login.php +++ b/login.php @@ -65,7 +65,7 @@ if (isset($_GET['mode'])) $user = strip_tags(addslashes($_POST['user'])); $pass = md5(strip_tags($_POST['pass'])); $sql = "SELECT `u_id`, `nick`, `pass` FROM `".USERS_TABLE."` WHERE nick='$user'"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain user inforamtion'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain user inforamtion'); $result = DataBase::fetch($query); $nick = $result['nick']; if ($result['nick']==$user) @@ -76,7 +76,7 @@ if (isset($_GET['mode'])) { $user_id = $result['u_id']; $sql = "DELETE FROM `".SESSIONS_TABLE."` WHERE `u_id`='$user_id'"; - DataBase::sql_query($sql,'GENERAL','Could not delete session.'); + DataBase::sql_query($sql,GENERAL,'Could not delete session.'); if (User::UserInformation($user_id,'active')==0) { SessDelete($_SESSION['uid']); @@ -88,10 +88,10 @@ if (isset($_GET['mode'])) $_SESSION['sessionid']=$ssid; //session register $sql = "INSERT INTO `".SESSIONS_TABLE."` VALUES ('', '".$_COOKIE[SESS_NAME]."','$user_id','".time()."')";//query - DataBase::sql_query($sql,'GENERAL','Could not add new session.');//run query + DataBase::sql_query($sql,GENERAL,'Could not add new session.');//run query //next... $sql = "UPDATE `".USERS_TABLE."` SET lastvisit='".time()."' WHERE u_id='$user_id'";//update lastvisit for user - DataBase::sql_query($sql,'GENERAL','Could not update user lastvisit');//run query + DataBase::sql_query($sql,GENERAL,'Could not update user lastvisit');//run query $msg = $lng['youareloggedas'].': '.$nick.'';// messaage "login as.." $skin['pa_link']=''; $stop = TimeGeneration();//generate generation's time diff --git a/moderate.php b/moderate.php index e127bec..235a9f5 100644 --- a/moderate.php +++ b/moderate.php @@ -48,6 +48,7 @@ switch(trim($_GET['action'])) Secure::topic_exists($tid); $fid = Topic::TopicInformation($tid,'f_id'); Mod::DeleteTopic($tid); + TriggerStats($fid, 1); $stop = TimeGeneration(); message_forum($lng['tdeleted'], 'forum.php?f='.$fid); break; @@ -79,6 +80,7 @@ switch(trim($_GET['action'])) if ($tpid >1) { Mod::DeletePost($pid); + TriggerStats($tid, 2); } $stop = TimeGeneration(); message_forum($lng['pdeleted'],'topic.php?t='.$tid); @@ -109,7 +111,10 @@ switch(trim($_GET['action'])) if (isset($_POST['forum_id'])) { $fid = $_POST['forum_id']; + $f_id = Topic::TopicInformation($tid, 'f_id'); Mod::MoveTopic($tid,$fid); + TriggerStats($fid, 1); + TriggerStats($f_id, 1); message_forum($lng['topic_moved'],'topic.php?t='.$tid); } else diff --git a/posting.php b/posting.php index 1118850..a92ada6 100644 --- a/posting.php +++ b/posting.php @@ -298,7 +298,7 @@ switch(trim($_GET['mode'])) $_POST['textedit']=''; } $sql = "SELECT `lock`, `name`, `f_id` FROM ".FORUMS_TABLE." WHERE `f_id`='".intval($_GET['f'])."'"; - $forum = DataBase::fetch(DataBase::sql_query($sql, 'GENERAL', 'Could not obtain forum information')); + $forum = DataBase::fetch(DataBase::sql_query($sql, GENERAL, 'Could not obtain forum information')); if($forum['name']=='') { message_forum($lng['no_forum'], 'index.php'); diff --git a/register.php b/register.php index ac3699b..882c282 100644 --- a/register.php +++ b/register.php @@ -52,7 +52,7 @@ if ( ereg ("^.+@.+\..+$", $_POST['email'])) if ($nick!='') { $sql = "SELECT * FROM `".USERS_TABLE."` WHERE `nick`='$nick'"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain user information.'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain user information.'); $result = DataBase::fetch($query); $result = $result['nick']; if ($result!=$nick) diff --git a/search.php b/search.php index 7a34a53..0a24fac 100644 --- a/search.php +++ b/search.php @@ -30,7 +30,7 @@ SessDelInvalid(); SessRegister(); SessDeleteOld(); $sql = "SELECT ".POSTS_TABLE.".*, ".USERS_TABLE.".* FROM ".POSTS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".USERS_TABLE.".u_id = ".POSTS_TABLE.".u_id ORDER BY `ptime`"; -$query = DataBase::sql_query($sql,'GENERAL', 'Could not obtain amout of posts in forum'); +$query = DataBase::sql_query($sql,GENERAL, 'Could not obtain amout of posts in forum'); while($result = DataBase::fetch($query)) { $lastpost[$result['t_id']]['tp_id']=$result['tp_id']; @@ -40,7 +40,7 @@ while($result = DataBase::fetch($query)) $lastpost[$result['t_id']]['user_rank']=$result['rank']; } $sql = "SELECT COUNT(*) as `p_id`, `t_id` FROM ".POSTS_TABLE." GROUP BY `t_id`"; -$query = DataBase::sql_query($sql,'GENERAL', 'Could not obtain amout of posts in forum'); +$query = DataBase::sql_query($sql,GENERAL, 'Could not obtain amout of posts in forum'); while($result = DataBase::fetch($query)) { $count_topic[$result['t_id']]=$result['p_id']; @@ -105,7 +105,7 @@ if ((isset($_POST['keywords'])) || ($_GET['content']=='lastposts') || ($_GET['co if (isset($_GET['u'])) { $count = DataBase::fetch(DataBase::sql_query("SELECT COUNT(`t_id`) as `t_id` - FROM ".TOPICS_TABLE." WHERE `author`='".intval($_GET['u'])."'",'GENERAL','Could not obtain count amout of topics')); + FROM ".TOPICS_TABLE." WHERE `author`='".intval($_GET['u'])."'",GENERAL,'Could not obtain count amout of topics')); $count = $count['t_id']; $count = ceil($count / $limiter); if ($count==0) @@ -139,7 +139,7 @@ if ((isset($_POST['keywords'])) || ($_GET['content']=='lastposts') || ($_GET['co $like_where .=' OR `text` LIKE \'%'.$keyword[$i].'%\''; } $sql = "SELECT COUNT(".TOPICS_TABLE.".t_id) as `count`, ".POSTS_TABLE.".* FROM ".TOPICS_TABLE." LEFT JOIN ".POSTS_TABLE." ON ".POSTS_TABLE.".t_id = ".TOPICS_TABLE.".t_id WHERE $like_where GROUP BY `t_id`"; - $count = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain count amout of topics')); + $count = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain count amout of topics')); $count = $count['count']; $count = ceil($count / $limiter); if ($count==0) @@ -178,7 +178,7 @@ if ((isset($_POST['keywords'])) || ($_GET['content']=='lastposts') || ($_GET['co $skin = array_push_associative($skin,GenerateHeader($window_title,$navigator_title)); include('./skins/'.$default_skin.'/overall_header.tpl'); include('./skins/'.$default_skin.'/forum_body.tpl'); - $query = DataBase::sql_query($sql,'GENERAL', 'Could not obtain topics information'); + $query = DataBase::sql_query($sql,GENERAL, 'Could not obtain topics information'); $value = DataBase::num_rows($query); if ($value>0) { diff --git a/shoutbox.php b/shoutbox.php index 8bc423e..aaf371f 100644 --- a/shoutbox.php +++ b/shoutbox.php @@ -25,9 +25,9 @@ if (isset($_GET['mode'])) if ((strlen($content)>3) and (strlen($content)<300)) { $sql = "DELETE FROM ".SHOUTBOX_TABLE." WHERE `mtime`<'".(time()-$forum_config['shoutbox_max_time'])."'"; - DataBase::sql_query($sql,'GENERAL','Could not delete old messages'); + DataBase::sql_query($sql,GENERAL,'Could not delete old messages'); $sql = "INSERT INTO ".SHOUTBOX_TABLE." VALUES('','".$_SESSION['uid']."','".$content."','".time()."')"; - DataBase::sql_query($sql,'GENERAL','Could not add shoutbox message'); + DataBase::sql_query($sql,GENERAL,'Could not add shoutbox message'); } } echo ''; @@ -37,7 +37,7 @@ if (isset($_GET['mode'])) { if (isset($_GET['id']) && (RANK>0)) { - DataBase::sql_query("DELETE FROM ".SHOUTBOX_TABLE." WHERE `m_id`='".intval($_GET['id'])."'",'GENERAL','Could not delete shoutbox message'); + DataBase::sql_query("DELETE FROM ".SHOUTBOX_TABLE." WHERE `m_id`='".intval($_GET['id'])."'",GENERAL,'Could not delete shoutbox message'); } break; } @@ -58,7 +58,7 @@ else } $shoutbox_content = ''; $sql = "SELECT ".SHOUTBOX_TABLE.".*, ".USERS_TABLE.".* FROM ".SHOUTBOX_TABLE." LEFT JOIN ".USERS_TABLE." ON ".SHOUTBOX_TABLE.".u_id = ".USERS_TABLE.".u_id ORDER BY `mtime` $desc LIMIT ".$forum_config['shoutbox_max']; -$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain shoutbox information'); +$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain shoutbox information'); while($sb_msg = DataBase::fetch($query)) { $allow_del = (RANK>0) ? 'X ' : ''; diff --git a/skins/subPurple/forum_body.tpl b/skins/subPurple/forum_body.tpl index fadcce1..c11cb4b 100644 --- a/skins/subPurple/forum_body.tpl +++ b/skins/subPurple/forum_body.tpl @@ -6,11 +6,11 @@ - - - + + +
- \ No newline at end of file +
diff --git a/skins/subPurple/images/Thumbs.db b/skins/subPurple/images/Thumbs.db index 8fb3294eda5c1b5d34749adb97c9e6686a2127be..893fff9b7f36184abac8cf9c1121a6ad132b2070 100644 GIT binary patch delta 3901 zcmb7Hc|25WA3tNJ30bmtZF6PIzDJ13GP09|vfOluY$=&hI3m>88t0-^goIp6#*!_Q zrD#`{>|3QoMwTYqywBWQ@2C6z@xGt;d_Lbf&+|RM=Q+Rg{ML!7WQ%EHt7J!GtRV`~cbWYR1TY3@1Aqm;iAmavrk_ zVPI?!Ggb9%+W={RVaWl(M3x|y3k4=DLDmI?Wss#UBrevQB*23>04fRVfMHX^Ae`*C zQT)_}fX68Kt9>dg?7fhXGU>I0lrZGf8;$!QB5>plgJ`kk{(!hsgyyI_!3|SzGMsbT z+pMtCQtloOA`MMUlbihaX0^h)CVgRZMk)>@q%G5A@S*%EuJFa;!Ky}dW`dbCoB87g zbq_Cb67dkdChgLuko-k?dU!*X&8lbBQLfi-tPSA(R1;mU8_C@ohqzKX#^=hVTP4}L zVc(%LyEV&&y^|!*_s{i)+Ui_yO99zJ#_`!MzE;+;^eN zM!T60J}Y%wRPp#4v?zXX!tUU=8QJ%%Mg5+c>-xCRb+wIrZ8Z^+h)qw;P@@OV-6*Je zc}eZ+V4`omcc)6eYrIdVjcmXp}v(H-h$v& zXzA*Bq|<~4d9J0It{R5WQZQ^gvDCAwmMFwjRRdcO_6S5HXZ2LDm#nLRw^GaWhR{@Y zZ4w5dncxwc1wP#gkDOJJL~`6X6bT}hKn+wN6apQC0w7iBIOGrcf;}Ke27r$>P%tZE zsoL!!$;GR(z!EtlkfHi!NZTsNb9u(dis`PL@W1fK>h& zx41N%NKm9(9x3;sq-@4Jx^SZ5O15Xb_?%GlnoP^_#m_C%MOSwzl4Eo zPvK(cPKVqMAiQ<=cM&bvakIHfw=`57E`BVg=Wr~L&9p+VvqF@yh3@3CaW(QtDXFM^ zweM1>ziQ@+#)I20l&MV>+R8D~g!&hmc(hD9gl)NX^2!N^R(-wW1&p1we|Xe;)J6_2 zdKmeRJZC3dzgei=(zIsOuvBL^!u#4do(WYO#ZS(&eay~mj0hhKm2)T z#w2p|(Xfh`(DUd6`rV#K=mjfQ9>-|WG;2NL#5{~_2!MMnI;qsn)wbFVudV2XhE6=3%~Ev;f-JQ zVM1-sPMfIfwbWL}KGo`aAIK}HDR{#;{6YG@SYGijI-3e47nhfj22;EjLdVLJ$_?za zhn_rCFMNMP``!8*_zm{O=aGD1qPXk7I|pgC-QU94KKP!RKlG?Tu3$@9Q|<1#`rk?D zKYau;HPtVpV~N{&wh60j@S0punAk`VUN0YgrWXIm_VA#4*QYb3&CeB27AZz9^Dl;k zt$unnmS{Sw#xf7#yLp<4z&wf1>RPJO&dCt@tQH(CE2lmSr;w-R{U!V=R2lYbvT_yU z5?W3RN33rLtR~sQr@dEZ4i7!Q`p)%QZd370(Xgn}Vqma9;?YZ`JNnbD?9IwEn{m!R z{NL!Ghg-LjSk)hNU&n88n3Ux4s`{C!J)fVhsO{pB!opdCMLi*zKfSTt@qETF;SZ<8 zPk)(CXgXHD4$~#Z$jjIEo(#DA>6JfkslAftjBxlJf^T(#P@U_5$KyG32hPmE82k#H z>?NkGlS>w@V&oncjjD@3;}%%m!jm9&Vbm>Y4z{})LV4?kdmLMW)2r$#yJC7bcd?^$q$(EsUq7-sf5niJuLT>Qj}1_BKAc z(++oqrJKzO#yVhiw-UOTwk zp$M~`Bu?n#d9u>Ny1V9C68UmcsgGQ38tn8ku6X=f?V~&HBp36>zPvv9?pe9sydC6C z>x2GNl1WlxiThrzR9rC*g4z9Cq7@iH!~;f2MYhD^6G1@{hM5%Va65*SN|079SS#8| zR+`f@-6SwVR+rU!7PWZCt=FxWj4ET<=kii_9COW2F_H1hb3O>n`eBQpqZiV{7%Q2> zF$WM%-`z+I2c8<^3sN?#XOa9Vfg)jk_S`5|+k^X=U1G7UwEpYQY?!}2(uUEXF8SMl zq|AXYhzUlgbKuY)YS z3V{3;p^e;%5VZXSCbIx@0G|Qo0q6h=0ABzW0hR!k0agIM0x$r+0kF3JfeqH2x*U;& zLTD`I&f&4?TA-4|;z8xn0<|ta4l#8G$|eA11->iF`slyAyo3vE`WWPFqUB#@`VH7D z7)@PGd{hC%w{UjTG!lKjkR*j=zqU z@XtcrTwRApqp}~5TPU0_FMlG$FLGJP48E-36#F9ki#?iAfbVPaS8n01E{-$^3L);j zk(Fe)i>+0)Y>G?}aU{fwoNq5YXrLaI2n8RIW-QXD4`k6sH5jV>!mGZu!A9MM!!ya= zu`BJPWpJxaavn7vyPGDXznC27K20;`vR~7TRO$^I6PP)Brek>UdKQIyw@Vg@l$YXw zHTQmZnT~o+(6m!pRpU;GS2m`$Hggdq5awjy-dR$BNuOWiL00mY1Fj5`1k<MdkQww4Yd75Y~bs}6+vahVEf;uC5I4R&_oz2A|85_-aZhwq_ z;ShSMcClR_dyUTrYv7lKGZUJ^N!C!$(dS*0NU}{iTQ|b3Hm}lrKI`m>eta&hE+8lX z4wE}@$nfjbbh{cK$$H8qb$#!xne>4VtB2}{KF3eo`EzH&o~w?hXh;myC9~G|Xf}gw z{nSQYlfw85aqaB+gc>R0N~16(kN;aZVwG!X?tXO2^nrvrsWYFveD{pJy-dj=?h-}Y zk&tNX(Y4VH8~t47fQ3%>Km%n>qGBDltnTY*@ zd{WJmjl-=&2k%!VKCNzOj`z(RsC%?Xc*=lh=008LK6RtLq6Qw%WkO#F%eia3&zR7yl^%z! RAlFM_ge3lJ0s^T``d`I47v}%~ delta 2747 zcmYjTc|6qVAO8+xSjHkGMk4iibH)KJ?2%IET>x0CNai5*tB^?FhMvEInB&I{@dn?-fxWgZ|RcEjAYcRFvA zX>NecU`yn#<-WC6_-S+=&h$3M)3gdOAyeAHR?-B?SvO+0TWG%53lgcQvFu~)F{YQ5 zX**kA_S}w2Q+w&8l42o^=DGRXErfu<&bqh{wBj-0R;?Kx1(3g>GBc{(J6}c8UR1z) zRQ0=I{W3FaWv}^Uqe7#Ln3}8d>z)y%T%o$w`-MS)10ex@Es~YR1@f$%K zo)i5M=RYW>ov*ahT|B!db654AL*hZZ-2T9cqi+n={J` zp{|d{XW3eP6-Q0a57*_tAkuRkI{R$X6fQc+;(Y);K(r|Jr?rz=E_SCP!CRs#;8nN^ z$PyJ{T$W(MkpfT}At3uVy%^y#hC5)*V1ctC!EHt*(Fdk0T z(?n28>zI50VxaX#1R0ktm@p*YgE+LB-}Cbw47YR?hwX$Ax$n_sODCiX1nl?@WQ1EC z5d`Bg*jj5A9ArVg?KQ-9-4!@kZ2!({2NaxYie+GrB|^tlfY^%Pc@UR_%B^qvxPS== zv$O^eUD6ZRg3$bLD29(Bl_1jY?}$Ps&=P;fXV+vw5NoOlcKjhBtOEoBL?D0>my-yi zN^u$7yd;RmG)K#SS`AbBfV=eAO(Q4bY2T3Had zZ0P>{?3PB=f&FcRbRD9-IS(+HK^v}Rmqwgi45!v)jc|DY|OhkEt%y z+jFZ%Qag=AZ|*N=0X{Gr8TZ*PtrF^UwiRy($`*BgVhebF(>{LGG}ddDc6N^Iw%wp~ zv?P$LiII<86SZ4oOOjI2-FMw%(^Kxlb><3TbgGrFW6CIsv)E2L{OC8#=fI^oG<)8F z@Io z(tAFoe{4{}wDlIzMLz9|8~#iV>OU3A4(m4c_fM!W|M^8koF<1@d7;be&ScQ_Cscw; zRhGLthsH){bkLK{gww*8Ki=#|C*4DMGE)xj(L9TbC^FmwzxT7$f%8D_+-GD0@{g^^2NZc4(cr+ ze8P=sH-Yx+7#pGt5Be@{=sZFjyj-&_bY+rX(X`|rPjq#ezRT01x0Q-KJ6)3ft|2aB z%=^H~nI{^~Pc+lpO;1#`61yIRnzaTjED!!ReS$N%dUZXGllU_Y$H}-%sWlv0@LI67 z>>wG>c)E%OQ;pRo5A70G3V-*)Ms@@lpizK7;by1vl-9@9Zv#aGj6oJu!SMm@Fr+k8 zBg&BdUoB2Kg4RO%;PSUVocMLlSSB8UQ_Zl&@xf4mnqe8Nb1VTco<9gr6!^*rkNU=p zT8DQ+wFh#dwc&&O!5%V3gnxT~y}^CRhT>BYIt|%-$Y#JyvRtN*ZEZ|E?CYi7Zf3z? zoyQ`m=8(!HV4>~Iu^{VW;`Sz&zHM?TNgz!Sj7hc=hw(3Te!c(u4~SQg+h5^~FUgOg zBbsAt)1afW%n$7J6S@xx1}p*y2G0Da5R`8UA-_qvo3>&6GKVl?l4%=a;9=sAl7FHc zqZFl_{Ve*nMuyk*Yd&U`x=k#V9tFf)<&-aSl5woJiN6VZP)+Or8)RzF#A@^x0A?A-DL^n7GqZPby4B;w0Td$6!x znnANd#anDRq`L-D@y>I(ZNcBi`hgLBSHh&U)ly~&c9^8V{Q&i|U?ksHAp3PH5 z4`kR!5IY)`{HscLwVtx;UUFE_#Vz+&<&NBXFX@t%qYxSB4vE4-XCCFNAQ(|C6cO8T z163^)e}uyPU*w$rlZg$=Oe|qZxC7)KT~8KUZ*2b{UY4?=NQl0-g(AGKY1`rOP>n!t zGk%UiHvJlV)BmV54@eqo=K;&c>y11>0(XN4wByYd!16J!<2p_Kc5dYu&cgf7K584w zIA&IGx)AwE&)*{B%@xGK*~izRN6#ok`*|&e!g)4B;~u9_3lql; zY^lF=+!4RkOU2}fh1R5{&u1R=jna^zdH~|GG#&uwri`zjn7~Y4@i^%yH(GhvC~v4G VQ>eijOJk6;g<;^^YbU=m{6DL8`)mLJ diff --git a/skins/subPurple/images/delete.gif b/skins/subPurple/images/delete.gif index 28a3f01697b10fdc7a7f78bb6cec5d237e1eb4b4..3ffd86a227bdc609b2bb0c7982b7d10bfc8b0908 100644 GIT binary patch literal 1024 zcmZ?wbhEHb6lM@&_|CwvZOQ))bN|m{BLg!J zhpE5~gAEH0aPTSx%y78Kc!YzG)k~rv@la#Gf~kAQ`Z=jPg1+A*wRaBAjd;#$Kp%R$qhHDY#FfrG=LkY!$* zlUfZL9Imq@t+it~AjS~M$i%kfDW`+xZ3eciyo?Lm-bHP*VP1eALS*NL=8^EMO#j&*y;R5mpWdXM+ZY##Xka##|>39B6L6EhqKh R%#904Y`l^xX*?VZ)&R(0==A^q literal 911 zcmYL|T}TvB6vzM5&Y-PgcHLPl7Tc{LQ!A6j482sm|aC3bTA7V8SZ};BSyv&?Acg~zMzw@6ntruGw zPT#P=f;B)kz)%LBi|!-};n*5}FTbeHwKK=+H3j)hRUJDin$k^=Y(6eFt*@#yqq>K-5%udAPzs z)07OAH`%b;y&oBec(2#)_aLJR9}7T|H^A1z@RlFtyPZX2pbBV+;e!T(R8CPVp)9WX zk;;IGKcy1_63r;gOJn(ylaMHPj?B&S}$^M4$&O;S9KywH&dnj2wUW({1W zwj53ClxP(8hQ3s~l#mX_?p44t>B}VD`7oInF&UtL~bvoEvL-R$5g5 zXFas|>BXMT>*xE)>q~=&OmA$%dw+i(EIu_e{j_Yn{dryWtC8=6N7{o2Uz%?pJ(+18 Yw-v4Q?7Lqz8>sU=`S@eb{zXUQKlo+%?EnA( diff --git a/skins/subPurple/images/lng_Polish/Thumbs.db b/skins/subPurple/images/lng_Polish/Thumbs.db index 76906444ab8f4c0e379b57175a9c48ff6960fbfd..3428cdb407e9491a14201ebab878891540867da6 100644 GIT binary patch delta 125 zcmZqJ!PKyWX+sW+u*0qXK;|;Hzi|7|qS#g+WuzT|&*<$v9<|I^$5A6)nU=%)X< z>Hir_|1)U(m_GCWo|XTXP5JMe{of(!|EcZ&7ccz3Z_|HXhWQau|F^FG&mjLP(eE>l z(|=C8|HpUyH}d*_`M`e$hO|*M8Ulkh1QdU=FfuU6Gw3h?0Vq$fb3A6S=Maf#WN7B$ zuoQS=s zL4kuqQ`nri-AzlS8XRt}NVr_2>mYu}pMmk3-GuDMbqp*v)+P(Qr>|#V6yQlo&}eLE zI8?;1{Gs6^b1NGMU-rE}<&JDT%)Cks2P6%fSa~@tT6P>bkio&hBe7$G)nj%BX^Dy* X2W~qz&)>!#b>~20^N}7#Mh0sDo(bvX literal 900 zcmXw&Uue@%6vltCtE)kzUY9yVFjEnkf^(KJoz^Mn{4-oZ&^}agC^BWj@Lv>yhUidm z53MgMh*Jcg1|s<2Lmg!k5kV0)5LB>jHr+sm8_qv4z22mH6Ox;pFXw#c`%YSRZf{)Q zUPTo@pu(+~`7<-~rvmi1T`VbrK&^2N)4vDHX{Pwp5Qch~_cn#@F)XkkXU@`1v}tsU z&WJX;2@zA6JSPf-1zE7qcSR$`kSh#Z1$tJZsl#9UQsDio^}^(1M3wdPx6lkv3HD>y z1w0WDs>Ylsn3>2}MRk~oEEyYHKKUw(v!%#N>=WnAux@6Dr)|qJaw%Q+TuszMiZky1^Nzk>s5Y=cQuW2rZIC4?`;1quFX_qodO|9$=lXS+!b`P4erlCG@NX8SrHFH7lXC*DV4s%#zcD3p9{^H6t* z@3jb5SwS_`6ZB?qlx|(fFfxm@krE;4l{mhJ#KT(9A?*4bSKm4=wlXj7P#Q1uXFyUb zaTQ#4K)URfA`#uFHF(5=0qXB3(S+No>h70|ze~@N!j_ngR>_MB(Wc-XKa%N$XShOP z4$bYSDnXl1G&B6ISnr88KhFnVdRkf9i^TJkys|HQh#u1#CW)yrB-YR71g=lCRf`sB z5cv8WrSBM1lXbzUs<9nG6Tb1C-Q%NQUyGp@6{z`Dp;XjZt?=rPsG>5`PAIZ?WzyN= zMiwkepR21G=w@mC=~S}$*)3@Tu|I=IkAKmo-z`Fmr z>Hir_|1)U(*t7Eg^qK#cP5JMe{of(!|EcZ&7ccz3Z`1#XsQ+76{}*Cd!XW>N$Lar( z?f*IL{-4|Xe`?SF%Lo25FrodLWX7@ z4oi_61{)S0;NVpXnBnk|@dyVWtCvDSqEl19g1*3n2LXo|yA*=e0t|{07}%skPO%(# z(CEO#Xrp%Ez~<#m^SQWWegrIRJlAhq$yCa)@L(GQdl*ybge#4q%Vgw4CMbMe-mofM zQ9xru=)q8C2^Nb7oC|arHZn2^?0EHHbu>>NyTXc{3mc;um{^{$8YD2VFiTq1ObAF| zczB?N+uN;x;W0ZGuZ_n&n@YzvZf0Jkh66VZnpk_oFidFArbD Y4c`XFbGMjvvmPu^Z1QbqWMr@g0O)b*M*si- literal 881 zcmXw&T}TvB6vuzJ+T5gMz3psE2#o|05oEC}MYTy(_93nhQ5zW)R9I;2Q)@8fI%S^{ zyVScr7WfeL5~8wM&?gZo^ia^wPEtaMO7;Qf?api+hM6;S&Ybf<|NprS`}S=F4+l0XMp1x)4afS?O=$ESZDJosYBpDbm7lcj3EXfRQMKQh# zS*vpjv=<3T@?c#^_XQncOT*HEp0&DE_<{PzndIp0n5s0XceBP|tmVsS*bI$Nevdl2iVI8&C6SO`iUw*{!X#E*4I zTT4Nd=p?;4vYNLvDuBwPER;ejdKFoZLt+8pPYCr|?t56({7`OINlRgF&XnAclv)*9e>S%yT*H<+=lIfL z!U>Wd(A?N}XOky^*60I#Bz2k!De_Ugzr*5vC&8#KK_B-ur!zFA3Hj zyf#%Fxw@=+XV2H1Q-8C1W7F%P={&hrv;Ewi;JekkyH*~!vg_W16EAPCIWqDzI(q6= Wcl_v$!Rrr8&+>_`kzLUcTmJ&B4*RzN diff --git a/skins/subPurple/images/stick.gif b/skins/subPurple/images/stick.gif index 0b1f0d1f79db8363d5fee0cf2550027e4bf9adcf..a1073bb7c76487d9116376d436b2aa7df2468416 100644 GIT binary patch literal 1061 zcmZ?wbhEHb6lM@&_|CwvVebEy-v82G|1CrQ&+hoIE46>ylK&HG|Hqa7XVCiTnDl?` zvi}FS{6DzvKLbP8o|XTL8~+z%|3A9difAPfsyEpt-bNzpA z?|&h?|IAkZ85F-Nx{c4%Z| z;cz(cV1WaRoRCJw4u{4D21b#J8wCc=O14l!{XXge^wu)aR3JV*XxCQh~Y$_ZZgV|T5*Nj}bEqiL~V z!{p^HYqj~+B0exQFwf+FB&D#R@r476tkjWGf$h4D%wje^cNZ*hX5GurAz{Gq;6MY5 zIJ?${UkMw}Gxe}*L=*@dV%W(hr^9+6;=qwcXG!J*4h;@0JgXRa91J#SWgn0-iBM=@ zJn)J`mM!hWfkXy&ehvYS83_*$#Ghq1XOUoNRCZ#NWy|<*V5i2pm*PBJOgtP6)&Mz! B@jd_m literal 910 zcmYL|Ur1AN6vw|;@5S{`^w+&(l=z40A)96~Y@)27bZUW%peF1g3u0)iJ(v<)YTQEh zB%2`25`>=WK^T$vB4b3s2(&^WA*=myIU!{DFbl+Azu#|`KkhyE{O-Bu+|T*mbDdos z_Le>sDz*UGkhgcXw|8U!Um(@6il74xUkYcKMo`T z0v|B=5V8p{0G&nMaYRzm5Ml21{50q!XaH1C;LQ)D3CjSS%fKp2=DE43KRK%qEzGhl zQEa3TBD{|Ol}`yO;l;2%tW$T8MkeS`fI|1>p-_aWPp5<0YwQogScEM_qI6lw`ltB|BR{O||GKFvey8b(qOUf(6%mb(0D9^$WJ$?<9DKZQ*PmS9! z)Bu;L<2?>f{*y%b^Zk1`uvH^DQ$&WX0!VZIIMDP2g?bS20W7d=U@C-w&MEisDH!<_ zh0qYqinNQ|z1GZf0|vtcYyqU#wPIgyDe5TZ8Ij^VuHp20!yN;zQVzPNuI)xgX^6PKxx8{87sH@A-I1%JDf z?dtx>Y;Gl3d4&HHPSXHNO;z^%{87VH8I$6!07g(=|FrXSU3-umZhRLBB|C!VlXreu zZe}{iO3sb6wN$QN9BnuiQztfG%s;mt_<5;!EVVFNb8OSPoX>uI*4|e#-gPbWKGYrl VJ{LLj^77<~L;c@Aj1OEu>t96;{l5SJ diff --git a/skins/subPurple/images/unlock.gif b/skins/subPurple/images/unlock.gif index b8d436ac7df979af04a4e30426307426325ca91e..54ff5152f0368e51246879759ae1626f388c5eca 100644 GIT binary patch literal 1031 zcmZ?wbhEHb6lM@&_|Cwvf6f28uK(MY{NFJ5zpU5)xRU?VTK-$9pJ^%nuN(IN$fp0f z>Hir_|1)U(m_GCWvMK+4v;R9J{Xez+|Kf%J_ig&m$FLwG>i@2l{~6>z@i_fIvi(1& z-TwsNPexw<&+Ywx`M`e$hO|*M8Ulkh1QdU=FfuU6Gw3h?0Vq$fb39?N=MeE&$iU3Q zVJ>pPV8cQO4qgSH2@V$-T{!qy-4qxcnwt6*^aVN|7&tL?DcDQ>;7E9KfI&K_$;RRH zVg@!o79oxYhN?}>Tzmx#3=15Z_(i0?uy8h{U1oNXH@P67!062&x+#sd!0|vUH@}&M zhJYhu;F>7yn%LhB4vd>z_Agtjupsa5Hb$m`80+in8W`CMvN9fQe}A8mUm)Sb2Sukw z#?t3}GkA6|ALAF6l2~wN=B7qg2|XT@j0cYCN9Ie56mS$aHeTY7Q{J$^>Tx@Rq(sSv Y1G|}<=Wb(vrnU3CRVuih~At6CFO@qtIq{S*NlJgKb&;%7zjG-_=GzMpP z@7_&VdUDo>-cn&7_CbVYUwTj(c3(6i1ciMlYG!UyLWl~w8@8tZ+jU#ntnO4rXSQ-=T!9Pnf6PVbBZnix^I$7yiCawPx2bm!FBFmIZcPit<@5 zQn8Z4h_b?~tF(WEw~Z|F%WByCe_zh=)hy}lfLi`Fvf+NCIjZ45Z%CW}xXJHOk>sCOSs1iz|6hg6}a03lVnnuHQuKk(RcU=#u%}cn{ z_8R!hyWjp@1*s_R7gt`bt=3>0gAM2KvX0V4~Wj~oK)k!7!PoMWy3d=2t2q+qD;+i`0_51Nh5hkRF5Iib>2+j z1w_Y;NR^}@(C0IjCpkLoua9a5>kkZ}WoBx2Z};G5u|28--T#ENiUzOfeEmms61FC2 zvbqM+E}qp9P0Xa1-oDj#A@yFqP<#AswBwVX?i6}P?}*`%t`{HlY|eK#Ee=k`FS*~n o^g&#GGx=@U^syoH5!8pXPg&G41VfUc;m@=f|DFqCS!*KXBlBkd?$$YD|&5A`Zk#M zQ&tXaG#j*CHMD8<@Md$(77HzP%?Qo%I-Po-L3`-t@brk&>toJuyD zBQFK{r%{lK!ZVPjq3A4%(^0~QOn}l1$b~2qL6He%7Rs}6E(aB2ROX^eg6cfffB3v=d`p81Kf!72NE>tzO*j!<~Li z4q<8-)0+SO%K}z&dL)7XVN3ks?-L6RKw$oHoQq2i+0t3${bsL7lWr#`)b-gci)|6N zq;n%|HzP;>#~$T0BVTDBsAeg_oQK;bnT9)d;CeAOx6a^Lc=dwdZMA}W-mjkN^e|h=@2xUtgRCnkaw06}Jl-qFpOE&mi<6yLT2!k`xFeRztR_5rOvTLB2I`JtTv%z#w}2Et z5CjHpL$(11ptGpY!f09=B+Na#G6^~k8V1!9c(;HIVHtq;7x0HA^W1zal$ue9X0mKo z49jUm39l1+9aJKUIcMraI`u{9=olRgQ|Q4JC=@0Q>U2Px!tMx+Ip{-xsHySt=!r#3 zW@Ko*$(CKda^z~ndjr)WKXRJzF%P7918m)iZTc49Z7-StRX|OK4;qP5IYXUKQQG|6)xs6Z3$R{X- zhGPoCxx=lyr)zyycAJgy*`!L9a=9AbCUFzlhrf5Kr^+_hD7cC9s?{5Vo}@PKN)dFFj+ujzaI zYOnR_(Z03|m1DiNU+hm=OTONDPMn diff --git a/skins/subPurple/post_add_body.tpl b/skins/subPurple/post_add_body.tpl deleted file mode 100644 index c3cb01d..0000000 --- a/skins/subPurple/post_add_body.tpl +++ /dev/null @@ -1,61 +0,0 @@ - - -
- - - - - - - -
Post
- - - - - - - - -0) { if(RANK>0) {?> - - - - - - - - - - - -
-
-


-
-

-
- Post - #
- :
- : online -
- quote
- - - pw
- <?= $skin['ua_system_desc']; ?> <?= $skin['ua_browser_desc']; ?> -
-
- - -
- -
-
- -
: : : :
- 
- diff --git a/skins/subPurple/topic_mod_body.tpl b/skins/subPurple/topic_mod_body.tpl index 6d2516a..54687ab 100644 --- a/skins/subPurple/topic_mod_body.tpl +++ b/skins/subPurple/topic_mod_body.tpl @@ -3,9 +3,9 @@ - delete + delete - move + move diff --git a/skins/subPurple/topic_post_body.tpl b/skins/subPurple/topic_post_body.tpl index bd2dd03..0b36895 100644 --- a/skins/subPurple/topic_post_body.tpl +++ b/skins/subPurple/topic_post_body.tpl @@ -1,10 +1,9 @@ - - + @@ -26,11 +25,11 @@ diff --git a/topic.php b/topic.php index ac5b9f8..beed321 100644 --- a/topic.php +++ b/topic.php @@ -54,7 +54,7 @@ include('./skins/'.$default_skin.'/overall_header.tpl'); include('./skins/'.$default_skin.'/topic_body.tpl'); $sql = "SELECT ".POSTS_TABLE.".*, ".USERS_TABLE.".*, ".USERS_TABLE.".u_id AS user_id,".SESSIONS_TABLE.".* FROM `".POSTS_TABLE."` LEFT JOIN ".USERS_TABLE." ON ".USERS_TABLE.".u_id = ".POSTS_TABLE.".u_id LEFT JOIN ".SESSIONS_TABLE." ON ".SESSIONS_TABLE.".u_id = ".POSTS_TABLE.".u_id WHERE t_id='$tid' ORDER BY tp_id $limit;"; -$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain post information.'); +$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain post information.'); while($item=DataBase::fetch($query)) { $ua = UserAgent($item['user_agent']); @@ -113,6 +113,7 @@ while($item=DataBase::fetch($query)) 'ua_browser_desc'=>$lng['browser'].' '.$ua[3], 'lno'=>$lng['no.'], 'lpinfo'=>$lng['postinfo'], + 'lpost'=>$lng['post'], 'C.delete_post'=>$lng['c_delete_post'] ); //do it! diff --git a/user.php b/user.php index 36d717c..b6fca7e 100644 --- a/user.php +++ b/user.php @@ -31,7 +31,7 @@ SessDeleteOld(); $uid = intval($_GET['id']); //check online for user $sql = "SELECT `s_id`, `u_id`, `time` FROM ".SESSIONS_TABLE." WHERE `u_id`='$uid' AND time+1250>".time()." LIMIT 1"; -$query = DataBase::sql_query($sql, 'GENERAL', 'Could not read user active.'); +$query = DataBase::sql_query($sql, GENERAL, 'Could not read user active.'); $result = DataBase::fetch($query); if ($result['u_id']==$uid) { @@ -44,7 +44,7 @@ else unset($sql, $query, $result); $userwarn = 0; $sql = "SELECT `u_id`,`value` FROM `".WARNINGS_TABLE."` WHERE `u_id`='$uid'"; -$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user warns information'); +$query = DataBase::sql_query($sql,GENERAL,'Could not obtain user warns information'); $result = DataBase::num_rows($query); while ($result = DataBase::fetch($query)) { @@ -60,7 +60,7 @@ while ($result = DataBase::fetch($query)) $userwarn = ($userwarn>0) ? $userwarn*10 : $userwarn; //add skin variables $sql = "SELECT * FROM `".USERS_TABLE."` WHERE u_id='$uid'"; -$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain user information'); +$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain user information'); $user_info = DataBase::fetch($query); if ($user_info['u_id']=='') { diff --git a/users.php b/users.php index c1b4adf..ddad51c 100644 --- a/users.php +++ b/users.php @@ -54,7 +54,7 @@ else $page=1; } $count = DataBase::fetch(DataBase::sql_query("SELECT COUNT(`u_id`) as `u_id` -FROM ".USERS_TABLE,'GENERAL','Could not obtain count amout of users')); +FROM ".USERS_TABLE,GENERAL,'Could not obtain count amout of users')); $count = $count['u_id'] -1; $count = ceil($count / $limiter); if(isset($_GET['page']) && ($_GET['page']>$count)) @@ -189,7 +189,7 @@ switch($_COOKIE['users_sort']) break; } } -$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain user information.'); +$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain user information.'); while($result = DataBase::fetch($query)) { $skin = array( diff --git a/warns.php b/warns.php index ccfcf4b..cceacd9 100644 --- a/warns.php +++ b/warns.php @@ -120,7 +120,7 @@ switch(trim($_GET['mode'])) { $uid = $_GET['id']; $sql = "SELECT `u_id`, `nick` FROM `".USERS_TABLE."` WHERE `u_id`='$uid'"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain user information'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain user information'); $user = DataBase::fetch($query); if ($user['u_id']=='') { @@ -135,7 +135,7 @@ switch(trim($_GET['mode'])) include('./skins/'.$default_skin.'/overall_header.tpl'); include('./skins/'.$default_skin.'/warns_view_body.tpl'); $sql = "SELECT * FROM `".WARNINGS_TABLE."` WHERE `u_id`='$uid'"; - $query = DataBase::sql_query($sql,'GENERAL','Could not obtain user warns information'); + $query = DataBase::sql_query($sql,GENERAL,'Could not obtain user warns information'); $result = DataBase::num_rows($query); $warns_count = 0; while($item = DataBase::fetch($query))
Post
- quote
- pw
<?= $skin['ua_system_desc']; ?> <?= $skin['ua_browser_desc']; ?>