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.

107 lines
2.8 KiB

  1. <?
  2. /**
  3. * @package uForum
  4. * @file admin/forum_info.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. define('IN_uF', true);
  11. //include files
  12. include('./../config.php');
  13. include('./../includes/constants.php');
  14. include('./../includes/class_db.php');
  15. include('./../includes/class_error.php');
  16. //connect to database
  17. DataBase::db_connect();
  18. include('./../includes/sessions.php');
  19. include('./../includes/class_user.php');
  20. include('./../common.php');
  21. include('./../includes/admin/class_main.php');
  22. include('./../includes/class_forum.php');
  23. include('./../lngs/'.Admin_Over::DefaultLang().'/admin.php');
  24. sess_del_invalid($_SESSION['uid']);
  25. sess_register($_SESSION['uid']);
  26. sess_delete_old();
  27. if (User::UserInformation($_SESSION['uid'],'rank')!=2)
  28. {
  29. admin_message_forum($lng['yournotadmin'],'../index.php');
  30. }
  31. //check script version...
  32. $errno = 0;
  33. $errstr = '';
  34. $version = '';
  35. if ($open = @fsockopen('pioder.gim2przemysl.int.pl', 80, $errno, $errstr, 10))
  36. {
  37. @fputs($open, "GET /updates.php?app=dsf HTTP/1.1\r\n");
  38. @fputs($open, "HOST: pioder.gim2przemysl.int.pl\r\n");
  39. @fputs($open, "Connection: close\r\n\r\n");
  40. $get_info = false;
  41. while (!@feof($open))
  42. {
  43. if ($get_info)
  44. {
  45. $version .= @fread($open, 1024);
  46. }
  47. else
  48. {
  49. if (@fgets($open, 1024) == "\r\n")
  50. {
  51. $get_info = true;
  52. }
  53. }
  54. }
  55. @fclose($open);
  56. if ($version==VERSION)
  57. {
  58. $result = $lng['noupdates'];
  59. }
  60. else
  61. {
  62. $result = $lng['updatenow'];
  63. }
  64. }
  65. else
  66. {
  67. echo '
  68. <table width="'.TABLES_WIDTH.'" class="maintable" align="center">
  69. <tr>
  70. <td class="fstandard">
  71. <font color="red"><b>Could not connect to script server. Server is unavailable.</b></font>
  72. </td>
  73. </tr>
  74. </table>';
  75. $result = $lng['noupdates'];
  76. }
  77. unset($addr,$open, $version, $get_info, $errstr, $errno);
  78. //add skin variables
  79. $skin = array(
  80. 'dsf_pa'=>$lng['dsf_pa'],
  81. 'index'=>$lng['index'],
  82. 'gotoforum'=>$lng['go_to_forum'],
  83. 'scriptstat'=>$lng['scriptstat'],
  84. 'scriptoptions'=>$lng['scriptconfig'],
  85. 'admin_forums'=>$lng['admin_forums'],
  86. 'admin_groups'=>$lng['admin_groups'],
  87. 'admin_users'=>$lng['admin_users'],
  88. 'admin_banlist'=>$lng['admin_banlist'],
  89. 'main_beam'=>$lng['pa_mainpage'],
  90. 'L.forum_stats'=>$lng['forum_stats'],
  91. 'L.install_date'=>$lng['forum_installed'],
  92. 'L.topics'=>$lng['topics'],
  93. 'L.posts'=>$lng['posts'],
  94. 'L.script_version'=>$lng['scriptversion'],
  95. 'L.updates'=>$lng['updates'],
  96. 'install_date'=>date('d-m-Y, G:i',$forum_config['date_install']),
  97. 'topics'=>Admin_Over::TotalTopics(),
  98. 'posts'=>Admin_Over::TotalPosts(),
  99. 'updates'=>$result,
  100. 'L.welcome_pa'=>$lng['pa_welcome']
  101. );
  102. //do it!
  103. Admin_Over::GenerateHeader();
  104. include('./template/index_body.tpl');
  105. include('./template/overall_footer.tpl');
  106. ?>