Browse Source

+ 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
master
pioder 15 years ago
parent
commit
9c75d445b0
14 changed files with 50 additions and 163 deletions
  1. +0
    -1
      admin/admin_forums.php
  2. +5
    -5
      admin/admin_script.php
  3. +6
    -7
      admin/admin_users.php
  4. +2
    -3
      admin/index.php
  5. +1
    -1
      config.php
  6. +5
    -5
      eprofile.php
  7. +1
    -1
      forum.php
  8. +13
    -73
      includes/admin/class_main.php
  9. +0
    -1
      includes/constants.php
  10. +14
    -63
      includes/misc_functions.php
  11. +1
    -1
      search.php
  12. BIN
      skins/subPurple/images/favicon.ico
  13. +1
    -1
      topic.php
  14. +1
    -1
      users.php

+ 0
- 1
admin/admin_forums.php View File

@ -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');

+ 5
- 5
admin/admin_script.php View File

@ -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'],

+ 6
- 7
admin/admin_users.php View File

@ -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

+ 2
- 3
admin/index.php View File

@ -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>&micro;Forum ACP</title>
<frameset rows="90,*" border="2" framespacing="0" frameborder="yes">
<frame src="header.php" name="nav" marginheight="3" scrolling="no">

+ 1
- 1
config.php View File

@ -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);
?>

+ 5
- 5
eprofile.php View File

@ -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'],

+ 1
- 1
forum.php View File

@ -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
- 73
includes/admin/class_main.php 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;

+ 0
- 1
includes/constants.php View File

@ -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');

+ 14
- 63
includes/misc_functions.php View File

@ -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;
@ -157,83 +158,35 @@ 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
{
$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>';
$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 AddLangs()
function ListDir($dir, $selection)
{
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)

+ 1
- 1
search.php View File

@ -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,

BIN
skins/subPurple/images/favicon.ico View File

Before After

+ 1
- 1
topic.php View File

@ -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

+ 1
- 1
users.php View File

@ -202,7 +202,7 @@ while($result = DataBase::fetch($query))
include('./skins/'.$default_skin.'/users_item_add_body.tpl');
}
$skin = array(
'option_pages'=>AddPages(),
'option_pages'=>ListPages($page, $count),
'lwith'=>$lng['with'],
'lpage'=>$lng['page'],
'lpages'=>$count

Loading…
Cancel
Save