Browse Source

+ 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
master
pioder 15 years ago
parent
commit
c2ba3eb804
70 changed files with 371 additions and 395 deletions
  1. +48
    -48
      admin/admin_forums.php
  2. +17
    -17
      admin/admin_groups.php
  3. +2
    -2
      admin/admin_script.php
  4. +9
    -9
      admin/admin_users.php
  5. +14
    -14
      admin/banlist.php
  6. +10
    -10
      admin/censorlist.php
  7. +2
    -2
      admin/check_script.php
  8. +10
    -10
      admin/smilelist.php
  9. +4
    -4
      admin/styles.php
  10. +3
    -3
      common.php
  11. +2
    -2
      config.php
  12. +4
    -3
      forum.php
  13. +3
    -3
      groups.php
  14. +1
    -1
      includes/admin/class_forum.php
  15. +5
    -5
      includes/admin/class_main.php
  16. +6
    -6
      includes/cache/cache_forums.php
  17. +2
    -2
      includes/cache/cache_index.php
  18. +4
    -4
      includes/cache/cache_topic.php
  19. +3
    -3
      includes/classes/class_forum.php
  20. +14
    -14
      includes/classes/class_mod.php
  21. +4
    -4
      includes/classes/class_pms.php
  22. +17
    -13
      includes/classes/class_posting.php
  23. +12
    -10
      includes/classes/class_topic.php
  24. +12
    -12
      includes/classes/class_user.php
  25. +13
    -13
      includes/classes/secure.php
  26. +2
    -21
      includes/constants.php
  27. +14
    -6
      includes/db.php
  28. +2
    -2
      includes/emailer.php
  29. +2
    -2
      includes/errors.php
  30. +67
    -32
      includes/misc_functions.php
  31. +2
    -2
      includes/pms/pms_folder.php
  32. +4
    -4
      includes/pms/pms_view.php
  33. +1
    -1
      includes/pms/pms_write.php
  34. +5
    -5
      includes/sessions.php
  35. +2
    -2
      index.php
  36. +0
    -0
      install1/config.php
  37. +1
    -1
      install1/functions_add.php
  38. +9
    -9
      install1/index.php
  39. +0
    -0
      install1/licence.html
  40. +0
    -0
      install1/tpls/index.html
  41. +0
    -0
      install1/tpls/install_check_script.tpl
  42. +0
    -0
      install1/tpls/install_step4.tpl
  43. +0
    -0
      install1/tpls/install_step6.tpl
  44. +0
    -0
      install1/tpls/install_step8.tpl
  45. +0
    -0
      install1/tpls/invalidfile_body.tpl
  46. +0
    -0
      install1/uf_tables.sql
  47. +1
    -0
      lngs/Polish/main.php
  48. +4
    -4
      login.php
  49. +5
    -0
      moderate.php
  50. +1
    -1
      posting.php
  51. +1
    -1
      register.php
  52. +5
    -5
      search.php
  53. +4
    -4
      shoutbox.php
  54. +4
    -4
      skins/subPurple/forum_body.tpl
  55. BIN
      skins/subPurple/images/Thumbs.db
  56. BIN
      skins/subPurple/images/delete.gif
  57. BIN
      skins/subPurple/images/lng_Polish/Thumbs.db
  58. BIN
      skins/subPurple/images/lock.gif
  59. BIN
      skins/subPurple/images/move.gif
  60. BIN
      skins/subPurple/images/stick.gif
  61. BIN
      skins/subPurple/images/unlock.gif
  62. BIN
      skins/subPurple/images/unstick.gif
  63. BIN
      skins/subPurple/images/wyzz/Thumbs.db
  64. +0
    -61
      skins/subPurple/post_add_body.tpl
  65. +2
    -2
      skins/subPurple/topic_mod_body.tpl
  66. +3
    -4
      skins/subPurple/topic_post_body.tpl
  67. +2
    -1
      topic.php
  68. +3
    -3
      user.php
  69. +2
    -2
      users.php
  70. +2
    -2
      warns.php

+ 48
- 48
admin/admin_forums.php View File

@ -35,7 +35,7 @@ function GenerateDefaultDisplay()
//cache forums --don't modify!!! //cache forums --don't modify!!!
$cache_id=1; $cache_id=1;
$sql = "SELECT * FROM ".FORUMS_TABLE." ORDER BY `c_id`, `sort`"; $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)) while($result = DataBase::fetch($query))
{ {
$forum[$cache_id]['f_id'] = $result['f_id']; $forum[$cache_id]['f_id'] = $result['f_id'];
@ -58,7 +58,7 @@ function GenerateDefaultDisplay()
include('./template/forums_beam_body.tpl'); include('./template/forums_beam_body.tpl');
//add forums and categories //add forums and categories
$sql = "SELECT * FROM `".CATS_TABLE."` ORDER BY `sort`"; $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)) while($result = DataBase::fetch($query))
{ {
$skin = array( $skin = array(
@ -115,15 +115,15 @@ switch($_GET['mode'])
{ {
$cat_name = strip_tags($_POST['cat_name']); $cat_name = strip_tags($_POST['cat_name']);
$sql = "SELECT `sort` FROM `".CATS_TABLE."` ORDER BY `sort` DESC LIMIT 1"; $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 = $last ['sort'];
$sort = $sort+1; $sort = $sort+1;
$sql = "SELECT `c_id` FROM `".CATS_TABLE."` ORDER BY `c_id` DESC LIMIT 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['c_id'];
$last = $last +1; $last = $last +1;
$sql = "INSERT INTO `".CATS_TABLE."` VALUES ('$last','$cat_name','$sort')"; $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'; $msg='./template/blank.tpl';
admin_message_forum($lng['cat_saved'],'admin_forums.php'); admin_message_forum($lng['cat_saved'],'admin_forums.php');
} }
@ -169,15 +169,15 @@ switch($_GET['mode'])
$forum_lock = (isset($_POST['forum_locked'])) ? 1 : 0; $forum_lock = (isset($_POST['forum_locked'])) ? 1 : 0;
$allow_moderate = (isset($_POST['allow_moderate'])) ? 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"; $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 = $last ['sort'];
$sort = $sort+1; $sort = $sort+1;
$sql = "SELECT `f_id` FROM `".FORUMS_TABLE."` ORDER BY `f_id` DESC LIMIT 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['f_id'];
$last = $last +1; $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'; $msg='./../skins/'.$default_skin.'/blank.tpl';
admin_message_forum($lng['forum_saved'],'admin_forums.php'); admin_message_forum($lng['forum_saved'],'admin_forums.php');
} }
@ -243,19 +243,19 @@ switch($_GET['mode'])
{ {
$i1 = $_GET['c']; $i1 = $_GET['c'];
$sql = "SELECT `sort`, `c_id` FROM ".CATS_TABLE." WHERE `c_id`='$i1'"; $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']; $s1 = $s1['sort'];
$s2 = $s1 -1; $s2 = $s1 -1;
if ($s1>1) if ($s1>1)
{ {
$sql = "SELECT `sort`, `c_id` FROM ".CATS_TABLE." WHERE `sort`='$s2'"; $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']; $i2 = $s2['c_id'];
$s2 = $s2['sort']; $s2 = $s2['sort'];
$sql = "UPDATE ".CATS_TABLE." SET `sort`='$s2' WHERE `c_id`='$i1'"; $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'"; $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; break;
@ -266,20 +266,20 @@ switch($_GET['mode'])
{ {
$i1 = $_GET['f']; $i1 = $_GET['f'];
$sql = "SELECT `sort`, `c_id`, `f_id` FROM ".FORUMS_TABLE." WHERE `f_id`='$i1'"; $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']; $cid = $s1['c_id'];
$s1 = $s1['sort']; $s1 = $s1['sort'];
$s2 = $s1 -1; $s2 = $s1 -1;
if ($s1>1) if ($s1>1)
{ {
$sql = "SELECT `sort`, `c_id`, `f_id` FROM ".FORUMS_TABLE." WHERE `sort`='$s2' AND `c_id`='$cid'"; $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']; $i2 = $s2['f_id'];
$s2 = $s2['sort']; $s2 = $s2['sort'];
$sql = "UPDATE ".FORUMS_TABLE." SET `sort`='$s2' WHERE `f_id`='$i1'"; $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'"; $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; break;
@ -306,21 +306,21 @@ switch($_GET['mode'])
$i1 = $_GET['c']; $i1 = $_GET['c'];
$i2 = $i1 +1; $i2 = $i1 +1;
$sql = "SELECT `sort`, `c_id` FROM ".CATS_TABLE." WHERE `c_id`='$i1'"; $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']; $s1 = $s1['sort'];
$s2 = $s1 +1; $s2 = $s1 +1;
$sql = "SELECT `c_id` FROM ".CATS_TABLE; $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) if ($s1<$count)
{ {
$sql = "SELECT `sort`, `c_id` FROM ".CATS_TABLE." WHERE `sort`='$s2'"; $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']; $i2 = $s2['c_id'];
$s2 = $s2['sort']; $s2 = $s2['sort'];
$sql = "UPDATE ".CATS_TABLE." SET `sort`='$s2' WHERE `c_id`='$i1'"; $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'"; $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; break;
@ -332,22 +332,22 @@ switch($_GET['mode'])
$i1 = $_GET['f']; $i1 = $_GET['f'];
$i2 = $i1 +1; $i2 = $i1 +1;
$sql = "SELECT `sort`, `c_id`, `f_id` FROM ".FORUMS_TABLE." WHERE `f_id`='$i1'"; $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']; $cid = $s1['c_id'];
$s1 = $s1['sort']; $s1 = $s1['sort'];
$s2 = $s1 +1; $s2 = $s1 +1;
$sql = "SELECT `f_id` FROM ".FORUMS_TABLE." WHERE `c_id`='$cid'"; $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) if ($s1<$count)
{ {
$sql = "SELECT `sort`, `f_id` FROM ".FORUMS_TABLE." WHERE `sort`='$s2'"; $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']; $i2 = $s2['f_id'];
$s2 = $s2['sort']; $s2 = $s2['sort'];
$sql = "UPDATE ".FORUMS_TABLE." SET `sort`='$s2' WHERE `f_id`='$i1'"; $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'"; $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; break;
@ -368,32 +368,32 @@ switch($_GET['mode'])
{ {
$cid = intval($_GET['c']); $cid = intval($_GET['c']);
$sql = "SELECT * FROM `".CATS_TABLE."` WHERE `c_id`='$cid'"; $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); $result = DataBase::fetch($query);
$sort = $result['sort']; $sort = $result['sort'];
$sql = "SELECT * FROM `".CATS_TABLE."` WHERE `sort`>'$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)) while($item = DataBase::fetch($query))
{ {
$new_sort = $item['sort']-1; $new_sort = $item['sort']-1;
$cid2 = $item['c_id']; $cid2 = $item['c_id'];
$sql2 = "UPDATE `".CATS_TABLE."` SET `sort`='$new_sort' WHERE `c_id`='$cid2'"; $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'"; $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)) while($item = DataBase::fetch($query))
{ {
$fid = $item['f_id']; $fid = $item['f_id'];
$sql="DELETE FROM `".POSTS_TABLE."` WHERE `f_id`='$fid'"; $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'"; $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'"; $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'"; $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': case 'forum':
@ -402,24 +402,24 @@ switch($_GET['mode'])
{ {
$fid = intval($_GET['f']); $fid = intval($_GET['f']);
$sql = "SELECT * FROM `".FORUMS_TABLE."` WHERE `f_id`='$fid'"; $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 = DataBase::fetch($query);
$sort = $result['sort']; $sort = $result['sort'];
$sql = "SELECT * FROM `".FORUMS_TABLE."` WHERE `sort`>'$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)) while($item = DataBase::fetch($query))
{ {
$new_sort = $item['sort']-1; $new_sort = $item['sort']-1;
$fid1 = $item['f_id']; $fid1 = $item['f_id'];
$sql2 = "UPDATE `".FORUMS_TABLE."` SET `sort`='$new_sort' WHERE `f_id`='$fid1'"; $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'"; $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'"; $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'"; $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']); $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"; $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 = $last ['sort'];
$sort = $sort+1; $sort = $sort+1;
$sql = "UPDATE `".CATS_TABLE."` SET `name`='$cat_name', `sort`='$sort' WHERE `c_id`='$cid'"; $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'; $msg='./../skins/'.$default_skin.'/blank.tpl';
admin_message_forum($lng['cat_saved'],'admin_forums.php'); admin_message_forum($lng['cat_saved'],'admin_forums.php');
} }
@ -455,7 +455,7 @@ switch($_GET['mode'])
} }
else 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']; $tmp = $tmp['name'];
$_POST['cat_name'] = $tmp; $_POST['cat_name'] = $tmp;
if($tmp['name']=='') if($tmp['name']=='')
@ -495,14 +495,14 @@ switch($_GET['mode'])
$forum_desc = strip_tags($_POST['forum_desc']); $forum_desc = strip_tags($_POST['forum_desc']);
$forum_cat = $_POST['forum_cat']; $forum_cat = $_POST['forum_cat'];
$sql = "SELECT * FROM `".FORUMS_TABLE."` WHERE `f_id`='$fid'"; $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 = DataBase::fetch($query);
$actual_cid = $result['c_id']; $actual_cid = $result['c_id'];
$sort = $result['sort']; $sort = $result['sort'];
if ($actual_cid != $forum_cat) if ($actual_cid != $forum_cat)
{ {
$sql = "SELECT * FROM `".FORUMS_TABLE."` WHERE `c_id`='$forum_cat' ORDER BY `sort` DESC LIMIT 1"; $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); $result = DataBase::fetch($query);
$sort = $result['sort']+1; $sort = $result['sort']+1;
} }
@ -517,7 +517,7 @@ switch($_GET['mode'])
`c_id`='$forum_cat', `c_id`='$forum_cat',
`sort`='$sort' `sort`='$sort'
WHERE `f_id`='$fid'"; 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'; $msg='./../skins/'.$default_skin.'/blank.tpl';
admin_message_forum($lng['forum_saved'],'admin_forums.php'); admin_message_forum($lng['forum_saved'],'admin_forums.php');
} }
@ -535,7 +535,7 @@ switch($_GET['mode'])
} }
else 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']; $_POST['forum_name'] = $tmp['name'];
$msg='./../skins/'.$default_skin.'/blank.tpl'; $msg='./../skins/'.$default_skin.'/blank.tpl';
$_POST['forum_desc'] = $tmp['desc']; $_POST['forum_desc'] = $tmp['desc'];

+ 17
- 17
admin/admin_groups.php View File

@ -41,7 +41,7 @@ function GenerateDefaultDisplay()
Admin_Over::GenerateHeader(); Admin_Over::GenerateHeader();
include('./template/groups_beam_body.tpl'); include('./template/groups_beam_body.tpl');
$sql = "SELECT `g_id`, `name`, `desc` FROM `".GROUPS_TABLE."` ORDER BY `sort`"; $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)) while($item = DataBase::fetch($query))
{ {
$skin = array( $skin = array(
@ -69,9 +69,9 @@ switch($_GET['mode'])
$gid = $_GET['id']; $gid = $_GET['id'];
Secure::group_exists($gid); Secure::group_exists($gid);
$sql = "DELETE FROM ".GROUPS_TABLE." WHERE `g_id`='$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'"; $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(); GenerateDefaultDisplay();
break; break;
} }
@ -88,15 +88,15 @@ switch($_GET['mode'])
$group_desc = htmlspecialchars($_POST['group_desc']); $group_desc = htmlspecialchars($_POST['group_desc']);
$group_mod = User::UserIdByNick(htmlspecialchars($_POST['group_mod'])); $group_mod = User::UserIdByNick(htmlspecialchars($_POST['group_mod']));
$result = DataBase::fetch(DataBase::sql_query("SELECT `sort` FROM `".GROUPS_TABLE."` $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 = $result['sort'];
$group_sort = $group_sort+1; $group_sort = $group_sort+1;
$result = DataBase::fetch(DataBase::sql_query("SELECT $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 = $result['g_id'];
$group_id = $group_id+1; $group_id = $group_id+1;
$sql = "INSERT INTO ".GROUPS_TABLE." VALUES ('$group_id', '$group_name', '$group_desc', '$group_mod', '$group_sort')"; $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); unset($group_name, $group_desc, $group_mod, $group_id);
admin_message_forum($lng['group_saved'],'admin_groups.php'); admin_message_forum($lng['group_saved'],'admin_groups.php');
} }
@ -148,7 +148,7 @@ switch($_GET['mode'])
`desc` = '$group_desc', `desc` = '$group_desc',
`m_id` = '$group_mod' `m_id` = '$group_mod'
WHERE `g_id` = '$group_id'"; 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); unset($group_name, $group_desc, $group_mod, $group_id);
admin_message_forum($lng['group_saved'],'admin_groups.php'); admin_message_forum($lng['group_saved'],'admin_groups.php');
} }
@ -161,7 +161,7 @@ switch($_GET['mode'])
else else
{ {
$sql = "SELECT * FROM `".GROUPS_TABLE."` WHERE `g_id`='$gid'"; $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_name'] = $g['name'];
$_POST['group_desc'] = $g['desc']; $_POST['group_desc'] = $g['desc'];
$_POST['group_mod'] = User::UserInformation($g['m_id'],'nick'); $_POST['group_mod'] = User::UserInformation($g['m_id'],'nick');
@ -188,19 +188,19 @@ switch($_GET['mode'])
{ {
$i1 = intval($_GET['id']); $i1 = intval($_GET['id']);
$sql = "SELECT `sort`, `g_id` FROM ".GROUPS_TABLE." WHERE `g_id`='$i1'"; $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']; $s1 = $s1['sort'];
$s2 = $s1 -1; $s2 = $s1 -1;
if ($s1>1) if ($s1>1)
{ {
$sql = "SELECT `sort`, `g_id` FROM ".GROUPS_TABLE." WHERE `sort`='$s2'"; $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']; $i2 = $s2['g_id'];
$s2 = $s2['sort']; $s2 = $s2['sort'];
$sql = "UPDATE ".GROUPS_TABLE." SET `sort`='$s2' WHERE `g_id`='$i1'"; $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'"; $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(); GenerateDefaultDisplay();
@ -213,21 +213,21 @@ switch($_GET['mode'])
$i1 = intval($_GET['id']); $i1 = intval($_GET['id']);
$i2 = $i1 +1; $i2 = $i1 +1;
$sql = "SELECT `sort`, `g_id` FROM ".GROUPS_TABLE." WHERE `g_id`='$i1'"; $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']; $s1 = $s1['sort'];
$s2 = $s1 +1; $s2 = $s1 +1;
$sql = "SELECT `g_id` FROM ".GROUPS_TABLE; $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) if ($s1<$count)
{ {
$sql = "SELECT `sort`, `g_id` FROM ".GROUPS_TABLE." WHERE `sort`='$s2'"; $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']; $i2 = $s2['g_id'];
$s2 = $s2['sort']; $s2 = $s2['sort'];
$sql = "UPDATE ".GROUPS_TABLE." SET `sort`='$s2' WHERE `g_id`='$i1'"; $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'"; $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(); GenerateDefaultDisplay();

+ 2
- 2
admin/admin_script.php View File

@ -33,7 +33,7 @@ function AddSkins()
{ {
global $forum_config; global $forum_config;
$all=''; $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)) while($t = DataBase::fetch($query))
{ {
@ -294,7 +294,7 @@ if (isset($_POST['forum_path']))
for($i=0;$i<$count_o;$i++) for($i=0;$i<$count_o;$i++)
{ {
$sql = "UPDATE `".CONFIG_TABLE."` SET `value`='".$value[$i]."' WHERE `name`='".$name[$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... //end...
unset($name, $value, $count_o, $sql); unset($name, $value, $count_o, $sql);

+ 9
- 9
admin/admin_users.php View File

@ -44,27 +44,27 @@ switch($_GET['mode'])
//delete from users table //delete from users table
$sql = "DELETE FROM ".USERS_TABLE." WHERE `u_id`='$uid'"; $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 //delete from PM SentBox table
$sql = "DELETE FROM ".PM_SENTBOX_TABLE." WHERE `u_n_id`='$uid'"; $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 //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'"; $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 //update user posts -> change u_id to Anonymous
$sql = "UPDATE ".POSTS_TABLE." SET `u_id`='-1' WHERE `u_id`='$uid'"; $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 //update shoutbox messages -> change u_id to Anonymous
$sql = "UPDATE ".SHOUTBOX_TABLE." SET `u_id`='-1' WHERE `u_id`='$uid'"; $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 //update user topics -> change u_id to Anonymous
$sql = "UPDATE ".TOPICS_TABLE." SET `author`='-1' WHERE `author`='$uid'"; $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 //back to admin users
admin_message_forum($lng['user_deleted'],'admin_users.php'); 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'"; $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']=='') if ($userinfo['rank']=='')
{ {
admin_message_forum($lng['no_user'],'admin_users.php?mode=view'); admin_message_forum($lng['no_user'],'admin_users.php?mode=view');
@ -297,7 +297,7 @@ switch($_GET['mode'])
$page=1; $page=1;
} }
$count = DataBase::fetch(DataBase::sql_query("SELECT COUNT(`u_id`) as `u_id` $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 = $count['u_id'];
$count = ceil($count /30); $count = ceil($count /30);
if(isset($_GET['page']) && ($_GET['page']>$count)) if(isset($_GET['page']) && ($_GET['page']>$count))
@ -428,7 +428,7 @@ switch($_GET['mode'])
break; 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)) while($result = DataBase::fetch($query))
{ {
$skin = array( $skin = array(

+ 14
- 14
admin/banlist.php View File

@ -67,7 +67,7 @@ switch($_GET['mode'])
} }
$ban_motive = strip_tags($_POST['motive']); $ban_motive = strip_tags($_POST['motive']);
$sql = "INSERT INTO ".BANLIST_TABLE." VALUES ('', '$ban_uid', '$ban_ip', '$ban_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'); admin_message_forum($lng['ban_added'],'banlist.php?mode=view');
} }
else else
@ -114,12 +114,12 @@ switch($_GET['mode'])
message_forum($lng['no_ban_me'],'banlist.php?mode=view'); message_forum($lng['no_ban_me'],'banlist.php?mode=view');
} }
$bid =$bid = DataBase::fetch(DataBase::sql_query("SELECT $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')); 'Could not obtain last ban id'));
$bid = $bid['b_id']; $bid = $bid['b_id'];
$bid = $bid +1; $bid = $bid +1;
$sql = "INSERT INTO ".BANLIST_TABLE." VALUES ('$bid', '$ban_uid', '$ban_ip', '$ban_motive')"; $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'); admin_message_forum($lng['ban_added'],'banlist.php?mode=view');
} }
else else
@ -168,12 +168,12 @@ switch($_GET['mode'])
message_forum($lng['no_ban_me'],'banlist.php?mode=view'); message_forum($lng['no_ban_me'],'banlist.php?mode=view');
} }
$bid =$bid = DataBase::fetch(DataBase::sql_query("SELECT $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')); 'Could not obtain last ban id'));
$bid = $bid['b_id']; $bid = $bid['b_id'];
$bid = $bid +1; $bid = $bid +1;
$sql = "INSERT INTO ".BANLIST_TABLE." VALUES ('$bid', '$ban_uid', '$ban_ip', '$ban_motive')"; $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'); admin_message_forum($lng['ban_added'],'banlist.php?mode=view');
} }
else else
@ -209,13 +209,13 @@ switch($_GET['mode'])
$catalog = '../tmp/'; $catalog = '../tmp/';
if(!move_uploaded_file($_FILES['file']['tmp_name'], $catalog.$_FILES['file']['name'])) 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'); $open = fopen($catalog.$_FILES['file']['name'],'r');
$file = fread($open, filesize($catalog.$_FILES['file']['name'])); $file = fread($open, filesize($catalog.$_FILES['file']['name']));
$item = @explode("\n",$file); $item = @explode("\n",$file);
$bid = $bid = DataBase::fetch(DataBase::sql_query("SELECT $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')); 'Could not obtain last ban id'));
$bid = $bid['b_id']; $bid = $bid['b_id'];
$bid = $bid +1; $bid = $bid +1;
@ -223,7 +223,7 @@ switch($_GET['mode'])
{ {
$ban_ip = $item[$i]; $ban_ip = $item[$i];
$sql = "INSERT INTO ".BANLIST_TABLE." VALUES ('$bid', '$ban_uid', '$ban_ip', '$ban_motive')"; $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; $bid = $bid +1;
} }
admin_message_forum($lng['ban_added'],'banlist.php?mode=view'); admin_message_forum($lng['ban_added'],'banlist.php?mode=view');
@ -255,7 +255,7 @@ switch($_GET['mode'])
{ {
$bid = $_GET['id']; $bid = $_GET['id'];
$sql = "DELETE FROM ".BANLIST_TABLE." WHERE `b_id`='$bid'"; $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'); admin_message_forum($lng['ban_deleted'],'banlist.php?mode=view');
break; break;
} }
@ -288,14 +288,14 @@ switch($_GET['mode'])
`u_id`='$ban_uid', `u_id`='$ban_uid',
`motive`='$ban_motive' `motive`='$ban_motive'
WHERE `b_id`='$bid'"; 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'); admin_message_forum($lng['ban_edited'],'banlist.php?mode=view');
} }
else else
{ {
$bid = $_GET['id']; $bid = $_GET['id'];
$sql = "SELECT * FROM ".BANLIST_TABLE." WHERE `b_id`='$bid'"; $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); $result = DataBase::fetch($query);
$_POST['ip']=$result['IP']; $_POST['ip']=$result['IP'];
$_POST['motive'] = $result['motive']; $_POST['motive'] = $result['motive'];
@ -321,18 +321,18 @@ switch($_GET['mode'])
case 'clear': case 'clear':
{ {
$sql = "TRUNCATE `".BANLIST_TABLE."`"; $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'); admin_message_forum($lng['banlist_cleanout'],'banlist.php?mode=view');
} }
case '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)) while($result = DataBase::fetch($query))
{ {
$user[$result['u_id']]['nick'] = $result['nick']; $user[$result['u_id']]['nick'] = $result['nick'];
} }
$sql = "SELECT * FROM ".BANLIST_TABLE.""; $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( $skin=array(
'L.banlist'=>$lng['admin_banlist'], 'L.banlist'=>$lng['admin_banlist'],
'L.select_mode'=>$lng['what_do_you_want'], 'L.select_mode'=>$lng['what_do_you_want'],

+ 10
- 10
admin/censorlist.php View File

@ -45,19 +45,19 @@ switch($_GET['mode'])
$catalog = '../tmp/'; $catalog = '../tmp/';
if(!move_uploaded_file($_FILES['file']['tmp_name'], $catalog.$_FILES['file']['name'])) 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'); $open = fopen($catalog.$_FILES['file']['name'],'r');
$file = fread($open, filesize($catalog.$_FILES['file']['name'])); $file = fread($open, filesize($catalog.$_FILES['file']['name']));
$item = @explode(',',$file); $item = @explode(',',$file);
$sql = "SELECT `w_id` FROM ".CENSORLIST_TABLE." ORDER BY `w_id` DESC"; $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['w_id'];
$last= $last +1; $last= $last +1;
for($i=0;$i<count($item);$i++) for($i=0;$i<count($item);$i++)
{ {
$word = $item[$i]; $word = $item[$i];
DataBase::sql_query("INSERT INTO ".CENSORLIST_TABLE." VALUES ('$last','$word')",'GENERAL','Could not add censored word.');
DataBase::sql_query("INSERT INTO ".CENSORLIST_TABLE." VALUES ('$last','$word')",GENERAL,'Could not add censored word.');
$last = $last +1; $last = $last +1;
} }
admin_message_forum($lng['words_added'],'censorlist.php'); admin_message_forum($lng['words_added'],'censorlist.php');
@ -81,7 +81,7 @@ switch($_GET['mode'])
{ {
$wid = intval($_GET['w']); $wid = intval($_GET['w']);
$sql = "DELETE FROM ".CENSORLIST_TABLE." WHERE `w_id`='$wid'"; $sql = "DELETE FROM ".CENSORLIST_TABLE." WHERE `w_id`='$wid'";
DataBase::sql_query($sql,'GENERAL','Could not delete word.');
DataBase::sql_query($sql,GENERAL,'Could not delete word.');
admin_message_forum($lng['word_deleted'],'censorlist.php?mode=view'); admin_message_forum($lng['word_deleted'],'censorlist.php?mode=view');
break; break;
} }
@ -91,10 +91,10 @@ switch($_GET['mode'])
{ {
$word = strip_tags($_POST['word']); $word = strip_tags($_POST['word']);
$sql = "SELECT `w_id` FROM ".CENSORLIST_TABLE." ORDER BY `w_id` DESC"; $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['w_id'];
$last= $last +1; $last= $last +1;
DataBase::sql_query("INSERT INTO ".CENSORLIST_TABLE." VALUES ('$last','$word')",'GENERAL','Could not add censored word.');
DataBase::sql_query("INSERT INTO ".CENSORLIST_TABLE." VALUES ('$last','$word')",GENERAL,'Could not add censored word.');
admin_message_forum($lng['word_added'],'censorlist.php'); admin_message_forum($lng['word_added'],'censorlist.php');
} }
else else
@ -120,14 +120,14 @@ switch($_GET['mode'])
{ {
$word = strip_tags(trim($_POST['word'])); $word = strip_tags(trim($_POST['word']));
$wid = intval($_GET['w']); $wid = intval($_GET['w']);
DataBase::sql_query("UPDATE ".CENSORLIST_TABLE." SET `word`='$word' WHERE `w_id`='$wid'",'GENERAL','Could not update censored word.');
DataBase::sql_query("UPDATE ".CENSORLIST_TABLE." SET `word`='$word' WHERE `w_id`='$wid'",GENERAL,'Could not update censored word.');
admin_message_forum($lng['word_edited'],'censorlist.php?mode=view'); admin_message_forum($lng['word_edited'],'censorlist.php?mode=view');
} }
else else
{ {
$wid = intval($_GET['w']); $wid = intval($_GET['w']);
$sql = "SELECT * FROM ".CENSORLIST_TABLE." WHERE `w_id`='$wid'"; $sql = "SELECT * FROM ".CENSORLIST_TABLE." WHERE `w_id`='$wid'";
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain censorlist words');
$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain censorlist words');
$result = DataBase::fetch($query); $result = DataBase::fetch($query);
$_POST['word']=$result['word']; $_POST['word']=$result['word'];
$skin = array( $skin = array(
@ -146,14 +146,14 @@ switch($_GET['mode'])
} }
case 'deleteall': case 'deleteall':
{ {
DataBase::sql_query("TRUNCATE TABLE ".CENSORLIST_TABLE,'GENERAL','Could not empty censorlist table.');
DataBase::sql_query("TRUNCATE TABLE ".CENSORLIST_TABLE,GENERAL,'Could not empty censorlist table.');
admin_message_forum($lng['table_cleanout'],'censorlist.php'); admin_message_forum($lng['table_cleanout'],'censorlist.php');
break; break;
} }
case 'view': case 'view':
{ {
$sql = "SELECT * FROM ".CENSORLIST_TABLE." ORDER BY `word`"; $sql = "SELECT * FROM ".CENSORLIST_TABLE." ORDER BY `word`";
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain censorlist words');
$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain censorlist words');
$skin = array( $skin = array(
'L.censorlist'=>$lng['admin_censorlist'], 'L.censorlist'=>$lng['admin_censorlist'],
'L.view_all_words'=>$lng['view_all_words'] 'L.view_all_words'=>$lng['view_all_words']

+ 2
- 2
admin/check_script.php View File

@ -47,7 +47,7 @@ function check_size_md5($file)
function mysqlversion() function mysqlversion()
{ {
$temp = ''; $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']; $result = $result['mysql_version'];
for($i=0;$i<5;$i++) for($i=0;$i<5;$i++)
{ {
@ -62,7 +62,7 @@ function db_size()
{ {
$sql = "SHOW TABLE STATUS"; $sql = "SHOW TABLE STATUS";
$db_size = 0; $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)) while ($result = DataBase::fetch($query))
{ {
$db_size += $result['Index_length']; $db_size += $result['Index_length'];

+ 10
- 10
admin/smilelist.php View File

@ -48,14 +48,14 @@ switch($_GET['mode'])
if (isset($_POST['word'],$_POST['url'])) if (isset($_POST['word'],$_POST['url']))
{ {
$sql = "SELECT * FROM ".SMILES_TABLE." ORDER BY `s_id` DESC LIMIT 1"; $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); $result = DataBase::fetch($query);
$smile_id = $result['s_id']; $smile_id = $result['s_id'];
$smile_id = $smile_id +1; $smile_id = $smile_id +1;
$smile_word = strip_tags($_POST['word']); $smile_word = strip_tags($_POST['word']);
$smile_url = strip_tags($_POST['url']); $smile_url = strip_tags($_POST['url']);
$sql = "INSERT INTO ".SMILES_TABLE." VALUES('$smile_id','$smile_word','$smile_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'); admin_message_forum($lng['smile_added'],'smilelist.php?mode=view');
} }
else else
@ -87,13 +87,13 @@ switch($_GET['mode'])
$catalog = '../tmp/'; $catalog = '../tmp/';
if(!move_uploaded_file($_FILES['file']['tmp_name'], $catalog.$_FILES['file']['name'])) 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'); $open = @fopen($catalog.$_FILES['file']['name'],'r');
$file = @fread($open, filesize($catalog.$_FILES['file']['name'])); $file = @fread($open, filesize($catalog.$_FILES['file']['name']));
$item = @explode("\n",$file); $item = @explode("\n",$file);
$bid = $bid = DataBase::fetch(DataBase::sql_query("SELECT $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')); 'Could not obtain last smile id'));
$sid = $sid['s_id']; $sid = $sid['s_id'];
$sid = $sid +1; $sid = $sid +1;
@ -103,7 +103,7 @@ switch($_GET['mode'])
$smile_word = $subitem[0]; $smile_word = $subitem[0];
$smile_url = $subitem[1]; $smile_url = $subitem[1];
$sql = "INSERT INTO ".SMILES_TABLE." VALUES ('$sid', '$smile_word', '$smile_url')"; $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; $sid = $bid +1;
} }
admin_message_forum($lng['smiles_added'],'smilelist.php?mode=view'); admin_message_forum($lng['smiles_added'],'smilelist.php?mode=view');
@ -133,7 +133,7 @@ switch($_GET['mode'])
{ {
$sid = $_GET['id']; $sid = $_GET['id'];
$sql = "DELETE FROM ".SMILES_TABLE." WHERE `s_id`='$sid'"; $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'); admin_message_forum($lng['smile_deleted'],'smilelist.php?mode=view');
break; break;
} }
@ -149,14 +149,14 @@ switch($_GET['mode'])
`smile`='$smile_word', `smile`='$smile_word',
`url`='$smile_url' `url`='$smile_url'
WHERE `s_id`='$smile_id'"; 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'); admin_message_forum($lng['smile_edited'],'smilelist.php?mode=view');
} }
else else
{ {
$sid = intval($_GET['id']); $sid = intval($_GET['id']);
$sql = "SELECT * FROM ".SMILES_TABLE." WHERE `s_id`='$sid'"; $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); $result = DataBase::fetch($query);
if ($result['s_id']=='') if ($result['s_id']=='')
{ {
@ -182,13 +182,13 @@ switch($_GET['mode'])
case 'clear': case 'clear':
{ {
$sql = "TRUNCATE `".SMILES_TABLE."`"; $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'); admin_message_forum($lng['smilelist_cleanout'],'smilelist.php?mode=view');
} }
case 'view': case 'view':
{ {
$sql = "SELECT * FROM ".SMILES_TABLE.""; $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( $skin=array(
'L.smilelist'=>$lng['admin_smilelist'], 'L.smilelist'=>$lng['admin_smilelist'],
'L.select_mode'=>$lng['what_do_you_want'], 'L.select_mode'=>$lng['what_do_you_want'],

+ 4
- 4
admin/styles.php View File

@ -44,9 +44,9 @@ switch($_GET['mode'])
if ($sid!=$forum_config['defaultskin']) if ($sid!=$forum_config['defaultskin'])
{ {
$sql = "DELETE FROM ".SKINS_TABLE." WHERE `s_id`='$sid'"; $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'"; $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'); admin_message_forum($lng['skins_deleted'],'styles.php?mode=view');
} }
else else
@ -64,7 +64,7 @@ switch($_GET['mode'])
if (is_dir('./../skins/'.$_POST['skin'])) if (is_dir('./../skins/'.$_POST['skin']))
{ {
$last = DataBase::new_id(SKINS_TABLE); $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']=''; $_POST['skin']='';
admin_message_forum($lng['skins_added'],'styles.php?mode=view'); admin_message_forum($lng['skins_added'],'styles.php?mode=view');
} }
@ -89,7 +89,7 @@ switch($_GET['mode'])
Admin_Over::GenerateHeader(); Admin_Over::GenerateHeader();
include('./template/skins_beam_body.tpl'); include('./template/skins_beam_body.tpl');
$sql = "SELECT * FROM ".SKINS_TABLE; $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)) while ($item = DataBase::fetch($query))
{ {
$skin=array( $skin=array(

+ 3
- 3
common.php View File

@ -19,7 +19,7 @@ if (phpversion()<'5.0.7')
} }
//set global preferences from DataBase //set global preferences from DataBase
$sql="SELECT * FROM ".CONFIG_TABLE.""; $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)) while($result=DataBase::fetch($query))
{ {
if (($result['name']=='') or ($result['name']=='0')) if (($result['name']=='') or ($result['name']=='0'))
@ -53,7 +53,7 @@ if ($_SESSION['uid']>0)
$ip = $_SERVER['REMOTE_ADDR']; $ip = $_SERVER['REMOTE_ADDR'];
$uid = $_SESSION['uid']; $uid = $_SESSION['uid'];
$sql = "SELECT `IP`, `u_id`, `motive` FROM ".BANLIST_TABLE." WHERE `IP`='$ip' OR `u_id`='$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']; $motive = $result['motive'];
$db_ip = $result['IP']; $db_ip = $result['IP'];
$db_uid = $result['u_id']; $db_uid = $result['u_id'];
@ -76,7 +76,7 @@ else
{ {
$sql = "SELECT * FROM ".USERS_TABLE." WHERE `u_id`='-1'"; $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); $userdata = DataBase::fetch($query);
define('RANK', $userdata['rank']); define('RANK', $userdata['rank']);

+ 2
- 2
config.php View File

@ -7,12 +7,12 @@ if ( !defined('IN_uF') )
{ {
die('Hacking attempt'); die('Hacking attempt');
} }
@ini_set('display_errors', '1');
ini_set('display_errors', '1');
define('DB_HOST','localhost'); define('DB_HOST','localhost');
define('DB_USER','root'); define('DB_USER','root');
define('DB_PASS',''); define('DB_PASS','');
define('DB_NAME','uf'); define('DB_NAME','uf');
define('DB_PREFIX','uf_'); define('DB_PREFIX','uf_');
define('VERSION','9.5.1');
define('VERSION','9.5.3');
define('UF_INSTALLED',true); define('UF_INSTALLED',true);
?> ?>

+ 4
- 3
forum.php View File

@ -52,18 +52,19 @@ $skin = array_push_associative($skin,GenerateHeader($lng['showforum'].': '.$foru
//do it! //do it!
include('./skins/'.$default_skin.'/overall_header.tpl'); include('./skins/'.$default_skin.'/overall_header.tpl');
include('./skins/'.$default_skin.'/forum_body.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); $value = DataBase::num_rows($query);
if ($value>0) if ($value>0)
{ {
while($record = DataBase::fetch($query)) while($record = DataBase::fetch($query))
{ {
$last_post = explode(':', $record['topic_lastpost']);
$skin = array( $skin = array(
't_id'=>$record['t_id'], 't_id'=>$record['t_id'],
'fname'=>($record['sticky']=='1') ? '<b>'.$lng['sticky'].'</b>'.$record['name'] : $record['name'], 'fname'=>($record['sticky']=='1') ? '<b>'.$lng['sticky'].'</b>'.$record['name'] : $record['name'],
'author'=>Topic::TopicAuthor($record['author']), 'author'=>Topic::TopicAuthor($record['author']),
'tposts'=>$count_topic[$record['t_id']],
'tposts'=>$record['postcount'],
'new_post'=>Topic::LastPostImg(), 'new_post'=>Topic::LastPostImg(),
'lastpost'=>Topic::LastPostInTopic($record['t_id']) 'lastpost'=>Topic::LastPostInTopic($record['t_id'])
); );

+ 3
- 3
groups.php View File

@ -69,7 +69,7 @@ if(isset($_GET['mode']))
$_POST['delnick']=''; $_POST['delnick']='';
} }
$sql = "SELECT `g_id`, `name`, `desc`, `m_id` FROM `".GROUPS_TABLE."` WHERE `g_id`='$gid'"; $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']=='') if ($group['g_id']=='')
{ {
message_forum($lng['no_group'], 'index.php'); message_forum($lng['no_group'], 'index.php');
@ -89,7 +89,7 @@ if(isset($_GET['mode']))
); );
include('./skins/'.$default_skin.'/group_view_head_body.tpl'); 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'"; $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); $amout = DataBase::num_rows($query);
if ($amout>0) if ($amout>0)
{ {
@ -142,7 +142,7 @@ else
$skin = GenerateHeader($lng['lgroups'], '</a>&gt; <a href="groups.php" class="navigator">'.$lng['lgroups']); $skin = GenerateHeader($lng['lgroups'], '</a>&gt; <a href="groups.php" class="navigator">'.$lng['lgroups']);
include('./skins/'.$default_skin.'/overall_header.tpl'); include('./skins/'.$default_skin.'/overall_header.tpl');
$sql = "SELECT `g_id`, `name`, `desc` FROM `".GROUPS_TABLE."` ORDER BY `sort`"; $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) if (DataBase::num_rows($query)>0)
{ {
while($item = DataBase::fetch($query)) while($item = DataBase::fetch($query))

+ 1
- 1
includes/admin/class_forum.php View File

@ -18,7 +18,7 @@ class Admin_Forum
global $forum_config; global $forum_config;
$cat = Forum::ForumInformation($fid,'c_id'); $cat = Forum::ForumInformation($fid,'c_id');
$all=''; $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)) while($t = DataBase::fetch($query))
{ {

+ 5
- 5
includes/admin/class_main.php View File

@ -37,7 +37,7 @@ class Admin_Over
global $forum_config; global $forum_config;
global $default_skin; global $default_skin;
$all=''; $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)) while($t = DataBase::fetch($query))
{ {
@ -104,14 +104,14 @@ class Admin_Over
{ {
$result = User::UserInformation($_SESSION['uid'],'skin'); $result = User::UserInformation($_SESSION['uid'],'skin');
$sql = "SELECT * FROM `".SKINS_TABLE."` WHERE `s_id`='$result'"; $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']; return $result['name'];
} }
else else
{ {
$result = $forum_config['defaultskin']; $result = $forum_config['defaultskin'];
$sql = "SELECT * FROM `".SKINS_TABLE."` WHERE `s_id`='$result'"; $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']; return $result['name'];
} }
} }
@ -130,14 +130,14 @@ class Admin_Over
function TotalTopics() function TotalTopics()
{ {
$sql = "SELECT `t_id` FROM ".TOPICS_TABLE.";"; $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); $result = DataBase::num_rows($query);
return($result); return($result);
} }
function TotalPosts() function TotalPosts()
{ {
$sql = "SELECT `p_id` FROM ".POSTS_TABLE.";"; $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); $result = DataBase::num_rows($query);
return($result); return($result);
} }

+ 6
- 6
includes/cache/cache_forums.php View File

@ -14,7 +14,7 @@ if(!defined('IN_uF'))
//cache forums and posts - version v1.0 Alpha 2--------------------------------- //cache forums and posts - version v1.0 Alpha 2---------------------------------
$default_skin = ViewSkinName(); $default_skin = ViewSkinName();
$sql = "SELECT `name`,`lock` FROM ".FORUMS_TABLE." WHERE `f_id`='$fid' LIMIT 1"; $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']=='') if ($result['name']=='')
{ {
message_forum($lng['no_forum'],'index.php'); message_forum($lng['no_forum'],'index.php');
@ -23,14 +23,14 @@ $forum = array(
'name'=>$result['name'], 'name'=>$result['name'],
'lock'=>$result['lock'] '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)) while($result = DataBase::fetch($query))
{ {
$count_topic[$result['t_id']]=$result['p_id']; $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`"; /*$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)) while($result = DataBase::fetch($query))
{ {
$lastpost[$result['t_id']]['tp_id']=$result['tp_id']; $lastpost[$result['t_id']]['tp_id']=$result['tp_id'];
@ -66,7 +66,7 @@ else
$page=1; $page=1;
} }
$count = DataBase::fetch(DataBase::sql_query("SELECT COUNT(`t_id`) as `t_id` $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 = $count['t_id'];
$count = ceil($count / $limiter); $count = ceil($count / $limiter);
if ($count==0) if ($count==0)

+ 2
- 2
includes/cache/cache_index.php View File

@ -18,7 +18,7 @@ if(!defined('IN_uF'))
//cache forums --don't modify!!! //cache forums --don't modify!!!
$cache_id=1; $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`"; $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)) while($result = DataBase::fetch($query))
{ {
$forum[$cache_id]['f_id'] = $result['f_id']; $forum[$cache_id]['f_id'] = $result['f_id'];
@ -31,7 +31,7 @@ while($result = DataBase::fetch($query))
$cache_id+=1; $cache_id+=1;
} }
$sql = "SELECT `u_id`,`nick`, `regdate` AS count FROM ".USERS_TABLE." ORDER BY `regdate` DESC"; $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); $lastuser = DataBase::fetch($query);
$count_users = DataBase::num_rows($query) -1; $count_users = DataBase::num_rows($query) -1;
?> ?>

+ 4
- 4
includes/cache/cache_topic.php View File

@ -13,7 +13,7 @@ if(!defined('IN_uF'))
} }
//||topic.php script cache ------------------------------------------------------------------------------ //||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"; $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']=='') if ($result['t_id']=='')
{ {
message_forum($lng['no_topic'], 'index.php'); message_forum($lng['no_topic'], 'index.php');
@ -29,7 +29,7 @@ $forum['moderate']=$result['moderate'];
$sql = "SELECT `u_id`,`value` FROM `".WARNINGS_TABLE."`"; $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); $result = DataBase::num_rows($query);
while ($result = DataBase::fetch($query)) while ($result = DataBase::fetch($query))
{ {
@ -49,7 +49,7 @@ while ($result = DataBase::fetch($query))
//check online for user //check online for user
$sql = "SELECT `s_id`, `u_id`, `time` FROM ".SESSIONS_TABLE." WHERE time+1250>".time(); $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)) while($result = DataBase::fetch($query))
{ {
$user[$result['u_id']]['online']='1'; $user[$result['u_id']]['online']='1';
@ -82,7 +82,7 @@ else
$page=1; $page=1;
} }
$count = DataBase::fetch(DataBase::sql_query("SELECT COUNT(`p_id`) as `p_id` $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 = $count['p_id'];
$count = ceil($count / $limiter); $count = ceil($count / $limiter);
if(isset($_GET['page']) && ($_GET['page']>$count)) if(isset($_GET['page']) && ($_GET['page']>$count))

+ 3
- 3
includes/classes/class_forum.php View File

@ -18,7 +18,7 @@ class Forum
global $forum_config; global $forum_config;
$forum = Topic::TopicInformation($tid,'f_id'); $forum = Topic::TopicInformation($tid,'f_id');
$all=''; $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)) while($t = DataBase::fetch($query))
{ {
@ -38,7 +38,7 @@ class Forum
function PostsInForum($forum_name) function PostsInForum($forum_name)
{ {
$sql = "SELECT count(*) as `p_id` FROM ".POSTS_TABLE." WHERE f_id='$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); $result = DataBase::fetch($query);
return $result['p_id']; return $result['p_id'];
} }
@ -132,7 +132,7 @@ class Forum
function ForumInformation($fid, $inf) function ForumInformation($fid, $inf)
{ {
$sql = "SELECT `f_id`, `$inf` FROM ".FORUMS_TABLE." WHERE f_id='$fid';"; $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 = DataBase::fetch($query);
$result = $result[$inf]; $result = $result[$inf];
return $result; return $result;

+ 14
- 14
includes/classes/class_mod.php View File

@ -16,9 +16,9 @@ class Mod
function MoveTopic($tid, $fid) function MoveTopic($tid, $fid)
{ {
$sql = "UPDATE `".TOPICS_TABLE."` SET `f_id`='$fid' WHERE `t_id`='$tid'"; $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'"; $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) function TopicLocked($tid)
@ -39,37 +39,37 @@ class Mod
function DeleteTopic($topicid) function DeleteTopic($topicid)
{ {
$sql="SELECT * FROM ".POSTS_TABLE." WHERE `t_id`='$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)) while($item = DataBase::fetch($query))
{ {
$uid = Topic::PostInformation($item['p_id'],'u_id'); $uid = Topic::PostInformation($item['p_id'],'u_id');
$posts = User::UserInformation($uid,'posts'); $posts = User::UserInformation($uid,'posts');
$posts = $posts -1; $posts = $posts -1;
$sql = "UPDATE `".USERS_TABLE."` SET `posts`='$posts' WHERE `u_id`='$uid'"; $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';"; $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';"; $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) function LockTopic($topicid)
{ {
$sql = "UPDATE `".TOPICS_TABLE."` SET `lock` = '1' WHERE `t_id` =$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) function StickTopic($topicid, $mode)
{ {
$sql = "UPDATE `".TOPICS_TABLE."` SET `sticky` = '$mode' WHERE `t_id` =$topicid;"; $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) function UnlockTopic($topicid)
{ {
$sql = "UPDATE `".TOPICS_TABLE."` SET `lock` = '0' WHERE `t_id` =$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) function DeletePost($postid)
@ -79,25 +79,25 @@ class Mod
$posts = User::UserInformation($uid,'posts'); $posts = User::UserInformation($uid,'posts');
$posts = $posts -1; $posts = $posts -1;
$sql = "UPDATE `".USERS_TABLE."` SET `posts`='$posts' WHERE `u_id`='$uid'"; $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';"; $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';"; $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)) while($item=DataBase::fetch($query))
{ {
$number = $item['tp_id']; $number = $item['tp_id'];
$number = $number-1; $number = $number-1;
$number2 = $item['p_id']; $number2 = $item['p_id'];
$sql3 = "UPDATE `".POSTS_TABLE."` SET `tp_id` = '$number' WHERE `p_id` =$number2;"; $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) function AcceptPost($postid)
{ {
$sql = "UPDATE `".POSTS_TABLE."` SET `moderated`='0' WHERE `p_id`='$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');
} }
} }
?> ?>

+ 4
- 4
includes/classes/class_pms.php View File

@ -50,12 +50,12 @@ class Pms
function DeleteMsgUser($mid) function DeleteMsgUser($mid)
{ {
$sql = "DELETE FROM `".PM_INBOX_TABLE."` WHERE `m_id`='$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) function DeleteMsgAuthor($mid)
{ {
$sql = "DELETE FROM `".PM_SENTBOX_TABLE."` WHERE `m_id`='$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); $last = DataBase::new_id(PM_INBOX_TABLE);
$time = time(); $time = time();
$sql = "INSERT INTO `".PM_INBOX_TABLE."` VALUES ('$last', '$uid', '$name', '$text', '$time', '$unid','0')"; $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) function AddToSentbox($text, $name, $unid, $uid)
{ {
$last=DataBase::new_id(PM_SENTBOX_TABLE); $last=DataBase::new_id(PM_SENTBOX_TABLE);
$time = time(); $time = time();
$sql = "INSERT INTO `".PM_SENTBOX_TABLE."` VALUES ('$last', '$uid', '$name', '$text', '$time', '$unid')"; $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');
} }
} }
?> ?>

+ 17
- 13
includes/classes/class_posting.php View File

@ -19,7 +19,7 @@ class Post
$last = DataBase::new_id(POSTS_TABLE); $last = DataBase::new_id(POSTS_TABLE);
#read last post in topic #read last post in topic
$sql = "SELECT * FROM ".POSTS_TABLE." WHERE t_id='$tid' ORDER BY tp_id DESC LIMIT 1;"; $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); $result = DataBase::fetch($query);
$forum = $result['f_id'];//forum id $forum = $result['f_id'];//forum id
$moderate = Forum::ForumInformation($forum,'moderate'); $moderate = Forum::ForumInformation($forum,'moderate');
@ -29,20 +29,20 @@ class Post
$time = time(); $time = time();
#add new post #add new post
$sql = "INSERT INTO `".POSTS_TABLE."` VALUES ('$last','$tid', '$uid', '$post', '".$_SERVER['HTTP_USER_AGENT']."', '$time', '$tpid', '$forum','$moderate','".$_SERVER['REMOTE_ADDR']."')"; $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=User::UserInformation($uid,'posts');
$result = $result+1; $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' "; $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; return $tpid;
} }
function EditPost($postid, $text) function EditPost($postid, $text)
{ {
$sql = "UPDATE `".POSTS_TABLE."` SET text='$text' WHERE `p_id`='$postid';"; $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) function NewTopic($posttext, $ntopic, $forum, $uid, $sticky)
@ -51,21 +51,25 @@ class Post
$moderate = Forum::ForumInformation($forum,'moderate'); $moderate = Forum::ForumInformation($forum,'moderate');
$time = time(); $time = time();
$lastt=DataBase::new_id(TOPICS_TABLE); $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 //add post
//select last post //select last post
$last = DataBase::new_id(POSTS_TABLE); $last = DataBase::new_id(POSTS_TABLE);
//add post //add post
$sql = "INSERT INTO ".POSTS_TABLE." VALUES ('$last','$lastt', '$uid', '$posttext','".$_SERVER['HTTP_USER_AGENT']."', '$time', '1', '$forum', '$moderate','".$_SERVER['REMOTE_ADDR']."');"; $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';"; $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 = DataBase::fetch($query);
$result = $result['posts']; $result = $result['posts'];
$result = $result+1; $result = $result+1;
TriggerStats($forum, 1);
TriggerStats($lastt, 2);
$sql = "UPDATE ".USERS_TABLE." SET posts='$result' WHERE u_id='$uid' "; $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; return $lastt;
} }
@ -74,7 +78,7 @@ class Post
$text =''; $text ='';
$result=''; $result='';
$sql = "SELECT * FROM ".SMILES_TABLE.""; $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; $i = 1;
while($smile = DataBase::fetch($query)) while($smile = DataBase::fetch($query))
{ {
@ -98,7 +102,7 @@ class Post
function SmilesReplace($text) function SmilesReplace($text)
{ {
$sql = "SELECT * FROM ".SMILES_TABLE.""; $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; $i = 1;
while($result = DataBase::fetch($query)) while($result = DataBase::fetch($query))
{ {

+ 12
- 10
includes/classes/class_topic.php View File

@ -16,13 +16,15 @@ class Topic
function LastPostInTopic($topic) function LastPostInTopic($topic)
{ {
global $lng; global $lng;
global $lastpost;
global $last_post;
global $forum_config; global $forum_config;
global $userdata; 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) switch($rank)
{ {
case '0': case '0':
@ -58,18 +60,18 @@ class Topic
{ {
$page=''; $page='';
} }
return '<p align="center"><span class="fverysmall"><b>'.GenerateTime($lastpost[$topic]['time']).'</b><br></span> <a href="topic.php?t='.$topic.$page.'#p'.$id.'" class="fverysmall"><b>Post #'.$id.'</b></a><a class="fsmall">: </a><a href="user.php?id='.$userid.'" class="fverysmall">'.$user_color_name.'</a></p>';
return '<p align="center"><span class="fverysmall"><b>'.GenerateTime($last_post[2]).'</b><br></span> <a href="topic.php?t='.$topic.$page.'#p'.$id.'" class="fverysmall"><b>Post #'.$id.'</b></a><a class="fsmall">: </a><a href="user.php?id='.$userid.'" class="fverysmall">'.$user_color_name.'</a></p>';
} }
function LastPostImg() function LastPostImg()
{ {
global $lastpost;
global $last_post;
global $record; global $record;
global $default_skin; global $default_skin;
$time = time()-129600; $time = time()-129600;
if ($_SESSION['uid']>0) if ($_SESSION['uid']>0)
{ {
if ($lastpost[$record['t_id']]['time']>$time)
if ($last_post[2]>$time)
{ {
return 'folder_new_posts'; return 'folder_new_posts';
} }
@ -115,7 +117,7 @@ class Topic
function TopicInformation($tid, $mode) function TopicInformation($tid, $mode)
{ {
$sql = "SELECT * FROM ".TOPICS_TABLE." WHERE t_id='$tid';"; $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 = DataBase::fetch($query);
$result = $result[$mode]; $result = $result[$mode];
return $result; return $result;
@ -124,7 +126,7 @@ class Topic
function PostInformation($pid, $mode) function PostInformation($pid, $mode)
{ {
$sql = "SELECT * FROM ".POSTS_TABLE." WHERE p_id='$pid';"; $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 = DataBase::fetch($query);
$result = $result[$mode]; $result = $result[$mode];
return $result; return $result;

+ 12
- 12
includes/classes/class_user.php View File

@ -24,7 +24,7 @@ class User
function UserInformation($uid, $inf) function UserInformation($uid, $inf)
{ {
$sql = "SELECT `$inf` FROM ".USERS_TABLE." WHERE u_id='$uid';"; $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 = DataBase::fetch($query);
$result = $result[$inf]; $result = $result[$inf];
return $result; return $result;
@ -33,7 +33,7 @@ class User
function UserIdByNick($nick) function UserIdByNick($nick)
{ {
$sql = "SELECT * FROM `".USERS_TABLE."` WHERE `nick`='$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']; $result = $result['u_id'];
/*if ($result=='') /*if ($result=='')
{ {
@ -46,13 +46,13 @@ class User
{ {
$last= DataBase::new_id(USERS_GROUP_TABLE); $last= DataBase::new_id(USERS_GROUP_TABLE);
$sql = "INSERT INTO `".USERS_GROUP_TABLE."` VALUES ('$last','$uid', '$gid')"; $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) function DeleteFromGroup($uid, $gid)
{ {
$sql = "DELETE FROM `".USERS_GROUP_TABLE."` WHERE `u_id`='$uid' AND `g_id`='$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) function LogedAs($sid, $uid)
@ -119,7 +119,7 @@ class User
if ($uid>0) if ($uid>0)
{ {
$sql = "SELECT * FROM ".USERS_TABLE." WHERE u_id='$uid'"; $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); $result = DataBase::fetch($query);
$rank = $result['rank']; $rank = $result['rank'];
if (($rank=='1') or ($rank=='2')) if (($rank=='1') or ($rank=='2'))
@ -156,7 +156,7 @@ class User
`view_shoutbox` = '$allow_shoutbox', `view_shoutbox` = '$allow_shoutbox',
`limit_users` = '$limit_users' `limit_users` = '$limit_users'
WHERE `u_id` ='$uid' LIMIT 1 ;"; 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) function UpdateAdminPools($uid, $posts, $rank, $active, $nick)
@ -167,7 +167,7 @@ class User
`active` = '$active', `active` = '$active',
`nick` = '$nick' `nick` = '$nick'
WHERE `u_id` ='$uid' LIMIT 1 ;"; 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) function UpdatePassword($uid, $pass)
@ -175,7 +175,7 @@ class User
$sql ="UPDATE `".USERS_TABLE."` SET $sql ="UPDATE `".USERS_TABLE."` SET
`pass` = '$pass' `pass` = '$pass'
WHERE `u_id` ='$uid' LIMIT 1 ;"; 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) function CreateProfile($nick, $pass, $email, $gg, $allow_gg, $allow_email, $allow_qr, $sig, $av, $interests)
@ -185,7 +185,7 @@ class User
$time = time(); $time = time();
$sql = "INSERT INTO ".USERS_TABLE." VALUES $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');"; ('$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() function UserMsgs()
@ -194,7 +194,7 @@ class User
if($uid>0) if($uid>0)
{ {
$sql = "SELECT count(*) as `m_id` FROM ".PM_INBOX_TABLE." WHERE `u_id`='$uid' AND `read`='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']; $result = $result['m_id'];
if ($result>0) if ($result>0)
{ {
@ -210,14 +210,14 @@ class User
function UserAddWarn($uid, $value, $motive) function UserAddWarn($uid, $value, $motive)
{ {
$sql = "INSERT INTO `".WARNINGS_TABLE."` ( `w_id` , `u_id` , `value` , `motive` ) VALUES('','$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) if (User::UserLevelWarns($uid)==100)
{ {
$ban_ip = '0.0.0.0'; $ban_ip = '0.0.0.0';
$ban_uid = $uid; $ban_uid = $uid;
$ban_motive = $lng['warns_ban']; $ban_motive = $lng['warns_ban'];
$sql = "INSERT INTO ".BANLIST_TABLE." VALUES ('', '$ban_uid', '$ban_ip', '$ban_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.');
} }
} }
} }

+ 13
- 13
includes/classes/secure.php View File

@ -17,7 +17,7 @@ class Secure
{ {
global $lng; global $lng;
$sql = "SELECT * FROM ".FORUMS_TABLE." WHERE f_id='$fid'"; $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 = DataBase::fetch($query);
$result = $result['f_id']; $result = $result['f_id'];
if ($result=='') if ($result=='')
@ -31,7 +31,7 @@ class Secure
if ($forum_config['use_censorlist']) if ($forum_config['use_censorlist'])
{ {
$sql = "SELECT * FROM ".CENSORLIST_TABLE.";"; $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)) while($word = DataBase::fetch($query))
{ {
$text = str_replace($word['word'],'[censored]', $text); $text = str_replace($word['word'],'[censored]', $text);
@ -68,7 +68,7 @@ class Secure
{ {
global $lng; global $lng;
$sql = "SELECT * FROM ".PM_INBOX_TABLE." WHERE m_id='$mid'"; $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 = DataBase::fetch($query);
$result = $result['m_id']; $result = $result['m_id'];
if ($result=='') if ($result=='')
@ -80,7 +80,7 @@ class Secure
{ {
global $lng; global $lng;
$sql = "SELECT * FROM ".PM_SENTBOX_TABLE." WHERE m_id='$mid'"; $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 = DataBase::fetch($query);
$result = $result['u_n_id']; $result = $result['u_n_id'];
if ($result!=$_SESSION['uid']) if ($result!=$_SESSION['uid'])
@ -92,7 +92,7 @@ class Secure
{ {
global $lng; global $lng;
$sql = "SELECT * FROM ".PM_INBOX_TABLE." WHERE m_id='$mid'"; $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']; $result = $result['u_id'];
if ($result!=$_SESSION['uid']) if ($result!=$_SESSION['uid'])
{ {
@ -103,7 +103,7 @@ class Secure
{ {
global $lng; global $lng;
$sql = "SELECT * FROM ".PM_SENTBOX_TABLE." WHERE m_id='$mid'"; $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']; $result = $result['m_id'];
if ($result=='') if ($result=='')
{ {
@ -114,7 +114,7 @@ class Secure
{ {
global $lng; global $lng;
$sql = "SELECT * FROM `".TOPICS_TABLE."` WHERE `t_id`='$tid'"; $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 = DataBase::fetch($query);
$result = $result['t_id']; $result = $result['t_id'];
if ($result=='') if ($result=='')
@ -126,7 +126,7 @@ class Secure
{ {
global $lng; global $lng;
$sql = "SELECT * FROM ".POSTS_TABLE." WHERE p_id='$pid'"; $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 = DataBase::fetch($query);
$result = $result['p_id']; $result = $result['p_id'];
if ($result=='') if ($result=='')
@ -138,7 +138,7 @@ class Secure
{ {
global $lng; global $lng;
$sql = "SELECT * FROM ".USERS_TABLE." WHERE u_id='$uid'"; $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']; $result = $result['u_id'];
if (($result=='') or ($result=='-1')) if (($result=='') or ($result=='-1'))
{ {
@ -149,7 +149,7 @@ class Secure
{ {
global $lng; global $lng;
$sql = "SELECT `g_id` FROM `".GROUPS_TABLE."` WHERE g_id='$gid'"; $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']; $result = $result['g_id'];
if ($result=='') if ($result=='')
{ {
@ -170,10 +170,10 @@ class Secure
{ {
global $lng; global $lng;
$sql = "SELECT `f_id`,`lock` FROM `".TOPICS_TABLE."` WHERE `t_id`='$tid'"; $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']; $fid = $result['f_id'];
$sql2 = "SELECT `lock` FROM `".FORUMS_TABLE."` WHERE `f_id`='$fid'"; $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')) if (($result['lock']=='1') or ($result2['lock']=='1'))
{ {
message_forum($lng['no_posting_topic_locked'],'topic.php?t='.$tid); message_forum($lng['no_posting_topic_locked'],'topic.php?t='.$tid);
@ -183,7 +183,7 @@ class Secure
{ {
global $lng; global $lng;
$sql = "SELECT `lock` FROM `".FORUMS_TABLE."` WHERE `f_id`='$fid'"; $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') if ($result['lock']=='1')
{ {
message_forum($lng['no_posting_forum_locked'],'forum.php?f='.$fid); message_forum($lng['no_posting_forum_locked'],'forum.php?f='.$fid);

+ 2
- 21
includes/constants.php View File

@ -44,25 +44,6 @@ define('FOOTER_TEXT','Powered by µForum
//hash for password //hash for password
define('PASSWD_HASH','bJVhVFCthvhVhKBU6GUbhUBU6VI7BiU6fV7G76Kbug6FU67VsaVYat5FJUHssaYVY5fV5GUHI76uKYTjYKKTatastYKYTYKg6ds7IRdsagI565JTrJ4NFGagGKLULygaTJHgfYDRZagGHJ65KL7iryikuuyriMYIYYUyugFTDeRnLKJNuyTDTRsERy78IJOhHCTDYjomLKBJDF5THNNBjyFCDYekjnKBUYgIHnUIbyuG6UyHNKJjnKHVut6FBYlH987g6GIUBbg76V5NNLUBH76BKLBi76FVtjN76Gi77ggYVCx3 R4SGhfGLHIH64XFGBUNLJOgfvc4Y3ScvmljmOBVc4klJKNIuBGVY6 MbvhGCRGgJLjKFHrYYJnKJGFHTfJJjnLK'); define('PASSWD_HASH','bJVhVFCthvhVhKBU6GUbhUBU6VI7BiU6fV7G76Kbug6FU67VsaVYat5FJUHssaYVY5fV5GUHI76uKYTjYKKTatastYKYTYKg6ds7IRdsagI565JTrJ4NFGagGKLULygaTJHgfYDRZagGHJ65KL7iryikuuyriMYIYYUyugFTDeRnLKJNuyTDTRsERy78IJOhHCTDYjomLKBJDF5THNNBjyFCDYekjnKBUYgIHnUIbyuG6UyHNKJjnKHVut6FBYlH987g6GIUBbg76V5NNLUBH76BKLBi76FVtjN76Gi77ggYVCx3 R4SGhfGLHIH64XFGBUNLJOgfvc4Y3ScvmljmOBVc4klJKNIuBGVY6 MbvhGCRGgJLjKFHrYYJnKJGFHTfJJjnLK');
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;
}
define('CRITICAL', 'Critical Error');
define('GENERAL', 'General Error');
?> ?>

+ 14
- 6
includes/db.php View File

@ -23,16 +23,16 @@ class DataBase
$db = new mysqli(DB_HOST, DB_USER, DB_PASS); $db = new mysqli(DB_HOST, DB_USER, DB_PASS);
if (mysqli_connect_errno() != 0) 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")) 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)) 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) function fetch($query)
{ {
return $query->fetch_array();
return $query->fetch_assoc();
} }
function num_rows($query) 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) function new_id($table)
@ -91,7 +99,7 @@ class DataBase
case WARNINGS_TABLE: { $id = 'w_id'; break; } case WARNINGS_TABLE: { $id = 'w_id'; break; }
} }
$sql = "SELECT `$id` FROM $table ORDER BY `$id` DESC LIMIT 1"; $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.<br> File: db.php, Line: '.__LINE__));
$return_id = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Error with obtain last id.<br> File: db.php, Line: '.__LINE__));
$return_id = $return_id[$id]; $return_id = $return_id[$id];
$return_id = $return_id+1; $return_id = $return_id+1;
return $return_id; return $return_id;

+ 2
- 2
includes/emailer.php View File

@ -38,7 +38,7 @@ function SendEmail($email, $title, $content)
#send email - do it! #send email - do it!
if ( !mail($email, $title, $email_content, $email_headers )) 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) function SendMassEmail($title,$content)
{ {
$sql = "SELECT `email`,`u_id` FROM ".USERS_TABLE." WHERE `u_id`>0"; $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)) while($item = DataBase::fetch($query))
{ {
SendEmail($item['email'], $title, $content); SendEmail($item['email'], $title, $content);

+ 2
- 2
includes/errors.php View File

@ -19,8 +19,8 @@ function message_die($type, $msm, $sql)
<table align="left" border="1" style="border-collapse: collapse; border-color: grey" width="500"> <table align="left" border="1" style="border-collapse: collapse; border-color: grey" width="500">
<tr> <tr>
<td bgcolor="" align="left"> <td bgcolor="" align="left">
<font face="Verdana" style="font-size: 18pt; font-weight: bold" color="red">DSF v'.VERSION.' - ';
$msg .= ($type='CRITICAL') ? 'CRITICAL ERROR' : 'GENERAL ERROR' ;
<font face="Verdana" style="font-size: 18pt; font-weight: bold" color="red">&micro;Forum v'.VERSION.' - ';
$msg .= $type;
$msg .= '</font> $msg .= '</font>
</td> </td>
</tr> </tr>

+ 67
- 32
includes/misc_functions.php View File

@ -19,7 +19,7 @@ function SetCounter()
{ {
setcookie('forum_visited','1'); setcookie('forum_visited','1');
$visit_count = $forum_config['forum_counter'] +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 else
{ {
@ -201,7 +201,7 @@ function AddSkins()
global $forum_config; global $forum_config;
global $default_skin; global $default_skin;
$all=''; $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)) while($t = DataBase::fetch($query))
{ {
@ -277,7 +277,7 @@ function IfModGroup($guid)
function TotalPosts() function TotalPosts()
{ {
$sql = "SELECT count(*) as `p_id` FROM ".POSTS_TABLE.""; $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 = DataBase::fetch($query);
$result = $result['p_id']; $result = $result['p_id'];
@ -338,13 +338,15 @@ function ViewSkinName()
$result = $forum_config['defaultskin']; $result = $forum_config['defaultskin'];
} }
$sql = "SELECT * FROM `".SKINS_TABLE."` WHERE `s_id`='$result'"; $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']; return $result['name'];
} }
function GenerateLastPost($id, $type) function GenerateLastPost($id, $type)
{ {
$last_post = '';
switch ($type) switch ($type)
{ {
/** field lastpost in forum format /** field lastpost in forum format
@ -352,8 +354,8 @@ function GenerateLastPost($id, $type)
*/ */
case 1: //for forum 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); $post_count = DataBase::num_rows($query);
$result = DataBase::fetch($query); $result = DataBase::fetch($query);
@ -372,7 +374,7 @@ function GenerateLastPost($id, $type)
$sql = "UPDATE ".FORUMS_TABLE." SET $sql = "UPDATE ".FORUMS_TABLE." SET
`lastpost`='$last_post' `lastpost`='$last_post'
WHERE `f_id`='$id'"; 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; break;
} }
@ -381,8 +383,8 @@ function GenerateLastPost($id, $type)
*/ */
case 2: //for topic 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); $result = DataBase::fetch($query);
$last_post .= $result['tp_id']; $last_post .= $result['tp_id'];
@ -396,60 +398,93 @@ function GenerateLastPost($id, $type)
$last_post .= $result['nick']; $last_post .= $result['nick'];
$sql = "UPDATE ".TOPICS_TABLE." SET $sql = "UPDATE ".TOPICS_TABLE." SET
`lastpost_time`='".$result['ptime']."',
`lastpost`='$last_post' `lastpost`='$last_post'
WHERE `t_id`='$id'"; 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; break;
} }
} }
} }
function GeneratePosts($id, $type) function GeneratePosts($id, $type)
{
{
switch ($type) switch ($type)
{ {
case 1: //for forum 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); $post_count = DataBase::num_rows($query);
$result = DataBase::fetch($query); $result = DataBase::fetch($query);
$posts = $result['count'];
$posts = $result['cnt'];
$sql = "UPDATE ".FORUMS_TABLE." SET $sql = "UPDATE ".FORUMS_TABLE." SET
`posts`='$last_post'
`posts`='$posts'
WHERE `f_id`='$id'"; 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; break;
} }
/** field lastpost in topic format
tp_id:u_id:ptime:rank:nick
*/
case 2: //for topic 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); $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 $sql = "UPDATE ".TOPICS_TABLE." SET
`lastpost`='$last_post'
`posts`='$posts'
WHERE `t_id`='$id'"; 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; 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;
}
?> ?>

+ 2
- 2
includes/pms/pms_folder.php View File

@ -4,7 +4,7 @@
//private messsages cache - v1.0 Alpha 2 //private messsages cache - v1.0 Alpha 2
// //
$sql = "SELECT `u_id`,`nick`,`rank` FROM `".USERS_TABLE."`"; $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); $user['count']= DataBase::num_rows($query);
while($result = DataBase::fetch($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); $count = DataBase::num_rows($query);
if ($count==0) if ($count==0)

+ 4
- 4
includes/pms/pms_view.php View File

@ -2,7 +2,7 @@
//smiles cache //smiles cache
$sql = "SELECT * FROM ".SMILES_TABLE.""; $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; $i = 1;
while($result = DataBase::fetch($query)) while($result = DataBase::fetch($query))
{ {
@ -33,7 +33,7 @@ switch($_GET['submode'])
break; 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); $result = DataBase::fetch($query);
//if message exist.... //if message exist....
if ($result['m_id']=='') if ($result['m_id']=='')
@ -63,12 +63,12 @@ switch($_GET['submode'])
} }
if ($_GET['submode']=='user') 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']."'"; $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); $user = DataBase::fetch($query);
$folder = ($_GET['submode']=='author') ? '<a href="pms.php?mode=folder&amp;submode=sentbox" class="navigator">'.$lng['sentbox'].'</a>' : '<a href="pms.php?mode=folder&amp;submode=inbox" class="navigator">'.$lng['inbox'].'</a>'; $folder = ($_GET['submode']=='author') ? '<a href="pms.php?mode=folder&amp;submode=sentbox" class="navigator">'.$lng['sentbox'].'</a>' : '<a href="pms.php?mode=folder&amp;submode=inbox" class="navigator">'.$lng['inbox'].'</a>';

+ 1
- 1
includes/pms/pms_write.php View File

@ -8,7 +8,7 @@ if ((isset($_POST['textedit'])) and (isset($_POST['nmsg'])) and (isset($_POST['u
{ {
$nick = strip_tags($_POST['username']); $nick = strip_tags($_POST['username']);
$sql = "SELECT * FROM `".USERS_TABLE."` WHERE `nick`='$nick'"; $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']!='') if ($result['u_id']!='')
{ {
$_POST['textedit'] = Secure::TagsReplace($_POST['textedit']); $_POST['textedit'] = Secure::TagsReplace($_POST['textedit']);

+ 5
- 5
includes/sessions.php View File

@ -58,7 +58,7 @@ function SessRegister()
SessDelete($uid); SessDelete($uid);
$time = time(); $time = time();
$sql = "INSERT INTO ".SESSIONS_TABLE." VALUES ('', '".$_COOKIE[SESS_NAME]."','$uid','$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) if (DataBase::num_rows($query)>0)
{ {
$result = DataBase::fetch(); $result = DataBase::fetch();
@ -75,7 +75,7 @@ function SessDeleteOld()
{ {
$time = time(); $time = time();
$sql = "DELETE FROM ".SESSIONS_TABLE." WHERE time+129600<$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() function SessDelInvalid()
@ -83,7 +83,7 @@ function SessDelInvalid()
if ($_SESSION['uid']>0) if ($_SESSION['uid']>0)
{ {
$sql = "SELECT `session_id`, `u_id` FROM ".SESSIONS_TABLE." WHERE `u_id`='".$_SESSION['uid']."'"; $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 = DataBase::fetch($query);
$result = $result['session_id']; $result = $result['session_id'];
if ($_COOKIE[SESS_NAME]!=$result) if ($_COOKIE[SESS_NAME]!=$result)
@ -98,7 +98,7 @@ function SessDelete($uid)
{ {
$time = time(); $time = time();
$sql = "DELETE FROM ".SESSIONS_TABLE." WHERE u_id='$uid'"; $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) if (DataBase::num_rows($query)>0)
{ {
$result = DataBase::fetch($query); $result = DataBase::fetch($query);
@ -115,7 +115,7 @@ function SessView()
$name = ''; $name = '';
$time = time(); $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;"; $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) if (DataBase::num_rows($query)>0)
{ {
while($result = DataBase::fetch($query)) while($result = DataBase::fetch($query))

+ 2
- 2
index.php View File

@ -54,7 +54,7 @@ include('./skins/'.$default_skin.'/index_body.tpl');
// //
$isset_forum = array(); $isset_forum = array();
$sql = "SELECT * FROM `".CATS_TABLE."` ORDER BY `sort`"; $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)) while($result = DataBase::fetch($query))
{ {
$skin = array( $skin = array(
@ -93,7 +93,7 @@ $skin =array(
'last_user' => $lng['last_user'] . ': <b>' . User::LastUser() . '</b>', 'last_user' => $lng['last_user'] . ': <b>' . User::LastUser() . '</b>',
'stat' => $lng['statistics'], 'stat' => $lng['statistics'],
'showlastposts'=>$lng['showlastposts'], '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']), 'lforum_counter'=> str_replace('%x%',$visit_count, $lng['forum_counter']),
'logged_users' => str_replace('%x%', $sess[1] , $lng['logged_users']), 'logged_users' => str_replace('%x%', $sess[1] , $lng['logged_users']),
'group_users' => $lng['users_groups'], 'group_users' => $lng['users_groups'],

install/config.php → install1/config.php View File


install/functions_add.php → install1/functions_add.php View File

@ -2,7 +2,7 @@
/** /**
* @package uForum * @package uForum
* @file install/functions_add.php * @file install/functions_add.php
* @version $Id$3:26
* @version $Id$
* @copyright 2009(c) PioDer <pioder@wp.pl> * @copyright 2009(c) PioDer <pioder@wp.pl>
* @link http://pioder.gim2przemysl.int.pl// * @link http://pioder.gim2przemysl.int.pl//
* @license GNU GPL v3 * @license GNU GPL v3

install/index.php → install1/index.php View File

@ -190,10 +190,10 @@ switch($_GET['page'])
$config_file = str_replace('%pass%',strip_tags($_POST['mysql_pass']),$config_file); $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('%dbname%',strip_tags($_POST['database']),$config_file);
$config_file = str_replace('%dbprefix%',strip_tags($_POST['mysql_prefix']),$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_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'); include('./../includes/sql_parse.php');
$sql = @fread(@fopen('uf_tables.sql','r'),@filesize('uf_tables.sql')); $sql = @fread(@fopen('uf_tables.sql','r'),@filesize('uf_tables.sql'));
$sql = preg_replace('/uf_/', $_POST['mysql_prefix'], $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($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')); $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'); header('Location: index.php?page=step5');
@ -250,11 +250,11 @@ switch($_GET['page'])
`regdate`='".time()."', `regdate`='".time()."',
`lastvisit`='".time()."' `lastvisit`='".time()."'
WHERE `u_id`='1';"; 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'"; $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'"; $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'); header('Location: index.php?page=step7');
} }
else else
@ -290,7 +290,7 @@ switch($_GET['page'])
$open = @fopen('../config.php','a+'); $open = @fopen('../config.php','a+');
$config_file = @fread($open,@filesize('../config.php')); $config_file = @fread($open,@filesize('../config.php'));
$config_file = str_replace('false','true',$config_file); $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.'<tr><td class="fitem" align="center"><span class="fstandard">'.$lng['info_2'].'</span></td></tr></table><meta http-equiv="refresh" content="4; url=../index.php"></body></html>'; echo $header.'<tr><td class="fitem" align="center"><span class="fstandard">'.$lng['info_2'].'</span></td></tr></table><meta http-equiv="refresh" content="4; url=../index.php"></body></html>';
break; break;
} }

install/licence.html → install1/licence.html View File


install/tpls/index.html → install1/tpls/index.html View File


install/tpls/install_check_script.tpl → install1/tpls/install_check_script.tpl View File


install/tpls/install_step4.tpl → install1/tpls/install_step4.tpl View File


install/tpls/install_step6.tpl → install1/tpls/install_step6.tpl View File


install/tpls/install_step8.tpl → install1/tpls/install_step8.tpl View File


install/tpls/invalidfile_body.tpl → install1/tpls/invalidfile_body.tpl View File


install/uf_tables.sql → install1/uf_tables.sql View File


+ 1
- 0
lngs/Polish/main.php View File

@ -142,6 +142,7 @@ $lng['sticky']='Przyklejony: ';
$lng['visible_of_post']='Kliknij tutaj, aby zatwierdzić post'; $lng['visible_of_post']='Kliknij tutaj, aby zatwierdzić post';
$lng['post_moderated']='Ten post nie został jeszcze zatwierdzony u moderatora'; $lng['post_moderated']='Ten post nie został jeszcze zatwierdzony u moderatora';
$lng['moderated_post_text']='Treść nie zatwierdzonego postu'; $lng['moderated_post_text']='Treść nie zatwierdzonego postu';
$lng['post'] = 'Post';
// //
//on private messages.....-------------------------------------------- //on private messages.....--------------------------------------------
// //

+ 4
- 4
login.php View File

@ -65,7 +65,7 @@ if (isset($_GET['mode']))
$user = strip_tags(addslashes($_POST['user'])); $user = strip_tags(addslashes($_POST['user']));
$pass = md5(strip_tags($_POST['pass'])); $pass = md5(strip_tags($_POST['pass']));
$sql = "SELECT `u_id`, `nick`, `pass` FROM `".USERS_TABLE."` WHERE nick='$user'"; $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); $result = DataBase::fetch($query);
$nick = $result['nick']; $nick = $result['nick'];
if ($result['nick']==$user) if ($result['nick']==$user)
@ -76,7 +76,7 @@ if (isset($_GET['mode']))
{ {
$user_id = $result['u_id']; $user_id = $result['u_id'];
$sql = "DELETE FROM `".SESSIONS_TABLE."` WHERE `u_id`='$user_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) if (User::UserInformation($user_id,'active')==0)
{ {
SessDelete($_SESSION['uid']); SessDelete($_SESSION['uid']);
@ -88,10 +88,10 @@ if (isset($_GET['mode']))
$_SESSION['sessionid']=$ssid; $_SESSION['sessionid']=$ssid;
//session register //session register
$sql = "INSERT INTO `".SESSIONS_TABLE."` VALUES ('', '".$_COOKIE[SESS_NAME]."','$user_id','".time()."')";//query $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... //next...
$sql = "UPDATE `".USERS_TABLE."` SET lastvisit='".time()."' WHERE u_id='$user_id'";//update lastvisit for user $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'].': <b>'.$nick.'</b>';// messaage "login as.." $msg = $lng['youareloggedas'].': <b>'.$nick.'</b>';// messaage "login as.."
$skin['pa_link']=''; $skin['pa_link']='';
$stop = TimeGeneration();//generate generation's time $stop = TimeGeneration();//generate generation's time

+ 5
- 0
moderate.php View File

@ -48,6 +48,7 @@ switch(trim($_GET['action']))
Secure::topic_exists($tid); Secure::topic_exists($tid);
$fid = Topic::TopicInformation($tid,'f_id'); $fid = Topic::TopicInformation($tid,'f_id');
Mod::DeleteTopic($tid); Mod::DeleteTopic($tid);
TriggerStats($fid, 1);
$stop = TimeGeneration(); $stop = TimeGeneration();
message_forum($lng['tdeleted'], 'forum.php?f='.$fid); message_forum($lng['tdeleted'], 'forum.php?f='.$fid);
break; break;
@ -79,6 +80,7 @@ switch(trim($_GET['action']))
if ($tpid >1) if ($tpid >1)
{ {
Mod::DeletePost($pid); Mod::DeletePost($pid);
TriggerStats($tid, 2);
} }
$stop = TimeGeneration(); $stop = TimeGeneration();
message_forum($lng['pdeleted'],'topic.php?t='.$tid); message_forum($lng['pdeleted'],'topic.php?t='.$tid);
@ -109,7 +111,10 @@ switch(trim($_GET['action']))
if (isset($_POST['forum_id'])) if (isset($_POST['forum_id']))
{ {
$fid = $_POST['forum_id']; $fid = $_POST['forum_id'];
$f_id = Topic::TopicInformation($tid, 'f_id');
Mod::MoveTopic($tid,$fid); Mod::MoveTopic($tid,$fid);
TriggerStats($fid, 1);
TriggerStats($f_id, 1);
message_forum($lng['topic_moved'],'topic.php?t='.$tid); message_forum($lng['topic_moved'],'topic.php?t='.$tid);
} }
else else

+ 1
- 1
posting.php View File

@ -298,7 +298,7 @@ switch(trim($_GET['mode']))
$_POST['textedit']=''; $_POST['textedit']='';
} }
$sql = "SELECT `lock`, `name`, `f_id` FROM ".FORUMS_TABLE." WHERE `f_id`='".intval($_GET['f'])."'"; $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']=='') if($forum['name']=='')
{ {
message_forum($lng['no_forum'], 'index.php'); message_forum($lng['no_forum'], 'index.php');

+ 1
- 1
register.php View File

@ -52,7 +52,7 @@ if ( ereg ("^.+@.+\..+$", $_POST['email']))
if ($nick!='') if ($nick!='')
{ {
$sql = "SELECT * FROM `".USERS_TABLE."` WHERE `nick`='$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 = DataBase::fetch($query);
$result = $result['nick']; $result = $result['nick'];
if ($result!=$nick) if ($result!=$nick)

+ 5
- 5
search.php View File

@ -30,7 +30,7 @@ SessDelInvalid();
SessRegister(); SessRegister();
SessDeleteOld(); 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`"; $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)) while($result = DataBase::fetch($query))
{ {
$lastpost[$result['t_id']]['tp_id']=$result['tp_id']; $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']; $lastpost[$result['t_id']]['user_rank']=$result['rank'];
} }
$sql = "SELECT COUNT(*) as `p_id`, `t_id` FROM ".POSTS_TABLE." GROUP BY `t_id`"; $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)) while($result = DataBase::fetch($query))
{ {
$count_topic[$result['t_id']]=$result['p_id']; $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'])) if (isset($_GET['u']))
{ {
$count = DataBase::fetch(DataBase::sql_query("SELECT COUNT(`t_id`) as `t_id` $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 = $count['t_id'];
$count = ceil($count / $limiter); $count = ceil($count / $limiter);
if ($count==0) if ($count==0)
@ -139,7 +139,7 @@ if ((isset($_POST['keywords'])) || ($_GET['content']=='lastposts') || ($_GET['co
$like_where .=' OR `text` LIKE \'%'.$keyword[$i].'%\''; $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`"; $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 = $count['count'];
$count = ceil($count / $limiter); $count = ceil($count / $limiter);
if ($count==0) 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)); $skin = array_push_associative($skin,GenerateHeader($window_title,$navigator_title));
include('./skins/'.$default_skin.'/overall_header.tpl'); include('./skins/'.$default_skin.'/overall_header.tpl');
include('./skins/'.$default_skin.'/forum_body.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); $value = DataBase::num_rows($query);
if ($value>0) if ($value>0)
{ {

+ 4
- 4
shoutbox.php View File

@ -25,9 +25,9 @@ if (isset($_GET['mode']))
if ((strlen($content)>3) and (strlen($content)<300)) if ((strlen($content)>3) and (strlen($content)<300))
{ {
$sql = "DELETE FROM ".SHOUTBOX_TABLE." WHERE `mtime`<'".(time()-$forum_config['shoutbox_max_time'])."'"; $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()."')"; $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 '<meta http-equiv="refresh" content="0; url=index.php">'; echo '<meta http-equiv="refresh" content="0; url=index.php">';
@ -37,7 +37,7 @@ if (isset($_GET['mode']))
{ {
if (isset($_GET['id']) && (RANK>0)) 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; break;
} }
@ -58,7 +58,7 @@ else
} }
$shoutbox_content = ''; $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']; $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)) while($sb_msg = DataBase::fetch($query))
{ {
$allow_del = (RANK>0) ? '<a href="index.php?mode=shoutbox_delete&amp;id='.$sb_msg['m_id'].'" class="fsmall">X</a><span class="small">&nbsp;</span>' : ''; $allow_del = (RANK>0) ? '<a href="index.php?mode=shoutbox_delete&amp;id='.$sb_msg['m_id'].'" class="fsmall">X</a><span class="small">&nbsp;</span>' : '';

+ 4
- 4
skins/subPurple/forum_body.tpl View File

@ -6,11 +6,11 @@
<table class="maintable" width="<?= TABLES_WIDTH; ?>" style="border-width: 0px"> <table class="maintable" width="<?= TABLES_WIDTH; ?>" style="border-width: 0px">
<tr> <tr>
<td width="17" style="background-image: url('skins/subPurple/images/td_beam_left.gif')"></td> <td width="17" style="background-image: url('skins/subPurple/images/td_beam_left.gif')"></td>
<td height="14" width="418" class="beam" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"><? echo $skin['ltopicname']; ?> </td>
<td height="14" width="110" class="beam" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"><? echo $skin['lauthor']; ?> </td>
<td height="14" width="58" class="beam" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"><? echo $skin['lposts']; ?> </td>
<td height="14" width="520" class="beam" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"><? echo $skin['ltopicname']; ?> </td>
<td height="14" width="130" class="beam" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"><? echo $skin['lauthor']; ?> </td>
<td height="14" width="62" class="beam" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"><? echo $skin['lposts']; ?> </td>
<td height="14" class="beam" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"><? echo $skin['llastpost']; ?> </td> <td height="14" class="beam" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"><? echo $skin['llastpost']; ?> </td>
<td width="17" style="background-image: url('skins/subPurple/images/td_beam_right.gif')"></td> <td width="17" style="background-image: url('skins/subPurple/images/td_beam_right.gif')"></td>
</tr> </tr>
</table> </table>
<table class="maintable" width="<?= TABLES_WIDTH; ?>" style="border-top: 0px">
<table class="maintable" width="<?= TABLES_WIDTH; ?>" style="border-top: 0px">

BIN
skins/subPurple/images/Thumbs.db View File


BIN
skins/subPurple/images/delete.gif View File

Before After
Width: 20  |  Height: 20  |  Size: 911 B Width: 19  |  Height: 18  |  Size: 1.0 KiB

BIN
skins/subPurple/images/lng_Polish/Thumbs.db View File


BIN
skins/subPurple/images/lock.gif View File

Before After
Width: 20  |  Height: 20  |  Size: 900 B Width: 19  |  Height: 18  |  Size: 1.0 KiB

BIN
skins/subPurple/images/move.gif View File

Before After
Width: 20  |  Height: 20  |  Size: 881 B Width: 19  |  Height: 18  |  Size: 1.0 KiB

BIN
skins/subPurple/images/stick.gif View File

Before After
Width: 20  |  Height: 20  |  Size: 910 B Width: 19  |  Height: 18  |  Size: 1.0 KiB

BIN
skins/subPurple/images/unlock.gif View File

Before After
Width: 20  |  Height: 20  |  Size: 890 B Width: 19  |  Height: 18  |  Size: 1.0 KiB

BIN
skins/subPurple/images/unstick.gif View File

Before After
Width: 20  |  Height: 20  |  Size: 899 B Width: 15  |  Height: 19  |  Size: 1.1 KiB

BIN
skins/subPurple/images/wyzz/Thumbs.db View File


+ 0
- 61
skins/subPurple/post_add_body.tpl View File

@ -1,61 +0,0 @@
<!-- post id #<?= $skin['tp_id'];?> -->
<table class="maintable" width="<?= TABLES_WIDTH; ?>" style="border-width: 0px">
<tr>
<td width="17" class="beam" style="background-image: url('skins/subPurple/images/td_beam_left.gif')"></td>
<td width="100" id="p<? echo $skin['tp_id']; ?>" height="14" class="beam" align="center" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"></td>
<td width="<?= (TABLES_WIDTH -244); ?>" height="14" class="beam" align="center" style="background-image: url('skins/subPurple/images/td_beam_top.gif')">Post</td>
<td width="110" height="15" class="beam" align="center" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"><? echo $skin['lpinfo']; ?></td>
<td width="17" class="beam" style="background-image: url('skins/subPurple/images/td_beam_right.gif')"></td>
</tr>
<table class="maintable" width="<?= TABLES_WIDTH; ?>" style="border-top: 0px">
<tr>
<td width="116" height="1" class="fitem" align="center" rowspan="<?= $skin['rowspan']; ?>" valign="top">
<a href="user.php?id=<? echo $skin['u_id']; ?>" class="fsmall"><? echo $skin['username']; ?></a><br>
<? echo $skin['avatar']; ?><br><br><br>
</td>
<td width="<?= (TABLES_WIDTH -264); ?>" height="76" class="fitem" align="left" colspan="3" rowspan="<?= $skin['rowspan']; ?>" valign="top">
<p align="left"><span class="fstandard"><? echo $skin['posttext']; ?></span><p class="fsmall" align="left"><? echo $skin['sig']; ?></p></p>
</td>
<td width="148" height="22" class="fitem" align="center" valign="top">
<span class="fsmall">Post <? echo $skin['lno']; ?> </span>
<a href="#p<? echo $skin['tp_id']; ?>" class="fsmall"><b>#<? echo $skin['tp_id']; ?></b></a><br>
<span class="fsmall"><? echo $skin['ldate']; ?>: <b><? echo $skin['pdate']; ?></b></span><br>
<span class="fsmall"><b><?= $skin['lstat']; ?>: </b></span><img src="images/<?= $skin['online']?>" alt="online">
</td>
</tr>
<tr>
<td width="148" class="fitem" align="center" valign="top">
<a href="posting.php?mode=qpost&amp;id=<? echo $skin['p_id']; ?>&amp;t=<? echo $tid; ?>"><img border="0" src="skins/subPurple/images/lng_<? echo $skin['lang']; ?>/quote_small.gif" width="48" onMouseOver="this.style.cursor='hand'; this.src='skins/<?= $default_skin; ?>/images/lng_<?= $default_lang; ?>/quote_small_active.gif'" 
onMouseOut="this.src='skins/<?= $default_skin; ?>/images/lng_<?= $default_lang; ?>/quote_small.gif'" alt="quote"></a><br>
<? echo $skin['edit']; ?>
<? echo $skin['user_gg']; ?>
<a href="pms.php?mode=write&amp;id=<? echo $skin['u_id']; ?>"><img src="skins/subPurple/images/lng_<? echo $skin['lang']; ?>/pm_small.gif" onMouseOver="this.style.cursor='hand'; this.src='skins/<?= $default_skin; ?>/images/lng_<?= $default_lang; ?>/pm_small_active.gif'" 
onMouseOut="this.src='skins/<?= $default_skin; ?>/images/lng_<?= $default_lang; ?>/pm_small.gif'" border="0" alt="pw"></a><br>
<img src="images/user_agent/<?= $skin['ua_system']; ?>" alt="<?= $skin['ua_system_desc']; ?>" title="<?= $skin['ua_system_desc']; ?>"> <img src="images/user_agent/<?= $skin['ua_browser']; ?>" alt="<?= $skin['ua_browser_desc']; ?>" title="<?= $skin['ua_browser_desc']; ?>">
</td>
</tr>
<? if ($_SESSION['uid']>0) { if(RANK>0) {?>
<tr>
<td colspan="3" height="40" class="fitem" style="background-color: #FFFF99" align="center" valign="top">
<span class="fsmall"><b><?= $skin['admin'];?></b><br></span>
<span class="fsmall"><?= $skin['L.IP']; ?></span>
<? echo $skin['mode_p_del']; ?>
<a href="http://localhost/DSF/warns.php?mode=add&id=<?= $skin['u_id']; ?>" class="fsmall" style="color: green"><?= $skin['add_warn']; ?></a><br>
<? if (RANK==2) { ?>
<a href="admin/admin_users.php?mode=edit&amp;id=<?= $skin['u_id']; ?>" class="fsmall" style="color: red"><?= $skin['edit_profile']; ?></a><br>
<a href="admin/banlist.php?mode=add&amp;submode=all&amp;ip=<?= $skin['IP']; ?>&amp;uid=<?= $skin['u_id']; ?>" class="fsmall" style="color: red"><?= $skin['ban']; ?></a><br>
<? }?>
</td>
</tr>
<? } }?>
<tr>
<td width="116" height="1" class="fitem" align="center"><span class="fsmall"><?= $skin['warns_pool']; ?></td>
<td width="105" height="1" class="fitem" align="center"><span class="fsmall"><? echo $skin['lposts']; ?>: <b><? echo $skin['posts']; ?></b></span></td>
<td width="153" height="1" class="fitem" align="center"><span class="fsmall"><? echo $skin['lregdate']; ?>: <b><? echo $skin['regdate']; ?></b></span></td>
<td width="228" height="1" class="fitem" align="center"><span class="fsmall"><? echo $skin['llastvisit']; ?>: <b><? echo $skin['lastvisit']; ?></b></span></td>
<td width="142" height="1" class="fitem" align="center"><span class="fsmall"><? echo $skin['lrank']; ?>: <? echo $skin['userrank']; ?></span></td>
</tr>
</table>
<span class="fverysmall">&nbsp;<br></span>
<!-- end of post id #<?= $skin['tp_id'];?> -->

+ 2
- 2
skins/subPurple/topic_mod_body.tpl View File

@ -3,9 +3,9 @@
<tr> <tr>
<td width="100" height="29" class="moderate"> <td width="100" height="29" class="moderate">
<?= $skin['stick']; ?> <?= $skin['stick']; ?>
<a href="javascript:confirm_action('<?= $skin['c_delete_topic']; ?>','moderate.php?action=delete&amp;id=<?= $tid; ?>')"><img border="0" src="skins/subPurple/images/delete.gif" width="20" height="20" alt="delete"></a>
<a href="javascript:confirm_action('<?= $skin['c_delete_topic']; ?>','moderate.php?action=delete&amp;id=<?= $tid; ?>')"><img border="0" src="skins/subPurple/images/delete.gif" alt="delete"></a>
<?= $skin['lock']; ?> <?= $skin['lock']; ?>
<a href="moderate.php?action=move&amp;id=<?= $tid; ?>"> <a href="moderate.php?action=move&amp;id=<?= $tid; ?>">
<img border="0" src="skins/subPurple/images/move.gif" width="20" height="20" alt="move">
<img border="0" src="skins/subPurple/images/move.gif" alt="move">
</a> </a>
</td> </td>

+ 3
- 4
skins/subPurple/topic_post_body.tpl View File

@ -1,10 +1,9 @@
<!-- post id #<?= $skin['tp_id'];?> --> <!-- post id #<?= $skin['tp_id'];?> -->
<table class="maintable" width="<?= TABLES_WIDTH; ?>" style="border-width: 0px"> <table class="maintable" width="<?= TABLES_WIDTH; ?>" style="border-width: 0px">
<tr> <tr>
<td width="17" style="background-image: url('skins/subPurple/images/td_beam_left.gif')"></td> <td width="17" style="background-image: url('skins/subPurple/images/td_beam_left.gif')"></td>
<td width="100" id="p<? echo $skin['tp_id']; ?>" height="14" class="beam" align="center" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"></td> <td width="100" id="p<? echo $skin['tp_id']; ?>" height="14" class="beam" align="center" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"></td>
<td width="<?= (TABLES_WIDTH -244); ?>" height="14" class="beam" align="center" style="background-image: url('skins/subPurple/images/td_beam_top.gif')">Post</td>
<td width="<?= (TABLES_WIDTH -244); ?>" height="14" class="beam" align="center" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"><?= $skin['lpost']?></td>
<td width="110" height="15" class="beam" align="center" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"><? echo $skin['lpinfo']; ?></td> <td width="110" height="15" class="beam" align="center" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"><? echo $skin['lpinfo']; ?></td>
<td width="17" style="background-image: url('skins/subPurple/images/td_beam_right.gif')"></td> <td width="17" style="background-image: url('skins/subPurple/images/td_beam_right.gif')"></td>
</tr> </tr>
@ -26,11 +25,11 @@
</tr> </tr>
<tr> <tr>
<td width="148" class="fitem" align="center" valign="top"> <td width="148" class="fitem" align="center" valign="top">
<a href="posting.php?mode=qpost&amp;id=<? echo $skin['p_id']; ?>&amp;t=<? echo $tid; ?>"><img border="0" src="skins/subPurple/images/lng_<? echo $skin['lang']; ?>/quote_small.gif" width="48" onMouseOver="this.style.cursor='hand'; this.src='skins/<?= $default_skin; ?>/images/lng_<?= $default_lang; ?>/quote_small_active.gif'" 
<a href="posting.php?mode=qpost&amp;id=<? echo $skin['p_id']; ?>&amp;t=<? echo $tid; ?>"><img border="0" src="skins/subPurple/images/lng_<? echo $skin['lang']; ?>/quote_small.gif" width="48" onMouseOver="this.style.cursor='hand'; this.src='skins/<?= $default_skin; ?>/images/lng_<?= $default_lang; ?>/quote_small_active.gif'"
onMouseOut="this.src='skins/<?= $default_skin; ?>/images/lng_<?= $default_lang; ?>/quote_small.gif'" alt="quote"></a><br> onMouseOut="this.src='skins/<?= $default_skin; ?>/images/lng_<?= $default_lang; ?>/quote_small.gif'" alt="quote"></a><br>
<? echo $skin['edit']; ?> <? echo $skin['edit']; ?>
<? echo $skin['user_gg']; ?> <? echo $skin['user_gg']; ?>
<a href="pms.php?mode=write&amp;id=<? echo $skin['u_id']; ?>"><img src="skins/subPurple/images/lng_<? echo $skin['lang']; ?>/pm_small.gif" onMouseOver="this.style.cursor='hand'; this.src='skins/<?= $default_skin; ?>/images/lng_<?= $default_lang; ?>/pm_small_active.gif'" 
<a href="pms.php?mode=write&amp;id=<? echo $skin['u_id']; ?>"><img src="skins/subPurple/images/lng_<? echo $skin['lang']; ?>/pm_small.gif" onMouseOver="this.style.cursor='hand'; this.src='skins/<?= $default_skin; ?>/images/lng_<?= $default_lang; ?>/pm_small_active.gif'"
onMouseOut="this.src='skins/<?= $default_skin; ?>/images/lng_<?= $default_lang; ?>/pm_small.gif'" border="0" alt="pw"></a><br> onMouseOut="this.src='skins/<?= $default_skin; ?>/images/lng_<?= $default_lang; ?>/pm_small.gif'" border="0" alt="pw"></a><br>
<img src="images/user_agent/<?= $skin['ua_system']; ?>" alt="<?= $skin['ua_system_desc']; ?>" title="<?= $skin['ua_system_desc']; ?>"> <img src="images/user_agent/<?= $skin['ua_browser']; ?>" alt="<?= $skin['ua_browser_desc']; ?>" title="<?= $skin['ua_browser_desc']; ?>"> <img src="images/user_agent/<?= $skin['ua_system']; ?>" alt="<?= $skin['ua_system_desc']; ?>" title="<?= $skin['ua_system_desc']; ?>"> <img src="images/user_agent/<?= $skin['ua_browser']; ?>" alt="<?= $skin['ua_browser_desc']; ?>" title="<?= $skin['ua_browser_desc']; ?>">
</td> </td>

+ 2
- 1
topic.php View File

@ -54,7 +54,7 @@ include('./skins/'.$default_skin.'/overall_header.tpl');
include('./skins/'.$default_skin.'/topic_body.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;"; $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)) while($item=DataBase::fetch($query))
{ {
$ua = UserAgent($item['user_agent']); $ua = UserAgent($item['user_agent']);
@ -113,6 +113,7 @@ while($item=DataBase::fetch($query))
'ua_browser_desc'=>$lng['browser'].' '.$ua[3], 'ua_browser_desc'=>$lng['browser'].' '.$ua[3],
'lno'=>$lng['no.'], 'lno'=>$lng['no.'],
'lpinfo'=>$lng['postinfo'], 'lpinfo'=>$lng['postinfo'],
'lpost'=>$lng['post'],
'C.delete_post'=>$lng['c_delete_post'] 'C.delete_post'=>$lng['c_delete_post']
); );
//do it! //do it!

+ 3
- 3
user.php View File

@ -31,7 +31,7 @@ SessDeleteOld();
$uid = intval($_GET['id']); $uid = intval($_GET['id']);
//check online for user //check online for user
$sql = "SELECT `s_id`, `u_id`, `time` FROM ".SESSIONS_TABLE." WHERE `u_id`='$uid' AND time+1250>".time()." LIMIT 1"; $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); $result = DataBase::fetch($query);
if ($result['u_id']==$uid) if ($result['u_id']==$uid)
{ {
@ -44,7 +44,7 @@ else
unset($sql, $query, $result); unset($sql, $query, $result);
$userwarn = 0; $userwarn = 0;
$sql = "SELECT `u_id`,`value` FROM `".WARNINGS_TABLE."` WHERE `u_id`='$uid'"; $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); $result = DataBase::num_rows($query);
while ($result = DataBase::fetch($query)) while ($result = DataBase::fetch($query))
{ {
@ -60,7 +60,7 @@ while ($result = DataBase::fetch($query))
$userwarn = ($userwarn>0) ? $userwarn*10 : $userwarn; $userwarn = ($userwarn>0) ? $userwarn*10 : $userwarn;
//add skin variables //add skin variables
$sql = "SELECT * FROM `".USERS_TABLE."` WHERE u_id='$uid'"; $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); $user_info = DataBase::fetch($query);
if ($user_info['u_id']=='') if ($user_info['u_id']=='')
{ {

+ 2
- 2
users.php View File

@ -54,7 +54,7 @@ else
$page=1; $page=1;
} }
$count = DataBase::fetch(DataBase::sql_query("SELECT COUNT(`u_id`) as `u_id` $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 = $count['u_id'] -1;
$count = ceil($count / $limiter); $count = ceil($count / $limiter);
if(isset($_GET['page']) && ($_GET['page']>$count)) if(isset($_GET['page']) && ($_GET['page']>$count))
@ -189,7 +189,7 @@ switch($_COOKIE['users_sort'])
break; 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)) while($result = DataBase::fetch($query))
{ {
$skin = array( $skin = array(

+ 2
- 2
warns.php View File

@ -120,7 +120,7 @@ switch(trim($_GET['mode']))
{ {
$uid = $_GET['id']; $uid = $_GET['id'];
$sql = "SELECT `u_id`, `nick` FROM `".USERS_TABLE."` WHERE `u_id`='$uid'"; $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); $user = DataBase::fetch($query);
if ($user['u_id']=='') if ($user['u_id']=='')
{ {
@ -135,7 +135,7 @@ switch(trim($_GET['mode']))
include('./skins/'.$default_skin.'/overall_header.tpl'); include('./skins/'.$default_skin.'/overall_header.tpl');
include('./skins/'.$default_skin.'/warns_view_body.tpl'); include('./skins/'.$default_skin.'/warns_view_body.tpl');
$sql = "SELECT * FROM `".WARNINGS_TABLE."` WHERE `u_id`='$uid'"; $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); $result = DataBase::num_rows($query);
$warns_count = 0; $warns_count = 0;
while($item = DataBase::fetch($query)) while($item = DataBase::fetch($query))

Loading…
Cancel
Save