diff --git a/install/sql/mysql.sql b/install/sql/mysql.sql
index 2b2d15e73..08af7c232 100644
--- a/install/sql/mysql.sql
+++ b/install/sql/mysql.sql
@@ -581,6 +581,7 @@ INSERT INTO `bb_config` VALUES ('show_mod_index', '0');
INSERT INTO `bb_config` VALUES ('premod', '0');
INSERT INTO `bb_config` VALUES ('new_tpls', '1');
INSERT INTO `bb_config` VALUES ('tor_comment', '1');
+INSERT INTO `bb_config` VALUES ('terms', '');
-- --------------------------------------------------------
diff --git a/upgrade/r600-stable.php b/upgrade/r600-stable.php
index b11071ac2..396506c53 100644
--- a/upgrade/r600-stable.php
+++ b/upgrade/r600-stable.php
@@ -137,6 +137,7 @@ ALTER TABLE `bb_posts` ADD `poster_rg_id` mediumint(8) NOT NULL DEFAULT '0' AFTE
// добавлено 598 ↑
ALTER TABLE `bb_posts` ADD `attach_rg_sig` tinyint(4) NOT NULL DEFAULT '0' AFTER `poster_rg_id`;
// добавлено 598 ↑
+INSERT INTO `bb_config` VALUES ('terms', ''); // добавлено 599b
Удаленные файлы/папки:
diff --git a/upload/admin/admin_cron.php b/upload/admin/admin_cron.php
index fc168e67f..2f45987c6 100644
--- a/upload/admin/admin_cron.php
+++ b/upload/admin/admin_cron.php
@@ -38,7 +38,7 @@ foreach ($sql as $row)
if (isset($_POST['submit']) && $row['config_value'] != $new[$config_name])
{
- bb_update_config(array($config_name => $new[$config_name]));
+ bb_update_config(array($config_name => $new[$config_name]));
}
}
diff --git a/upload/admin/admin_terms.php b/upload/admin/admin_terms.php
new file mode 100644
index 000000000..cb9437927
--- /dev/null
+++ b/upload/admin/admin_terms.php
@@ -0,0 +1,25 @@
+ $_POST['message']));
+ bb_die($lang['CONFIG_UPDATED']);
+}
+
+$template->assign_vars(array(
+ 'S_ACTION' => 'admin_terms.php',
+ 'EXT_LINK_NW' => $bb_cfg['ext_link_new_win'],
+ 'MESSAGE' => ($bb_cfg['terms']) ? $bb_cfg['terms'] : '',
+ 'PREVIEW_HTML' => (isset($_REQUEST['preview'])) ? bbcode2html($_POST['message']) : '',
+));
+
+print_page('admin_terms.tpl', 'admin');
\ No newline at end of file
diff --git a/upload/config.php b/upload/config.php
index 3de83cea6..904042443 100644
--- a/upload/config.php
+++ b/upload/config.php
@@ -72,8 +72,8 @@ $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $do
// Version info
$bb_cfg['tp_version'] = '2.1 (RC)';
-$bb_cfg['tp_release_date'] = '30-08-2014';
-$bb_cfg['tp_release_state'] = 'R599';
+$bb_cfg['tp_release_date'] = '31-08-2014';
+$bb_cfg['tp_release_state'] = 'R599b';
// Database
$charset = 'utf8';
@@ -88,18 +88,18 @@ $bb_cfg['db']['db1'] = array('localhost', 'dbase', 'user', 'pass', $charset, $pc
$bb_cfg['db_alias'] = array(
// 'alias' => 'srv_name'
# db1
- 'log' => 'db1', // BB_LOG
- 'search' => 'db1', // BB_TOPIC_SEARCH
- 'sres' => 'db1', // BB_BT_USER_SETTINGS, BB_SEARCH_RESULTS
- 'u_ses' => 'db1', // BB_USER_SES, BB_USER_LASTVISIT
+ 'log' => 'db1', // BB_LOG
+ 'search' => 'db1', // BB_TOPIC_SEARCH
+ 'sres' => 'db1', // BB_BT_USER_SETTINGS, BB_SEARCH_RESULTS
+ 'u_ses' => 'db1', // BB_USER_SES, BB_USER_LASTVISIT
# db2
- 'dls' => 'db1', // BB_BT_DLS_*
- 'ip' => 'db1', // BB_POSTS_IP
- 'ut' => 'db1', // BB_TOPICS_USER_POSTED
+ 'dls' => 'db1', // BB_BT_DLS_*
+ 'ip' => 'db1', // BB_POSTS_IP
+ 'ut' => 'db1', // BB_TOPICS_USER_POSTED
# db3
- 'cap' => 'db1', // BB_CAPTCHA
- 'pm' => 'db1', // BB_PRIVMSGS, BB_PRIVMSGS_TEXT
- 'pt' => 'db1', // BB_POSTS_TEXT
+ 'cap' => 'db1', // BB_CAPTCHA
+ 'pm' => 'db1', // BB_PRIVMSGS, BB_PRIVMSGS_TEXT
+ 'pt' => 'db1', // BB_POSTS_TEXT
);
// Cache
@@ -121,12 +121,13 @@ $bb_cfg['cache']['redis'] = array(
// Available cache types: memcache, sqlite, redis, eaccelerator, apc, xcache (default of filecache)
# name => array( (string) type, (array) cfg )
$bb_cfg['cache']['engines'] = array(
- 'bb_cache' => array('filecache', array()),
- 'tr_cache' => array('filecache', array()),
- 'session_cache' => array('filecache', array()),
- 'bb_cap_sid' => array('filecache', array()),
- 'bb_login_err' => array('filecache', array()),
- 'bb_poll_data' => array('filecache', array()),
+ 'bb_cache' => array('filecache', array()),
+ 'bb_config' => array('filecache', array()),
+ 'tr_cache' => array('filecache', array()),
+ 'session_cache' => array('filecache', array()),
+ 'bb_cap_sid' => array('filecache', array()),
+ 'bb_login_err' => array('filecache', array()),
+ 'bb_poll_data' => array('filecache', array()),
);
// Datastore
// Available datastore types: memcache, sqlite, redis, eaccelerator, apc, xcache (default filecache)
@@ -148,8 +149,8 @@ $bb_cfg['js_ver'] = 1;
$bb_cfg['css_ver'] = 1;
// Backup
-$bb_cfg['db_backup_shell_cmd'] = ''; // '/path/to/db_backup.sh 2>&1'
-$bb_cfg['site_backup_shell_cmd'] = '';
+$bb_cfg['db_backup_shell_cmd'] = ''; // '/path/to/db_backup.sh 2>&1'
+$bb_cfg['site_backup_shell_cmd'] = '';
// GZip
$bb_cfg['gzip_compress'] = true; // compress output
@@ -292,10 +293,10 @@ else
}
$bb_cfg['languages'] = array(
-// 'folder' => 'Name',
- 'ru' => 'Русский',
- 'uk' => 'Український',
- 'en' => 'English',
+// 'folder' => 'Name',
+ 'ru' => 'Русский',
+ 'uk' => 'Український',
+ 'en' => 'English',
);
// Templates
@@ -600,7 +601,7 @@ $banned_user_agents = array(
$bb_cfg['trash_forum_id'] = 0; // (int) 7
$bb_cfg['first_logon_redirect_url'] = 'index.php';
-$bb_cfg['terms_and_conditions_url'] = 'index.php';
+$bb_cfg['terms_and_conditions_url'] = 'terms.php';
$bb_cfg['user_agreement_url'] = 'misc.php?do=info&show=user_agreement';
$bb_cfg['copyright_holders_url'] = 'misc.php?do=info&show=copyright_holders';
diff --git a/upload/includes/functions.php b/upload/includes/functions.php
index d6b7e5e25..bb7aaea27 100644
--- a/upload/includes/functions.php
+++ b/upload/includes/functions.php
@@ -1288,7 +1288,7 @@ function get_attachments_dir ($cfg = null)
function bb_get_config ($table, $from_db = false, $update_cache = true)
{
- if ($from_db OR !$cfg = CACHE('bb_cache')->get("config_{$table}"))
+ if ($from_db OR !$cfg = CACHE('bb_config')->get("config_{$table}"))
{
$cfg = array();
foreach (DB()->fetch_rowset("SELECT * FROM $table") as $row)
@@ -1297,7 +1297,7 @@ function bb_get_config ($table, $from_db = false, $update_cache = true)
}
if ($update_cache)
{
- CACHE('bb_cache')->set("config_{$table}", $cfg);
+ CACHE('bb_config')->set("config_{$table}", $cfg);
}
}
return $cfg;
@@ -1316,6 +1316,7 @@ function bb_update_config ($params, $table = BB_CONFIG)
$updates = DB()->build_array('MULTI_INSERT', $updates);
DB()->query("REPLACE INTO $table $updates");
+
// Update cache
bb_get_config($table, true, true);
}
diff --git a/upload/includes/init_bb.php b/upload/includes/init_bb.php
index 38592736f..c022bd5a3 100644
--- a/upload/includes/init_bb.php
+++ b/upload/includes/init_bb.php
@@ -215,18 +215,18 @@ define('TOR_TMP', 10); // временная
define('TOR_PREMOD', 11); // премодерация
$bb_cfg['tor_icons'] = array(
- TOR_NOT_APPROVED => '*',
- TOR_CLOSED => 'x',
- TOR_APPROVED => '√',
- TOR_NEED_EDIT => '?',
- TOR_NO_DESC => '!',
- TOR_DUP => 'D',
- TOR_CLOSED_CPHOLD => '©',
- TOR_CONSUMED => '∑',
- TOR_DOUBTFUL => '#',
- TOR_CHECKING => '%',
- TOR_TMP => 'T',
- TOR_PREMOD => '∏',
+ TOR_NOT_APPROVED => '*',
+ TOR_CLOSED => 'x',
+ TOR_APPROVED => '√',
+ TOR_NEED_EDIT => '?',
+ TOR_NO_DESC => '!',
+ TOR_DUP => 'D',
+ TOR_CLOSED_CPHOLD => '©',
+ TOR_CONSUMED => '∑',
+ TOR_DOUBTFUL => '#',
+ TOR_CHECKING => '%',
+ TOR_TMP => 'T',
+ TOR_PREMOD => '∏',
);
// Запрет на скачивание
@@ -468,10 +468,8 @@ $html = new html_common();
$log_action = new log_action();
$ads = new ads_common();
-// !!! Temporarily (??) 'cat_forums' always enqueued
-$datastore->enqueue(array(
- 'cat_forums',
-));
+// TODO temporarily 'cat_forums' always enqueued
+$datastore->enqueue(array('cat_forums'));
// Дата старта вашего проекта
if (!$bb_cfg['board_startdate'])
@@ -488,13 +486,13 @@ if ((empty($_POST) && !defined('IN_ADMIN') && !defined('IN_AJAX') && !file_exist
// Update cron_last_check
bb_update_config(array('cron_last_check' => (TIMENOW + 10)));
- define('CRON_LOG_ENABLED', true); // global ON/OFF
- define('CRON_FORCE_LOG', false); // always log regardless of job settings
+ define('CRON_LOG_ENABLED', true); // global ON/OFF
+ define('CRON_FORCE_LOG', false); // always log regardless of job settings
define('CRON_DIR', INC_DIR .'cron/');
define('CRON_JOB_DIR', CRON_DIR .'jobs/');
- define('CRON_LOG_DIR', 'cron/'); // inside LOG_DIR
- define('CRON_LOG_FILE', 'cron'); // without ext
+ define('CRON_LOG_DIR', 'cron/'); // inside LOG_DIR
+ define('CRON_LOG_FILE', 'cron'); // without ext
bb_log(date('H:i:s - ') . getmypid() .' -x-- DB-LOCK try'. LOG_LF, CRON_LOG_DIR .'cron_check');
diff --git a/upload/language/en/main.php b/upload/language/en/main.php
index 95263429f..23e870088 100644
--- a/upload/language/en/main.php
+++ b/upload/language/en/main.php
@@ -2877,4 +2877,7 @@ $lang['ATOM_NO_FORUM'] = 'This forum does not have a feed (no ongoing topics)';
$lang['ATOM_NO_USER'] = 'This user does not have a feed (no ongoing topics)';
$lang['HASH_INVALID'] = 'Hash %s is invalid';
-$lang['HASH_NOT_FOUND'] = 'Release with hash %s not found';
\ No newline at end of file
+$lang['HASH_NOT_FOUND'] = 'Release with hash %s not found';
+
+$lang['TERMS_EMPTY_TEXT'] = '[align=center]The text of this page is edited at: [url=http://%s/admin/admin_terms.php]admin/admin_terms.php[/url]. This line can see only administrators.[/align]';
+$lang['TERMS_EXPLAIN'] = 'On this page, you can specify the text of the basic rules of the resource is displayed to users.';
\ No newline at end of file
diff --git a/upload/language/ru/main.php b/upload/language/ru/main.php
index 5cb40e2e3..a1d1a699f 100644
--- a/upload/language/ru/main.php
+++ b/upload/language/ru/main.php
@@ -2877,4 +2877,7 @@ $lang['ATOM_NO_FORUM'] = 'Для этого форума нет ленты (не
$lang['ATOM_NO_USER'] = 'Для этого пользователя нет ленты (нет начатых тем)';
$lang['HASH_INVALID'] = 'Хэш %s некорректен';
-$lang['HASH_NOT_FOUND'] = 'Раздача с хэшем %s не найдена';
\ No newline at end of file
+$lang['HASH_NOT_FOUND'] = 'Раздача с хэшем %s не найдена';
+
+$lang['TERMS_EMPTY_TEXT'] = '[align=center]Текст этой страницы редактируется по адресу: [url=http://%s/admin/admin_terms.php]admin/admin_terms.php[/url]. Эту строку видят только администраторы.[/align]';
+$lang['TERMS_EXPLAIN'] = 'На данной странице вы можете указать текст основных правил ресурса, выводящихся пользователям.';
\ No newline at end of file
diff --git a/upload/language/uk/main.php b/upload/language/uk/main.php
index b9ea61065..705082b02 100644
--- a/upload/language/uk/main.php
+++ b/upload/language/uk/main.php
@@ -2877,4 +2877,7 @@ $lang['ATOM_NO_FORUM'] = 'Для цього форуму немає стрічк
$lang['ATOM_NO_USER'] = 'Для цього користувача немає стрічки (немає початих тем)';
$lang['HASH_INVALID'] = 'Хеш %s некоректний';
-$lang['HASH_NOT_FOUND'] = 'Роздача з хешем %s не знайдено';
\ No newline at end of file
+$lang['HASH_NOT_FOUND'] = 'Роздача з хешем %s не знайдено';
+
+$lang['TERMS_EMPTY_TEXT'] = '[align=center]Текст цієї сторінки редагується за адресою: [url=http://%s/admin/admin_terms.php]admin/admin_terms.php[/url]. Цю рядок бачать тільки адміністраторам.[/align]';
+$lang['TERMS_EXPLAIN'] = 'На цій сторінці ви можете вказати текст основних правил ресурсу, які виводяться користувачам.';
\ No newline at end of file
diff --git a/upload/templates/admin/admin_cron.tpl b/upload/templates/admin/admin_cron.tpl
index 856cc9661..fb6159715 100644
--- a/upload/templates/admin/admin_cron.tpl
+++ b/upload/templates/admin/admin_cron.tpl
@@ -1,11 +1,11 @@
@@ -24,60 +24,59 @@ tr.hl-tr:hover td { background-color: #CFC !important; }
@@ -142,12 +141,12 @@ tr.hl-tr:hover td { background-color: #CFC !important; }
- {L_CRON_ACTIVE}
+ {L_CRON_ACTIVE}
{L_CRON_ACTIVE_EXPL}
|
-
-
+
+
|
@@ -189,7 +188,7 @@ tr.hl-tr:hover td { background-color: #CFC !important; }
{L_LOG_ENABLED} |
-
+
|
@@ -200,14 +199,14 @@ tr.hl-tr:hover td { background-color: #CFC !important; }
{L_LOG_SQL_QUERIES} |
-
+
|
{L_FORUM_DISABLE}{L_BOARD_DISABLE_EXPL} |
-
+
|
diff --git a/upload/templates/admin/admin_terms.tpl b/upload/templates/admin/admin_terms.tpl
new file mode 100644
index 000000000..4da5dcd63
--- /dev/null
+++ b/upload/templates/admin/admin_terms.tpl
@@ -0,0 +1,25 @@
+
+{L_TERMS}
+
+{L_TERMS_EXPLAIN}
+
+
+
+
+
\ No newline at end of file
diff --git a/upload/templates/default/page_header.tpl b/upload/templates/default/page_header.tpl
index 52d8ef08d..eab1df04f 100644
--- a/upload/templates/default/page_header.tpl
+++ b/upload/templates/default/page_header.tpl
@@ -21,8 +21,8 @@
window.encURL = encodeURIComponent;