<?php
|
|
/**
|
|
* @package uForum
|
|
* @file install/functions_add.php
|
|
* @version $Id$
|
|
* @copyright 2007-2010 (c) PioDer <[email protected]>
|
|
* @link http://www.pioder.pl//
|
|
* @license see LICENSE.txt
|
|
**/
|
|
if (!defined('IN_uF'))
|
|
{
|
|
die('Hacking attempt');
|
|
}
|
|
//functions installer
|
|
function alert($msg)
|
|
{
|
|
echo '<script language="JavaScript">window.alert(\''.$msg.'\');</script>';
|
|
}
|
|
function check_size_md5($file)
|
|
{
|
|
if ( file_exists($file) )
|
|
{
|
|
$result = @filesize($file);
|
|
return md5($result);
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
function AddLangs($default)
|
|
{
|
|
$result='';
|
|
$rep=opendir('./../lngs');
|
|
while ($file = readdir($rep))
|
|
{
|
|
if($file != '..' && $file !='.' && $file !='')
|
|
{
|
|
if (is_dir('./../lngs/'.$file)){
|
|
if (($file=='Polish') and $default){
|
|
$result .='<option selected="selected" value="'.$file.'">'.$file.'</option>';
|
|
} else {
|
|
$result .='<option value="'.$file.'">'.$file.'</option>';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return $result;
|
|
unset($rep, $file, $result);
|
|
}
|
|
function AddPages2($page)//for admin script, 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);
|
|
}
|
|
?>
|