+ Deleted skins table - obtaining skin information from skins/ catalog

+ Renamed AddPages to ListPages and rewrited function.
+ Removed AddPages2, AddLangs, Admin_Over::ViewSkinName()
+ Created ListDir() function

git-svn-id: https://svn.pioder.pl/uf-svn/uF@34 72ec579a-5ced-4fa4-82f3-afba5d98df2f
This commit is contained in:
pioder
2009-07-28 13:38:31 +00:00
parent 92e90cd55f
commit 9c75d445b0
14 changed files with 50 additions and 163 deletions

View File

@@ -12,51 +12,11 @@ if ( !defined('IN_uF') )
die('Hacking attempt');
}
class Admin_Over
{
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 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 = DataBase::fetch($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 AddPages2($page)//for edit profile, not used in limit!
{
function ListPages($page, $count = 50)//for edit profile, not used in limit!
{
$content = '';
for ($i=1;$i<=50;$i++)
for ($i=1;$i<=$count;$i++)
{
if ($i==$page)
{
@@ -70,20 +30,17 @@ class Admin_Over
return $content;
unset($content);
}
function AddLangs()
function ListDir($dir, $selection)
{
global $forum_config;
global $default_lang;
$result='';
$cat=opendir('./../lngs');
$notempty = false;
while ($file = readdir($cat))
{
if($file != '..' && $file !='.' && $file !='')
$rep=opendir('./../'.$dir);
while ($file = readdir($rep))
{
if($file != '..' && $file !='.' && $file !='' && $file[0] != '.')
{
if (is_dir('./../lngs/'.$file)){
$notempty = true;
if ($file==$default_lang)
if (is_dir('./../'.$dir.'/'.$file)){
if ($file==$selection)
{
$result .='<option value="'.$file.'" selected="selected">'.$file.'</option>';
}
@@ -95,26 +52,9 @@ class Admin_Over
}
}
return $result;
unset($cat, $notempty, $file, $result);
}
function ViewSkinName()
{
global $forum_config;
if ($_SESSION['uid']>0)
{
$result = User::UserInformation($_SESSION['uid'],'skin');
$sql = "SELECT * FROM `".SKINS_TABLE."` WHERE `s_id`='$result'";
$result = DataBase::fetch(DataBase::sql_query($sql,CRITICAL,'Could not obtain skin information.'));
return $result['name'];
}
else
{
$result = $forum_config['defaultskin'];
$sql = "SELECT * FROM `".SKINS_TABLE."` WHERE `s_id`='$result'";
$result = DataBase::fetch(DataBase::sql_query($sql,CRITICAL,'Could not obtain skin information.'));
return $result['name'];
}
unset($rep, $file, $result);
}
function DefaultLang()
{
global $forum_config;