+ 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:
@@ -25,7 +25,6 @@ include('./../lngs/'.Admin_Over::DefaultLang().'/admin.php');
|
||||
SessDelInvalid();
|
||||
SessRegister();
|
||||
SessDeleteOld();
|
||||
//$default_skin = Admin_Over::ViewSkinName();
|
||||
if (User::UserInformation($_SESSION['uid'],'rank')!=2)
|
||||
{
|
||||
admin_message_forum($lng['yournotadmin'],'../index.php');
|
||||
|
||||
@@ -334,10 +334,10 @@ $skin = array(
|
||||
'forum_disabled'=>$forum_config['disable_forum'],
|
||||
'L.default_skin'=>$lng['default_skin'],
|
||||
'L2.default_skin'=>$lng['select_skin'],
|
||||
'OPTIONS.default_skin'=>AddSkins(),
|
||||
'OPTIONS.default_skin'=>ListDir('skins', $forum_config['default_skin']),
|
||||
'L.default_lang'=>$lng['default_lang'],
|
||||
'L2.default_lang'=>$lng['select_lang'],
|
||||
'OPTIONS.default_lang'=>AddLangs(),
|
||||
'OPTIONS.default_lang'=>ListDir('lngs', $forum_config['default_lang']),
|
||||
'L.meta_keywords'=>$lng['meta_keywords'],
|
||||
'meta_keywords'=>$forum_config['meta_keywords'],
|
||||
'L.meta_description'=>$lng['meta_description'],
|
||||
@@ -361,12 +361,12 @@ $skin = array(
|
||||
'OPTION.allow_upload_avatars'=>($forum_config['allow_upload_avatars']) ? 'checked="checked"' : '',
|
||||
'L.select_value'=>$lng['select_value'],
|
||||
'L.limit_users'=>$lng['limit_users'],
|
||||
'OPTIONS.limit_users'=>AddPages2($forum_config['limit_users']),
|
||||
'OPTIONS.limit_users'=>ListPages($forum_config['limit_users']),
|
||||
'L.posts_in_topic'=>$lng['limit_posts'],
|
||||
'L.scriptoptions'=>$lng['scriptconfig'],
|
||||
'OPTIONS.limit_tpid'=>AddPages2($forum_config['limit_tpid']),
|
||||
'OPTIONS.limit_tpid'=>ListPages($forum_config['limit_tpid']),
|
||||
'L.topics_in_forum'=>$lng['limit_topics'],
|
||||
'OPTIONS.limit_ftid'=>AddPages2($forum_config['limit_ftid']),
|
||||
'OPTIONS.limit_ftid'=>ListPages($forum_config['limit_ftid']),
|
||||
'L.admin_mod'=>$lng['admin_mod_preferences'],
|
||||
'L.shoutbox'=>$lng['shoutbox_preferences'],
|
||||
'L.allow_shoutbox'=>$lng['allow_shoutbox'],
|
||||
|
||||
@@ -201,7 +201,6 @@ switch($_GET['mode'])
|
||||
{
|
||||
admin_message_forum($lng['no_user'],'admin_users.php?mode=view');
|
||||
}
|
||||
$default_skin = Admin_Over::ViewSkinName();
|
||||
//add skin variables
|
||||
$skin = array(
|
||||
//labels profile
|
||||
@@ -221,11 +220,11 @@ switch($_GET['mode'])
|
||||
'lovpr'=>$lng['general_settings'],
|
||||
'L.select_value'=>$lng['select_value'],
|
||||
'L.limit_users'=>$lng['limit_users'],
|
||||
'OPTIONS.limit_users'=>Admin_Over::AddPages2($userinfo['limit_users']),
|
||||
'OPTIONS.limit_users'=>Admin_Over::ListPages($userinfo['limit_users']),
|
||||
'L.posts_in_topic'=>$lng['limit_posts'],
|
||||
'OPTIONS.limit_tpid'=>Admin_Over::AddPages2($userinfo['limit_tpid']),
|
||||
'OPTIONS.limit_tpid'=>Admin_Over::ListPages($userinfo['limit_tpid']),
|
||||
'L.topics_in_forum'=>$lng['limit_topics'],
|
||||
'OPTIONS.limit_ftid'=>Admin_Over::AddPages2($userinfo['limit_ftid']),
|
||||
'OPTIONS.limit_ftid'=>Admin_Over::ListPages($userinfo['limit_ftid']),
|
||||
'lupr'=>$lng['profile_settings'],
|
||||
'lspr'=>$lng['signature_settings'],
|
||||
'ladmpr'=>$lng['admin_settings'],
|
||||
@@ -234,10 +233,10 @@ switch($_GET['mode'])
|
||||
'lposts'=>$lng['posts'],
|
||||
'posts'=>$userinfo['posts'],
|
||||
'ldefault_lang'=>$lng['default_lang'],
|
||||
'default_lang'=>Admin_Over::AddLangs(),
|
||||
'default_lang'=>Admin_Over::ListDir('lngs', $userinfo['default_lang']),
|
||||
'l2default_lang'=>$lng['select_lang'],
|
||||
'ldefault_skin'=>$lng['default_skin2'],
|
||||
'default_skin'=>Admin_Over::AddSkins(),
|
||||
'default_skin'=>Admin_Over::ListDir('skins', $userinfo['default_skin']),
|
||||
'l2default_skin'=>$lng['select_skin'],
|
||||
'lapr'=>$lng['avatar_settings'],
|
||||
'lsubmit'=>$lng['save'],
|
||||
@@ -442,7 +441,7 @@ switch($_GET['mode'])
|
||||
include('./template/user_item_add_body.tpl');
|
||||
}
|
||||
$skin = array(
|
||||
'option_pages'=>Admin_Over::AddPages(),
|
||||
'option_pages'=>Admin_Over::ListPages($page, $count),
|
||||
'lwith'=>$lng['with'],
|
||||
'lpage'=>$lng['page'],
|
||||
'lpages'=>$count
|
||||
|
||||
@@ -21,7 +21,6 @@ include('./../common.php');
|
||||
include('./../includes/admin/class_main.php');
|
||||
include('./../includes/classes/class_forum.php');
|
||||
include('./../lngs/'.Admin_Over::DefaultLang().'/admin.php');
|
||||
$default_skin = Admin_Over::ViewSkinName();
|
||||
SessDelInvalid();
|
||||
SessRegister();
|
||||
SessDeleteOld();
|
||||
@@ -33,8 +32,8 @@ echo '
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link rel="shortcut icon" href="../skins/'.$default_skin.'/images/favicon.ico">
|
||||
<link rel="favicon" href="../skins/'.$default_skin.'/images/favicon.ico">
|
||||
<link rel="shortcut icon" href="../images/favicon.ico">
|
||||
<link rel="favicon" href="../images/favicon.ico">
|
||||
<title>µForum ACP</title>
|
||||
<frameset rows="90,*" border="2" framespacing="0" frameborder="yes">
|
||||
<frame src="header.php" name="nav" marginheight="3" scrolling="no">
|
||||
|
||||
@@ -13,6 +13,6 @@ define('DB_USER','root');
|
||||
define('DB_PASS','');
|
||||
define('DB_NAME','uf');
|
||||
define('DB_PREFIX','uf_');
|
||||
define('VERSION','9.6.25');
|
||||
define('VERSION','1.0.4');
|
||||
define('UF_INSTALLED',true);
|
||||
?>
|
||||
|
||||
10
eprofile.php
10
eprofile.php
@@ -231,18 +231,18 @@ $skin = array(
|
||||
'lovpr'=>$lng['general_settings'],
|
||||
'L.select_value'=>$lng['select_value'],
|
||||
'L.limit_users'=>$lng['limit_users'],
|
||||
'OPTIONS.limit_users'=>AddPages2($userdata['limit_users']),
|
||||
'OPTIONS.limit_users'=>ListPages($userdata['limit_users']),
|
||||
'L.posts_in_topic'=>$lng['limit_posts'],
|
||||
'OPTIONS.limit_tpid'=>AddPages2($userdata['limit_tpid']),
|
||||
'OPTIONS.limit_tpid'=>ListPages($userdata['limit_tpid']),
|
||||
'L.topics_in_forum'=>$lng['limit_topics'],
|
||||
'OPTIONS.limit_ftid'=>AddPages2($userdata['limit_ftid']),
|
||||
'OPTIONS.limit_ftid'=>ListPages($userdata['limit_ftid']),
|
||||
'lupr'=>$lng['profile_settings'],
|
||||
'lspr'=>$lng['signature_settings'],
|
||||
'ldefault_lang'=>$lng['default_lang'],
|
||||
'default_lang'=>AddLangs(),
|
||||
'default_lang'=>ListDir('lngs', $default_lang),
|
||||
'l2default_lang'=>$lng['select_lang'],
|
||||
'ldefault_skin'=>$lng['default_skin'],
|
||||
'default_skin'=>AddSkins(),
|
||||
'default_skin'=>ListDir('skins', $default_skin),
|
||||
'l2default_skin'=>$lng['select_skin'],
|
||||
'lapr'=>$lng['avatar_settings'],
|
||||
'lsubmit'=>$lng['save'],
|
||||
|
||||
@@ -77,7 +77,7 @@ else
|
||||
$skin['noposts']='<tr><td width="'.TABLES_WIDTH.'" colspan="8" height="19" class="fitem"><p class="fstandard" align="center">'.$lng['nopost'].'!</p></td></tr>';
|
||||
}
|
||||
$skin = array_push_assoc($skin, array(
|
||||
'option_pages' => AddPages(),
|
||||
'option_pages' => ListPages($page, $count),
|
||||
'lwith' => $lng['with'],
|
||||
'lpage' => $lng['page'],
|
||||
'lpages' => $count,
|
||||
|
||||
@@ -13,50 +13,10 @@ if ( !defined('IN_uF') )
|
||||
}
|
||||
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))
|
||||
$rep=opendir('./../'.$dir);
|
||||
while ($file = readdir($rep))
|
||||
{
|
||||
if($file != '..' && $file !='.' && $file !='')
|
||||
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;
|
||||
|
||||
@@ -32,7 +32,6 @@ define('PM_SENTBOX_TABLE',DB_PREFIX.'msg_sentbox');
|
||||
define('POSTS_TABLE',DB_PREFIX.'posts');
|
||||
define('SESSIONS_TABLE',DB_PREFIX.'sessions');
|
||||
define('SHOUTBOX_TABLE',DB_PREFIX.'shoutbox');
|
||||
define('SKINS_TABLE',DB_PREFIX.'skins');
|
||||
define('SMILES_TABLE',DB_PREFIX.'smiles');
|
||||
define('USERS_TABLE',DB_PREFIX.'users');
|
||||
define('USERS_GROUP_TABLE',DB_PREFIX.'users_group');
|
||||
|
||||
@@ -91,7 +91,8 @@ function UserAgent($agent)
|
||||
$system = (strpos($agent_tst, 'kateos')) ? 'linux_kateos' : $system;
|
||||
$system = (strpos($agent_tst, 'bsd')) ? 'linux_freebsd' : $system;
|
||||
}
|
||||
if ( $system == '')
|
||||
|
||||
if ( $system == '')
|
||||
{
|
||||
$system = (strpos($agent_tst, 'mac')) ? 'macos' : $system;
|
||||
$system = (strpos($agent_tst, 'aix')) ? 'aix' : $system;
|
||||
@@ -158,15 +159,13 @@ function GenerateTime($request_time)
|
||||
return $date;
|
||||
}
|
||||
|
||||
function AddPages()
|
||||
function ListPages($page, $count = 50)//for edit profile, not used in limit!
|
||||
{
|
||||
global $count;
|
||||
global $page;
|
||||
$content = '';
|
||||
for ($i=1;$i<=$count;$i++)
|
||||
{
|
||||
if ($i==$page)
|
||||
{
|
||||
{
|
||||
$content .= '<option value="'.$i.'" selected="selected">'.$i.'</option>';
|
||||
}
|
||||
else
|
||||
@@ -174,66 +173,20 @@ function AddPages()
|
||||
$content .= '<option value="'.$i.'">'.$i.'</option>';
|
||||
}
|
||||
}
|
||||
return $content;
|
||||
unset($content);
|
||||
}
|
||||
|
||||
function AddPages2($page)//for edit profile, 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);
|
||||
}
|
||||
|
||||
function AddSkins()
|
||||
function ListDir($dir, $selection)
|
||||
{
|
||||
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 AddLangs()
|
||||
{
|
||||
global $forum_config;
|
||||
global $default_lang;
|
||||
$result='';
|
||||
$rep=opendir('./lngs');
|
||||
$browseruMoinsUnRepertoire = false;
|
||||
$rep=opendir('./'.$dir);
|
||||
while ($file = readdir($rep))
|
||||
{
|
||||
if($file != '..' && $file !='.' && $file !='')
|
||||
if($file != '..' && $file !='.' && $file !='' && $file[0] != '.')
|
||||
{
|
||||
if (is_dir('./lngs/'.$file)){
|
||||
$browseruMoinsUnRepertoire = true;
|
||||
if ($file==$default_lang)
|
||||
if (is_dir('./'.$dir.'/'.$file)){
|
||||
if ($file==$selection)
|
||||
{
|
||||
$result .='<option value="'.$file.'" selected="selected">'.$file.'</option>';
|
||||
}
|
||||
@@ -245,7 +198,7 @@ function AddLangs()
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
unset($rep, $browseruMoinsUnRepertoire, $file, $result);
|
||||
unset($rep, $file, $result);
|
||||
}
|
||||
|
||||
function TimeGeneration()
|
||||
@@ -338,10 +291,8 @@ function ViewSkinName()
|
||||
{
|
||||
$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'];
|
||||
return $result;
|
||||
}
|
||||
|
||||
function GenerateLastPost($id, $type)
|
||||
|
||||
@@ -257,7 +257,7 @@ if ((isset($_POST['keywords'])) || ($_GET['content']=='lastposts') || ($_GET['co
|
||||
echo '<tr><td width="'.TABLES_WIDTH.'" colspan="10" height="19" class="fitem"><p class="fstandard" align="center">'.$lng['nopost'].'!</p></td></tr>';
|
||||
}
|
||||
$skin = array(
|
||||
'option_pages' => AddPages(),
|
||||
'option_pages' => ListPages($page, $count),
|
||||
'lwith' => $lng['with'],
|
||||
'lpage' => $lng['page'],
|
||||
'lpages' => $count,
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.3 KiB |
@@ -129,7 +129,7 @@ $skin = array(
|
||||
alt="stick"></a>',
|
||||
'lmod' => $lng['lmod'],
|
||||
'c_delete_topic'=>$lng['c_delete_topic'],
|
||||
'option_pages'=>AddPages(),
|
||||
'option_pages'=>ListPages($page, $count),
|
||||
'lwith'=>$lng['with'],
|
||||
'lpage'=>$lng['page'],
|
||||
'lpages'=>$count
|
||||
|
||||
Reference in New Issue
Block a user