A lightweight forum engine written in PHP. Repository is now obsolete and read-only. http://www.pioder.pl/uforum.html
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
2.4 KiB

  1. <?php
  2. /**
  3. * @package uForum
  4. * @file includes/admin/class_main.php
  5. * @version $Id$
  6. * @copyright 2009(c) PioDer <pioder@wp.pl>
  7. * @link http://pioder.gim2przemysl.int.pl/
  8. * @license GNU GPL v3
  9. **/
  10. if ( !defined('IN_uF') )
  11. {
  12. die('Hacking attempt');
  13. }
  14. class Admin_Over
  15. {
  16. function ListPages($page, $count = 50)//for edit profile, not used in limit!
  17. {
  18. $content = '';
  19. for ($i=1;$i<=$count;$i++)
  20. {
  21. if ($i==$page)
  22. {
  23. $content .= '<option value="'.$i.'" selected="selected">'.$i.'</option>';
  24. }
  25. else
  26. {
  27. $content .= '<option value="'.$i.'">'.$i.'</option>';
  28. }
  29. }
  30. return $content;
  31. unset($content);
  32. }
  33. function ListDir($dir, $selection)
  34. {
  35. $result='';
  36. $rep=opendir('./../'.$dir);
  37. while ($file = readdir($rep))
  38. {
  39. if($file != '..' && $file !='.' && $file !='' && $file[0] != '.')
  40. {
  41. if (is_dir('./../'.$dir.'/'.$file)){
  42. if ($file==$selection)
  43. {
  44. $result .='<option value="'.$file.'" selected="selected">'.$file.'</option>';
  45. }
  46. else
  47. {
  48. $result .='<option value="'.$file.'">'.$file.'</option>';
  49. }
  50. }
  51. }
  52. }
  53. return $result;
  54. unset($rep, $file, $result);
  55. }
  56. function DefaultLang()
  57. {
  58. global $forum_config;
  59. if ($_SESSION['uid']>0)
  60. {
  61. return User::UserInformation($_SESSION['uid'],'lang');
  62. }
  63. else
  64. {
  65. return $forum_config['defaultlang'];
  66. }
  67. }
  68. function TotalTopics()
  69. {
  70. $sql = "SELECT `t_id` FROM ".TOPICS_TABLE.";";
  71. $query = DataBase::sql_query($sql,GENERAL,'Could not obtain total posts information');
  72. $result = DataBase::num_rows($query);
  73. return($result);
  74. }
  75. function TotalPosts()
  76. {
  77. $sql = "SELECT `p_id` FROM ".POSTS_TABLE.";";
  78. $query = DataBase::sql_query($sql,GENERAL,'Could not obtain total posts information');
  79. $result = DataBase::num_rows($query);
  80. return($result);
  81. }
  82. function GenerateHeader()
  83. {
  84. global $default_skin;
  85. global $lng;
  86. echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  87. <head>
  88. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  89. <link rel="shortcut icon" href="skins/'.$default_skin.'/images/favicon.ico">
  90. <link rel="favicon" href="template/images/favicon.ico">
  91. <link rel="stylesheet" href="template/skin.css" type="text/css">
  92. <title>DSF Administration</title>
  93. </head>
  94. <body class="body">';
  95. }
  96. }
  97. ?>