Parcourir la source

Minor changes version, constants and the updating script

Visman il y a 8 ans
Parent
commit
472b8b59f2
11 fichiers modifiés avec 147 ajouts et 1199 suppressions
  1. 2 0
      .gitignore
  2. 2 2
      admin_index.php
  3. 103 103
      app/Core/Install.php
  4. 24 1073
      db_update.php
  5. 2 2
      extern.php
  6. 1 1
      footer.php
  7. 9 14
      include/common.php
  8. 1 1
      lang/English/common.php
  9. 1 1
      lang/Russian/common.php
  10. 1 1
      lang/Russian/update.php
  11. 1 1
      readme.md

+ 2 - 0
.gitignore

@@ -1,6 +1,8 @@
 /app/config/main.php
 /app/cache/**/*.php
+/app/cache/**/*.lock
 /cache/**/*.php
+/cache/**/*.lock
 /img/avatars/*
 !/img/avatars/index.html
 /img/members/*

+ 2 - 2
admin_index.php

@@ -32,7 +32,7 @@ if ($action == 'check_upgrade')
 	if (empty($latest_version))
 		message($lang_admin_index['Upgrade check failed message']);
 
-	if (version_compare($pun_config['o_cur_version'], $latest_version, '>='))
+	if (version_compare($pun_config['s_fork_version'], $latest_version, '>='))
 		message($lang_admin_index['Running latest version message']);
 	else
 		message(sprintf($lang_admin_index['New version available message'], '<a href="http://fluxbb.org/">FluxBB.org</a>'));
@@ -89,7 +89,7 @@ generate_admin_menu('index');
 				<dl>
 					<dt><?php echo $lang_admin_index['FluxBB version label'] ?></dt>
 					<dd>
-						<?php printf($lang_admin_index['FluxBB version data']."\n", $pun_config['o_cur_version'].'.'.$pun_config['o_cur_ver_revision'], '<a href="https://fluxbb.org/forums/viewtopic.php?id=4941">'.$lang_admin_index['Check for upgrade'].'</a>') ?> - <a href="https://github.com/MioVisman/FluxBB_by_Visman">GitHub</a>
+						<?php printf($lang_admin_index['FluxBB version data']."\n", $pun_config['s_fork_version'].'.'.$pun_config['i_fork_revision'], '<a href="https://fluxbb.org/forums/viewtopic.php?id=4941">'.$lang_admin_index['Check for upgrade'].'</a>') ?> - <a href="https://github.com/MioVisman/FluxBB_by_Visman">GitHub</a>
 					</dd>
 					<dt><?php echo $lang_admin_index['Server statistics label'] ?></dt>
 					<dd>

+ 103 - 103
app/Core/Install.php

@@ -88,7 +88,7 @@ class Install implements ContainerAwareInterface
 
         // Make sure we are running at least MIN_PHP_VERSION
         if (! function_exists('version_compare') || version_compare(PHP_VERSION, MIN_PHP_VERSION, '<'))
-            exit(sprintf($lang_install['You are running error'], 'PHP', PHP_VERSION, FORUM_VERSION, MIN_PHP_VERSION));
+            exit(sprintf($lang_install['You are running error'], 'PHP', PHP_VERSION, FORK_VERSION, MIN_PHP_VERSION));
 
 
         if (null !== $this->request->postBool('generate_config'))
@@ -314,7 +314,7 @@ foreach ($languages as $temp)
 <?php endif; ?>
 
 <div class="blockform">
-    <h2><span><?php echo sprintf($lang_install['Install'], FORUM_VERSION.'.'.FORUM_VER_REVISION) ?></span></h2>
+    <h2><span><?php echo sprintf($lang_install['Install'], FORK_VERSION . '.' . FORK_REVISION) ?></span></h2>
     <div class="box">
         <form id="install" method="post" action="" onsubmit="this.start.disabled=true;if(process_form(this)){return true;}else{this.start.disabled=false;return false;}">
         <div><input type="hidden" name="form_sent" value="1" /><input type="hidden" name="install_lang" value="<?php echo pun_htmlspecialchars($install_lang) ?>" /></div>
@@ -501,13 +501,13 @@ foreach ($styles as $temp)
                 case 'mysqli_innodb':
                     $mysql_info = $db->get_version();
                     if (version_compare($mysql_info['version'], MIN_MYSQL_VERSION, '<'))
-                        error(sprintf($lang_install['You are running error'], 'MySQL', $mysql_info['version'], FORUM_VERSION, MIN_MYSQL_VERSION));
+                        error(sprintf($lang_install['You are running error'], 'MySQL', $mysql_info['version'], FORK_VERSION, MIN_MYSQL_VERSION));
                     break;
 
                 case 'pgsql':
                     $pgsql_info = $db->get_version();
                     if (version_compare($pgsql_info['version'], MIN_PGSQL_VERSION, '<'))
-                        error(sprintf($lang_install['You are running error'], 'PostgreSQL', $pgsql_info['version'], FORUM_VERSION, MIN_PGSQL_VERSION));
+                        error(sprintf($lang_install['You are running error'], 'PostgreSQL', $pgsql_info['version'], FORK_VERSION, MIN_PGSQL_VERSION));
                     break;
 
                 case 'sqlite':
@@ -1504,7 +1504,7 @@ foreach ($styles as $temp)
                         'default'        => '\'\''
                     ),
                     'password'            => array(
-                        'datatype'        => 'VARCHAR(40)',
+                        'datatype'        => 'VARCHAR(255)',
                         'allow_null'    => false,
                         'default'        => '\'\''
                     ),
@@ -1907,105 +1907,105 @@ foreach ($styles as $temp)
 
             // Insert config data
             $pun_config = array(
-                'o_cur_version'                => FORUM_VERSION,
-                'o_cur_ver_revision'    => FORUM_VER_REVISION, // номер сборки - Visman
-                'o_database_revision'        => FORUM_DB_REVISION,
-                'o_searchindex_revision'    => FORUM_SI_REVISION,
-                'o_parser_revision'            => FORUM_PARSER_REVISION,
-                'o_board_title'                => $title,
-                'o_board_desc'                => $description,
-                'o_default_timezone'        => 0,
-                'o_time_format'                => 'H:i:s',
-                'o_date_format'                => 'Y-m-d',
-                'o_timeout_visit'            => 1800,
-                'o_timeout_online'            => 300,
-                'o_redirect_delay'            => 1,
-                'o_show_version'            => 0,
-                'o_show_user_info'            => 1,
-                'o_show_post_count'            => 1,
-                'o_signatures'                => 1,
-                'o_smilies'                    => 1,
-                'o_smilies_sig'                => 1,
-                'o_make_links'                => 1,
-                'o_default_lang'            => $default_lang,
-                'o_default_style'            => $default_style,
-                'o_default_user_group'        => 4,
-                'o_topic_review'            => 15,
-                'o_disp_topics_default'        => 30,
-                'o_disp_posts_default'        => 25,
-                'o_indent_num_spaces'        => 4,
-                'o_quote_depth'                => 3,
-                'o_quickpost'                => 1,
-                'o_users_online'            => 1,
-                'o_censoring'                => 0,
-                'o_show_dot'                => 0,
-                'o_topic_views'                => 1,
-                'o_quickjump'                => 1,
-                'o_gzip'                    => 0,
-                'o_additional_navlinks'        => '',
-                'o_report_method'            => 0,
-                'o_regs_report'                => 0,
-                'o_default_email_setting'    => 1,
-                'o_mailing_list'            => $email,
-                'o_avatars'                    => $avatars,
-                'o_avatars_dir'                => 'img/avatars',
-                'o_avatars_width'            => 60,
-                'o_avatars_height'            => 60,
-                'o_avatars_size'            => 10240,
-                'o_search_all_forums'        => 1,
-                'o_base_url'                => $base_url,
-                'o_admin_email'                => $email,
-                'o_webmaster_email'            => $email,
-                'o_forum_subscriptions'        => 1,
-                'o_topic_subscriptions'        => 1,
-                'o_smtp_host'                => NULL,
-                'o_smtp_user'                => NULL,
-                'o_smtp_pass'                => NULL,
-                'o_smtp_ssl'                => 0,
-                'o_regs_allow'                => 1,
-                'o_regs_verify'                => 0,
-                'o_announcement'            => 0,
-                'o_announcement_message'    => $lang_install['Announcement'],
-                'o_rules'                    => 0,
-                'o_rules_message'            => $lang_install['Rules'],
-                'o_maintenance'                => 0,
-                'o_maintenance_message'        => $lang_install['Maintenance message'],
-                'o_default_dst'                => 0,
-                'o_feed_type'                => 2,
-                'o_feed_ttl'                => 0,
-                'p_message_bbcode'            => 1,
-                'p_message_img_tag'            => 1,
-                'p_message_all_caps'        => 1,
-                'p_subject_all_caps'        => 1,
-                'p_sig_all_caps'            => 1,
-                'p_sig_bbcode'                => 1,
-                'p_sig_img_tag'                => 0,
-                'p_sig_length'                => 400,
-                'p_sig_lines'                => 4,
-                'p_allow_banned_email'        => 1,
-                'p_allow_dupe_email'        => 0,
-                'p_force_guest_email'        => 1,
-                'o_pms_enabled'                => 1,                    // New PMS - Visman
-                'o_pms_min_kolvo'            => 0,
-                'o_merge_timeout'            => 86400,        // merge post - Visman
+                's_fork_version'          => FORK_VERSION,
+                'i_fork_revision'         => FORK_REVISION,
+                'o_database_revision'     => FORK_DB_REVISION,
+                'o_searchindex_revision'  => FORK_SI_REVISION,
+                'o_parser_revision'       => FORK_PARSER_REVISION,
+                'o_board_title'           => $title,
+                'o_board_desc'            => $description,
+                'o_default_timezone'      => 0,
+                'o_time_format'           => 'H:i:s',
+                'o_date_format'           => 'Y-m-d',
+                'o_timeout_visit'         => 1800,
+                'o_timeout_online'        => 300,
+                'o_redirect_delay'        => 1,
+                'o_show_version'          => 0,
+                'o_show_user_info'        => 1,
+                'o_show_post_count'       => 1,
+                'o_signatures'            => 1,
+                'o_smilies'               => 1,
+                'o_smilies_sig'           => 1,
+                'o_make_links'            => 1,
+                'o_default_lang'          => $default_lang,
+                'o_default_style'         => $default_style,
+                'o_default_user_group'    => 4,
+                'o_topic_review'          => 15,
+                'o_disp_topics_default'   => 30,
+                'o_disp_posts_default'    => 25,
+                'o_indent_num_spaces'     => 4,
+                'o_quote_depth'           => 3,
+                'o_quickpost'             => 1,
+                'o_users_online'          => 1,
+                'o_censoring'             => 0,
+                'o_show_dot'              => 0,
+                'o_topic_views'           => 1,
+                'o_quickjump'             => 1,
+                'o_gzip'                  => 0,
+                'o_additional_navlinks'   => '',
+                'o_report_method'         => 0,
+                'o_regs_report'           => 0,
+                'o_default_email_setting' => 1,
+                'o_mailing_list'          => $email,
+                'o_avatars'               => $avatars,
+                'o_avatars_dir'           => 'img/avatars',
+                'o_avatars_width'         => 60,
+                'o_avatars_height'        => 60,
+                'o_avatars_size'          => 10240,
+                'o_search_all_forums'     => 1,
+                'o_base_url'              => $base_url,
+                'o_admin_email'           => $email,
+                'o_webmaster_email'       => $email,
+                'o_forum_subscriptions'   => 1,
+                'o_topic_subscriptions'   => 1,
+                'o_smtp_host'             => NULL,
+                'o_smtp_user'             => NULL,
+                'o_smtp_pass'             => NULL,
+                'o_smtp_ssl'              => 0,
+                'o_regs_allow'            => 1,
+                'o_regs_verify'           => 0,
+                'o_announcement'          => 0,
+                'o_announcement_message'  => $lang_install['Announcement'],
+                'o_rules'                 => 0,
+                'o_rules_message'         => $lang_install['Rules'],
+                'o_maintenance'           => 0,
+                'o_maintenance_message'   => $lang_install['Maintenance message'],
+                'o_default_dst'           => 0,
+                'o_feed_type'             => 2,
+                'o_feed_ttl'              => 0,
+                'p_message_bbcode'        => 1,
+                'p_message_img_tag'       => 1,
+                'p_message_all_caps'      => 1,
+                'p_subject_all_caps'      => 1,
+                'p_sig_all_caps'          => 1,
+                'p_sig_bbcode'            => 1,
+                'p_sig_img_tag'           => 0,
+                'p_sig_length'            => 400,
+                'p_sig_lines'             => 4,
+                'p_allow_banned_email'    => 1,
+                'p_allow_dupe_email'      => 0,
+                'p_force_guest_email'     => 1,
+                'o_pms_enabled'           => 1,                    // New PMS - Visman
+                'o_pms_min_kolvo'         => 0,
+                'o_merge_timeout'         => 86400,        // merge post - Visman
                 'o_board_redirect'        => '',    // для редиректа - Visman
-                'o_board_redirectg'        => 0,
-                'o_poll_enabled'            => 0,    // опросы - Visman
-                'o_poll_max_ques'            => 3,
+                'o_board_redirectg'       => 0,
+                'o_poll_enabled'          => 0,    // опросы - Visman
+                'o_poll_max_ques'         => 3,
                 'o_poll_max_field'        => 20,
-                'o_poll_time'                    => 60,
-                'o_poll_term'                    => 3,
-                'o_poll_guest'                => 0,
-                'o_fbox_guest'                => 0,    // Fancybox - Visman
-                'o_fbox_files'                => 'viewtopic.php,search.php,pmsnew.php',
-                'o_coding_forms'            => 1,    // кодирование форм - Visman
-                'o_check_ip'                    => 0,    // проверка ip администрации - Visman
-                'o_crypto_enable'            => 1,    // случайные имена полей форм - Visman
-                'o_crypto_pas'                => random_pass(25),
-                'o_crypto_salt'                => random_pass(13),
-                'o_enable_acaptcha'        => 1, // математическая каптча
-                'st_max_users'                => 1,    // статистика по максимуму юзеров - Visman
-                'st_max_users_time'        => time(),
+                'o_poll_time'             => 60,
+                'o_poll_term'             => 3,
+                'o_poll_guest'            => 0,
+                'o_fbox_guest'            => 0,    // Fancybox - Visman
+                'o_fbox_files'            => 'viewtopic.php,search.php,pmsnew.php',
+                'o_coding_forms'          => 1,    // кодирование форм - Visman
+                'o_check_ip'              => 0,    // проверка ip администрации - Visman
+                'o_crypto_enable'         => 1,    // случайные имена полей форм - Visman
+                'o_crypto_pas'            => random_pass(25),
+                'o_crypto_salt'           => random_pass(13),
+                'o_enable_acaptcha'       => 1, // математическая каптча
+                'st_max_users'            => 1,    // статистика по максимуму юзеров - Visman
+                'st_max_users_time'       => time(),
             );
 
             foreach ($pun_config as $conf_name => $conf_value)
@@ -2044,7 +2044,7 @@ foreach ($styles as $temp)
                 $alerts[] = $lang_install['Alert upload'];
 
             // Add some random bytes at the end of the cookie name to prevent collisions
-            $cookie_prefix = 'fork_'.random_key(7, false, true);
+            $cookie_prefix = 'fork' . random_key(7, false, true) . '_';
 
             // Generate the main.php file data
             $config = $this->generate_config_file($base_url, $db_type, $db_host, $db_name, $db_username, $db_password, $db_prefix, $cookie_prefix);

Fichier diff supprimé car celui-ci est trop grand
+ 24 - 1073
db_update.php


+ 2 - 2
extern.php

@@ -128,7 +128,7 @@ function output_rss($feed)
 	echo "\t\t".'<lastBuildDate>'.gmdate('r', count($feed['items']) ? $feed['items'][0]['pubdate'] : time()).'</lastBuildDate>'."\n";
 
 	if ($pun_config['o_show_version'] == '1')
-		echo "\t\t".'<generator>FluxBB '.$pun_config['o_cur_version'].'</generator>'."\n";
+		echo "\t\t".'<generator>FluxBB '.$pun_config['s_fork_version'].'</generator>'."\n";
 	else
 		echo "\t\t".'<generator>FluxBB</generator>'."\n";
 
@@ -172,7 +172,7 @@ function output_atom($feed)
 	echo "\t".'<updated>'.gmdate('Y-m-d\TH:i:s\Z', count($feed['items']) ? $feed['items'][0]['pubdate'] : time()).'</updated>'."\n";
 
 	if ($pun_config['o_show_version'] == '1')
-		echo "\t".'<generator version="'.$pun_config['o_cur_version'].'">FluxBB</generator>'."\n";
+		echo "\t".'<generator version="'.$pun_config['s_fork_version'].'">FluxBB</generator>'."\n";
 	else
 		echo "\t".'<generator>FluxBB</generator>'."\n";
 

+ 1 - 1
footer.php

@@ -137,7 +137,7 @@ else if ($footer_style == 'viewtopic')
 }
 
 ?>
-				<p id="poweredby"><?php printf($lang_common['Powered by'], '<a href="http://fluxbb.org/">FluxBB</a>'.(($pun_config['o_show_version'] == '1') ? ' '.$pun_config['o_cur_version'] : '')) ?></p>
+				<p id="poweredby"><?php printf($lang_common['Powered by'], '<a href="https://github.com/forkbb">ForkBB</a>'.(($pun_config['o_show_version'] == '1') ? ' '.$pun_config['s_fork_version'] : '')) ?></p>
 			</div>
 			<div class="clearer"></div>
 		</div>

+ 9 - 14
include/common.php

@@ -10,11 +10,11 @@ if (!defined('PUN_ROOT'))
 	exit('The constant PUN_ROOT must be defined and point to a valid FluxBB installation root directory.');
 
 // Define the version and database revision that this code was written for
-define('FORUM_VERSION', '1.5.10');
-define('FORUM_VER_REVISION', 75);	// номер сборки - Visman
-define('FORUM_DB_REVISION', 21);
-define('FORUM_SI_REVISION', 2.1);
-define('FORUM_PARSER_REVISION', 2);
+define('FORK_VERSION', '0.0.0');
+define('FORK_REVISION', 1);
+define('FORK_DB_REVISION', 21);
+define('FORK_SI_REVISION', 2.1);
+define('FORK_PARSER_REVISION', 2);
 
 define('MIN_PHP_VERSION', '5.6.0');
 define('MIN_MYSQL_VERSION', '4.1.2');
@@ -99,15 +99,10 @@ if (!defined('PUN_CONFIG_LOADED'))
 }
 
 // Verify that we are running the proper database schema revision
-if (!isset($pun_config['o_database_revision']) || $pun_config['o_database_revision'] < FORUM_DB_REVISION ||
-		!isset($pun_config['o_searchindex_revision']) || $pun_config['o_searchindex_revision'] < FORUM_SI_REVISION ||
-		!isset($pun_config['o_parser_revision']) || $pun_config['o_parser_revision'] < FORUM_PARSER_REVISION ||
-		!isset($pun_config['o_cur_ver_revision']) || $pun_config['o_cur_ver_revision'] < FORUM_VER_REVISION ||
-		version_compare($pun_config['o_cur_version'], FORUM_VERSION, '<'))
-	{
-		header('Location: db_update.php');
-		exit;
-	}
+if (empty($pun_config['i_fork_revision']) || $pun_config['i_fork_revision'] < FORK_REVISION) {
+	header('Location: db_update.php');
+	exit;
+}
 
 // Enable output buffering
 if (!defined('PUN_DISABLE_BUFFERING'))

+ 1 - 1
lang/English/common.php

@@ -142,7 +142,7 @@ $lang_common = array(
 'Unstick topic'						=>	'Unstick topic',
 'Stick topic'						=>	'Stick topic',
 'Moderate forum'					=>	'Moderate forum',
-'Powered by' => 'Powered by %s<br />Modified by &#x56;&#x69;&#x73;&#x6D;&#x61;&#x6E;',
+'Powered by' => 'Powered by %s',
 
 // Debug information
 'Debug table'						=>	'Debug information',

+ 1 - 1
lang/Russian/common.php

@@ -142,7 +142,7 @@ $lang_common = array(
 'Unstick topic' => 'Снять выделение темы',
 'Stick topic' => 'Выделить тему',
 'Moderate forum' => 'Модерирование раздела',
-'Powered by' => 'Под управлением %s<br />Модифицировал &#x56;&#x69;&#x73;&#x6D;&#x61;&#x6E;',
+'Powered by' => 'Под управлением %s',
 
 // Debug information
 'Debug table' => 'Отладочная информация',

+ 1 - 1
lang/Russian/update.php

@@ -17,7 +17,7 @@ $lang_update = array(
 'Maintenance message'		    =>	'Сообщение обслуживания',
 
 'You are running error'			=>	'Вы используете %1$s версии %2$s. ForkBB %3$s требует как минимум %1$s %4$s для своей работы. Вы должны обновить ваш %1$s, прежде чем продолжить.',
-'Version mismatch error'		=>	'Несоответствие версии. База данных \'%s\' не может быть сконвертирована этим скриптом до структуры текущей ForkBB.',
+'Version mismatch error'		=>	'Несоответствие версии. База данных \'%s\' не может быть сконвертирована этим скриптом до текущей структуры ForkBB.',
 'Invalid file error'			=>	'Неправильное имя файла базы данных. Имя файла базы данных SQLite должно точно соответствовать тому, что указано в конфигурационном файле \'%s\'',
 'Invalid password error'		=>	'Неправильный пароль базы данных. Для обновления ForkBB вы должны ввести пароль к базе форума в соответствии с данными из \'%s\'',
 'No password error'				=>	'Отсутствует пароль базы данных',

+ 1 - 1
readme.md

@@ -1,4 +1,4 @@
-# ForkBB 0.0 Pre-Alpha Readme
+# ForkBB 0.0.0 Pre-Alpha Readme
 
 ## About
 

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff