Browse Source

+ Moved classes to includes/classes catalog

+ Deleted a few of classes
+ Renamed functions
+ Fixed bug: Changing user nick in ACP

git-svn-id: https://svn.pioder.pl/uf-svn/uF@17 72ec579a-5ced-4fa4-82f3-afba5d98df2f
master
pioder 15 years ago
parent
commit
fd5c1ca78b
55 changed files with 1724 additions and 875 deletions
  1. +7
    -7
      admin/admin_forums.php
  2. +7
    -7
      admin/admin_groups.php
  3. +7
    -7
      admin/admin_script.php
  4. +9
    -7
      admin/admin_users.php
  5. +7
    -7
      admin/banlist.php
  6. +7
    -7
      admin/censorlist.php
  7. +7
    -7
      admin/check_script.php
  8. +9
    -9
      admin/check_script_data.php
  9. +7
    -7
      admin/forum_info.php
  10. +6
    -6
      admin/header.php
  11. +7
    -7
      admin/index.php
  12. +9
    -9
      admin/mass_email.php
  13. +7
    -7
      admin/smilelist.php
  14. +7
    -7
      admin/styles.php
  15. +3
    -3
      common.php
  16. +2
    -2
      config.php
  17. +22
    -22
      eprofile.php
  18. +15
    -15
      forum.php
  19. +20
    -20
      groups.php
  20. BIN
      images/smiles/Thumbs.db
  21. BIN
      images/user_agent/Thumbs.db
  22. +5
    -5
      includes/admin/class_main.php
  23. +1
    -1
      includes/cache/cache_forums.php
  24. +0
    -80
      includes/class_email.php
  25. +0
    -328
      includes/class_overall.php
  26. +0
    -51
      includes/class_shoutbox.php
  27. +140
    -0
      includes/classes/class_forum.php
  28. +103
    -0
      includes/classes/class_mod.php
  29. +119
    -0
      includes/classes/class_posting.php
  30. +204
    -0
      includes/classes/class_topic.php
  31. +224
    -0
      includes/classes/class_user.php
  32. +3
    -3
      includes/db.php
  33. +87
    -0
      includes/emailer.php
  34. +72
    -0
      includes/errors.php
  35. +346
    -0
      includes/misc_functions.php
  36. +6
    -6
      includes/pms/pms_delete.php
  37. +4
    -4
      includes/pms/pms_folder.php
  38. +4
    -4
      includes/pms/pms_view.php
  39. +3
    -3
      includes/pms/pms_write.php
  40. +18
    -7
      includes/sessions.php
  41. +19
    -19
      index.php
  42. +1
    -1
      install/config.php
  43. +3
    -3
      install/index.php
  44. +25
    -25
      login.php
  45. +26
    -26
      moderate.php
  46. +16
    -16
      pms.php
  47. +22
    -22
      posting.php
  48. +1
    -1
      quick_reply.php
  49. +20
    -20
      register.php
  50. +17
    -17
      search.php
  51. +1
    -1
      shoutbox.php
  52. +19
    -19
      topic.php
  53. +14
    -14
      user.php
  54. +16
    -16
      users.php
  55. +20
    -20
      warns.php

+ 7
- 7
admin/admin_forums.php View File

@ -11,20 +11,20 @@ define('IN_uF', true);
//include files
include('./../config.php');
include('./../includes/constants.php');
include('./../includes/class_db.php');
include('./../includes/class_error.php');
include('./../includes/db.php');
include('./../includes/errors.php');
//connect to database
DataBase::db_connect();
include('./../includes/sessions.php');
include('./../includes/class_user.php');
include('./../includes/classes/class_user.php');
include('./../common.php');
include('./../includes/admin/class_main.php');
include('./../includes/class_forum.php');
include('./../includes/classes/class_forum.php');
include('./../includes/admin/class_forum.php');
include('./../lngs/'.Admin_Over::DefaultLang().'/admin.php');
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
SessDelInvalid();
SessRegister();
SessDeleteOld();
//$default_skin = Admin_Over::ViewSkinName();
if (User::UserInformation($_SESSION['uid'],'rank')!=2)
{

+ 7
- 7
admin/admin_groups.php View File

@ -11,22 +11,22 @@ define('IN_uF', true);
//include files
include('./../config.php');
include('./../includes/constants.php');
include('./../includes/class_db.php');
include('./../includes/class_error.php');
include('./../includes/db.php');
include('./../includes/errors.php');
include('./../includes/classes/class_pms.php');
//connect to database
DataBase::db_connect();
include('./../includes/sessions.php');
include('./../includes/class_user.php');
include('./../includes/classes/class_user.php');
include('./../common.php');
include('./../includes/admin/class_main.php');
include('./../includes/class_forum.php');
include('./../includes/classes/class_forum.php');
include('./../includes/admin/class_forum.php');
include('./../includes/classes/secure.php');
include('./../lngs/'.Admin_Over::DefaultLang().'/admin.php');
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
SessDelInvalid();
SessRegister();
SessDeleteOld();
if (User::UserInformation($_SESSION['uid'],'rank')!=2)
{
admin_message_forum($lng['yournotadmin'],'../index.php');

+ 7
- 7
admin/admin_script.php View File

@ -11,19 +11,19 @@ define('IN_uF', true);
//include files
include('./../config.php');
include('./../includes/constants.php');
include('./../includes/class_db.php');
include('./../includes/class_error.php');
include('./../includes/db.php');
include('./../includes/errors.php');
//connect to database
DataBase::db_connect();
include('./../includes/sessions.php');
include('./../includes/class_user.php');
include('./../includes/classes/class_user.php');
include('./../common.php');
include('./../includes/admin/class_main.php');
include('./../includes/class_forum.php');
include('./../includes/classes/class_forum.php');
include('./../lngs/'.Admin_Over::DefaultLang().'/admin.php');
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
SessDelInvalid();
SessRegister();
SessDeleteOld();
if (User::UserInformation($_SESSION['uid'],'rank')!=2)
{
admin_message_forum($lng['yournotadmin'],'../index.php');

+ 9
- 7
admin/admin_users.php View File

@ -11,21 +11,22 @@ define('IN_uF', true);
//include files
include('./../config.php');
include('./../includes/constants.php');
include('./../includes/class_db.php');
include('./../includes/class_error.php');
include('./../includes/db.php');
include('./../includes/errors.php');
//connect to database
DataBase::db_connect();
include('./../includes/sessions.php');
include('./../includes/class_user.php');
include('./../includes/classes/class_user.php');
include('./../common.php');
include('./../includes/admin/class_main.php');
include('./../includes/class_topic.php');
include('./../includes/classes/class_topic.php');
include('./../includes/classes/class_posting.php');
include('./../includes/classes/secure.php');
$default_lang = Admin_Over::DefaultLang();
include('./../lngs/'.$default_lang.'/admin.php');
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
SessDelInvalid();
SessRegister();
SessDeleteOld();
if (User::UserInformation($_SESSION['uid'],'rank')!=2)
{
admin_message_forum($lng['yournotadmin'],'../index.php');
@ -200,6 +201,7 @@ switch($_GET['mode'])
{
admin_message_forum($lng['no_user'],'admin_users.php?mode=view');
}
$default_skin = Admin_Over::ViewSkinName();
//add skin variables
$skin = array(
//labels profile

+ 7
- 7
admin/banlist.php View File

@ -11,22 +11,22 @@ define('IN_uF', true);
//include files
include('./../config.php');
include('./../includes/constants.php');
include('./../includes/class_db.php');
include('./../includes/class_error.php');
include('./../includes/db.php');
include('./../includes/errors.php');
include('./../includes/classes/class_pms.php');
//connect to database
DataBase::db_connect();
include('./../includes/sessions.php');
include('./../includes/class_user.php');
include('./../includes/classes/class_user.php');
include('./../common.php');
include('./../includes/admin/class_main.php');
include('./../includes/class_forum.php');
include('./../includes/classes/class_forum.php');
include('./../includes/admin/class_forum.php');
include('./../includes/classes/secure.php');
include('./../lngs/'.Admin_Over::DefaultLang().'/admin.php');
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
SessDelInvalid();
SessRegister();
SessDeleteOld();
if (User::UserInformation($_SESSION['uid'],'rank')!=2)
{
admin_message_forum($lng['yournotadmin'],'../index.php');

+ 7
- 7
admin/censorlist.php View File

@ -11,22 +11,22 @@ define('IN_uF', true);
//include files
include('./../config.php');
include('./../includes/constants.php');
include('./../includes/class_db.php');
include('./../includes/class_error.php');
include('./../includes/db.php');
include('./../includes/errors.php');
include('./../includes/classes/class_pms.php');
//connect to database
DataBase::db_connect();
include('./../includes/sessions.php');
include('./../includes/class_user.php');
include('./../includes/classes/class_user.php');
include('./../common.php');
include('./../includes/admin/class_main.php');
include('./../includes/class_forum.php');
include('./../includes/classes/class_forum.php');
include('./../includes/admin/class_forum.php');
include('./../includes/classes/secure.php');
include('./../lngs/'.Admin_Over::DefaultLang().'/admin.php');
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
SessDelInvalid();
SessRegister();
SessDeleteOld();
if (User::UserInformation($_SESSION['uid'],'rank')!=2)
{
admin_message_forum($lng['yournotadmin'],'../index.php');

+ 7
- 7
admin/check_script.php View File

@ -11,20 +11,20 @@ define('IN_uF', true);
//include files
include('./../config.php');
include('./../includes/constants.php');
include('./../includes/class_db.php');
include('./../includes/class_error.php');
include('./../includes/db.php');
include('./../includes/errors.php');
//connect to database
DataBase::db_connect();
include('./../includes/sessions.php');
include('./../includes/class_user.php');
include('./../includes/classes/class_user.php');
include('./../common.php');
include('./../includes/admin/class_main.php');
include('./../includes/class_forum.php');
include('./../includes/classes/class_forum.php');
include('./../lngs/'.Admin_Over::DefaultLang().'/admin.php');
include('./../admin/check_script_data.php');
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
SessDelInvalid();
SessRegister();
SessDeleteOld();
if (User::UserInformation($_SESSION['uid'],'rank')!=2)
{

+ 9
- 9
admin/check_script_data.php View File

@ -30,17 +30,17 @@ $size_md5['../user.php'] = 'bf56a1b37b94243486b2034f8479c475';
$size_md5['../users.php'] = '7990ec44fcf3d7a0e5a2add28362213c';
$size_md5['../warns.php'] = '9570efef719d705326f0ff817ef084e6';
$size_md5['../includes/class_db.php'] = 'a376033f78e144f494bfc743c0be3330';
$size_md5['../includes/class_email.php'] = 'e37b08dd3015330dcbb5d6663667b8b8';
$size_md5['../includes/class_error.php'] = '8232e119d8f59aa83050a741631803a6';
$size_md5['../includes/class_forum.php'] = '87f7ee4fdb57bdfd52179947211b7ebb';
$size_md5['../includes/class_mod.php'] = '4764f37856fc727f70b666b8d0c4ab7a';
$size_md5['../includes/db.php'] = 'a376033f78e144f494bfc743c0be3330';
$size_md5['../includes/emailer.php'] = 'e37b08dd3015330dcbb5d6663667b8b8';
$size_md5['../includes/errors.php'] = '8232e119d8f59aa83050a741631803a6';
$size_md5['../includes/classes/class_forum.php'] = '87f7ee4fdb57bdfd52179947211b7ebb';
$size_md5['../includes/classes/class_mod.php'] = '4764f37856fc727f70b666b8d0c4ab7a';
$size_md5['../includes/classes/class_pms.php'] = '850af92f8d9903e7a4e0559a98ecc857';
$size_md5['../includes/class_overall.php'] = '92c3d054835eff3d5a7f7ed731d2a3db';
$size_md5['../includes/class_posting.php'] = '9c72e0c8882794b79d65f14776a0a974';
$size_md5['../includes/misc_functions.php'] = '92c3d054835eff3d5a7f7ed731d2a3db';
$size_md5['../includes/classes/class_posting.php'] = '9c72e0c8882794b79d65f14776a0a974';
$size_md5['../includes/class_shoutbox.php'] = 'cd14821dab219ea06e2fd1a2df2e3582';
$size_md5['../includes/class_topic.php'] = '48f7d3043bc03e6c48a6f0ebc0f258a8';
$size_md5['../includes/class_user.php'] = '2d5951d1e3b31dfb7fd2dcc172df17fd';
$size_md5['../includes/classes/class_topic.php'] = '48f7d3043bc03e6c48a6f0ebc0f258a8';
$size_md5['../includes/classes/class_user.php'] = '2d5951d1e3b31dfb7fd2dcc172df17fd';
$size_md5['../includes/constants.php'] = 'fc79250f8c5b804390e8da280b4cf06e';
$size_md5['../includes/msgs_delete.php'] = '571e0f7e2d992e738adff8b1bd43a521';
$size_md5['../includes/msgs_folder.php'] = 'd756d3d2b9dac72449a6a6926534558a';

+ 7
- 7
admin/forum_info.php View File

@ -11,19 +11,19 @@ define('IN_uF', true);
//include files
include('./../config.php');
include('./../includes/constants.php');
include('./../includes/class_db.php');
include('./../includes/class_error.php');
include('./../includes/db.php');
include('./../includes/errors.php');
//connect to database
DataBase::db_connect();
include('./../includes/sessions.php');
include('./../includes/class_user.php');
include('./../includes/classes/class_user.php');
include('./../common.php');
include('./../includes/admin/class_main.php');
include('./../includes/class_forum.php');
include('./../includes/classes/class_forum.php');
include('./../lngs/'.Admin_Over::DefaultLang().'/admin.php');
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
SessDelInvalid();
SessRegister();
SessDeleteOld();
if (User::UserInformation($_SESSION['uid'],'rank')!=2)
{
admin_message_forum($lng['yournotadmin'],'../index.php');

+ 6
- 6
admin/header.php View File

@ -10,18 +10,18 @@
define('IN_uF', true);
include('./../config.php');
include('./../includes/constants.php');
include('./../includes/class_db.php');
include('./../includes/class_error.php');
include('./../includes/db.php');
include('./../includes/errors.php');
//connect to database
DataBase::db_connect();
include('./../includes/sessions.php');
include('./../includes/class_user.php');
include('./../includes/classes/class_user.php');
include('./../common.php');
include('./../includes/admin/class_main.php');
include('./../lngs/'.Admin_Over::DefaultLang().'/admin.php');
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
SessDelInvalid();
SessRegister();
SessDeleteOld();
if (User::UserInformation($_SESSION['uid'],'rank')!=2)
{
admin_message_forum($lng['yournotadmin'],'../index.php');

+ 7
- 7
admin/index.php View File

@ -11,20 +11,20 @@ define('IN_uF', true);
//include files
include('./../config.php');
include('./../includes/constants.php');
include('./../includes/class_db.php');
include('./../includes/class_error.php');
include('./../includes/db.php');
include('./../includes/errors.php');
//connect to database
DataBase::db_connect();
include('./../includes/sessions.php');
include('./../includes/class_user.php');
include('./../includes/classes/class_user.php');
include('./../common.php');
include('./../includes/admin/class_main.php');
include('./../includes/class_forum.php');
include('./../includes/classes/class_forum.php');
include('./../lngs/'.Admin_Over::DefaultLang().'/admin.php');
$default_skin = Admin_Over::ViewSkinName();
sess_del_invalid();
sess_register($_SESSION['uid']);
sess_delete_old();
SessDelInvalid();
SessRegister();
SessDeleteOld();
if (User::UserInformation($_SESSION['uid'],'rank')!=2)
{
admin_message_forum($lng['yournotadmin'],'../index.php');

+ 9
- 9
admin/mass_email.php View File

@ -11,21 +11,21 @@ define('IN_uF', true);
//include files
include('./../config.php');
include('./../includes/constants.php');
include('./../includes/class_db.php');
include('./../includes/class_error.php');
include('./../includes/db.php');
include('./../includes/errors.php');
//connect to database
DataBase::db_connect();
include('./../includes/sessions.php');
include('./../includes/class_user.php');
include('./../includes/classes/class_user.php');
include('./../common.php');
include('./../includes/admin/class_main.php');
include('./../includes/class_email.php');
include('./../includes/class_forum.php');
include('./../includes/emailer.php');
include('./../includes/classes/class_forum.php');
include('./../includes/admin/class_forum.php');
include('./../lngs/'.Admin_Over::DefaultLang().'/admin.php');
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
SessDelInvalid();
SessRegister();
SessDeleteOld();
if (User::UserInformation($_SESSION['uid'],'rank')!=2)
{
admin_message_forum($lng['yournotadmin'],'../index.php');
@ -39,7 +39,7 @@ if (isset($_POST['msg_content']))
{
if (strlen($_POST['msg_content'])>=5)
{
Email::SendMassEmail(str_replace('%email%',$forum_config['forumname'],$lng['mass']),Post::TagsReplace($_POST['msg_content']));
SendMassEmail(str_replace('%email%',$forum_config['forumname'],$lng['mass']),Post::TagsReplace($_POST['msg_content']));
$msg='./template/blank.tpl';
admin_message_forum($lng['mass_email_sended'],'forum_info.php');
}

+ 7
- 7
admin/smilelist.php View File

@ -11,22 +11,22 @@ define('IN_uF', true);
//include files
include('./../config.php');
include('./../includes/constants.php');
include('./../includes/class_db.php');
include('./../includes/class_error.php');
include('./../includes/db.php');
include('./../includes/errors.php');
include('./../includes/classes/class_pms.php');
//connect to database
DataBase::db_connect();
include('./../includes/sessions.php');
include('./../includes/class_user.php');
include('./../includes/classes/class_user.php');
include('./../common.php');
include('./../includes/admin/class_main.php');
include('./../includes/class_forum.php');
include('./../includes/classes/class_forum.php');
include('./../includes/admin/class_forum.php');
include('./../includes/classes/secure.php');
include('./../lngs/'.Admin_Over::DefaultLang().'/admin.php');
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
SessDelInvalid();
SessRegister();
SessDeleteOld();
if (User::UserInformation($_SESSION['uid'],'rank')!=2)
{
admin_message_forum($lng['yournotadmin'],'../index.php');

+ 7
- 7
admin/styles.php View File

@ -11,22 +11,22 @@ define('IN_uF', true);
//include files
include('./../config.php');
include('./../includes/constants.php');
include('./../includes/class_db.php');
include('./../includes/class_error.php');
include('./../includes/db.php');
include('./../includes/errors.php');
include('./../includes/classes/class_pms.php');
//connect to database
DataBase::db_connect();
include('./../includes/sessions.php');
include('./../includes/class_user.php');
include('./../includes/classes/class_user.php');
include('./../common.php');
include('./../includes/admin/class_main.php');
include('./../includes/class_forum.php');
include('./../includes/classes/class_forum.php');
include('./../includes/admin/class_forum.php');
include('./../includes/classes/secure.php');
include('./../lngs/'.Admin_Over::DefaultLang().'/admin.php');
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
SessDelInvalid();
SessRegister();
SessDeleteOld();
if (User::UserInformation($_SESSION['uid'],'rank')!=2)
{

+ 3
- 3
common.php View File

@ -55,9 +55,9 @@ if ($_SESSION['uid']>0)
$db_uid = $result['u_id'];
if (($db_ip==$ip) || ($db_uid==$uid))
{
include('./includes/class_overall.php');
include('./lngs/'.Over::DefaultLang().'/main.php');
sess_delete($_SESSION['uid']);
include('./includes/misc_functions.php');
include('./lngs/'.DefaultLang().'/main.php');
SessDelete($_SESSION['uid']);
$_SESSION['uid']='0';
message_forum($motive,'index.php', '10');
}

+ 2
- 2
config.php View File

@ -13,6 +13,6 @@ define('DB_USER','root');
define('DB_PASS','');
define('DB_NAME','uf');
define('DB_PREFIX','uf_');
define('VERSION','9.4.29');
define('DSF_INSTALLED',true);
define('VERSION','9.5.1');
define('UF_INSTALLED',true);
?>

+ 22
- 22
eprofile.php View File

@ -11,28 +11,28 @@ define('IN_uF', true);
//include files
include('./config.php');
include('./includes/constants.php');
include('./includes/class_db.php');
include('./includes/class_error.php');
include('./includes/db.php');
include('./includes/errors.php');
//connect to database
DataBase::db_connect();
include('./includes/sessions.php');
include('./includes/class_user.php');
include('./includes/classes/class_user.php');
include('./common.php');
include('./includes/class_overall.php');
include('./includes/class_posting.php');
include('./includes/class_forum.php');
include('./includes/class_topic.php');
include('./includes/misc_functions.php');
include('./includes/classes/class_posting.php');
include('./includes/classes/class_forum.php');
include('./includes/classes/class_topic.php');
include('./includes/classes/secure.php');
$default_skin = Over::ViewSkinName();
$default_lang = Over::DefaultLang();
$default_skin = ViewSkinName();
$default_lang = DefaultLang();
include('./lngs/'.$default_lang.'/main.php');
$start = Over::TimeGeneration();
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
$start = TimeGeneration();
SessDelInvalid();
SessRegister();
SessDeleteOld();
if ($_SESSION['uid']==0)
{
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
message_forum($lng['youarenotlogd'],'login.php?mode=login');
}
foreach ($_POST as $name => $value)
@ -231,18 +231,18 @@ $skin = array(
'lovpr'=>$lng['general_settings'],
'L.select_value'=>$lng['select_value'],
'L.limit_users'=>$lng['limit_users'],
'OPTIONS.limit_users'=>Over::AddPages2($userdata['limit_users']),
'OPTIONS.limit_users'=>AddPages2($userdata['limit_users']),
'L.posts_in_topic'=>$lng['limit_posts'],
'OPTIONS.limit_tpid'=>Over::AddPages2($userdata['limit_tpid']),
'OPTIONS.limit_tpid'=>AddPages2($userdata['limit_tpid']),
'L.topics_in_forum'=>$lng['limit_topics'],
'OPTIONS.limit_ftid'=>Over::AddPages2($userdata['limit_ftid']),
'OPTIONS.limit_ftid'=>AddPages2($userdata['limit_ftid']),
'lupr'=>$lng['profile_settings'],
'lspr'=>$lng['signature_settings'],
'ldefault_lang'=>$lng['default_lang'],
'default_lang'=>Over::AddLangs(),
'default_lang'=>AddLangs(),
'l2default_lang'=>$lng['select_lang'],
'ldefault_skin'=>$lng['default_skin'],
'default_skin'=>Over::AddSkins(),
'default_skin'=>AddSkins(),
'l2default_skin'=>$lng['select_skin'],
'lapr'=>$lng['avatar_settings'],
'lsubmit'=>$lng['save'],
@ -270,7 +270,7 @@ $skin = array(
'lavfile'=>$lng['avatar_file'],
'yes'=>$lng['yes']
);
$skin = array_push_associative($skin,Over::generate_header($lng['leprofile'],'</a>&gt; <a href="eprofile.php" class="navigator">'.$lng['leprofile']));
$skin = array_push_associative($skin,GenerateHeader($lng['leprofile'],'</a>&gt; <a href="eprofile.php" class="navigator">'.$lng['leprofile']));
if ($msg=='')
{
$msg = './skins/'.$default_skin.'/blank.tpl';
@ -286,7 +286,7 @@ else
{
$skin['pa_link']='';
}
$stop = Over::TimeGeneration();
$skin['queries'] = Over::ShowQueries($start, $stop);
$stop = TimeGeneration();
$skin['queries'] = ShowQueries($start, $stop);
include('./skins/'.$default_skin.'/overall_footer.tpl');
?>

+ 15
- 15
forum.php View File

@ -11,25 +11,25 @@ define('IN_uF', true);
//include files
include('./config.php');
include('./includes/constants.php');
include('./includes/class_db.php');
include('./includes/class_error.php');
include('./includes/db.php');
include('./includes/errors.php');
//connect to database
DataBase::db_connect();
include('./includes/sessions.php');
include('./includes/class_user.php');
include('./includes/classes/class_user.php');
include('./common.php');
include('./includes/class_overall.php');
include('./includes/class_forum.php');
include('./includes/class_topic.php');
include('./includes/misc_functions.php');
include('./includes/classes/class_forum.php');
include('./includes/classes/class_topic.php');
include('./includes/classes/secure.php');
$default_lang = Over::DefaultLang();
$default_lang = DefaultLang();
include('./lngs/'.$default_lang.'/main.php');
$start = Over::TimeGeneration();
$start = TimeGeneration();
$fid = intval($_GET['f']);
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
SessDelInvalid();
SessRegister();
SessDeleteOld();
include('./includes/cache/cache_forums.php');
@ -48,7 +48,7 @@ $skin = array(
'f_id' => $fid,
'lang'=> $default_lang
);
$skin = array_push_associative($skin,Over::generate_header($lng['showforum'].': '.$forum['name'], '</a>&gt; <a href="forum.php?f='.$_GET['f'].'" class="navigator">'.$forum['name']));
$skin = array_push_associative($skin,GenerateHeader($lng['showforum'].': '.$forum['name'], '</a>&gt; <a href="forum.php?f='.$_GET['f'].'" class="navigator">'.$forum['name']));
//do it!
include('./skins/'.$default_skin.'/overall_header.tpl');
include('./skins/'.$default_skin.'/forum_body.tpl');
@ -76,7 +76,7 @@ else
$skin['noposts']='<tr><td width="'.TABLES_WIDTH.'" colspan="8" height="19" class="fitem"><p class="fstandard" align="center">'.$lng['nopost'].'!</p></td></tr>';
}
$skin = array_push_associative($skin, array(
'option_pages' => Over::AddPages(),
'option_pages' => AddPages(),
'lwith' => $lng['with'],
'lpage' => $lng['page'],
'lpages' => $count,
@ -104,7 +104,7 @@ else
{
$skin['pa_link']='';
}
$stop = Over::TimeGeneration();
$skin['queries'] = Over::ShowQueries($start, $stop);
$stop = TimeGeneration();
$skin['queries'] = ShowQueries($start, $stop);
include('./skins/'.$default_skin.'/overall_footer.tpl');
?>

+ 20
- 20
groups.php View File

@ -11,21 +11,21 @@ define('IN_uF', true);
//include files
include('./config.php');
include('./includes/constants.php');
include('./includes/class_db.php');
include('./includes/class_error.php');
include('./includes/db.php');
include('./includes/errors.php');
//connect to database
DataBase::db_connect();
include('./includes/sessions.php');
include('./includes/class_user.php');
include('./includes/classes/class_user.php');
include('./common.php');
include('./includes/class_overall.php');
include('./includes/class_topic.php');
include('./includes/misc_functions.php');
include('./includes/classes/class_topic.php');
include('./includes/classes/secure.php');
include('./lngs/'.Over::DefaultLang().'/main.php');
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
$start = Over::TimeGeneration();
include('./lngs/'.DefaultLang().'/main.php');
SessDelInvalid();
SessRegister();
SessDeleteOld();
$start = TimeGeneration();
foreach ($_POST as $name => $value)
{
if ($forum_config['use_censorlist'])
@ -39,8 +39,8 @@ if(isset($_GET['mode']))
{
case 'view':
{
$start = Over::TimeGeneration();
$default_skin = Over::ViewSkinName();
$start = TimeGeneration();
$default_skin = ViewSkinName();
$gid = intval($_GET['id']);
if ((isset($_POST['nick']))and ($_POST['nick']!=''))
{
@ -75,10 +75,10 @@ if(isset($_GET['mode']))
message_forum($lng['no_group'], 'index.php');
}
unset($tmp);
$skin = Over::generate_header($lng['showgroup'].': '.$group['name'], '</a>&gt; <a href="groups.php?mode=view&amp;id='.$group['g_id'].'" class="navigator">'.$lng['showgroup'].': '.$group['name']);
$skin = GenerateHeader($lng['showgroup'].': '.$group['name'], '</a>&gt; <a href="groups.php?mode=view&amp;id='.$group['g_id'].'" class="navigator">'.$lng['showgroup'].': '.$group['name']);
include('./skins/'.$default_skin.'/overall_header.tpl');
$skin = array(
'moderate'=>Over::IfModGroup($group['m_id']),
'moderate'=>IfModGroup($group['m_id']),
'name'=>$group['name'],
'desc'=>$group['desc'],
'lregdate'=>$lng['luregister'],
@ -125,8 +125,8 @@ if(isset($_GET['mode']))
$skin['pa_link']='';
}
echo '</table>';
$stop = Over::TimeGeneration();
$skin['queries'] = Over::ShowQueries($start, $stop);
$stop = TimeGeneration();
$skin['queries'] = ShowQueries($start, $stop);
include('./skins/'.$default_skin.'/overall_footer.tpl');
break;
}
@ -138,8 +138,8 @@ if(isset($_GET['mode']))
}
else
{
$default_skin = Over::ViewSkinName();
$skin = Over::generate_header($lng['lgroups'], '</a>&gt; <a href="groups.php" class="navigator">'.$lng['lgroups']);
$default_skin = ViewSkinName();
$skin = GenerateHeader($lng['lgroups'], '</a>&gt; <a href="groups.php" class="navigator">'.$lng['lgroups']);
include('./skins/'.$default_skin.'/overall_header.tpl');
$sql = "SELECT `g_id`, `name`, `desc` FROM `".GROUPS_TABLE."` ORDER BY `sort`";
$query = DataBase::sql_query($sql, 'GENERAL', 'Could not obtain groups information.');
@ -175,8 +175,8 @@ else
{
$skin['pa_link']='';
}
$stop = Over::TimeGeneration();
$skin['queries'] = Over::ShowQueries($start, $stop);
$stop = TimeGeneration();
$skin['queries'] = ShowQueries($start, $stop);
include('./skins/'.$default_skin.'/overall_footer.tpl');
}
?>

BIN
images/smiles/Thumbs.db View File


BIN
images/user_agent/Thumbs.db View File


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

@ -75,14 +75,14 @@ class Admin_Over
global $forum_config;
global $default_lang;
$result='';
$rep=opendir('./../lngs');
$bAuMoinsUnRepertoire = false;
while ($file = readdir($rep))
$cat=opendir('./../lngs');
$notempty = false;
while ($file = readdir($cat))
{
if($file != '..' && $file !='.' && $file !='')
{
if (is_dir('./../lngs/'.$file)){
$bAuMoinsUnRepertoire = true;
$notempty = true;
if ($file==$default_lang)
{
$result .='<option value="'.$file.'" selected="selected">'.$file.'</option>';
@ -95,7 +95,7 @@ class Admin_Over
}
}
return $result;
unset($rep, $bAuMoinsUnRepertoire, $file, $result);
unset($cat, $notempty, $file, $result);
}
function ViewSkinName()
{

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

@ -12,7 +12,7 @@ if(!defined('IN_uF'))
die('Hacking attempt');
}
//cache forums and posts - version v1.0 Alpha 2---------------------------------
$default_skin = Over::ViewSkinName();
$default_skin = ViewSkinName();
$sql = "SELECT `name`,`lock` FROM ".FORUMS_TABLE." WHERE `f_id`='$fid' LIMIT 1";
$result = @mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not obtain forum information'));
if ($result['name']=='')

+ 0
- 80
includes/class_email.php View File

@ -1,80 +0,0 @@
<?php
/**
* @package uForum
* @file includes/class_email.php
* @version $Id$
* @copyright 2009(c) PioDer <pioder@wp.pl>
* @link http://pioder.gim2przemysl.int.pl/
* @license GNU GPL v3
**/
if ( !defined('IN_uF') )
{
die('Hacking attempt');
}
class Email
{
function SendEmail($email, $title, $content)
{
global $forum_config;
$email_headers = "MIME-Version: 1.0\r\n";
$email_headers .= "Content-type: text/html; charset=iso-8859-2\r\n";
$email_headers .= "From: ".$forum_config['forumname']." \n";
$email_date = date('d-m-Y, G:i',time());
$email_content = '
<html>
<head>
<title>'.$title.'</title>
</head>
<body>
'.$content.'<br>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
<font face="Verdana" style="font-size:10pt">
Message generated automatic by DSF v'.VERSION.'. <b>('.$email_date.')</b></font>
</body>
</html>';
if ( !mail($email, $title, $email_content, $email_headers ))
{
message_die('GENERAL','Could not send email from: '.$email.'. sorry :(','');
}
}
function SendRegisterEmail()
{
global $forum_config;
global $original_pass;
global $lng;
$email_content = $lng['email_newpasswd_msg'];
$email_content = str_replace('%forum%',$forum_config['forumname'],$email_content);
$email_content = str_replace('%url_f%',$forum_config['forumpatch'],$email_content);
$email_content = str_replace('%ip%',$_SERVER['REMOTE_ADDR'],$email_content);
$email_content = str_replace('%forum%',$forum_config['forumname'],$email_content);
$email_content = str_replace('%login%',$_POST['nick'],$email_content);
$email_content = str_replace('%pass%',$original_pass,$email_content);
Email::SendEmail($_POST['email'],$lng['email_welcome'].$forum_config['forumname'],$email_content);
}
function SendForgotPassEmail($newpass)
{
global $forum_config;
global $original_pass;
global $lng;
global $uid;
$email_content = $lng['email_register_msg'];
$email_content = str_replace('%forum%',$forum_config['forumname'],$email_content);
$email_content = str_replace('%url_f%',$forum_config['forumpatch'],$email_content);
$email_content = str_replace('%ip%',$_SERVER['REMOTE_ADDR'],$email_content);
$email_content = str_replace('%forum%',$forum_config['forumname'],$email_content);
$email_content = str_replace('%login%',$_POST['username'],$email_content);
$email_content = str_replace('%pass%',$newpass,$email_content);
Email::SendEmail(User::UserInformation($uid,'email'),$lng['email_sent_forget_pass'].$forum_config['forumname'],$email_content);
}
function SendMassEmail($title,$content)
{
$sql = "SELECT `email`,`u_id` FROM ".USERS_TABLE." WHERE `u_id`>0";
$query = DataBase::sql_query($sql,'CRITICAL','Could not read users table');
while($item = @mysql_fetch_array($query))
{
Email::SendEmail($item['email'], $title, $content);
}
}
}
?>

+ 0
- 328
includes/class_overall.php View File

@ -1,328 +0,0 @@
<?php
/**
* @package uForum
* @file includes/class_overall.php
* @version $Id$
* @copyright 2009(c) PioDer <pioder@wp.pl>
* @link http://pioder.gim2przemysl.int.pl/
* @license GNU GPL v3
**/
if ( !defined('IN_uF') )
{
die('Hacking attempt');
}
class Over
{
function set_counter()
{
global $forum_config;
if (!isset($_COOKIE['forum_visited']))
{
setcookie('forum_visited','1');
$visit_count = $forum_config['forum_counter'] +1;
DataBase::sql_query("UPDATE `".CONFIG_TABLE."` SET `value`='$visit_count' WHERE `name`='forum_counter'",'GENERAL','Could not update forum counter');
}
else
{
$visit_count = $forum_config['forum_counter'];
}
return $visit_count;
}
function generate_header($title, $navigator)
{
global $lng;
global $forum_config;
$skin = array(
'forumname' => $forum_config['forumname'],
'forumdesc' => $forum_config['forumdesc'],
'users' => $lng['lusers'],
'pm' => $lng['lpm'],
'register' => $lng['lregister'],
'search' => $lng['lsearch'],
'eprofile' => $lng['leprofile'],
'groups' => $lng['lgroups'],
'keywords' => $forum_config['meta_keywords'],
'description' => $forum_config['meta_description'],
'mainpage' => $title,
'lmainpage' => $navigator,
'lactual_time'=>$lng['lactualtime'],
'modelogin' => ($_SESSION['uid']>0) ? 'logout' : 'login',
'llogin' => ($_SESSION['uid']>0) ? $lng['lunlogin'] : $lng['llogin']
);
return $skin;
}
function user_agent($agent)
{
global $lng;
/*This original function is in phpBB 1.12.5 modified by Przemo*/
/*Modified by PioDer: added new browsers and systems and other replaces*/
$agent_tst = ' ' . strtolower($agent);
$system = $browser = '';
if (
strpos($agent_tst, 'windows') ||
strpos($agent_tst, 'win9') ||
strpos($agent_tst, 'win32') ||
strpos($agent_tst, 'nt 5.') ||
strpos($agent_tst, 'nt 4') )
{
$system = ( strpos($agent_tst, 'windows 9') || strpos($agent_tst, 'nt 4') || strpos($agent_tst, 'windows') || strpos($agent_tst, 'win32') ) ? 'windows_98_nt_2000' : $system;
$system = ( strpos($agent_tst, 'nt 5.') || strpos($agent_tst, 'nt 6.') || strpos($agent_tst, 'nt 7.') || strpos($agent_tst, 'nt 8.') ) ? 'windows_xp_2003' : $system;
$system = (strpos($agent_tst, 'nt 5.0')) ? 'windows_98_nt_2000' : $system;
$system = (strpos($agent_tst, 'nt 6.0')) ? 'windows_vista' : $system;
}
else
{
$system = (strpos($agent_tst, 'linux')) ? 'linux' : $system;
$system = (strpos($agent_tst, 'suse')) ? 'linux_suse' : $system;
$system = (strpos($agent_tst, 'knoppix')) ? 'linux_knoppix' : $system;
$system = (strpos($agent_tst, 'turbolinux')) ? 'linux_turbolinux' : $system;
$system = (strpos($agent_tst, 'slackware')) ? 'linux_slackware' : $system;
$system = (strpos($agent_tst, 'gentoo')) ? 'linux_gentoo' : $system;
$system = (strpos($agent_tst, 'lycoris')) ? 'linux_lycoris' : $system;
$system = (strpos($agent_tst, 'debian')) ? 'linux_debian' : $system;
$system = (strpos($agent_tst, 'redhat')) ? 'linux_redhat' : $system;
$system = (strpos($agent_tst, 'archlinux')) ? 'linux_arch' : $system;
$system = (strpos($agent_tst, 'ubuntu')) ? 'linux_ubuntu' : $system;
$system = (strpos($agent_tst, 'cdlinux')) ? 'linux_cdlinux' : $system;
$system = (strpos($agent_tst, 'mandriva')) ? 'linux_mandriva' : $system;
$system = (strpos($agent_tst, 'kateos')) ? 'linux_kateos' : $system;
$system = (strpos($agent_tst, 'bsd')) ? 'linux_freebsd' : $system;
}
if ( $system == '')
{
$system = (strpos($agent_tst, 'mac')) ? 'macos' : $system;
$system = (strpos($agent_tst, 'aix')) ? 'aix' : $system;
$system = (strpos($agent_tst, 'lindows')) ? 'lindows' : $system;
$system = (strpos($agent_tst, 'amiga')) ? 'amiga' : $system;
$system = (strpos($agent_tst, 'athe')) ? 'athe' : $system;
$system = (strpos($agent_tst, 'beos')) ? 'beos' : $system;
$system = (strpos($agent_tst, 'zeta')) ? 'beos' : $system;
$system = (strpos($agent_tst, 'BlueEyed')) ? 'beos' : $system;
$system = (strpos($agent_tst, 'nextstep')) ? 'nextstep' : $system;
$system = (strpos($agent_tst, 'warp')) ? 'warp' : $system;
$system = (strpos($agent_tst, 'qnx')) ? 'qnx' : $system;
$system = (strpos($agent_tst, 'risc')) ? 'risc' : $system;
$system = (strpos($agent_tst, 'solaris')) ? 'solaris' : $system;
$system = (strpos($agent_tst, 'unix')) ? 'unix' : $system;
$system = (strpos($agent_tst, 'macos')) ? 'macos' : $system;
$system = (strpos($agent_tst, 'mac os')) ? 'macos' : $system;
$system = (strpos($agent_tst, 'symbian')) ? 'symbian' : $system;
$system = ($system == '' && strpos($agent_tst, 'win9') || strpos($agent_tst, 'win3') || strpos($agent_tst, 'windows') ) ? 'windows_98_nt_2000' : $system;
}
$browser = (strpos($agent_tst, 'mozilla')) ? 'mozilla' : $browser;
$browser = (strpos($agent_tst, 'msie')) ? 'ie' : $browser;
$browser = (strpos($agent_tst, 'msie 7')) ? 'ie7' : $browser;
$browser = (strpos($agent_tst, 'netscape')) ? 'netscape' : $browser;
$browser = (strpos($agent_tst, 'opera')) ? 'opera' : $browser;
$browser = (strpos($agent_tst, 'konqueror')) ? 'konqueror' : $browser;
$browser = (strpos($agent_tst, 'galeon')) ? 'galeon' : $browser;
$browser = (strpos($agent_tst, 'firefox')) ? 'firefox' : $browser;
$browser = (strpos($agent_tst, 'netsprint')) ? 'netsprint' : $browser;
$browser = (strpos($agent_tst, 'firebird')) ? 'firebird' : $browser;
$browser = (strpos($agent_tst, 'links')) ? 'links' : $browser;
$browser = (strpos($agent_tst, 'dillo')) ? 'dillo' : $browser;
$browser = (strpos($agent_tst, 'omniweb')) ? 'omniweb' : $browser;
$browser = (strpos($agent_tst, 'avant')) ? 'avant' : $browser;
$browser = (strpos($agent_tst, 'myie2')) ? 'myie2' : $browser;
$browser = (strpos($agent_tst, 'seamonkey')) ? 'seamonkey' : $browser;
$browser = (strpos($agent_tst, 'maxthon')) ? 'maxthon' : $browser;
$browser = ($browser == '') ? 'unknown' : $browser;
$system = ($system == '') ? 'unknown' : $system;
return array('icon_' . $system . '.gif', 'icon_' . $browser . '.gif', ($system=='unknown') ? $lng['unknown'] : $system, ($browser=='unknown') ? $lng['unknown'] : $browser);
}
function GenerateTime($request_time)
{
global $lng;
if (date('d-m-Y',$request_time)== date('d-m-Y',time()))
{
$date = $lng['today'].', '.date('G:i', $request_time);
}
else
{
if ((date('d',$request_time))== (date('d',time())-1) && (date('m-Y',$request_time)== date('m-Y',time())))
{
$date = $lng['yesterday'].', '.date('G:i', $request_time);
}
else
{
$date = date('d-m-Y, G:i',$request_time);
}
}
return $date;
}
function AddPages()
{
global $count;
global $page;
$content = '';
for ($i=1;$i<=$count;$i++)
{
if ($i==$page)
{
$content .= '<option value="'.$i.'" selected="selected">'.$i.'</option>';
}
else
{
$content .= '<option value="'.$i.'">'.$i.'</option>';
}
}
return $content;
unset($content);
}
function AddPages2($page)//for edit profile, not used in limit!
{
$content = '';
for ($i=1;$i<=50;$i++)
{
if ($i==$page)
{
$content .= '<option value="'.$i.'" selected="selected">'.$i.'</option>';
}
else
{
$content .= '<option value="'.$i.'">'.$i.'</option>';
}
}
return $content;
unset($content);
}
function AddSkins()
{
global $forum_config;
global $default_skin;
$all='';
$query = DataBase::sql_query("SELECT `name`, `s_id` FROM `".SKINS_TABLE."`",'GENERAL','Could not obtain skins information');
while($t = @mysql_fetch_array($query))
{
if ($t['name']==$default_skin)
{
$all .= '<option value="'.$t['s_id'].'" selected="selected">'.$t['name'].'</option>';
}
else
{
$all .= '<option value="'.$t['s_id'].'">'.$t['name'].'</option>';
}
}
return $all;
unset($t, $all);
}
function AddLangs()
{
global $forum_config;
global $default_lang;
$result='';
$rep=opendir('./lngs');
$browseruMoinsUnRepertoire = false;
while ($file = readdir($rep))
{
if($file != '..' && $file !='.' && $file !='')
{
if (is_dir('./lngs/'.$file)){
$browseruMoinsUnRepertoire = true;
if ($file==$default_lang)
{
$result .='<option value="'.$file.'" selected="selected">'.$file.'</option>';
}
else
{
$result .='<option value="'.$file.'">'.$file.'</option>';
}
}
}
}
return $result;
unset($rep, $browseruMoinsUnRepertoire, $file, $result);
}
function TimeGeneration()
{
list($usec, $sec ) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
function IfModGroup($guid)
{
global $lng;
$uid = $_SESSION['uid'];
if ($guid==$uid)
{
return'
<tr>
<td class="fitem">
<span class="fstandard">'.$lng['addusrtogrp'].':</span><input type="text" name="nick" style="widtfh:100px; height:15px" value="'.$_POST['nick'].'">
</td>
<td class="fitem">
<span class="fstandard">'.$lng['delusrforgrp'].':</span><input type="text" name="delnick" style="widtfh:100px; height:15px" value="'.$_POST['nick'].'">
</td>
<td class="fitem">
<input type="submit" class="fbutton" value="'.$lng['lgo'].'">
</tr>
';
}
}
function TotalPosts()
{
$sql = "SELECT count(*) as `p_id` FROM ".POSTS_TABLE."";
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain total posts information');
$result = mysql_fetch_array($query);
$result = $result['p_id'];
return($result);
}
function DefaultLang()
{
global $forum_config;
global $userdata;
if ($_SESSION['uid']>0)
{
//$sql = "SELECT `u_id`, `lang` FROM ".USERS_TABLE." WHERE `u_id`='".$_SESSION['uid']."' LIMIT 1";
//$result = @mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not obtain user information'));
return $userdata['lang'];
}
else
{
return $forum_config['defaultlang'];
}
}
function ShowQueries($start, $stop)
{
global $forum_config;
global $lng;
if ($forum_config['show_time_generation'])
{
$result = $stop - $start;
$result = round($result,3);
if (extension_loaded('xdebug'))
{
return $lng['script_generated'].$result.' '.$lng['seconds'].'. SQL: '.$_COOKIE['queries'].'.<br>
Wersja Xdebug: '.phpversion('xdebug').', Użycie pamięci: '.round((xdebug_memory_usage()/1024),2).'KB.';
}
else
{
return $lng['script_generated'].$result.' '.$lng['seconds'].'. SQL: '.$_COOKIE['queries'].'.';
}
}
else
{
return '';
}
}
function ViewSkinName()
{
global $forum_config;
global $userdata;
if ($_SESSION['uid']>0)
{
$result = $userdata['skin'];
}
else
{
$result = $forum_config['defaultskin'];
}
$sql = "SELECT * FROM `".SKINS_TABLE."` WHERE `s_id`='$result'";
$result = mysql_fetch_array(DataBase::sql_query($sql,'CRITICAL','Could not obtain skin information.'));
return $result['name'];
}
}
?>

+ 0
- 51
includes/class_shoutbox.php View File

@ -1,51 +0,0 @@
<?php
/**
* @package uForum
* @file includes/class_shoutbox.php
* @version $Id$
* @copyright 2009(c) PioDer <pioder@wp.pl>
* @link http://pioder.gim2przemysl.int.pl/
* @license GNU GPL v3
**/
if ( !defined('IN_uF') )
{
die('Hacking attempt');
}
class ShoutBox
{
function new_message($message,$uid)
{
$time = time();
$sql = "INSERT INTO ".SHOUTBOX_TABLE." VALUES ('', '$uid', '$message','$time')";
DataBase::sql_query($sql,'GENERAL','Could not add shoutbox message.');
}
function read_messages($limit)
{
$sb_content = '';
$rank_mod = ($_SESSION['uid']>0) ? User::UserInformation($_SESSION['uid'],'rank') : 0;
global $user;
global $default_skin;
$sql = "SELECT * FROM ".SHOUTBOX_TABLE." ORDER BY `time` LIMIT $limit";
$query = DataBase::sql_query($sql,'CRITICAL', 'Could not read shoutbox table');
while($sb_msg = @mysql_fetch_array($query))
{
$del_edit_msg = ($rank_mod>0) ? '<a href="shoutbox.php?mode=
delete&amp;id='.$sb_msg.'" class="fsmall">x</a> <a href="
shoutbox.php?mode=edit&amp;id='.$sb_msg.'" class="fsmall">e</a>' : '&nbsp;';
$sb_content .= '<tr><td>'.$del_edit_msg.'<span class="fsmall">
<a href="user.php?id='.$b_msg['u_id'].'" class="fsmall">'
.Topic::UserName($user[$sb_msg['u_id']]['nick'],$user[$sb_msg['u_id']]['rank']).
'</a> <span class="fsmall">['.date('d-m, G:i',$sb_msg['time']).']:
'.$sb_msg['msg_content'].'</span></td></tr>';
}
return $sb_content;
}
function del_old_msgs($limiter)
{
$sql = "DELETE FROM ".SHOUTBOX_TABLE." WHERE `time`+$limiter<'".time()."'";
DataBase::sql_query($sql,'GENERAL','Could not delete old messages in shoutbox');
unset($sql);
}
}
?>

+ 140
- 0
includes/classes/class_forum.php View File

@ -0,0 +1,140 @@
<?php
/**
* @package uForum
* @file includes/classes/class_forum.php
* @version $Id: classes/class_forum.php 15 2009-05-01 17:06:40Z pioder $
* @copyright 2009(c) PioDer <pioder@wp.pl>
* @link http://pioder.gim2przemysl.int.pl/
* @license GNU GPL v3
**/
if ( !defined('IN_uF') )
{
die('Hacking attempt');
}
class Forum
{
function AddForums($tid)
{
global $forum_config;
$forum = Topic::TopicInformation($tid,'f_id');
$all='';
$query = DataBase::sql_query("SELECT `name`, `f_id` FROM `".FORUMS_TABLE."` ORDER BY `f_id`",'GENERAL','Could not obtain forum information');
while($t = @mysql_fetch_array($query))
{
if ($t['f_id']==$forum)
{
$all .= '<option value="'.$t['f_id'].'" selected="selected">'.$t['name'].'</option>'."\n";
}
else
{
$all .= '<option value="'.$t['f_id'].'">'.$t['name'].'</option>'."\n";
}
}
return $all;
unset($t, $all);
}
function PostsInForum($forum_name)
{
$sql = "SELECT count(*) as `p_id` FROM ".POSTS_TABLE." WHERE f_id='$forum_name'";
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain posts information.');
$result = mysql_fetch_array($query);
return $result['p_id'];
}
function LastPost($posts, $forum)
{
global $lng;
global $user;
global $last_post;
global $userdata;
global $forum_config;
if ($posts==0) { return '<p align="center" class="fstandard">'.$lng['nopost'].'</p>';}
else
{
$id = $last_post[$forum]['tp_id'];
$topic = $last_post[$forum]['t_id'];
$userid = $last_post[$forum]['u_id'];
$un = $last_post[$forum]['user_nick'];
$rank = $last_post[$forum]['user_rank'];
switch($rank)
{
case '0':
{
$user_color_name = $un;
break;
}
case '1':
{
$user_color_name = '<font color="'.$forum_config['color_mod'].'"><b>'.$un.'</b></font>';
break;
}
case '2':
{
$user_color_name = '<font color="'.$forum_config['color_admin'].'"><b>'.$un.'</b></font>';
break;
}
}
if ($_SESSION['uid']>0)
{
$limiter = $userdata['limit_tpid'];
}
else
{
$limiter = $forum_config['limit_tpid'];
}
$count = ceil($id / $limiter);
if ($count >1)
{
$page= '&amp;page='.$count;
}
else
{
$page='';
}
return '<p align="center"><span class="fverysmall"><b>'.GenerateTime($last_post[$forum]['time']).'</b><br></span> <a href="topic.php?t='.$topic.$page.'#p'.$id.'" class="fverysmall"><b>'.$lng['topic'].' #'.$topic.'</b></a><a class="fsmall">: </a><a href="user.php?id='.$userid.'" class="fverysmall">'.$user_color_name.'</a></p>';
}
}
function LastPostImg($postsinforum)
{
global $last_post;
global $i;
global $forum;
global $default_skin;
$time = time()-129600;
if ($_SESSION['uid']>0)
{
if ($postsinforum>0)
{
if ($last_post[$forum[$i]['f_id']]['time']>$time)
{
return 'folder_new_posts';
}
else
{
return 'folder_no_new_posts';
}
}
else
{
return 'folder_no_new_posts';
}
}
else
{
return 'folder_no_new_posts';
}
}
function ForumInformation($fid, $inf)
{
$sql = "SELECT `f_id`, `$inf` FROM ".FORUMS_TABLE." WHERE f_id='$fid';";
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain forum information.');
$result = mysql_fetch_array($query);
$result = $result[$inf];
return $result;
}
}
?>

+ 103
- 0
includes/classes/class_mod.php View File

@ -0,0 +1,103 @@
<?php
/**
* @package uForum
* @file includes/classes/class_mod.php
* @version $Id: classes/class_mod.php 15 2009-05-01 17:06:40Z pioder $
* @copyright 2009(c) PioDer <pioder@wp.pl>
* @link http://pioder.gim2przemysl.int.pl/
* @license GNU GPL v3
**/
if ( !defined('IN_uF') )
{
die('Hacking attempt');
}
class Mod
{
function MoveTopic($tid, $fid)
{
$sql = "UPDATE `".TOPICS_TABLE."` SET `f_id`='$fid' WHERE `t_id`='$tid'";
DataBase::sql_query($sql,'GENERAL','Could not update topic');
$sql = "UPDATE `".POSTS_TABLE."` SET `f_id`='$fid' WHERE `t_id`='$tid'";
DataBase::sql_query($sql,'GENERAL','Could not update post');
}
function TopicLocked($tid)
{
global $default_skin;
global $default_lang;
$lock = Topic::TopicInformation($tid,'lock');
if ($lock=='1')
{
return '<a href="moderate.php?action=unlock&amp;id='.$tid.'"><img border="0" src="skins/'.$default_skin.'/images/unlock.gif" width="20" height="20" alt="unlock">';
}
else
{
return '<a href="moderate.php?action=lock&amp;id='.$tid.'"><img border="0" src="skins/'.$default_skin.'/images/lock.gif" width="20" height="20" alt="lock"></a>';
}
}
function DeleteTopic($topicid)
{
$sql="SELECT * FROM ".POSTS_TABLE." WHERE `t_id`='$topicid'";
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain post information');
while($item = @mysql_fetch_array($query))
{
$uid = Topic::PostInformation($item['p_id'],'u_id');
$posts = User::UserInformation($uid,'posts');
$posts = $posts -1;
$sql = "UPDATE `".USERS_TABLE."` SET `posts`='$posts' WHERE `u_id`='$uid'";
DataBase::sql_query($sql,'GENERAL','Could not update user amout of posts');
}
$sql = "DELETE FROM ".POSTS_TABLE." WHERE t_id='$topicid';";
DataBase::sql_query($sql,'GENERAL','Could not delete topic posts.');
$sql = "DELETE FROM ".TOPICS_TABLE." WHERE t_id='$topicid';";
DataBase::sql_query($sql,'GENERAL','Could not delete topic posts.');
}
function LockTopic($topicid)
{
$sql = "UPDATE `".TOPICS_TABLE."` SET `lock` = '1' WHERE `t_id` =$topicid;";
DataBase::sql_query($sql,'GENERAL','Could not lock topic.');
}
function StickTopic($topicid, $mode)
{
$sql = "UPDATE `".TOPICS_TABLE."` SET `sticky` = '$mode' WHERE `t_id` =$topicid;";
DataBase::sql_query($sql,'GENERAL','Could not stick topic.');
}
function UnlockTopic($topicid)
{
$sql = "UPDATE `".TOPICS_TABLE."` SET `lock` = '0' WHERE `t_id` =$topicid;";
DataBase::sql_query($sql,'GENERAL','Could not unlock topic.');
}
function DeletePost($postid)
{
$uid = Topic::PostInformation($postid,'u_id');
$tid = Topic::PostInformation($postid,'t_id');
$posts = User::UserInformation($uid,'posts');
$posts = $posts -1;
$sql = "UPDATE `".USERS_TABLE."` SET `posts`='$posts' WHERE `u_id`='$uid'";
DataBase::sql_query($sql,'GENERAL','Could not update user amout of posts');
$sql2 = "DELETE FROM ".POSTS_TABLE." WHERE p_id='$postid';";
DataBase::sql_query($sql2,'GENERAL','Could not delete post.');
$sql = "SELECT * FROM ".POSTS_TABLE." WHERE p_id>'$postid' AND `t_id`='$tid';";
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain post information.');
while($item=mysql_fetch_array($query))
{
$number = $item['tp_id'];
$number = $number-1;
$number2 = $item['p_id'];
$sql3 = "UPDATE `".POSTS_TABLE."` SET `tp_id` = '$number' WHERE `p_id` =$number2;";
DataBase::sql_query($sql3,'GENERAL','Could not update post.');
}
}
function AcceptPost($postid)
{
$sql = "UPDATE `".POSTS_TABLE."` SET `moderated`='0' WHERE `p_id`='$postid'";
DataBase::sql_query($sql, 'GENERAL', 'Could not accept post');
}
}
?>

+ 119
- 0
includes/classes/class_posting.php View File

@ -0,0 +1,119 @@
<?php
/**
* @package uForum
* @file includes/classes/class_posting.php
* @version $Id: classes/class_posting.php 15 2009-05-01 17:06:40Z pioder $
* @copyright 2009(c) PioDer <pioder@wp.pl>
* @link http://pioder.gim2przemysl.int.pl/
* @license GNU GPL v3
**/
if ( !defined('IN_uF') )
{
die('Hacking attempt');
}
class Post
{
function NewPost($tid, $post, $uid)
{
#read last post
$last = DataBase::new_id(POSTS_TABLE);
#read last post in topic
$sql = "SELECT * FROM ".POSTS_TABLE." WHERE t_id='$tid' ORDER BY tp_id DESC LIMIT 1;";
$query = DataBase::sql_query($sql,'GENERAL','Could not last post information.');
$result = mysql_fetch_array($query);
$forum = $result['f_id'];//forum id
$moderate = Forum::ForumInformation($forum,'moderate');
$tpid = $result['tp_id'];//post in topic id
$tpid = $tpid+1;
#
$time = time();
#add new post
$sql = "INSERT INTO `".POSTS_TABLE."` VALUES ('$last','$tid', '$uid', '$post', '".$_SERVER['HTTP_USER_AGENT']."', '$time', '$tpid', '$forum','$moderate','".$_SERVER['REMOTE_ADDR']."')";
$query = DataBase::sql_query($sql,'GENERAL','Could not add new post.');
$result=User::UserInformation($uid,'posts');
$result = $result+1;
$sql="UPDATE ".TOPICS_TABLE." SET lastpost_time='$time' WHERE t_id='$tid' ";
$query = DataBase::sql_query($sql,'GENERAL','Could not update user information.');
$sql="UPDATE ".USERS_TABLE." SET posts='$result' WHERE u_id='$uid' ";
$query = DataBase::sql_query($sql,'GENERAL','Could not update user information.');
return $tpid;
}
function EditPost($postid, $text)
{
$sql = "UPDATE `".POSTS_TABLE."` SET text='$text' WHERE `p_id`='$postid';";
$query = DataBase::sql_query($sql,'GENERAL','Could not edit post.');
}
function NewTopic($posttext, $ntopic, $forum, $uid, $sticky)
{
//Select last topic
$moderate = Forum::ForumInformation($forum,'moderate');
$time = time();
$lastt=DataBase::new_id(TOPICS_TABLE);
$sql = "INSERT INTO ".TOPICS_TABLE." VALUES ('$lastt', '$forum', '0', '$sticky', '$ntopic', '$uid','$time')";
$query = DataBase::sql_query($sql,'GENERAL','Could not add new topic');
//add post
//select last post
$last = DataBase::new_id(POSTS_TABLE);
//add post
$sql = "INSERT INTO ".POSTS_TABLE." VALUES ('$last','$lastt', '$uid', '$posttext','".$_SERVER['HTTP_USER_AGENT']."', '$time', '1', '$forum', '$moderate','".$_SERVER['REMOTE_ADDR']."');";
$query = DataBase::sql_query($sql,'GENERAL','Could not add new post.');
$sql = "SELECT * FROM ".USERS_TABLE." WHERE u_id='$uid';";
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user information.');
$result = mysql_fetch_array($query);
$result = $result['posts'];
$result = $result+1;
$sql = "UPDATE ".USERS_TABLE." SET posts='$result' WHERE u_id='$uid' ";
$query = DataBase::sql_query($sql,'GENERAL','Could not update user information.');
return $lastt;
}
function SmilesShow()
{
$text ='';
$result='';
$sql = "SELECT * FROM ".SMILES_TABLE."";
$query = DataBase::sql_query($sql,'GENERAL','Cold not obtain smiles information.');
$i = 1;
while($smile = mysql_fetch_array($query))
{
$action = "insertSmile('".$smile['url']."','".$smile['smile']."')";
$mouse = "this.style.cursor='hand';";
$text = "\n".'<img src="'.$smile['url'].'" onmouseover="'.$mouse.'" onclick="'.$action.'" alt="'.$smile['smile'].'">&nbsp;'."\n";
$result = $result.$text;
if ($i%5==0)
{
$i = 1;
$result=$result.'<br>';
}
else
{
$i +=1;
}
}
return $result;
}
function SmilesReplace($text)
{
$sql = "SELECT * FROM ".SMILES_TABLE."";
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain emoticons information.');
$i = 1;
while($result = mysql_fetch_array($query))
{
$smile[$i]['smile'] = $result['smile'];
$smile[$i]['url'] = $result['url'];
$i +=1;
}
$smile = (!isset($smile)) ? array() : $smile;
$i = 1;
for($i=1;$i<=count($smile);$i++)
{
$text = str_replace(' '.$smile[$i]['smile'],'<img src="'.$smile[$i]['url'].'" alt="'.$smile[$i]['smile'].'">', $text);
$text = str_replace('&nbsp;'.$smile[$i]['smile'],'<img src="'.$smile[$i]['url'].'" alt="'.$smile[$i]['smile'].'">', $text);
}
return $text;
}
}
?>

+ 204
- 0
includes/classes/class_topic.php View File

@ -0,0 +1,204 @@
<?php
/**
* @package uForum
* @file includes/classes/class_topic.php
* @version $Id: classes/class_topic.php 15 2009-05-01 17:06:40Z pioder $
* @copyright 2009(c) PioDer <pioder@wp.pl>
* @link http://pioder.gim2przemysl.int.pl/
* @license GNU GPL v3
**/
if ( !defined('IN_uF') )
{
die('Hacking attempt');
}
class Topic
{
function LastPostInTopic($topic)
{
global $lng;
global $lastpost;
global $forum_config;
global $userdata;
$id = $lastpost[$topic]['tp_id'];
$userid = $lastpost[$topic]['u_id'];
$un = $lastpost[$topic]['user_nick'];
$rank = $lastpost[$topic]['user_rank'];
switch($rank)
{
case '0':
{
$user_color_name = $un;
break;
}
case '1':
{
$user_color_name = '<font color="'.$forum_config['color_mod'].'"><b>'.$un.'</b></font>';
break;
}
case '2':
{
$user_color_name = '<font color="'.$forum_config['color_admin'].'"><b>'.$un.'</b></font>';
break;
}
}
if ($_SESSION['uid']>0)
{
$limiter = $userdata['limit_tpid'];
}
else
{
$limiter = $forum_config['limit_tpid'];
}
$count = ceil($id / $limiter);
if ($count >1)
{
$page= '&amp;page='.$count;
}
else
{
$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>';
}
function LastPostImg()
{
global $lastpost;
global $record;
global $default_skin;
$time = time()-129600;
if ($_SESSION['uid']>0)
{
if ($lastpost[$record['t_id']]['time']>$time)
{
return 'folder_new_posts';
}
else
{
return 'folder_no_new_posts';
}
}
else
{
return 'folder_no_new_posts';
}
}
function TopicAuthor($uid)
{
global $record;
global $forum_config;
$rank = $record['rank'];
$nick = $record['nick'];
switch($rank)
{
case '0':
{
$user_color_name = $nick;
break;
}
case '1':
{
$user_color_name = '<font color="'.$forum_config['color_mod'].'"><b>'.$nick.'</b></font>';
break;
}
case '2':
{
$user_color_name = '<font color="'.$forum_config['color_admin'].'"><b>'.$nick.'</b></font>';
break;
}
}
return '<a href="user.php?id='.$uid.'" class="fstandard">'.$user_color_name.'</a>';
}
function TopicInformation($tid, $mode)
{
$sql = "SELECT * FROM ".TOPICS_TABLE." WHERE t_id='$tid';";
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain topic information');
$result = mysql_fetch_array($query);
$result = $result[$mode];
return $result;
}
function PostInformation($pid, $mode)
{
$sql = "SELECT * FROM ".POSTS_TABLE." WHERE p_id='$pid';";
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain topic information');
$result = mysql_fetch_array($query);
$result = $result[$mode];
return $result;
}
function PostText($text,$postmoderate, $pid)
{
global $forum;
global $lng;
$text = stripslashes($text);
$text = Topic::TagsReplace($text);
if($forum['moderate']==1)
{
if ($postmoderate==1)
{
if ($_SESSION['uid']>0)
{
if (RANK>0)
{
return '<span class="fstandard"><b>'.$lng['moderated_post_text'].': </b></span><br>'.Topic::TagsReplace('[quote]'.$text.'[/quote]').'<br><a href="moderate.php?action=accept&amp;id='.$pid.'"><span class="fstandard" style="color: red"><b>'.$lng['visible_of_post'].'</b></span></a>';
}
else
{
return '<span class="fstandard"><b><i>'.$lng['post_moderated'].'</i></b></span>';
}
}
else
{
return '<span class="fstandard"><b><i>'.$lng['post_moderated'].'</i></b></span>';
}
}
else
{
return $text;
}
}
else
{
return $text;
}
}
function UserName($nick, $rank)
{
global $forum_config;
switch($rank)
{
case '0':
{
return $nick;
break;
}
case '1':
{
return '<font color="'.$forum_config['color_mod'].'"><b>'.$nick.'</b></font>';
break;
}
case '2':
{
return '<font color="'.$forum_config['color_admin'].'"><b>'.$nick.'</b></font>';
break;
}
}
}
function TagsReplace($text)
{
global $lng;
//quote
$text = preg_replace("#\[quote\](.*?)\[/quote]#si", "<table class=\"maintable\" width=\"450\"><tr><td bgcolor=\"silver\"><span class=\"fsmall\"><b>".$lng['quote2'].":</b></span></td></tr><tr><td bgcolor=\"lightgrey\"><span class=\"textquote\">\\1</span></td></tr></table>", $text);
//code
$text = preg_replace("#\[code\](.*?)\[/code]#si", "<table class=\"maintable\" width=\"450\"><tr><td bgcolor=\"lightgreen\"><font face=\"Verdana\" style=\"font-size: 8pt\" color=\"green\"><b>Code:</b></font></td></tr><tr><td bgcolor=\"#D4FFAA\"><span class=\"textquote\">\\1</span></td></tr></table>", $text);
return $text;
}
}
?>

+ 224
- 0
includes/classes/class_user.php View File

@ -0,0 +1,224 @@
<?php
/**
* @package uForum
* @file includes/classes/class_user.php
* @version $Id: classes/class_user.php 15 2009-05-01 17:06:40Z pioder $
* @copyright 2009(c) PioDer <pioder@wp.pl>
* @link http://pioder.gim2przemysl.int.pl/
* @license GNU GPL v3
**/
if ( !defined('IN_uF') )
{
die('Hacking attempt');
}
class User
{
function LastUser()
{
global $lastuser;
$usr = $lastuser['nick'];
$uid = $lastuser['u_id'];
return '<a href="user.php?id='.$uid.'" class="fstandard">'.$usr.'</a>';
}
function UserInformation($uid, $inf)
{
$sql = "SELECT `$inf` FROM ".USERS_TABLE." WHERE u_id='$uid';";
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user information.');
$result = mysql_fetch_array($query);
$result = $result[$inf];
return $result;
}
function UserIdByNick($nick)
{
$sql = "SELECT * FROM `".USERS_TABLE."` WHERE `nick`='$nick';";
$result = mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not obtain user information.'));
$result = $result['u_id'];
/*if ($result=='')
{
message_forum('nick failed','admin_groups.php');
}*/
return $result;
}
function AddToGroup($uid, $gid)
{
$last= DataBase::new_id(USERS_GROUP_TABLE);
$sql = "INSERT INTO `".USERS_GROUP_TABLE."` VALUES ('$last','$uid', '$gid')";
DataBase::sql_query($sql,'GENERAL','Could not add user to group.');
}
function DeleteFromGroup($uid, $gid)
{
$sql = "DELETE FROM `".USERS_GROUP_TABLE."` WHERE `u_id`='$uid' AND `g_id`='$gid'";
DataBase::sql_query($sql,'GENERAL','Could not delete user for group.');
}
function LogedAs($sid, $uid)
{
global $lng;
global $userdata;
if ($uid>0)
{
$nick = $userdata['nick'];
return(''.$lng['youareloggedas'].' <a href="user.php?id='.$uid.'" class="fstandard"><b>'.$nick.'</b></a>');
}
else
{
return($lng['youarenotlogd']);
}
}
function PostWithForum($posts)
{
$result2 = TotalPosts();
if($result2>0)
{
$result3 = ($posts/$result2*100);
$result3 = round($result3,2);
return($result3);
}
else
{
return(0);
}
}
function LastRegVisit($uid, $mode)
{
global $lng;
$result = User::UserInformation($uid,$mode);
if ($result=='0')
{
return($lng['never']);
}
else
{
$date = date('d-m-Y, G:i',$result);
return($date);
}
}
function UserRank($rank)
{
global $lng;
global $forum_config;
switch($rank)
{
case '0': {$result=$lng['user']; break; }
case '1': {$result='<font color="'.$forum_config['color_mod'].'"><b>'.$lng['mod'].'</b></font>'; break; }
case '2': {$result='<font color="'.$forum_config['color_admin'].'"><b>'.$lng['admin'].'</b></font>'; break; }
}
return($result);
}
function RankAdminMod($uid)
{
if ($uid>0)
{
$sql = "SELECT * FROM ".USERS_TABLE." WHERE u_id='$uid'";
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user`s rank information.');
$result = mysql_fetch_array($query);
$rank = $result['rank'];
if (($rank=='1') or ($rank=='2'))
{
return '1';
}
else
{
return '0';
}
}
else
{
return '0';
}
}
function UpdateProfile($uid, $gg, $email, $interests, $sig, $avatar, $allow_qr, $allow_email, $allow_gg, $skin, $lang, $limit_tpid, $limit_ftid, $limit_users, $allow_shoutbox)
{
$sql ="UPDATE `".USERS_TABLE."` SET
`gg` = '$gg',
`email` = '$email',
`allow_gg` = '$allow_gg',
`allow_email` = '$allow_email',
`allow_qr` = '$allow_qr',
`interests` = '$interests',
`sig` = '$sig',
`avatar` = '$avatar',
`skin`='$skin',
`lang`='$lang',
`limit_tpid` = '$limit_tpid',
`limit_ftid` = '$limit_ftid',
`view_shoutbox` = '$allow_shoutbox',
`limit_users` = '$limit_users'
WHERE `u_id` ='$uid' LIMIT 1 ;";
DataBase::sql_query($sql,'CRITICAL','Could not update user information');
}
function UpdateAdminPools($uid, $posts, $rank, $active, $nick)
{
$sql ="UPDATE `".USERS_TABLE."` SET
`posts` = '$posts',
`rank` = '$rank',
`active` = '$active',
`nick` = '$nick'
WHERE `u_id` ='$uid' LIMIT 1 ;";
DataBase::sql_query($sql,'CRITICAL','Could not update user information');
}
function UpdatePassword($uid, $pass)
{
$sql ="UPDATE `".USERS_TABLE."` SET
`pass` = '$pass'
WHERE `u_id` ='$uid' LIMIT 1 ;";
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)
{
global $forum_config;
$last = DataBase::new_id(USERS_TABLE);
$time = time();
$sql = "INSERT INTO ".USERS_TABLE." VALUES
('$last', '$nick', '$pass', '$email', '0', '$time', '0', '$gg', '$allow_gg', '$allow_email', '$allow_qr', '".$forum_config['view_shoutbox']."', '".$forum_config['defaultskin']."', '".$forum_config['defaultlang']."','".$forum_config['limit_tpid']."', '".$forum_config['limit_ftid']."', '".$forum_config['limit_users']."', '$sig', '$av', '1','0','$interests');";
DataBase::sql_query($sql,'CRITICAL','Could not create new user');
}
function UserMsgs()
{
$uid = $_SESSION['uid'];
if($uid>0)
{
$sql = "SELECT count(*) as `m_id` FROM ".PM_INBOX_TABLE." WHERE `u_id`='$uid' AND `read`='0'";
$result = mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not obtain amounts PM of User.'));
$result = $result['m_id'];
if ($result>0)
{
return '<font color="red">'.$result.'</font>';
}
else
{
return $result;
}
}
}
function UserAddWarn($uid, $value, $motive)
{
$sql = "INSERT INTO `".WARNINGS_TABLE."` ( `w_id` , `u_id` , `value` , `motive` ) VALUES('','$uid','$value','$motive');";
DataBase::sql_query($sql,'GENERAL','Could not add new warn.');
if (User::UserLevelWarns($uid)==100)
{
$ban_ip = '0.0.0.0';
$ban_uid = $uid;
$ban_motive = $lng['warns_ban'];
$sql = "INSERT INTO ".BANLIST_TABLE." VALUES ('', '$ban_uid', '$ban_ip', '$ban_motive')";
DataBase::sql_query($sql,'GENERAL','Could not update add ban.');
}
}
}
?>

includes/class_db.php → includes/db.php View File

@ -1,7 +1,7 @@
<?php
/**
* @package uForum
* @file includes/class_db.php
* @file includes/db.php
* @version $Id$
* @copyright 2009(c) PioDer <pioder@wp.pl>
* @link http://pioder.gim2przemysl.int.pl/
@ -29,7 +29,7 @@ class DataBase
$_COOKIE['queries'] = $_COOKIE['queries']+1;
}
}
//echo '<span class="fsmall">'.$sql.'<br></span>'; //for optymalization ONLY!!!!!!!!!!!!!!
//echo '<span class="fsmall">'.$sql.'<br></span>'; //for optimizing only
$query = mysql_query($sql) or message_die($type, $msg, mysql_error());
return $query;
}
@ -55,7 +55,7 @@ class DataBase
case WARNINGS_TABLE: { $id = 'w_id'; break; }
}
$sql = "SELECT `$id` FROM $table ORDER BY `$id` DESC LIMIT 1";
$return_id = mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Error with obtain last id.<br> File: class_db.php, Line: '.__LINE__));
$return_id = mysql_fetch_array(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+1;
return $return_id;

+ 87
- 0
includes/emailer.php View File

@ -0,0 +1,87 @@
<?php
/**
* @package uForum
* @file includes/class_email.php
* @version $Id: emailer.php -1 $
* @copyright 2009(c) PioDer <pioder@wp.pl>
* @link http://pioder.gim2przemysl.int.pl/
* @license GNU GPL v3
**/
if ( !defined('IN_uF') )
{
die('Hacking attempt');
}
function SendEmail($email, $title, $content)
{
global $forum_config;
#headers
$email_headers = "MIME-Version: 1.0\r\n";
$email_headers .= "Content-type: text/html; charset=iso-8859-2\r\n";
$email_headers .= "From: ".$forum_config['forumname']." \n";
$email_date = date('d-m-Y, G:i',time());
$email_content = '
<html>
<head>
<title>'.$title.'</title>
</head>
<body>
'.$content.'<br>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
<font face="Verdana" style="font-size:10pt">
Message generated automatic by &micro;Forum <b>('.$email_date.')</b></font>
</body>
</html>';
#send email - do it!
if ( !mail($email, $title, $email_content, $email_headers ))
{
message_die('GENERAL','Could not send email from: '.$email.'. sorry :(','');
}
}
function SendRegisterEmail()
{
global $forum_config;
global $original_pass;
global $lng;
$email_content = $lng['email_newpasswd_msg'];
$email_content = str_replace('%forum%',$forum_config['forumname'],$email_content);
$email_content = str_replace('%url_f%',$forum_config['forumpatch'],$email_content);
$email_content = str_replace('%ip%',$_SERVER['REMOTE_ADDR'],$email_content);
$email_content = str_replace('%forum%',$forum_config['forumname'],$email_content);
$email_content = str_replace('%login%',$_POST['nick'],$email_content);
$email_content = str_replace('%pass%',$original_pass,$email_content);
SendEmail($_POST['email'],$lng['email_welcome'].$forum_config['forumname'],$email_content);
}
function SendForgotPassEmail($newpass)
{
global $forum_config;
global $original_pass;
global $lng;
global $uid;
$email_content = $lng['email_register_msg'];
$email_content = str_replace('%forum%',$forum_config['forumname'],$email_content);
$email_content = str_replace('%url_f%',$forum_config['forumpatch'],$email_content);
$email_content = str_replace('%ip%',$_SERVER['REMOTE_ADDR'],$email_content);
$email_content = str_replace('%forum%',$forum_config['forumname'],$email_content);
$email_content = str_replace('%login%',$_POST['username'],$email_content);
$email_content = str_replace('%pass%',$newpass,$email_content);
SendEmail(User::UserInformation($uid,'email'),$lng['email_sent_forget_pass'].$forum_config['forumname'],$email_content);
}
function SendMassEmail($title,$content)
{
$sql = "SELECT `email`,`u_id` FROM ".USERS_TABLE." WHERE `u_id`>0";
$query = DataBase::sql_query($sql,'CRITICAL','Could not read users table');
while($item = @mysql_fetch_array($query))
{
SendEmail($item['email'], $title, $content);
}
}
?>

+ 72
- 0
includes/errors.php View File

@ -0,0 +1,72 @@
<?php
/**
* @package uForum
* @file includes/errors.php
* @version $Id: errors.php 15 2009-05-01 17:06:40Z pioder $
* @copyright 2009(c) PioDer <pioder@wp.pl>
* @link http://pioder.gim2przemysl.int.pl/
* @license GNU GPL v3
**/
if ( !defined('IN_uF') )
{
die('Hacking attempt');
}
function message_die($type, $msm, $sql)
{
$msg ='';
$msg = '
<body bgcolor="">
<table align="left" border="1" style="border-collapse: collapse; border-color: grey" width="500">
<tr>
<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' ;
$msg .= '</font>
</td>
</tr>
<tr>
<td bgcolor="#FEC876" align="center">
<font face="Verdana" style="font-size: 13pt; font-weight: bold">';
$msg = $msg.$msm.'
</font>
</td>
</tr>
<tr>
<td align="left" bgcolor="white">';
if ($sql !='')
{
$msg = $msg.'<font face="Verdana" style="font-size: 11pt"><i>'.$sql.'</i></font>';
}
$msg = $msg.'</td></tr><tr><td bgcolor="white"><center><font face="Verdana" style="font-size: 10pt">Problems? Questions? Visit:
<a href="http://pioder.gim2przemysl.int.pl/forum/" target="_blank">http://pioder.gim2przemysl.int.pl/forum</a></font></td></tr></table></center></body>';
die($msg);
}
function message_forum($text, $url, $interval = 1.8)
{
global $lng;
global $forum_config;
$skin = array(
'url' => $url,
'msg' => $text,
'queries' => '',
'pa_link' => '',
);
$skin = array_push_associative($skin,GenerateHeader($lng['message_forum'], '&gt; '.$lng['message_forum']));
die(
include('./skins/'.ViewSkinName().'/message_body.tpl')
);
}
function admin_message_forum($text, $url)
{
$skin = array(
'url'=>$url,
'msg'=>$text,
);
$skin['queries'] = '';
$skin['pa_link'] = '';
die(
include('./template/message_body.tpl')
);
}
?>

+ 346
- 0
includes/misc_functions.php View File

@ -0,0 +1,346 @@
<?php
/**
* @package uForum
* @file includes/class_overall.php
* @version $Id$
* @copyright 2009(c) PioDer <pioder@wp.pl>
* @link http://pioder.gim2przemysl.int.pl/
* @license GNU GPL v3
**/
if ( !defined('IN_uF') )
{
die('Hacking attempt');
}
function SetCounter()
{
global $forum_config;
if (!isset($_COOKIE['forum_visited']))
{
setcookie('forum_visited','1');
$visit_count = $forum_config['forum_counter'] +1;
DataBase::sql_query("UPDATE `".CONFIG_TABLE."` SET `value`='$visit_count' WHERE `name`='forum_counter'",'GENERAL','Could not update forum counter');
}
else
{
$visit_count = $forum_config['forum_counter'];
}
return $visit_count;
}
function GenerateHeader($title, $navigator)
{
global $lng;
global $forum_config;
$skin = array(
'forumname' => $forum_config['forumname'],
'forumdesc' => $forum_config['forumdesc'],
'users' => $lng['lusers'],
'pm' => $lng['lpm'],
'register' => $lng['lregister'],
'search' => $lng['lsearch'],
'eprofile' => $lng['leprofile'],
'groups' => $lng['lgroups'],
'keywords' => $forum_config['meta_keywords'],
'description' => $forum_config['meta_description'],
'mainpage' => $title,
'lmainpage' => $navigator,
'lactual_time'=>$lng['lactualtime'],
'modelogin' => ($_SESSION['uid']>0) ? 'logout' : 'login',
'llogin' => ($_SESSION['uid']>0) ? $lng['lunlogin'] : $lng['llogin']
);
return $skin;
}
function UserAgent($agent)
{
global $lng;
/*This original function is in phpBB 1.12.5 modified by Przemo*/
/*Modified by PioDer: added new browsers and systems and other replaces*/
$agent_tst = ' ' . strtolower($agent);
$system = $browser = '';
if (
strpos($agent_tst, 'windows') ||
strpos($agent_tst, 'win9') ||
strpos($agent_tst, 'win32') ||
strpos($agent_tst, 'nt 5.') ||
strpos($agent_tst, 'nt 4') )
{
$system = ( strpos($agent_tst, 'windows 9') || strpos($agent_tst, 'nt 4') || strpos($agent_tst, 'windows') || strpos($agent_tst, 'win32') ) ? 'windows_98_nt_2000' : $system;
$system = ( strpos($agent_tst, 'nt 5.') || strpos($agent_tst, 'nt 6.') || strpos($agent_tst, 'nt 7.') || strpos($agent_tst, 'nt 8.') ) ? 'windows_xp_2003' : $system;
$system = (strpos($agent_tst, 'nt 5.0')) ? 'windows_98_nt_2000' : $system;
$system = (strpos($agent_tst, 'nt 6.0')) ? 'windows_vista' : $system;
}
else
{
$system = (strpos($agent_tst, 'linux')) ? 'linux' : $system;
$system = (strpos($agent_tst, 'suse')) ? 'linux_suse' : $system;
$system = (strpos($agent_tst, 'knoppix')) ? 'linux_knoppix' : $system;
$system = (strpos($agent_tst, 'turbolinux')) ? 'linux_turbolinux' : $system;
$system = (strpos($agent_tst, 'slackware')) ? 'linux_slackware' : $system;
$system = (strpos($agent_tst, 'gentoo')) ? 'linux_gentoo' : $system;
$system = (strpos($agent_tst, 'lycoris')) ? 'linux_lycoris' : $system;
$system = (strpos($agent_tst, 'debian')) ? 'linux_debian' : $system;
$system = (strpos($agent_tst, 'redhat')) ? 'linux_redhat' : $system;
$system = (strpos($agent_tst, 'archlinux')) ? 'linux_arch' : $system;
$system = (strpos($agent_tst, 'ubuntu')) ? 'linux_ubuntu' : $system;
$system = (strpos($agent_tst, 'cdlinux')) ? 'linux_cdlinux' : $system;
$system = (strpos($agent_tst, 'mandriva')) ? 'linux_mandriva' : $system;
$system = (strpos($agent_tst, 'kateos')) ? 'linux_kateos' : $system;
$system = (strpos($agent_tst, 'bsd')) ? 'linux_freebsd' : $system;
}
if ( $system == '')
{
$system = (strpos($agent_tst, 'mac')) ? 'macos' : $system;
$system = (strpos($agent_tst, 'aix')) ? 'aix' : $system;
$system = (strpos($agent_tst, 'lindows')) ? 'lindows' : $system;
$system = (strpos($agent_tst, 'amiga')) ? 'amiga' : $system;
$system = (strpos($agent_tst, 'athe')) ? 'athe' : $system;
$system = (strpos($agent_tst, 'beos')) ? 'beos' : $system;
$system = (strpos($agent_tst, 'zeta')) ? 'beos' : $system;
$system = (strpos($agent_tst, 'BlueEyed')) ? 'beos' : $system;
$system = (strpos($agent_tst, 'nextstep')) ? 'nextstep' : $system;
$system = (strpos($agent_tst, 'warp')) ? 'warp' : $system;
$system = (strpos($agent_tst, 'qnx')) ? 'qnx' : $system;
$system = (strpos($agent_tst, 'risc')) ? 'risc' : $system;
$system = (strpos($agent_tst, 'solaris')) ? 'solaris' : $system;
$system = (strpos($agent_tst, 'unix')) ? 'unix' : $system;
$system = (strpos($agent_tst, 'macos')) ? 'macos' : $system;
$system = (strpos($agent_tst, 'mac os')) ? 'macos' : $system;
$system = (strpos($agent_tst, 'symbian')) ? 'symbian' : $system;
$system = ($system == '' && strpos($agent_tst, 'win9') || strpos($agent_tst, 'win3') || strpos($agent_tst, 'windows') ) ? 'windows_98_nt_2000' : $system;
}
$browser = (strpos($agent_tst, 'mozilla')) ? 'mozilla' : $browser;
$browser = (strpos($agent_tst, 'msie')) ? 'ie' : $browser;
$browser = (strpos($agent_tst, 'msie 7')) ? 'ie7' : $browser;
$browser = (strpos($agent_tst, 'netscape')) ? 'netscape' : $browser;
$browser = (strpos($agent_tst, 'opera')) ? 'opera' : $browser;
$browser = (strpos($agent_tst, 'konqueror')) ? 'konqueror' : $browser;
$browser = (strpos($agent_tst, 'galeon')) ? 'galeon' : $browser;
$browser = (strpos($agent_tst, 'firefox')) ? 'firefox' : $browser;
$browser = (strpos($agent_tst, 'netsprint')) ? 'netsprint' : $browser;
$browser = (strpos($agent_tst, 'firebird')) ? 'firebird' : $browser;
$browser = (strpos($agent_tst, 'links')) ? 'links' : $browser;
$browser = (strpos($agent_tst, 'dillo')) ? 'dillo' : $browser;
$browser = (strpos($agent_tst, 'omniweb')) ? 'omniweb' : $browser;
$browser = (strpos($agent_tst, 'avant')) ? 'avant' : $browser;
$browser = (strpos($agent_tst, 'myie2')) ? 'myie2' : $browser;
$browser = (strpos($agent_tst, 'seamonkey')) ? 'seamonkey' : $browser;
$browser = (strpos($agent_tst, 'maxthon')) ? 'maxthon' : $browser;
$browser = ($browser == '') ? 'unknown' : $browser;
$system = ($system == '') ? 'unknown' : $system;
return array('icon_' . $system . '.gif', 'icon_' . $browser . '.gif', ($system=='unknown') ? $lng['unknown'] : $system, ($browser=='unknown') ? $lng['unknown'] : $browser);
}
function GenerateTime($request_time)
{
global $lng;
if (date('d-m-Y',$request_time)== date('d-m-Y',time()))
{
$date = $lng['today'].', '.date('G:i', $request_time);
}
else
{
if ((date('d',$request_time))== (date('d',time())-1) && (date('m-Y',$request_time)== date('m-Y',time())))
{
$date = $lng['yesterday'].', '.date('G:i', $request_time);
}
else
{
$date = date('d-m-Y, G:i',$request_time);
}
}
return $date;
}
function AddPages()
{
global $count;
global $page;
$content = '';
for ($i=1;$i<=$count;$i++)
{
if ($i==$page)
{
$content .= '<option value="'.$i.'" selected="selected">'.$i.'</option>';
}
else
{
$content .= '<option value="'.$i.'">'.$i.'</option>';
}
}
return $content;
unset($content);
}
function AddPages2($page)//for edit profile, not used in limit!
{
$content = '';
for ($i=1;$i<=50;$i++)
{
if ($i==$page)
{
$content .= '<option value="'.$i.'" selected="selected">'.$i.'</option>';
}
else
{
$content .= '<option value="'.$i.'">'.$i.'</option>';
}
}
return $content;
unset($content);
}
function AddSkins()
{
global $forum_config;
global $default_skin;
$all='';
$query = DataBase::sql_query("SELECT `name`, `s_id` FROM `".SKINS_TABLE."`",'GENERAL','Could not obtain skins information');
while($t = @mysql_fetch_array($query))
{
if ($t['name']==$default_skin)
{
$all .= '<option value="'.$t['s_id'].'" selected="selected">'.$t['name'].'</option>';
}
else
{
$all .= '<option value="'.$t['s_id'].'">'.$t['name'].'</option>';
}
}
return $all;
unset($t, $all);
}
function AddLangs()
{
global $forum_config;
global $default_lang;
$result='';
$rep=opendir('./lngs');
$browseruMoinsUnRepertoire = false;
while ($file = readdir($rep))
{
if($file != '..' && $file !='.' && $file !='')
{
if (is_dir('./lngs/'.$file)){
$browseruMoinsUnRepertoire = true;
if ($file==$default_lang)
{
$result .='<option value="'.$file.'" selected="selected">'.$file.'</option>';
}
else
{
$result .='<option value="'.$file.'">'.$file.'</option>';
}
}
}
}
return $result;
unset($rep, $browseruMoinsUnRepertoire, $file, $result);
}
function TimeGeneration()
{
list($usec, $sec ) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
function IfModGroup($guid)
{
global $lng;
$uid = $_SESSION['uid'];
if ($guid==$uid)
{
return'
<tr>
<td class="fitem">
<span class="fstandard">'.$lng['addusrtogrp'].':</span><input type="text" name="nick" style="widtfh:100px; height:15px" value="'.$_POST['nick'].'">
</td>
<td class="fitem">
<span class="fstandard">'.$lng['delusrforgrp'].':</span><input type="text" name="delnick" style="widtfh:100px; height:15px" value="'.$_POST['nick'].'">
</td>
<td class="fitem">
<input type="submit" class="fbutton" value="'.$lng['lgo'].'">
</tr>
';
}
}
function TotalPosts()
{
$sql = "SELECT count(*) as `p_id` FROM ".POSTS_TABLE."";
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain total posts information');
$result = mysql_fetch_array($query);
$result = $result['p_id'];
return($result);
}
function DefaultLang()
{
global $forum_config;
global $userdata;
if ($_SESSION['uid']>0)
{
return $userdata['lang'];
}
else
{
return $forum_config['defaultlang'];
}
}
function ShowQueries($start, $stop)
{
global $forum_config;
global $lng;
if ($forum_config['show_time_generation'])
{
$result = $stop - $start;
$result = round($result,3);
if (extension_loaded('xdebug'))
{
return $lng['script_generated'].$result.' '.$lng['seconds'].'. SQL: '.$_COOKIE['queries'].'.<br>
Wersja Xdebug: '.phpversion('xdebug').', Użycie pamięci: '.round((xdebug_memory_usage()/1024),2).'KB.';
}
else
{
return $lng['script_generated'].$result.' '.$lng['seconds'].'. SQL: '.$_COOKIE['queries'].'.';
}
}
else
{
return '';
}
}
function ViewSkinName()
{
global $forum_config;
global $userdata;
if ($_SESSION['uid']>0)
{
$result = $userdata['skin'];
}
else
{
$result = $forum_config['defaultskin'];
}
$sql = "SELECT * FROM `".SKINS_TABLE."` WHERE `s_id`='$result'";
$result = mysql_fetch_array(DataBase::sql_query($sql,'CRITICAL','Could not obtain skin information.'));
return $result['name'];
}
?>

+ 6
- 6
includes/pms/pms_delete.php View File

@ -11,12 +11,12 @@ if (isset($_GET['user']))
Secure::message_u_exists(intval($_GET['m']));
Secure::message_user_loged(intval($_GET['m']));
Pms::DeleteMsgUser(intval($_GET['m']));
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
message_forum($lng['pm_is_deleted'],'pms.php');
}
else
{
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
message_forum($lng['invalidmode'],'pms.php');
}
break;
@ -28,19 +28,19 @@ if (isset($_GET['user']))
Secure::message_a_exists(intval($_GET['m']));
Secure::message_author_loged(intval($_GET['m']));
Pms::DeleteMsgAuthor(intval($_GET['m']));
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
message_forum($lng['pm_is_deleted'],'pms.php?mode=folder&amp;submode=sentbox');
}
else
{
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
message_forum($lng['invalidmode'],'pms.php');
}
break;
}
default:
{
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
message_forum($lng['invalidmode'],'pms.php');
break;
}
@ -48,7 +48,7 @@ if (isset($_GET['user']))
}
else
{
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
message_forum($lng['invalidmode'],'pms.php');
}

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

@ -17,13 +17,13 @@ while($result = mysql_fetch_array($query))
$folder = ($_GET['submode']=='sentbox') ? '<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>';
//add skin variables
$skin = array(
'lang'=>Over::DefaultLang(),
'lang'=>DefaultLang(),
'lname'=>$lng['message_name'],
'lauthor'=>$lng['user'],
'lmdate'=>$lng['date']
);
$skin = array_push_associative($skin,Over::generate_header($lng['lpm'].': '.(($_GET['submode']=='sentbox') ? $lng['sentbox'] : $lng['inbox']), '</a> &gt; <a href="pms.php" class="navigator">'.$lng['lpm'].'</a> &gt; '.$folder));
$skin = array_push_associative($skin,GenerateHeader($lng['lpm'].': '.(($_GET['submode']=='sentbox') ? $lng['sentbox'] : $lng['inbox']), '</a> &gt; <a href="pms.php" class="navigator">'.$lng['lpm'].'</a> &gt; '.$folder));
//do it!
include('./skins/'.$default_skin.'/overall_header.tpl');
include('./skins/'.$default_skin.'/msgs_is_body.tpl');
@ -87,8 +87,8 @@ else
$skin['pa_link']='';
}
$stop = Over::TimeGeneration();
$skin['queries'] = Over::ShowQueries($start, $stop);
$stop = TimeGeneration();
$skin['queries'] = ShowQueries($start, $stop);
include('./skins/'.$default_skin.'/overall_footer.tpl');
?>

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

@ -75,7 +75,7 @@ $folder = ($_GET['submode']=='author') ? '
//add skin variables
$skin = array(
'lang'=>Over::DefaultLang(),
'lang'=>DefaultLang(),
'lname'=>$lng['message'],
'u_id'=>$result['u_n_id'],
'username'=>Topic::UserName($user['nick'], $user['rank']),
@ -97,7 +97,7 @@ $skin = array(
'lpinfo'=>$lng['postinfo']
);
$skin = array_push_associative($skin,Over::generate_header($lng['show_message'].': '.$result['name'], '</a> &gt; '.$folder.' &gt;
$skin = array_push_associative($skin,GenerateHeader($lng['show_message'].': '.$result['name'], '</a> &gt; '.$folder.' &gt;
<a href="pms.php?mode=view&amp;submode='.$_GET['submode'].'&amp;id='.
$result['m_id'].'" class="navigator">'.$lng['show_message']
.': '.$result['name']));
@ -113,8 +113,8 @@ else
{
$skin['pa_link']='';
}
$stop = Over::TimeGeneration();
$skin['queries'] = Over::ShowQueries($start, $stop);
$stop = TimeGeneration();
$skin['queries'] = ShowQueries($start, $stop);
include('./skins/'.$default_skin.'/overall_footer.tpl');
break;

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

@ -56,7 +56,7 @@ $skin = array(
'action'=>$_SERVER['REQUEST_URI']
);
$skin = array_push_associative($skin, Over::generate_header($lng['lpm'].': '.$lng['write_pm'], '</a>&gt;<a href="pms.php" class="navigator">'.$lng['lpm'].'</a> &gt; <a href="'.$_SERVER['REQUEST_URI'].'" class="navigator">'.$lng['write_pm']));
$skin = array_push_associative($skin, GenerateHeader($lng['lpm'].': '.$lng['write_pm'], '</a>&gt;<a href="pms.php" class="navigator">'.$lng['lpm'].'</a> &gt; <a href="'.$_SERVER['REQUEST_URI'].'" class="navigator">'.$lng['write_pm']));
if ($msg=='')
{
@ -76,8 +76,8 @@ else
$skin['pa_link']='';
}
$stop = Over::TimeGeneration();
$skin['queries'] = Over::ShowQueries($start, $stop);
$stop = TimeGeneration();
$skin['queries'] = ShowQueries($start, $stop);
include('./skins/'.$default_skin.'/overall_footer.tpl');
?>

+ 18
- 7
includes/sessions.php View File

@ -26,42 +26,51 @@ if (empty($_SESSION['uid']))
{
$_SESSION['uid']='0';
}
if (empty($_SESSION['login_on']))
{
$_SESSION['login_on']='0';
}
if (empty($_SESSION['sessionid']))
{
$_SESSION['sessionid']='0';
}
if (empty($_COOKIE['queries']))
{
$_COOKIE['queries']=0;
setcookie('queries','0',time()+31104000);
}
if($_COOKIE['queries']>0)
{
setcookie('queries','0',time()+31104000);
$_COOKIE['uid']='0';
}
function sess_register($uid)
function SessRegister()
{
if ($uid>0)
$uid = $_SESSION['uid'];
if ($uid>0)
{
sess_delete($uid);
SessDelete($uid);
$time = time();
$sql = "INSERT INTO ".SESSIONS_TABLE." VALUES ('', '".$_COOKIE[SESS_NAME]."','$uid','$time')";
$result = @mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not add new session.',true));
return $result;
}
}
function sess_delete_old()
function SessDeleteOld()
{
$time = time();
$sql = "DELETE FROM ".SESSIONS_TABLE." WHERE time+129600<$time;";
DataBase::sql_query($sql, 'GENERAL','Could not delete session',true);
}
function sess_del_invalid()
function SessDelInvalid()
{
if ($_SESSION['uid']>0)
{
@ -76,7 +85,8 @@ function sess_del_invalid()
}
}
}
function sess_delete($uid)
function SessDelete($uid)
{
$time = time();
$sql = "DELETE FROM ".SESSIONS_TABLE." WHERE u_id='$uid'";
@ -84,7 +94,8 @@ function sess_delete($uid)
$_SESSION['sessionid']='0';
return $result['count'];
}
function sess_view()
function SessView()
{
global $lng;
global $user;

+ 19
- 19
index.php View File

@ -10,30 +10,30 @@
define('IN_uF', true);
//include files
include('./config.php');
if (!DSF_INSTALLED)
if (!UF_INSTALLED)
{
header('Location: install/');
}
include('./includes/constants.php');
include('./includes/class_db.php');
include('./includes/class_error.php');
include('./includes/db.php');
include('./includes/errors.php');
//connect to database
DataBase::db_connect();
include('./includes/sessions.php');
include('./includes/class_user.php');
include('./includes/classes/class_user.php');
include('./common.php');
include('./includes/class_overall.php');
include('./includes/class_posting.php');
include('./includes/class_topic.php');
include('./includes/class_forum.php');
include('./lngs/'.Over::DefaultLang().'/main.php');
include('./includes/misc_functions.php');
include('./includes/classes/class_posting.php');
include('./includes/classes/class_topic.php');
include('./includes/classes/class_forum.php');
include('./lngs/'.DefaultLang().'/main.php');
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
$start = Over::TimeGeneration();
$default_skin = Over::ViewSkinName();
$visit_count = Over::set_counter();
SessDelInvalid();
SessRegister();
SessDeleteOld();
$start = TimeGeneration();
$default_skin = ViewSkinName();
$visit_count = SetCounter();
include('./includes/cache/cache_index.php');
//add skin variables
@ -45,7 +45,7 @@ $skin = array(
'lpm_msgs' => ($_SESSION['uid']>0) ? $lng['pm_messages'] : '',
'amsgs' => ($_SESSION['uid']>0) ? User::UserMsgs() : ''
);
$skin = array_push_associative($skin, Over::generate_header($lng['mainpage'], '</a>&gt; <a href="index.php" class="navigator">'.$lng['mainpage']));
$skin = array_push_associative($skin, GenerateHeader($lng['mainpage'], '</a>&gt; <a href="index.php" class="navigator">'.$lng['mainpage']));
//do it!
include('./skins/'.$default_skin.'/overall_header.tpl');
include('./skins/'.$default_skin.'/index_body.tpl');
@ -85,7 +85,7 @@ while($result = @mysql_fetch_array($query))
}
echo '</table>';
}
$sess = sess_view();
$sess = SessView();
//add skin variables
$skin =array(
'registered_users' => str_replace('%x%', $count_users ,$lng['reg_users']),
@ -136,7 +136,7 @@ else
{
$skin['pa_link']='';
}
$stop = Over::TimeGeneration();
$skin['queries'] = Over::ShowQueries($start, $stop);
$stop = TimeGeneration();
$skin['queries'] = ShowQueries($start, $stop);
include('./skins/'.$default_skin.'/overall_footer.tpl');
?>

+ 1
- 1
install/config.php View File

@ -18,5 +18,5 @@ define('DB_PASS','%pass%');
define('DB_NAME','%dbname%');
define('DB_PREFIX','%dbprefix%');
define('VERSION','1.0.B3');
define('DSF_INSTALLED',false);
define('UF_INSTALLED',false);
?>

+ 3
- 3
install/index.php View File

@ -10,8 +10,8 @@
define('IN_uF',true);
include('./../config.php');
include('./../includes/constants.php');
include('./../includes/class_error.php');
include('./../includes/class_db.php');
include('./../includes/errors.php');
include('./../includes/db.php');
include('./functions_add.php');
include('./../admin/check_script_data.php');
@ -39,7 +39,7 @@ for($i=0; $i
$count +=1;
}
}
if (DSF_INSTALLED)
if (UF_INSTALLED)
{
header('Location: ../index.php');
}

+ 25
- 25
login.php View File

@ -11,23 +11,23 @@ define('IN_uF', true);
//include files
include('./config.php');
include('./includes/constants.php');
include('./includes/class_db.php');
include('./includes/class_error.php');
include('./includes/db.php');
include('./includes/errors.php');
//connect to database
DataBase::db_connect();
include('./includes/sessions.php');
include('./includes/class_user.php');
include('./includes/classes/class_user.php');
include('./common.php');
include('./includes/class_email.php');
include('./includes/class_overall.php');
$default_lang = Over::DefaultLang();
include('./includes/emailer.php');
include('./includes/misc_functions.php');
$default_lang = DefaultLang();
include('./lngs/'.$default_lang.'/main.php');
include('./lngs/'.$default_lang.'/email.php');
include('./includes/classes/secure.php');
$start = Over::TimeGeneration();
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
$start = TimeGeneration();
SessDelInvalid();
SessRegister();
SessDeleteOld();
foreach ($_POST as $name => $value)
{
if ($forum_config['use_censorlist'])
@ -48,14 +48,14 @@ if (isset($_GET['mode']))
$uid = $_SESSION['uid'];
$_SESSION['uid']=0;
$_SESSION['sessionid']='0';
sess_delete($uid);
$stop = Over::TimeGeneration();
SessDelete($uid);
$stop = TimeGeneration();
message_forum($lng['islogout'], 'index.php');
break;
}
case 'login':
{
$default_skin = Over::ViewSkinName();
$default_skin = ViewSkinName();
if ($_SESSION['uid']>0)
{
header('Location: index.php');
@ -79,7 +79,7 @@ if (isset($_GET['mode']))
DataBase::sql_query($sql,'GENERAL','Could not delete session.');
if (User::UserInformation($user_id,'active')==0)
{
sess_delete($_SESSION['uid']);
SessDelete($_SESSION['uid']);
$_SESSION['uid']='0';
message_forum($lng['account_disabled'],'index.php');
}
@ -94,7 +94,7 @@ if (isset($_GET['mode']))
DataBase::sql_query($sql,'GENERAL','Could not update user lastvisit');//run query
$msg = $lng['youareloggedas'].': <b>'.$nick.'</b>';// messaage "login as.."
$skin['pa_link']='';
$stop = Over::TimeGeneration();//generate generation's time
$stop = TimeGeneration();//generate generation's time
message_forum($msg, 'index.php');//message and require to index.php
}
else
@ -125,12 +125,12 @@ if (isset($_GET['mode']))
'llog_in'=> $lng['llog_in'],
'msg' => $msg
);
$skin = array_push_associative($skin, Over::generate_header($lng['llogin'],'</a>&gt; <a href="login.php?mode=login" class="navigator">'.$lng['llogin']));
$skin = array_push_associative($skin, GenerateHeader($lng['llogin'],'</a>&gt; <a href="login.php?mode=login" class="navigator">'.$lng['llogin']));
include('./skins/'.$default_skin.'/overall_header.tpl');
include('./skins/'.$default_skin.'/login_body.tpl');
$skin['pa_link']='';
$stop = Over::TimeGeneration();
$skin['queries'] = Over::ShowQueries($start, $stop);
$stop = TimeGeneration();
$skin['queries'] = ShowQueries($start, $stop);
include('./skins/'.$default_skin.'/overall_footer.tpl');
break;
}
@ -140,7 +140,7 @@ if (isset($_GET['mode']))
{
header('Location: index.php');
}
$default_skin = Over::ViewSkinName();
$default_skin = ViewSkinName();
if (!$forum_config['allow_send_email'])
{
message_forum($lng['no_send_newpass'],'index.php');
@ -153,7 +153,7 @@ if (isset($_GET['mode']))
$int_rand = rand(1, (strlen(PASSWD_HASH)-$forum_config['newpasswd_len']));
$newpass = substr(PASSWD_HASH, $int_rand, $forum_config['newpasswd_len']);
User::UpdatePassword($uid, md5($newpass));
Email::SendForgotPassEmail($newpass);
SendForgotPassEmail($newpass);
message_forum($lng['pass_changed'],'index.php');
}
else
@ -166,24 +166,24 @@ if (isset($_GET['mode']))
'lsave' => $lng['save'],
'pa_link'=>''
);
$skin = array_push_associative($skin, Over::generate_header($lng['lforgot_pass2'], '</a>&gt; <a href="'.$_SERVER['REQUEST_URI'].'" class="navigator">'.$lng['lforgot_pass2']));
$skin = array_push_associative($skin, GenerateHeader($lng['lforgot_pass2'], '</a>&gt; <a href="'.$_SERVER['REQUEST_URI'].'" class="navigator">'.$lng['lforgot_pass2']));
include('./skins/'.$default_skin.'/overall_header.tpl');
include('./skins/'.$default_skin.'/newpass_body.tpl');
$stop = Over::TimeGeneration();
$skin['queries'] = Over::ShowQueries($start, $stop);
$stop = TimeGeneration();
$skin['queries'] = ShowQueries($start, $stop);
include('./skins/'.$default_skin.'/overall_footer.tpl');
break;
}
default:
{
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
message_forum($lng['invalidmode'], 'index.php');
}
}
}
else
{
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
message_forum($lng['invalidmode'], 'index.php');
}
?>

+ 26
- 26
moderate.php View File

@ -11,28 +11,28 @@ define('IN_uF', true);
//include files
include('./config.php');
include('./includes/constants.php');
include('./includes/class_db.php');
include('./includes/class_error.php');
include('./includes/db.php');
include('./includes/errors.php');
//connect to database
DataBase::db_connect();
include('./includes/sessions.php');
include('./includes/class_user.php');
include('./includes/classes/class_user.php');
include('./common.php');
include('./includes/class_overall.php');
include('./includes/misc_functions.php');
include('./includes/classes/secure.php');
include('./includes/class_mod.php');
include('./includes/class_forum.php');
include('./includes/class_topic.php');
include('./lngs/'.Over::DefaultLang().'/main.php');
$start = Over::TimeGeneration();
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
include('./includes/classes/class_mod.php');
include('./includes/classes/class_forum.php');
include('./includes/classes/class_topic.php');
include('./lngs/'.DefaultLang().'/main.php');
$start = TimeGeneration();
SessDelInvalid();
SessRegister();
SessDeleteOld();
if ($_SESSION['uid']>0)
{
if (RANK==0)
{
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
message_forum($lng['is_no_mod'],'index.php');
}
}
@ -48,7 +48,7 @@ switch(trim($_GET['action']))
Secure::topic_exists($tid);
$fid = Topic::TopicInformation($tid,'f_id');
Mod::DeleteTopic($tid);
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
message_forum($lng['tdeleted'], 'forum.php?f='.$fid);
break;
}
@ -57,7 +57,7 @@ switch(trim($_GET['action']))
$tid = intval($_GET['id']);
Secure::topic_exists($tid);
Mod::LockTopic($tid);
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
message_forum($lng['tlocked'], 'topic.php?t='.$tid);
break;
}
@ -66,7 +66,7 @@ switch(trim($_GET['action']))
$tid = intval($_GET['id']);
Secure::topic_exists($tid);
Mod::UnlockTopic($tid);
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
message_forum($lng['tunlocked'], 'topic.php?t='.$tid);
break;
}
@ -80,7 +80,7 @@ switch(trim($_GET['action']))
{
Mod::DeletePost($pid);
}
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
message_forum($lng['pdeleted'],'topic.php?t='.$tid);
break;
}
@ -89,7 +89,7 @@ switch(trim($_GET['action']))
$tid = intval($_GET['id']);
Secure::topic_exists($tid);
Mod::StickTopic($tid,'1');
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
message_forum($lng['tstuck'], 'topic.php?t='.$tid);
break;
}
@ -98,7 +98,7 @@ switch(trim($_GET['action']))
$tid = intval($_GET['id']);
Secure::topic_exists($tid);
Mod::StickTopic($tid,'0');
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
message_forum($lng['tunstuck'], 'topic.php?t='.$tid);
break;
}
@ -114,8 +114,8 @@ switch(trim($_GET['action']))
}
else
{
$start = Over::TimeGeneration();
$default_skin = Over::ViewSkinName();
$start = TimeGeneration();
$default_skin = ViewSkinName();
//add skin variables
$skin = array(
't' => $tid,
@ -124,7 +124,7 @@ switch(trim($_GET['action']))
'L.reset' => $lng['reset'],
'OPTIONS.select_forum' => Forum::AddForums($tid)
);
$skin = array_push_associative($skin, Over::generate_header($lng['move_topic'].': '.Topic::TopicInformation($tid,'name'),'</a><a href="moderate.php?action=move&id='.$tid.'" class="navigator">'
$skin = array_push_associative($skin, GenerateHeader($lng['move_topic'].': '.Topic::TopicInformation($tid,'name'),'</a><a href="moderate.php?action=move&id='.$tid.'" class="navigator">'
.$lng['move_topic'].': </a><a href="topic.php?t='.$tid.'" class="navigator">'
.Topic::TopicInformation($tid,'name')));
if ($_SESSION['uid']>0)
@ -142,8 +142,8 @@ switch(trim($_GET['action']))
{
$skin['pa_link']='';
}
$stop = Over::TimeGeneration();
$skin['queries'] = Over::ShowQueries($start, $stop);
$stop = TimeGeneration();
$skin['queries'] = ShowQueries($start, $stop);
//do it!
include('./skins/'.$default_skin.'/overall_header.tpl');
include('./skins/'.$default_skin.'/move_topic_body.tpl');
@ -156,14 +156,14 @@ switch(trim($_GET['action']))
$pid = intval($_GET['id']);
Secure::post_exists($pid);
Mod::AcceptPost($pid);
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
$tid = Topic::PostInformation($pid,'t_id');
message_forum($lng['post_accepted'], 'topic.php?t='.$tid);
break;
}
default:
{
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
message_forum($lng['invalidmode'],'index.php');
break;
}

+ 16
- 16
pms.php View File

@ -11,29 +11,29 @@ define('IN_uF', true);
//include files
include('./config.php');
include('./includes/constants.php');
include('./includes/class_db.php');
include('./includes/class_error.php');
include('./includes/db.php');
include('./includes/errors.php');
//connect to database
DataBase::db_connect();
include('./includes/sessions.php');
include('./includes/class_user.php');
include('./includes/classes/class_user.php');
include('./common.php');
include('./includes/classes/class_pms.php');
include('./includes/class_overall.php');
include('./includes/class_forum.php');
include('./includes/class_posting.php');
include('./includes/class_topic.php');
include('./includes/misc_functions.php');
include('./includes/classes/class_forum.php');
include('./includes/classes/class_posting.php');
include('./includes/classes/class_topic.php');
include('./includes/classes/secure.php');
include('./lngs/'.Over::DefaultLang().'/main.php');
$start = Over::TimeGeneration();
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
include('./lngs/'.DefaultLang().'/main.php');
$start = TimeGeneration();
SessDelInvalid();
SessRegister();
SessDeleteOld();
//costam
if ($_SESSION['uid']<1)
{
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
message_forum($lng['youarenotlogd'],'login.php?mode=login');
}
foreach ($_POST as $name => $value)
@ -44,7 +44,7 @@ foreach ($_POST as $name => $value)
}
}
$uid = $_SESSION['uid'];
$default_skin = Over::ViewSkinName();
$default_skin = ViewSkinName();
if (isset($_GET['mode']))
{
switch($_GET['mode'])
@ -73,7 +73,7 @@ if (isset($_GET['mode']))
}
default:
{
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
message_forum($lng['invalidmode'],'index.php');
break;
}

+ 22
- 22
posting.php View File

@ -11,24 +11,24 @@ define('IN_uF', true);
//include files
include('./config.php');
include('./includes/constants.php');
include('./includes/class_db.php');
include('./includes/class_error.php');
include('./includes/db.php');
include('./includes/errors.php');
//connect to database
DataBase::db_connect();
include('./includes/sessions.php');
include('./includes/class_user.php');
include('./includes/classes/class_user.php');
include('./common.php');
include('./includes/class_overall.php');
include('./includes/class_forum.php');
include('./includes/class_posting.php');
include('./includes/class_topic.php');
include('./includes/misc_functions.php');
include('./includes/classes/class_forum.php');
include('./includes/classes/class_posting.php');
include('./includes/classes/class_topic.php');
include('./includes/classes/secure.php');
include('./lngs/'.Over::DefaultLang().'/main.php');
$start = Over::TimeGeneration();
$default_skin = Over::ViewSkinName();
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
include('./lngs/'.DefaultLang().'/main.php');
$start = TimeGeneration();
$default_skin = ViewSkinName();
SessDelInvalid();
SessRegister();
SessDeleteOld();
$msg='';
if ($_SESSION['uid']<1)
{
@ -41,7 +41,7 @@ foreach ($_POST as $name => $value)
$_POST[$name] = Secure::UseCensorlist($value);
}
}
$start = Over::TimeGeneration();
$start = TimeGeneration();
//add skin variables
$skin = array(
'smiles'=>Post::SmilesShow(),
@ -54,9 +54,9 @@ $skin = array(
'lsticky_topic'=>$lng['sticky_topic'],
'lwritetopic'=>$lng['writetopic'],
);
$skin = array_push_associative($skin, Over::generate_header('',''));
$stop = Over::TimeGeneration();
$skin['queries'] = Over::ShowQueries($start, $stop);
$skin = array_push_associative($skin, GenerateHeader('',''));
$stop = TimeGeneration();
$skin['queries'] = ShowQueries($start, $stop);
if(RANK=='2')
{
$skin['pa_link']='<a href="admin/index.php" class="fsmall"><b>'.$lng['pa_link'].'</b></a>';
@ -101,7 +101,7 @@ switch(trim($_GET['mode']))
{
$page='';
}
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
message_forum($lng['post_is_saved'],'topic.php?t='.$_GET['t'].$page.'#'.$id);
}
else
@ -161,7 +161,7 @@ switch(trim($_GET['mode']))
{
$page='';
}
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
message_forum($lng['post_is_saved'],'topic.php?t='.Topic::PostInformation(intval($_GET['id']),'t_id').$page.'#p'.$_GET['id']);
}
else
@ -219,7 +219,7 @@ switch(trim($_GET['mode']))
{
$page='';
}
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
message_forum($lng['post_is_saved'],'topic.php?t='.$_GET['id'].$page.'#p'.$id);
}
else
@ -283,7 +283,7 @@ switch(trim($_GET['mode']))
$_POST['topic_sticky']='0';
}
$last = Post::NewTopic($_POST['textedit'],$_POST['ntopic'], intval($_GET['f']), $_SESSION['uid'], $_POST['topic_sticky']);
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
message_forum($lng['post_is_saved'],'topic.php?t='.$last);
}
else
@ -323,7 +323,7 @@ switch(trim($_GET['mode']))
// if no mode... :D
default:
{
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
message_forum($lng['invalidmode'],'index.php');
break;
}

+ 1
- 1
quick_reply.php View File

@ -19,7 +19,7 @@ foreach ($_POST as $name => $value)
}
}
include('./lngs/'.$default_lang.'/quick_reply.php');
include('./includes/class_posting.php');
include('./includes/classes/class_posting.php');
$skin = array(
'ltitle'=>$lng['title'],
'lmsg'=>$lng['message'],

+ 20
- 20
register.php View File

@ -11,28 +11,28 @@ define('IN_uF', true);
//include files
include('./config.php');
include('./includes/constants.php');
include('./includes/class_db.php');
include('./includes/class_error.php');
include('./includes/db.php');
include('./includes/errors.php');
//connect to database
DataBase::db_connect();
include('./includes/sessions.php');
include('./includes/class_user.php');
include('./includes/classes/class_user.php');
include('./common.php');
include('./includes/class_overall.php');
include('./includes/class_forum.php');
include('./includes/class_posting.php');
include('./includes/class_topic.php');
include('./includes/class_email.php');
include('./includes/class_mod.php');
include('./includes/misc_functions.php');
include('./includes/classes/class_forum.php');
include('./includes/classes/class_posting.php');
include('./includes/classes/class_topic.php');
include('./includes/emailer.php');
include('./includes/classes/class_mod.php');
include('./includes/classes/secure.php');
$default_lang = Over::DefaultLang();
$default_lang = DefaultLang();
include('./lngs/'.$default_lang.'/main.php');
include('./lngs/'.$default_lang.'/email.php');
$start = Over::TimeGeneration();
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
$default_skin = Over::ViewSkinName();
$start = TimeGeneration();
SessDelInvalid();
SessRegister();
SessDeleteOld();
$default_skin = ViewSkinName();
$msg='';
if ($_SESSION['uid']>0)
{
@ -67,10 +67,10 @@ if ( ereg ("^.+@.+\..+$", $_POST['email']))
$original_pass = $_POST['password'];
$_POST['password']=md5($_POST['password']);
User::CreateProfile($_POST['nick'],$_POST['password'], $_POST['email'],0,1,0,1,'','','');
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
if ($forum_config['allow_send_email'])
{
Email::SendRegisterEmail();
SendRegisterEmail();
}
message_forum($lng['account_created'],'index.php');
}
@ -147,7 +147,7 @@ $skin = array(
'pa_link'=>''
);
$_POST['allow_gg']='1';
$skin = array_push_associative($skin, Over::generate_header($lng['lregister'],'</a>&gt; <a href="register.php" class="navigator">'.$lng['lregister']));
$skin = array_push_associative($skin, GenerateHeader($lng['lregister'],'</a>&gt; <a href="register.php" class="navigator">'.$lng['lregister']));
if ($msg=='')
{
$msg = './skins/'.$default_skin.'/blank.tpl';
@ -155,7 +155,7 @@ if ($msg=='')
//do it!
include('./skins/'.$default_skin.'/overall_header.tpl');
include('./skins/'.$default_skin.'/register_body.tpl');
$stop = Over::TimeGeneration();
$skin['queries'] = Over::ShowQueries($start, $stop);
$stop = TimeGeneration();
$skin['queries'] = ShowQueries($start, $stop);
include('./skins/'.$default_skin.'/overall_footer.tpl');
?>

+ 17
- 17
search.php View File

@ -11,24 +11,24 @@ define('IN_uF', true);
//include files
include('./config.php');
include('./includes/constants.php');
include('./includes/class_db.php');
include('./includes/class_error.php');
include('./includes/db.php');
include('./includes/errors.php');
//connect to database
DataBase::db_connect();
include('./includes/sessions.php');
include('./includes/class_user.php');
include('./includes/classes/class_user.php');
include('./common.php');
include('./includes/class_overall.php');
include('./includes/class_forum.php');
include('./includes/class_topic.php');
include('./includes/misc_functions.php');
include('./includes/classes/class_forum.php');
include('./includes/classes/class_topic.php');
include('./includes/classes/secure.php');
$default_lang = Over::DefaultLang();
$default_lang = DefaultLang();
include('./lngs/'.$default_lang.'/main.php');
$start = Over::TimeGeneration();
$default_skin = Over::ViewSkinName();
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
$start = TimeGeneration();
$default_skin = ViewSkinName();
SessDelInvalid();
SessRegister();
SessDeleteOld();
$sql = "SELECT ".POSTS_TABLE.".*, ".USERS_TABLE.".* FROM ".POSTS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".USERS_TABLE.".u_id = ".POSTS_TABLE.".u_id ORDER BY `ptime`";
$query = DataBase::sql_query($sql,'GENERAL', 'Could not obtain amout of posts in forum');
while($result = @mysql_fetch_array($query))
@ -175,7 +175,7 @@ if ((isset($_POST['keywords'])) || ($_GET['content']=='lastposts') || ($_GET['co
'ltopicname'=>$lng['ltopicname'],
'lang'=> $default_lang
);
$skin = array_push_associative($skin,Over::generate_header($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.'/forum_body.tpl');
$query = DataBase::sql_query($sql,'GENERAL', 'Could not obtain topics information');
@ -211,7 +211,7 @@ if ((isset($_POST['keywords'])) || ($_GET['content']=='lastposts') || ($_GET['co
else
{
$skin = array(
'option_pages' => Over::AddPages(),
'option_pages' => AddPages(),
'lwith' => $lng['with'],
'lpage' => $lng['page'],
'lpages' => $count,
@ -230,7 +230,7 @@ else
);
$window_title = $lng['lsearch'];
$navigator_title = '</a>&gt; <a href="'.$_SERVER['REQUEST_URI'].'" class="navigator">'.$lng['lsearch'];
$skin = array_push_associative($skin,Over::generate_header($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.'/search_body.tpl');
}
@ -249,7 +249,7 @@ else
{
$skin['pa_link']='';
}
$stop = Over::TimeGeneration();
$skin['queries'] = Over::ShowQueries($start, $stop);
$stop = TimeGeneration();
$skin['queries'] = ShowQueries($start, $stop);
include('./skins/'.$default_skin.'/overall_footer.tpl');
?>

+ 1
- 1
shoutbox.php View File

@ -65,7 +65,7 @@ while($sb_msg = @mysql_fetch_array($query))
$shoutbox_content .= '
<tr>
<td class="fitem" height="7">
'.$allow_del.'<a href="user.php?id='.$sb_msg['u_id'].'" class="fsmall">'.Topic::UserName($sb_msg['nick'], $sb_msg['rank']).'</a><span class="fsmall"><b> ['.Over::GenerateTime($sb_msg['mtime']).']</b>: '.$sb_msg['message'].'</span>
'.$allow_del.'<a href="user.php?id='.$sb_msg['u_id'].'" class="fsmall">'.Topic::UserName($sb_msg['nick'], $sb_msg['rank']).'</a><span class="fsmall"><b> ['.GenerateTime($sb_msg['mtime']).']</b>: '.$sb_msg['message'].'</span>
</td>
</tr>';
}

+ 19
- 19
topic.php View File

@ -11,28 +11,28 @@ define('IN_uF', true);
//include files
include('./config.php');
include('./includes/constants.php');
include('./includes/class_db.php');
include('./includes/class_error.php');
include('./includes/db.php');
include('./includes/errors.php');
//connect to database
DataBase::db_connect();
include('./includes/sessions.php');
include('./includes/class_user.php');
include('./includes/classes/class_user.php');
include('./common.php');
include('./includes/class_overall.php');
include('./includes/class_forum.php');
include('./includes/class_topic.php');
include('./includes/class_mod.php');
include('./includes/misc_functions.php');
include('./includes/classes/class_forum.php');
include('./includes/classes/class_topic.php');
include('./includes/classes/class_mod.php');
include('./includes/classes/secure.php');
$default_lang = Over::DefaultLang();
$default_lang = DefaultLang();
include('./lngs/'.$default_lang.'/main.php');
$tid = intval($_GET['t']);
$start = Over::TimeGeneration();
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
$default_skin = Over::ViewSkinName();
$start = TimeGeneration();
SessDelInvalid();
SessRegister();
SessDeleteOld();
$default_skin = ViewSkinName();
include('./includes/cache/cache_topic.php');
$forum_locked = $forum['lock'];
@ -47,7 +47,7 @@ $skin = array(
onMouseOut="this.src=\'skins/'.$default_skin.'/images/lng_'.$default_lang.'/reply.gif\'" border="0" alt="reply"></a>'
);
$skin = array_push_associative($skin, Over::generate_header($lng['showtopic'].': '.$topic['name'], '</a>&gt; <a href="forum.php?f='.$fid.'" class="navigator">'.$forum['name'].'</a> &gt; <a href="'.$_SERVER['REQUEST_URI'].'" class="navigator">'.$topic['name']));
$skin = array_push_associative($skin, GenerateHeader($lng['showtopic'].': '.$topic['name'], '</a>&gt; <a href="forum.php?f='.$fid.'" class="navigator">'.$forum['name'].'</a> &gt; <a href="'.$_SERVER['REQUEST_URI'].'" class="navigator">'.$topic['name']));
//do it!
include('./skins/'.$default_skin.'/overall_header.tpl');
@ -57,7 +57,7 @@ $sql = "SELECT ".POSTS_TABLE.".*, ".USERS_TABLE.".*, ".USERS_TABLE.".u_id AS use
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain post information.');
while($item=mysql_fetch_array($query))
{
$ua = Over::user_agent($item['user_agent']);
$ua = UserAgent($item['user_agent']);
$warn_pool = ($forum_config['allow_warns'] && $forum_config['warns_in_topic'] ) ? (isset($user_warnlevel[$item['u_id']])) ?
'<a href="warns.php?mode=view&amp;id='.$item['u_id'].'" class="fsmall">'.$lng['warns'].'</a>:
<font color="red"><b>'.($user_warnlevel[$item['u_id']]*10).'%</b></span>' : '<a href="warns.php?mode=view&amp;id='.$item['u_id'].'" class="fsmall">'.$lng['warns'].'</a>:
@ -67,7 +67,7 @@ while($item=mysql_fetch_array($query))
'p_id' => $item['p_id'],
'u_id' => $item['user_id'],
'username' => Topic::UserName($item['nick'], $item['rank']),
'pdate' => Over::GenerateTime($item['ptime']),
'pdate' => GenerateTime($item['ptime']),
'user_gg' => (($item['allow_gg'])&& ($item['gg']!='0')) ?
'<a href="gg:'.$item['gg'].'"><img border="0" src="skins/'.$default_skin.'/images/gg_small.gif"
alt="gg" onMouseOver="this.style.cursor=\'hand\'; this.src=\'skins/'.$default_skin.'/images/gg_small_active.gif\'"
@ -129,7 +129,7 @@ $skin = array(
alt="stick"></a>',
'lmod' => $lng['lmod'],
'c_delete_topic'=>$lng['c_delete_topic'],
'option_pages'=>Over::AddPages(),
'option_pages'=>AddPages(),
'lwith'=>$lng['with'],
'lpage'=>$lng['page'],
'lpages'=>$count
@ -160,7 +160,7 @@ else
{
$skin['pa_link']='';
}
$stop = Over::TimeGeneration();
$skin['queries'] = Over::ShowQueries($start, $stop);
$stop = TimeGeneration();
$skin['queries'] = ShowQueries($start, $stop);
include('./skins/'.$default_skin.'/overall_footer.tpl');
?>

+ 14
- 14
user.php View File

@ -11,23 +11,23 @@ define('IN_uF', true);
//include files
include('./config.php');
include('./includes/constants.php');
include('./includes/class_db.php');
include('./includes/class_error.php');
include('./includes/db.php');
include('./includes/errors.php');
//connect to database
DataBase::db_connect();
include('./includes/sessions.php');
include('./includes/class_user.php');
include('./includes/classes/class_user.php');
include('./common.php');
include('./includes/class_overall.php');
include('./includes/class_forum.php');
include('./includes/misc_functions.php');
include('./includes/classes/class_forum.php');
include('./includes/classes/secure.php');
$default_lang = Over::DefaultLang();
$default_lang = DefaultLang();
include('./lngs/'.$default_lang.'/main.php');
$start = Over::TimeGeneration();
$default_skin = Over::ViewSkinName();
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
$start = TimeGeneration();
$default_skin = ViewSkinName();
SessDelInvalid();
SessRegister();
SessDeleteOld();
$uid = intval($_GET['id']);
//check online for user
$sql = "SELECT `s_id`, `u_id`, `time` FROM ".SESSIONS_TABLE." WHERE `u_id`='$uid' AND time+1250>".time()." LIMIT 1";
@ -97,7 +97,7 @@ $skin = array(
'user_email'=>($user_info['allow_email']=='1') ? '<a href="mailto:'.$user_info['email'].'"><img border="0" src="skins/'.$default_skin.'/images/email.gif" onMouseOver="this.style.cursor=\'hand\'; this.src=\'skins/'.$default_skin.'/images/email_active.gif\'"
onMouseOut="this.src=\'skins/'.$default_skin.'/images/email.gif\'" alt="email"></a>' : '',
);
$skin = array_push_associative($skin,Over::generate_header($lng['showprofile'].': '.$user_info['nick'], '</a>&gt; <a href="user.php?id='.$_GET['id'].'" class="navigator">'.$lng['showprofile'].': '.$user_info['nick']));
$skin = array_push_associative($skin,GenerateHeader($lng['showprofile'].': '.$user_info['nick'], '</a>&gt; <a href="user.php?id='.$_GET['id'].'" class="navigator">'.$lng['showprofile'].': '.$user_info['nick']));
//do it!
include('./skins/'.$default_skin.'/overall_header.tpl');
include('./skins/'.$default_skin.'/user_body.tpl');
@ -116,7 +116,7 @@ else
{
$skin['pa_link']='';
}
$stop = Over::TimeGeneration();
$skin['queries'] = Over::ShowQueries($start, $stop);
$stop = TimeGeneration();
$skin['queries'] = ShowQueries($start, $stop);
include('./skins/'.$default_skin.'/overall_footer.tpl');
?>

+ 16
- 16
users.php View File

@ -11,22 +11,22 @@ define('IN_uF', true);
//include files
include('./config.php');
include('./includes/constants.php');
include('./includes/class_db.php');
include('./includes/class_error.php');
include('./includes/db.php');
include('./includes/errors.php');
//connect to database
DataBase::db_connect();
include('./includes/sessions.php');
include('./includes/class_user.php');
include('./includes/classes/class_user.php');
include('./common.php');
include('./includes/class_topic.php');
include('./includes/class_overall.php');
include('./includes/class_forum.php');
$start = Over::TimeGeneration();
include('./lngs/'.Over::DefaultLang().'/main.php');
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
$default_skin = Over::ViewSkinName();
include('./includes/classes/class_topic.php');
include('./includes/misc_functions.php');
include('./includes/classes/class_forum.php');
$start = TimeGeneration();
include('./lngs/'.DefaultLang().'/main.php');
SessDelInvalid();
SessRegister();
SessDeleteOld();
$default_skin = ViewSkinName();
//
//generate output pages
//
@ -162,7 +162,7 @@ $skin = array(
'luname'=>$lng['user_name'],
'lgo'=>$lng['lgo']
);
$skin = array_push_associative($skin, Over::generate_header($lng['lusers'],'</a>&gt; <a href="users.php" class="navigator">'.$lng['lusers']));
$skin = array_push_associative($skin, GenerateHeader($lng['lusers'],'</a>&gt; <a href="users.php" class="navigator">'.$lng['lusers']));
//do it!
include('./skins/'.$default_skin.'/overall_header.tpl');
include('./skins/'.$default_skin.'/users_body.tpl');
@ -202,7 +202,7 @@ while($result = mysql_fetch_array($query))
include('./skins/'.$default_skin.'/users_item_add_body.tpl');
}
$skin = array(
'option_pages'=>Over::AddPages(),
'option_pages'=>AddPages(),
'lwith'=>$lng['with'],
'lpage'=>$lng['page'],
'lpages'=>$count
@ -223,7 +223,7 @@ else
{
$skin['pa_link']='';
}
$stop = Over::TimeGeneration();
$skin['queries'] = Over::ShowQueries($start, $stop);
$stop = TimeGeneration();
$skin['queries'] = ShowQueries($start, $stop);
include('./skins/'.$default_skin.'/overall_footer.tpl');
?>

+ 20
- 20
warns.php View File

@ -11,23 +11,23 @@ define('IN_uF', true);
//include files
include('./config.php');
include('./includes/constants.php');
include('./includes/class_db.php');
include('./includes/class_error.php');
include('./includes/db.php');
include('./includes/errors.php');
//connect to database
DataBase::db_connect();
include('./includes/sessions.php');
include('./includes/class_user.php');
include('./includes/classes/class_user.php');
include('./common.php');
include('./includes/class_overall.php');
include('./includes/class_topic.php');
include('./includes/class_posting.php');
include('./includes/class_forum.php');
include('./includes/misc_functions.php');
include('./includes/classes/class_topic.php');
include('./includes/classes/class_posting.php');
include('./includes/classes/class_forum.php');
include('./includes/classes/secure.php');
include('./lngs/'.Over::DefaultLang().'/main.php');
$start = Over::TimeGeneration();
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
include('./lngs/'.DefaultLang().'/main.php');
$start = TimeGeneration();
SessDelInvalid();
SessRegister();
SessDeleteOld();
foreach ($_POST as $name => $value)
{
if ($forum_config['use_censorlist'])
@ -40,7 +40,7 @@ if (!$forum_config['allow_warns'])
message_forum($lng['warns_disabled'],'index.php');
}
$default_skin = Over::ViewSkinName();
$default_skin = ViewSkinName();
switch(trim($_GET['mode']))
{
@ -60,7 +60,7 @@ switch(trim($_GET['mode']))
{
$_POST['textedit'] = Secure::TagsReplace($_POST['textedit']);
User::UserAddWarn($_GET['id'],$_POST['value'] ,addslashes(strip_tags($_POST['textedit'])));
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
message_forum($lng['warn_is_added'],'warns.php?mode=view&amp;id='.$_GET['id']);
}
else
@ -100,9 +100,9 @@ switch(trim($_GET['mode']))
'lreset'=>$lng['reset'],
'lwarn'=>$lng['warn'],
'lall_warns'=>$lng['all_warns'],
'queries'=>Over::ShowQueries($start, Over::TimeGeneration())
'queries'=>ShowQueries($start, TimeGeneration())
);
$skin = array_push_associative($skin, Over::generate_header($lng['add_warn'].': '.$nick_name,'</a>&gt; <a href="warns.php?mode=add&amp;id='.$uid.'" class="navigator">'.$lng['add_warn'].': '.$nick_name));
$skin = array_push_associative($skin, GenerateHeader($lng['add_warn'].': '.$nick_name,'</a>&gt; <a href="warns.php?mode=add&amp;id='.$uid.'" class="navigator">'.$lng['add_warn'].': '.$nick_name));
if(User::UserInformation($_SESSION['uid'],'rank')=='2')
{
$skin['pa_link']='<a href="admin/index.php" class="fsmall"><b>'.$lng['pa_link'].'</b></a>';
@ -131,7 +131,7 @@ switch(trim($_GET['mode']))
'lvalue' => $lng['value'],
'lmotive' => $lng['motive']
);
$skin = array_push_associative($skin, Over::generate_header($lng['show_warns'].': '.$user['nick'],'</a>&gt; <a href="warns.php?mode=view&amp;id='.$uid.'" class="navigator">'.$lng['show_warns'].': '.$user['nick']));
$skin = array_push_associative($skin, GenerateHeader($lng['show_warns'].': '.$user['nick'],'</a>&gt; <a href="warns.php?mode=view&amp;id='.$uid.'" class="navigator">'.$lng['show_warns'].': '.$user['nick']));
include('./skins/'.$default_skin.'/overall_header.tpl');
include('./skins/'.$default_skin.'/warns_view_body.tpl');
$sql = "SELECT * FROM `".WARNINGS_TABLE."` WHERE `u_id`='$uid'";
@ -147,11 +147,11 @@ switch(trim($_GET['mode']))
include('./skins/'.$default_skin.'/warns_view_item_body.tpl');
$warns_count = ($item['value']=='+') ? $warns_count + 1 : $warns_count -1;
}
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
$skin = array(
'lall_warns'=>$lng['all_warns'],
'all_warns'=>($warns_count>0) ? '<span class="fstandard" style="color: "red"><b>'.($warns_count*10).'%</b></span>' : '<span class="fstandard" style="color: green"><b>'.$warns_count.'%</b></span>',
'queries'=>Over::ShowQueries($start, $stop)
'queries'=>ShowQueries($start, $stop)
);
$user_rank = ($_SESSION['uid']>0) ? RANK : 0;
if ($user_rank>0)
@ -184,7 +184,7 @@ switch(trim($_GET['mode']))
}
default:
{
$stop = Over::TimeGeneration();
$stop = TimeGeneration();
message_forum($lng['invalidmode'],'index.php');
break;
}

Loading…
Cancel
Save