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.

68 lines
1.4 KiB

  1. <?php
  2. /**
  3. * @package uForum
  4. * @file install/functions_add.php
  5. * @version $Id$
  6. * @copyright 2007-2010 (c) PioDer <pioder@wp.pl>
  7. * @link http://www.pioder.pl//
  8. * @license see LICENSE.txt
  9. **/
  10. if (!defined('IN_uF'))
  11. {
  12. die('Hacking attempt');
  13. }
  14. //functions installer
  15. function alert($msg)
  16. {
  17. echo '<script language="JavaScript">window.alert(\''.$msg.'\');</script>';
  18. }
  19. function check_size_md5($file)
  20. {
  21. if ( file_exists($file) )
  22. {
  23. $result = @filesize($file);
  24. return md5($result);
  25. }
  26. else
  27. {
  28. return false;
  29. }
  30. }
  31. function AddLangs($default)
  32. {
  33. $result='';
  34. $rep=opendir('./../lngs');
  35. while ($file = readdir($rep))
  36. {
  37. if($file != '..' && $file !='.' && $file !='')
  38. {
  39. if (is_dir('./../lngs/'.$file)){
  40. if (($file=='Polish') and $default){
  41. $result .='<option selected="selected" value="'.$file.'">'.$file.'</option>';
  42. } else {
  43. $result .='<option value="'.$file.'">'.$file.'</option>';
  44. }
  45. }
  46. }
  47. }
  48. return $result;
  49. unset($rep, $file, $result);
  50. }
  51. function AddPages2($page)//for admin script, not used in limit!
  52. {
  53. $content = '';
  54. for ($i=1;$i<=50;$i++)
  55. {
  56. if ($i==$page)
  57. {
  58. $content .= '<option value="'.$i.'" selected="selected">'.$i.'</option>';
  59. }
  60. else
  61. {
  62. $content .= '<option value="'.$i.'">'.$i.'</option>';
  63. }
  64. }
  65. return $content;
  66. unset($content);
  67. }
  68. ?>