[geeklog-hg] geeklog: Merged with upstream
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Mon Sep 17 10:04:26 EDT 2012
changeset 8819:4bbdff15a011
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/4bbdff15a011
user: Tom <websitemaster at cogeco.net>
date: Mon Sep 17 09:57:08 2012 -0400
description:
Merged with upstream
diffstat:
language/japanese_utf-8.php | 2 +
public_html/lib-common.php | 162 +++++++++++++++++----------------------
system/classes/config.class.php | 52 +++++++-----
3 files changed, 103 insertions(+), 113 deletions(-)
diffs (truncated from 323 to 300 lines):
diff -r 5c6484f9dd1d -r 4bbdff15a011 language/japanese_utf-8.php
--- a/language/japanese_utf-8.php Fri Sep 14 09:36:06 2012 -0400
+++ b/language/japanese_utf-8.php Mon Sep 17 09:57:08 2012 -0400
@@ -1986,6 +1986,7 @@
'linktext_maxlen' => 'ã¯ãªãã«ãã«ãªã³ã¯ã®é·ã',
'compressed_output' => 'HTMLåºåãå§ç¸®ãã¦éä¿¡ãã',
'frame_options' => '"ã¯ãªãã¯ã¸ã£ããã³ã°"ãé²æ¢ãã',
+ 'page_navigation_max_pages' => 'ãã¼ã¸ããã²ã¼ã·ã§ã³ã®ãã¼ã¸æ°',
'censormode' => 'ãã§ãã¯ãã',
'censorreplace' => 'ç½®ãæããã¯ã¼ã',
'censorlist' => 'ãããã¯ã¼ã',
@@ -2202,6 +2203,7 @@
'language' => 'è¨èªãã¡ã¤ã«ãããã¾ãã',
'timezone' => 'ç¡å¹ãªã¿ã¤ã ã¾ã¼ã³ã§ã',
'single_char' => 'ãã®ãã£ã¼ã«ãã«ã¯åè§1æåãå
¥åãã¦ãã ãã',
+ 'page_navigation_max_pages' => 'ãã®ãã£ã¼ã«ãã«ã¯2ãã21ã®æ°å¤ãå
¥åãã¦ãã ãã',
'hash' => 'ãã®ãã£ã¼ã«ãã¯ããªãã®ãã¼ã¸ã§ã³ã®PHPã«ããhashé¢æ°ãå¿
è¦ã§ãã'
);
diff -r 5c6484f9dd1d -r 4bbdff15a011 public_html/lib-common.php
--- a/public_html/lib-common.php Fri Sep 14 09:36:06 2012 -0400
+++ b/public_html/lib-common.php Mon Sep 17 09:57:08 2012 -0400
@@ -5462,11 +5462,14 @@
if (function_exists('CUSTOM_printPageNavigation')) {
return CUSTOM_printPageNavigation($base_url, $curpage, $num_pages, $page_str, $do_rewrite, $msg, $open_ended);
}
-
- $retval = '';
+
+ if ($num_pages < 2) {
+ return '';
+ }
+
$first_url = '';
- $last_url = '';
-
+ $last_url = '';
+
if (is_array($base_url)) {
$first_url = current($base_url);
$last_url = end($base_url);
@@ -5474,117 +5477,94 @@
$first_url = $base_url;
}
- if ($num_pages < 2) {
- return;
- }
-
if (!$do_rewrite) {
- $hasargs = strstr($first_url, '?');
- if ($hasargs) {
- $sep = '&';
- } else {
- $sep = '?';
- }
+ $sep = strstr($first_url, '?') ? '&' : '?';
} else {
$sep = '/';
$page_str = '';
}
-
- $page_navigation = COM_newTemplate($_CONF['path_layout'] . 'page_navigation/');
- $page_navigation->set_file(array('page_navigation' => 'page_navigation.thtml',
- 'page_navigation_start' => 'page_navigation_start.thtml',
- 'page_navigation_end' => 'page_navigation_end.thtml',
- 'page' => 'page.thtml',
- 'page_current' => 'page_current.thtml',
- 'page_open_ended' => 'page_navigation_open_ended.thtml'));
-
+
+ $page_navigation = COM_newTemplate($_CONF['path_layout'] . 'page_navigation');
+ $page_navigation->set_file(array('page_navigation' => 'page_navigation.thtml',
+ 'page_navigation_start' => 'page_navigation_start.thtml',
+ 'page_navigation_end' => 'page_navigation_end.thtml',
+ 'page' => 'page.thtml',
+ 'page_current' => 'page_current.thtml',
+ 'page_open_ended' => 'page_navigation_open_ended.thtml'));
$page_navigation->set_var('lang_first', $LANG05[7]);
$page_navigation->set_var('lang_previous', $LANG05[6]);
$page_navigation->set_var('lang_next', $LANG05[5]);
$page_navigation->set_var('lang_last', $LANG05[8]);
-
+
if ($curpage > 1) {
- $pg = '';
- if (($curpage - 1) > 1) {
- $pg = $sep . $page_str . ( $curpage - 1 );
- }
-
- $page_navigation->set_var('start_first_anchortag', '<a href="' . $first_url . $last_url . '">');
- $page_navigation->set_var('end_first_anchortag', '</a>');
- $page_navigation->set_var('start_previous_anchortag', '<a href="' . $first_url . $pg . $last_url . '">');
- $page_navigation->set_var('end_previous_anchortag', '</a>');
+ $pg = '';
+ if (($curpage - 1) > 1) {
+ $pg = $sep . $page_str . ($curpage - 1);
+ }
+ $page_navigation->set_var('start_first_anchortag', '<a href="' . $first_url . $last_url . '">');
+ $page_navigation->set_var('end_first_anchortag', '</a>');
+ $page_navigation->set_var('start_previous_anchortag', '<a href="' . $first_url . $pg . $last_url . '">');
+ $page_navigation->set_var('end_previous_anchortag', '</a>');
} else {
- $page_navigation->set_var('start_first_anchortag', '');
+ $page_navigation->set_var('start_first_anchortag', '');
$page_navigation->set_var('end_first_anchortag', '');
$page_navigation->set_var('start_previous_anchortag', '');
$page_navigation->set_var('end_previous_anchortag', '');
}
$page_navigation->parse('page_navigation_start', 'page_navigation_start');
-
- $page_nav_split = intval($_CONF['page_navigation_max_pages'] / 2);
- $page_start = $curpage - $page_nav_split;
- if (intval($_CONF['page_navigation_max_pages'] / 2) == ($_CONF['page_navigation_max_pages'] / 2)) { // For even number Max Pages
- if ($page_start <= 0) {
- $page_end = $curpage + $page_nav_split - $page_start;
- $page_start = 1;
- } else {
- $page_end = $curpage + $page_nav_split - 1;
- }
- } else { // For odd number Max Pages
- if ($page_start <= 0) {
- $page_end = $curpage + $page_nav_split - $page_start + 1;
- $page_start = 1;
- } else {
- $page_end = $curpage + $page_nav_split;
- }
- }
+
+ $page_nav_left = intval($_CONF['page_navigation_max_pages'] / 2);
+ $page_nav_right = $_CONF['page_navigation_max_pages'] - $page_nav_left - 1;
+ $page_start = $curpage - $page_nav_left;
+ $odd = 0;
+ if ($page_start < 1) {
+ $odd = 1 - $page_start;
+ $page_start = 1;
+ }
+ $page_end = $curpage + $page_nav_right + $odd;
if ($page_end > $num_pages) {
- $page_start = $curpage - $page_nav_split - ($page_end - $num_pages);
+ $odd = $page_end - $num_pages;
$page_end = $num_pages;
- }
- if ($page_start <= 0) {
- $page_start = 1;
- }
-
- for ($pgcount = $page_start; ($pgcount <= $page_end) AND ($pgcount <= $num_pages); $pgcount++) {
+ if ($page_start - $odd >= 1) {
+ $page_start = $page_start - $odd;
+ }
+ }
+ for ($pgcount = $page_start; $pgcount <= $page_end; $pgcount++) {
if ($pgcount == $curpage) {
- $page_navigation->set_var('page_number', $pgcount);
- $page_navigation->parse('pages', 'page_current', true);
- } else {
- $pg = '';
- if ($pgcount > 1) {
- $pg = $sep . $page_str . $pgcount;
- }
- $page_navigation->set_var('page_number', COM_createLink($pgcount, $first_url . $pg . $last_url));
- $page_navigation->parse( 'pages', 'page', true );
- }
- }
-
- if (!empty($open_ended)) {
+ $page_navigation->set_var('page_number', $pgcount);
+ $page_navigation->parse('pages', 'page_current', true);
+ continue;
+ }
+ $pg = '';
+ if ($pgcount > 1) {
+ $pg = $sep . $page_str . $pgcount;
+ }
+ $page_navigation->set_var('page_number', COM_createLink($pgcount, $first_url . $pg . $last_url));
+ $page_navigation->parse('pages', 'page', true);
+ }
+
+ if (!empty($open_ended)) {
$page_navigation->set_var('open_ended', $open_ended);
$page_navigation->parse('page_navigation_end', 'page_open_ended');
- } else {
- if ( $curpage == $num_pages ) {
+ } else {
+ if ($curpage == $num_pages) {
$page_navigation->set_var('start_next_anchortag', '');
$page_navigation->set_var('end_next_anchortag', '');
- $page_navigation->set_var('start_last_anchortag', '');
- $page_navigation->set_var('end_last_anchortag', '');
- } else {
- $page_navigation->set_var('start_next_anchortag', '<a href="' . $first_url . $sep . $page_str . ($curpage + 1) . $last_url . '">');
- $page_navigation->set_var('end_next_anchortag', '</a>');
- $page_navigation->set_var('start_last_anchortag', '<a href="' . $first_url . $sep . $page_str . $num_pages . $last_url . '">');
- $page_navigation->set_var('end_last_anchortag', '</a>');
- }
- $page_navigation->parse('page_navigation_end', 'page_navigation_end');
- }
-
- if (!empty($retval)) {
- if (!empty($msg)) {
- $msg .= ' ';
- }
- $page_navigation->set_var('message', $msg);
- }
+ $page_navigation->set_var('start_last_anchortag', '');
+ $page_navigation->set_var('end_last_anchortag', '');
+ } else {
+ $page_navigation->set_var('start_next_anchortag', '<a href="' . $first_url . $sep . $page_str . ($curpage + 1) . $last_url . '">');
+ $page_navigation->set_var('end_next_anchortag', '</a>');
+ $page_navigation->set_var('start_last_anchortag', '<a href="' . $first_url . $sep . $page_str . $num_pages . $last_url . '">');
+ $page_navigation->set_var('end_last_anchortag', '</a>');
+ }
+ $page_navigation->parse('page_navigation_end', 'page_navigation_end');
+ }
+
+ if (!empty($msg)) {
+ $page_navigation->set_var('message', $msg . ' ');
+ }
return $page_navigation->finish($page_navigation->parse('output', 'page_navigation'));
}
diff -r 5c6484f9dd1d -r 4bbdff15a011 system/classes/config.class.php
--- a/system/classes/config.class.php Fri Sep 14 09:36:06 2012 -0400
+++ b/system/classes/config.class.php Mon Sep 17 09:57:08 2012 -0400
@@ -289,6 +289,7 @@
[$tabs[$row[2]][$row[4]][$row[5]]][$row[5]][$row[0]] = $row[0];
}
}
+ $this->_post_initconfig();
$this->_post_configuration();
return $this->config_array;
@@ -352,7 +353,6 @@
"name = '{$escaped_name}' AND group_name = '{$escaped_grp}'";
$this->_DB_escapedQuery($sql);
$this->config_array[$group][$name] = $value;
- $this->_post_configuration();
}
/**
@@ -605,31 +605,30 @@
/**
* Changes any config settings that depend on other configuration settings.
- * Called by config::initConfig and config::set
+ * Called by config::initConfig
+ *
+ * @return voif
+ */
+ function _post_initconfig()
+ {
+ global $_USER;
+
+ $theme = $this->config_array['Core']['theme'];
+ if ($this->config_array['Core']['allow_user_themes'] == 1 && !empty($_USER['theme'])) {
+ $theme = $_USER['theme'];
+ }
+ $this->config_array['Core']['path_layout'] = $this->config_array['Core']['path_themes'] . $theme . '/';
+ $this->config_array['Core']['layout_url'] = $this->config_array['Core']['site_url'] . '/layout/' . $theme;
+ }
+
+ /**
+ * Changes any config settings that depend on other configuration settings.
+ * Called by config::initConfig and config::updateConfig
*
* @return voif
*/
function _post_configuration()
{
- global $_USER;
-
- if (empty($_USER['theme'])) {
- if (! empty($this->config_array['Core']['theme'])) {
- $theme = $this->config_array['Core']['theme'];
- }
- } else {
- $theme = $_USER['theme'];
- }
-
- if (! empty($theme)) {
- if (! empty($this->config_array['Core']['path_themes'])) {
- $this->config_array['Core']['path_layout'] = $this->config_array['Core']['path_themes'] . $theme . '/';
- }
- if (! empty($this->config_array['Core']['site_url'])) {
- $this->config_array['Core']['layout_url'] = $this->config_array['Core']['site_url'] . '/layout/' . $theme;
- }
- }
-
$methods = array('standard', 'openid', '3rdparty', 'oauth');
$methods_disabled = 0;
foreach ($methods as $m) {
@@ -1525,12 +1524,20 @@
$this->config_array['Core']['language'] = unserialize($value);
/**
- * Same with $_CONF['cookiedomain'], which is overwritten in
+ * Same with $_CONF['cookiedomain'], which is overwritten
* in lib-sessions.php (if empty).
More information about the geeklog-cvs
mailing list