From 98bd401edbedbfb91cc3e4a30c409535f36e0030 Mon Sep 17 00:00:00 2001 From: pioder Date: Tue, 10 Nov 2009 16:11:00 +0000 Subject: [PATCH] + Replaced old functions to listing dirs in admin_script.php and admin_users.php + Fixed update server address + Replaced URL in footer + Deleted admin styles page + Fixed a few bugs in polish language files git-svn-id: https://svn.pioder.pl/uf-svn/uF@35 72ec579a-5ced-4fa4-82f3-afba5d98df2f --- admin/admin_script.php | 66 +---------------- admin/admin_users.php | 13 ++-- admin/banlist.php | 2 +- admin/forum_info.php | 18 ++--- admin/styles.php | 112 ----------------------------- admin/template/message_body.tpl | 2 +- admin/template/overall_header.tpl | 1 - admin/template/skin.css | 2 +- admin/template/skins_beam_body.tpl | 20 ------ admin/template/skins_item_add.tpl | 10 --- includes/admin/class_main.php | 40 ----------- includes/constants.php | 2 +- lngs/Polish/admin.php | 6 +- lngs/Polish/main.php | 2 +- search.php | 18 +---- 15 files changed, 28 insertions(+), 286 deletions(-) delete mode 100644 admin/styles.php delete mode 100644 admin/template/skins_beam_body.tpl delete mode 100644 admin/template/skins_item_add.tpl diff --git a/admin/admin_script.php b/admin/admin_script.php index 250c815..a12e8ec 100644 --- a/admin/admin_script.php +++ b/admin/admin_script.php @@ -20,6 +20,7 @@ include('./../includes/classes/class_user.php'); include('./../common.php'); include('./../includes/admin/class_main.php'); include('./../includes/classes/class_forum.php'); +include('./../includes/misc_functions.php'); include('./../lngs/'.Admin_Over::DefaultLang().'/admin.php'); SessDelInvalid(); SessRegister(); @@ -29,67 +30,6 @@ if (User::UserInformation($_SESSION['uid'],'rank')!=2) admin_message_forum($lng['yournotadmin'],'../index.php'); } -function AddSkins() -{ - global $forum_config; - $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['s_id']==$forum_config['defaultskin']) - { - $all .= ''; - } - else - { - $all .= ''; - } - } - return $all; - unset($t, $all); -} -function AddPages2($page)//for admin script, not used in limit! -{ - $content = ''; - for ($i=1;$i<=50;$i++) - { - if ($i==$page) - { - $content .= ''; - } - else - { - $content .= ''; - } - } - return $content; - unset($content); -} -function AddLangs() -{ - global $forum_config; - $result=''; - $rep=opendir('./../lngs'); - while ($file = readdir($rep)) - { - if($file != '..' && $file !='.' && $file !='') - { - if (is_dir('./../lngs/'.$file)){ - if ($file==$forum_config['defaultlang']) - { - $result .=''; - } - else - { - $result .=''; - } - } - } - } - return $result; - unset($rep, $file, $result); -} $errors = true; if (isset($_POST['forum_path'])) { @@ -334,10 +274,10 @@ $skin = array( 'forum_disabled'=>$forum_config['disable_forum'], 'L.default_skin'=>$lng['default_skin'], 'L2.default_skin'=>$lng['select_skin'], -'OPTIONS.default_skin'=>ListDir('skins', $forum_config['default_skin']), +'OPTIONS.default_skin'=>ListDir('../skins', $forum_config['defaultskin']), 'L.default_lang'=>$lng['default_lang'], 'L2.default_lang'=>$lng['select_lang'], -'OPTIONS.default_lang'=>ListDir('lngs', $forum_config['default_lang']), +'OPTIONS.default_lang'=>ListDir('../lngs', $forum_config['defaultlang']), 'L.meta_keywords'=>$lng['meta_keywords'], 'meta_keywords'=>$forum_config['meta_keywords'], 'L.meta_description'=>$lng['meta_description'], diff --git a/admin/admin_users.php b/admin/admin_users.php index e1994bd..faa215f 100644 --- a/admin/admin_users.php +++ b/admin/admin_users.php @@ -19,6 +19,7 @@ include('./../includes/sessions.php'); include('./../includes/classes/class_user.php'); include('./../common.php'); include('./../includes/admin/class_main.php'); +include('./../includes/misc_functions.php'); include('./../includes/classes/class_topic.php'); include('./../includes/classes/class_posting.php'); include('./../includes/classes/secure.php'); @@ -220,11 +221,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::ListPages($userinfo['limit_users']), + 'OPTIONS.limit_users'=>ListPages($userinfo['limit_users']), 'L.posts_in_topic'=>$lng['limit_posts'], - 'OPTIONS.limit_tpid'=>Admin_Over::ListPages($userinfo['limit_tpid']), + 'OPTIONS.limit_tpid'=>ListPages($userinfo['limit_tpid']), 'L.topics_in_forum'=>$lng['limit_topics'], - 'OPTIONS.limit_ftid'=>Admin_Over::ListPages($userinfo['limit_ftid']), + 'OPTIONS.limit_ftid'=>ListPages($userinfo['limit_ftid']), 'lupr'=>$lng['profile_settings'], 'lspr'=>$lng['signature_settings'], 'ladmpr'=>$lng['admin_settings'], @@ -233,10 +234,10 @@ switch($_GET['mode']) 'lposts'=>$lng['posts'], 'posts'=>$userinfo['posts'], 'ldefault_lang'=>$lng['default_lang'], - 'default_lang'=>Admin_Over::ListDir('lngs', $userinfo['default_lang']), + 'default_lang'=>ListDir('../lngs', $userinfo['lang']), 'l2default_lang'=>$lng['select_lang'], 'ldefault_skin'=>$lng['default_skin2'], - 'default_skin'=>Admin_Over::ListDir('skins', $userinfo['default_skin']), + 'default_skin'=>ListDir('../skins', $userinfo['skin']), 'l2default_skin'=>$lng['select_skin'], 'lapr'=>$lng['avatar_settings'], 'lsubmit'=>$lng['save'], @@ -441,7 +442,7 @@ switch($_GET['mode']) include('./template/user_item_add_body.tpl'); } $skin = array( - 'option_pages'=>Admin_Over::ListPages($page, $count), + 'option_pages'=>ListPages($page, $count), 'lwith'=>$lng['with'], 'lpage'=>$lng['page'], 'lpages'=>$count diff --git a/admin/banlist.php b/admin/banlist.php index 7ab6712..ee3237e 100644 --- a/admin/banlist.php +++ b/admin/banlist.php @@ -374,4 +374,4 @@ switch($_GET['mode']) break; } } -?> +?> \ No newline at end of file diff --git a/admin/forum_info.php b/admin/forum_info.php index a959ec4..06ff2c2 100644 --- a/admin/forum_info.php +++ b/admin/forum_info.php @@ -4,7 +4,7 @@ * @file admin/forum_info.php * @version $Id$ * @copyright 2009(c) PioDer -* @link http://pioder.gim2przemysl.int.pl/ +* @link http://pioder.gim2przemysl.int.pl/ * @license GNU GPL v3 **/ define('IN_uF', true); @@ -33,27 +33,27 @@ if (User::UserInformation($_SESSION['uid'],'rank')!=2) $errno = 0; $errstr = ''; $version = ''; -if ($open = @fsockopen('pioder.gim2przemysl.int.pl', 80, $errno, $errstr, 10)) +if ($open = fsockopen('pioder.ath.cx', 80, $errno, $errstr, 10)) { - @fputs($open, "GET /updates.php?app=dsf HTTP/1.1\r\n"); - @fputs($open, "HOST: pioder.gim2przemysl.int.pl\r\n"); - @fputs($open, "Connection: close\r\n\r\n"); + fputs($open, "GET /updates.php?app=uf HTTP/1.1\r\n"); + fputs($open, "HOST: pioder.ath.cx\r\n"); + fputs($open, "Connection: close\r\n\r\n"); $get_info = false; - while (!@feof($open)) + while (!feof($open)) { if ($get_info) { - $version .= @fread($open, 1024); + $version .= fread($open, 1024); } else { - if (@fgets($open, 1024) == "\r\n") + if (fgets($open, 1024) == "\r\n") { $get_info = true; } } } - @fclose($open); + fclose($open); if ($version==VERSION) { $result = $lng['noupdates']; diff --git a/admin/styles.php b/admin/styles.php deleted file mode 100644 index 12a843e..0000000 --- a/admin/styles.php +++ /dev/null @@ -1,112 +0,0 @@ - -* @link http://pioder.gim2przemysl.int.pl/ -* @license GNU GPL v3 -**/ -define('IN_uF', true); -//include files -include('./../config.php'); -include('./../includes/constants.php'); -include('./../includes/db.php'); -include('./../includes/errors.php'); -include('./../includes/classes/class_pms.php'); -//connect to database -DataBase::db_connect(); -include('./../includes/sessions.php'); -include('./../includes/classes/class_user.php'); -include('./../common.php'); -include('./../includes/admin/class_main.php'); -include('./../includes/classes/class_forum.php'); -include('./../includes/admin/class_forum.php'); -include('./../includes/classes/secure.php'); -include('./../lngs/'.Admin_Over::DefaultLang().'/admin.php'); -SessDelInvalid(); -SessRegister(); -SessDeleteOld(); - -if (User::UserInformation($_SESSION['uid'],'rank')!=2) -{ - admin_message_forum($lng['yournotadmin'],'../index.php'); -} -if (!isset($_GET['mode'])) -{ - header('Location: styles.php?mode=view'); -} -switch($_GET['mode']) -{ - case 'delete': - { - $sid = intval($_GET['id']); - if ($sid!=$forum_config['defaultskin']) - { - $sql = "DELETE FROM ".SKINS_TABLE." WHERE `s_id`='$sid'"; - DataBase::sql_query($sql,GENERAL,'Could not delete skin'); - $sql = "UPDATE ".USERS_TABLE." SET `skin`='".$forum_config['defaultskin']."' WHERE `skin`='$sid'"; - DataBase::sql_query($sql,GENERAL,'Could not update user'); - admin_message_forum($lng['skins_deleted'],'styles.php?mode=view'); - } - else - { - admin_message_forum($lng['styles_info_1'],'styles.php?mode=view'); - } - break; - } - case 'view': - { - if (isset($_POST['skin'])) - { - if(strlen(trim($_POST['skin']))>3) - { - if (is_dir('./../skins/'.$_POST['skin'])) - { - $last = DataBase::new_id(SKINS_TABLE); - DataBase::sql_query("INSERT INTO ".SKINS_TABLE." VALUES ('$last','".strip_tags($_POST['skin'])."')",GENERAL,'Could not add skin'); - $_POST['skin']=''; - admin_message_forum($lng['skins_added'],'styles.php?mode=view'); - } - else - { - $_POST['skin']=''; - admin_message_forum($lng['invalid_skin'],'styles.php?mode=view'); - } - } - } - else - { - $_POST['skin']=''; - } - $skin = array( - 'L.main_beam'=>$lng['admin_styles'], - 'L.install'=>$lng['install'], - 'L.new_skin'=>$lng['new_skin'], - 'L.delete'=>$lng['delete'], - 'L.actual_skins'=>$lng['actual_skins'] - ); - Admin_Over::GenerateHeader(); - include('./template/skins_beam_body.tpl'); - $sql = "SELECT * FROM ".SKINS_TABLE; - $query = DataBase::sql_query($sql,GENERAL,'Could not obtain skins information'); - while ($item = DataBase::fetch($query)) - { - $skin=array( - 'L.delete' => $lng['delete'], - 'skin_name' => $item['name'], - 's_id' => $item['s_id'] - ); - include('./template/skins_item_add.tpl'); - } - echo ''; - include('./template/overall_footer.tpl'); - break; - } - default: - { - header('Location: styles.php?mode=view'); - break; - } -} -?> diff --git a/admin/template/message_body.tpl b/admin/template/message_body.tpl index 0f78341..7080c41 100644 --- a/admin/template/message_body.tpl +++ b/admin/template/message_body.tpl @@ -15,7 +15,7 @@
- + diff --git a/admin/template/skin.css b/admin/template/skin.css index eb3a549..65f11b5 100644 --- a/admin/template/skin.css +++ b/admin/template/skin.css @@ -23,7 +23,7 @@ a:hover /* body class */ .body { - background-color: #E8E8FF; + background-color: #E8E8FF; background-image: url('images/body_bg.gif'); margin: 4px; } diff --git a/admin/template/skins_beam_body.tpl b/admin/template/skins_beam_body.tpl deleted file mode 100644 index 33517ae..0000000 --- a/admin/template/skins_beam_body.tpl +++ /dev/null @@ -1,20 +0,0 @@ -
-
-
-
-
- -
-:     - - -
DSF v
µForum v
diff --git a/admin/template/overall_header.tpl b/admin/template/overall_header.tpl index eff30f0..6b0e1eb 100644 --- a/admin/template/overall_header.tpl +++ b/admin/template/overall_header.tpl @@ -18,7 +18,6 @@ • -
- - - - - -
-

-

- diff --git a/admin/template/skins_item_add.tpl b/admin/template/skins_item_add.tpl deleted file mode 100644 index f4d3f24..0000000 --- a/admin/template/skins_item_add.tpl +++ /dev/null @@ -1,10 +0,0 @@ - - - - \ No newline at end of file diff --git a/includes/admin/class_main.php b/includes/admin/class_main.php index cc246a9..e767050 100644 --- a/includes/admin/class_main.php +++ b/includes/admin/class_main.php @@ -13,47 +13,7 @@ if ( !defined('IN_uF') ) } class Admin_Over { - function ListPages($page, $count = 50)//for edit profile, not used in limit! - { - $content = ''; - for ($i=1;$i<=$count;$i++) - { - if ($i==$page) - { - $content .= ''; - } - else - { - $content .= ''; - } - } - return $content; - unset($content); - } - function ListDir($dir, $selection) - { - $result=''; - $rep=opendir('./../'.$dir); - while ($file = readdir($rep)) - { - if($file != '..' && $file !='.' && $file !='' && $file[0] != '.') - { - if (is_dir('./../'.$dir.'/'.$file)){ - if ($file==$selection) - { - $result .=''; - } - else - { - $result .=''; - } - } - } - } - return $result; - unset($rep, $file, $result); - } function DefaultLang() { diff --git a/includes/constants.php b/includes/constants.php index c7b33a0..18b620d 100644 --- a/includes/constants.php +++ b/includes/constants.php @@ -39,7 +39,7 @@ define('TOPICS_TABLE',DB_PREFIX.'topics'); define('WARNINGS_TABLE',DB_PREFIX.'warns'); //footer forum text -define('FOOTER_TEXT','Powered by µForum © 2007-2009 PioDer'); +define('FOOTER_TEXT','Powered by µForum © 2007-2009 PioDer'); //hash for password define('PASSWD_HASH','bJVhVFCthvhVhKBU6GUbhUBU6VI7BiU6fV7G76Kbug6FU67VsaVYat5FJUHssaYVY5fV5GUHI76uKYTjYKKTatastYKYTYKg6ds7IRdsagI565JTrJ4NFGagGKLULygaTJHgfYDRZagGHJ65KL7iryikuuyriMYIYYUyugFTDeRnLKJNuyTDTRsERy78IJOhHCTDYjomLKBJDF5THNNBjyFCDYekjnKBUYgIHnUIbyuG6UyHNKJjnKHVut6FBYlH987g6GIUBbg76V5NNLUBH76BKLBi76FVtjN76Gi77ggYVCx3 R4SGhfGLHIH64XFGBUNLJOgfvc4Y3ScvmljmOBVc4klJKNIuBGVY6 MbvhGCRGgJLjKFHrYYJnKJGFHTfJJjnLK'); diff --git a/lngs/Polish/admin.php b/lngs/Polish/admin.php index 1ffa3cc..d318e11 100644 --- a/lngs/Polish/admin.php +++ b/lngs/Polish/admin.php @@ -109,7 +109,7 @@ $lng['posts']='Liczba postów'; $lng['scriptversion']='Wersja skryptu'; $lng['updates']='Aktualizacje'; $lng['noupdates']='Twoje forum jest aktualne.'; -$lng['updatenow']='Skrypt jest nieaktualny, zaaktualizuj najszybciej!'; +$lng['updatenow']='Skrypt jest nieaktualny, zaaktualizuj najszybciej!'; // //on check script.......---------------------------------------- // @@ -169,7 +169,7 @@ $lng['t_forum_path']='Jeżeli forum działa poprawnie nie zmieniaj tej ścieżki $lng['forum_name']='Nazwa forum'; $lng['forum_disabled']='Forum wyłączone'; $lng['t_forum_disabled']='Aby wyłączyć forum podaj powód, w innym przypadku pozostaw pole puste!'; -$lng['default_skin']='Domyślny styl forum (Zarządzaj)'; +$lng['default_skin']='Domyślny styl forum'; $lng['default_skin2']='Styl forum'; $lng['select_skin']='Wybierz styl'; $lng['default_lang']='Domyślny język'; @@ -179,7 +179,7 @@ $lng['meta_keywords']='Słowa kluczowe'; $lng['meta_description']='Opis'; $lng['other']='Inne'; $lng['show_time_generation']='Pokazuj czas generowania strony'; -$lng['enable_censorlist']='Cenzura słów włączączona'; +$lng['enable_censorlist']='Cenzura słów włączona'; $lng['enable_confirms']='Potwierdzenia czynności(Kasacja, przenoszenie, itp.)'; $lng['select_value']='Wybierz wartość'; $lng['limit_users']='Użytkowników na stronę'; diff --git a/lngs/Polish/main.php b/lngs/Polish/main.php index d2a0785..206fb4f 100644 --- a/lngs/Polish/main.php +++ b/lngs/Polish/main.php @@ -40,7 +40,7 @@ $lng['statistics']='Statystyki'; $lng['showlastposts']='Pokaż ostatnie posty'; $lng['forum_counter']='Forum odwiedzono %x% razy.'; $lng['total_posts']='Nasi użytkownicy napisali %x% postów'; -$lng['reg_users']='Na forum jest zarejestrowanych %x% użytkowników'; +$lng['reg_users']='Zarejestrowanych %x% profili użytkowników'; $lng['users_groups']='Grupy użytkowników: AdministratorModerator • Użytkownik'; $lng['youareloggedas']='Jesteś zalogowany jako'; $lng['youarenotlogd']='Nie jesteś zalogowany'; diff --git a/search.php b/search.php index 7dd3d25..46d8b29 100644 --- a/search.php +++ b/search.php @@ -29,22 +29,7 @@ $default_skin = ViewSkinName(); SessDelInvalid(); SessRegister(); SessDeleteOld(); -/*$sql = "SELECT ".POSTS_TABLE.".*, ".USERS_TABLE.".* FROM ".POSTS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".USERS_TABLE.".u_id = ".POSTS_TABLE.".u_id ORDER BY `ptime`"; -$query = DataBase::sql_query($sql,GENERAL, 'Could not obtain amout of posts in forum'); -while($result = DataBase::fetch($query)) -{ - $lastpost[$result['t_id']]['tp_id']=$result['tp_id']; - $lastpost[$result['t_id']]['u_id']=$result['u_id']; - $lastpost[$result['t_id']]['time']=$result['ptime']; - $lastpost[$result['t_id']]['user_nick']=$result['nick']; - $lastpost[$result['t_id']]['user_rank']=$result['rank']; -} -$sql = "SELECT COUNT(*) as `p_id`, `t_id` FROM ".POSTS_TABLE." GROUP BY `t_id`"; -$query = DataBase::sql_query($sql,GENERAL, 'Could not obtain amout of posts in forum'); -while($result = DataBase::fetch($query)) -{ - $count_topic[$result['t_id']]=$result['p_id']; -}*/ + if (!isset($_GET['content'])) { header('Location: search.php?content=posts'); @@ -183,7 +168,6 @@ if ((isset($_POST['keywords'])) || ($_GET['content']=='lastposts') || ($_GET['co FROM ".TOPICS_TABLE." LEFT JOIN ".POSTS_TABLE." ON ".POSTS_TABLE.".t_id = ".TOPICS_TABLE.".t_id WHERE $like_where GROUP BY `t_id`"; - echo $sql; $count = DataBase::sql_query($sql,GENERAL,'Could not obtain count amout of topics'); $count = DataBase::num_rows($count);//$count['count']; $count = ceil($count / $limiter);
- - - - - -