| version 1.4, 2012/09/28 18:49:48 |
version 1.5, 2012/10/07 15:45:58 |
|
|
| $link = $_GET['link']; |
$link = $_GET['link']; |
| require_once 'cfgldr.inc.php'; |
require_once 'cfgldr.inc.php'; |
| |
|
| |
ezin_cgi_parse(); |
| |
|
| $link_file_type = -1; |
$link_file_type = -1; |
| |
|
| // type 0 |
// type 0 |
| Line 63 if ($link == 'index.php' |
|
| Line 65 if ($link == 'index.php' |
|
| || in_array('ezin_print', $setvars)) |
|| in_array('ezin_print', $setvars)) |
| ) |
) |
| { // redirect |
{ // redirect |
| ezin_cgi_parse(); |
|
| |
|
| // section |
// section |
| if (in_array('ezin_section_key', $setvars)) { |
if (in_array('ezin_section_key', $setvars)) { |
| Line 107 if ($link == 'index.php' |
|
| Line 108 if ($link == 'index.php' |
|
| if (strlen($link) == 0) { |
if (strlen($link) == 0) { |
| $link = 'index.php'; |
$link = 'index.php'; |
| } |
} |
| |
// redirect for old access-key |
| |
$keys = array( |
| |
array('ezin_article_key', 'article_id'), |
| |
array('ezin_section_key', 'section_id'), |
| |
array('ezin_author_key', 'author_id') |
| |
); |
| |
foreach ($keys as $key) { |
| |
$id_param = Platon::parse_id_param($key[0]); |
| |
$ar = ezin_validate_IDs(array($key[1] => $id_param)); |
| |
if (isset($ar['redirect']) |
| |
&& $ar['redirect']) |
| |
{ |
| |
ezin_redirect_auto($ar); |
| |
} |
| |
} |
| |
// end redirect for old access-key |
| |
|
| require_once $link; |
require_once $link; |
| } |
} |
| } |
} |
| Line 117 if (in_array($link, array('section.php', |
|
| Line 135 if (in_array($link, array('section.php', |
|
| if ( $ezin_cfg['link_file_type'] != 1 |
if ( $ezin_cfg['link_file_type'] != 1 |
| && $ezin_cfg['link_redirect'] > 0) |
&& $ezin_cfg['link_redirect'] > 0) |
| { // redirect |
{ // redirect |
| ezin_cgi_parse(); |
|
| switch ($link) { |
switch ($link) { |
| case 'section.php': |
case 'section.php': |
| $section_id = Platon::parse_id_param(); |
$section_id = Platon::parse_id_param(); |
| Line 139 if (in_array($link, array('section.php', |
|
| Line 157 if (in_array($link, array('section.php', |
|
| } |
} |
| |
|
| } else { // normal |
} else { // normal |
| |
// redirect for old access-key |
| |
$id_param = Platon::parse_id_param(); |
| |
switch($link) { |
| |
case 'article.php': |
| |
$ar = ezin_validate_IDs(array('article_id' => $id_param)); |
| |
break; |
| |
case 'section.php': |
| |
$ar = ezin_validate_IDs(array('section_id' => $id_param)); |
| |
break; |
| |
case 'author.php': |
| |
$ar = ezin_validate_IDs(array('author_id' => $id_param)); |
| |
break; |
| |
} |
| |
if (isset($ar['redirect']) |
| |
&& $ar['redirect']) |
| |
{ |
| |
ezin_redirect_auto($ar); |
| |
} |
| |
// end redirect for old access-key |
| require_once $link; |
require_once $link; |
| } |
} |
| } |
} |
| Line 159 if (strlen($link) > 0 |
|
| Line 196 if (strlen($link) > 0 |
|
| if (count($args) == 1 |
if (count($args) == 1 |
| && strlen($args[0]) > 0) |
&& strlen($args[0]) > 0) |
| { |
{ |
| ezin_redirect_section($args[0]); |
$ar = ezin_validate_IDs(array('section_id' => $args[0])); |
| |
if (intval($ar['section_id']) > 0) { |
| |
ezin_redirect_section($args[0]); |
| |
} else { |
| |
$ar = ezin_validate_IDs(array('article_id' => $args[0])); |
| |
if (intval($ar['article_id']) > 0) { |
| |
ezin_redirect_article($args[0]); |
| |
} |
| |
} |
| } |
} |
| |
|
| // others, default: article |
// others, default: article |
| Line 196 if (strlen($link) > 0 |
|
| Line 241 if (strlen($link) > 0 |
|
| && strlen($args[0]) > 0) |
&& strlen($args[0]) > 0) |
| { |
{ |
| require_once 'cfgldr.inc.php'; |
require_once 'cfgldr.inc.php'; |
| |
// redirect for old access-key |
| $ar = ezin_validate_IDs(array('article_id' => $args[0])); |
$ar = ezin_validate_IDs(array('article_id' => $args[0])); |
| |
if (isset($ar['redirect']) |
| |
&& $ar['redirect']) |
| |
{ |
| |
ezin_redirect_auto($ar); |
| |
} |
| |
// end redirect for old access-key |
| |
|
| if (intval($ar['article_id']) > 0) { |
if (intval($ar['article_id']) > 0) { |
| $ezin_cgi['query_string'] = $args; |
$ezin_cgi['query_string'] = $args; |
| $ezin_cgi['input'] = 'article'; |
$ezin_cgi['input'] = 'article'; |
| Line 216 if (strlen($link) > 0 |
|
| Line 269 if (strlen($link) > 0 |
|
| $showed = false; |
$showed = false; |
| if (ezin_get_rewrite_key($args[0]) == 'author') { |
if (ezin_get_rewrite_key($args[0]) == 'author') { |
| array_shift($args); |
array_shift($args); |
| |
// redirect for old access-key |
| |
$ar = ezin_validate_IDs(array('author_id' => $args[0])); |
| |
if (isset($ar['redirect']) |
| |
&& $ar['redirect']) |
| |
{ |
| |
ezin_redirect_auto($ar); |
| |
} |
| |
// end redirect for old access-key |
| $ezin_cgi['query_string'] = $args; |
$ezin_cgi['query_string'] = $args; |
| $ezin_cgi['input'] = 'author'; |
$ezin_cgi['input'] = 'author'; |
| $showed = true; |
$showed = true; |
| Line 228 if (strlen($link) > 0 |
|
| Line 289 if (strlen($link) > 0 |
|
| } |
} |
| if (!$showed) { |
if (!$showed) { |
| array_shift($args); |
array_shift($args); |
| |
// redirect for old access-key |
| |
$ar = ezin_validate_IDs(array('article_id' => $args[0])); |
| |
if (isset($ar['redirect']) |
| |
&& $ar['redirect']) |
| |
{ |
| |
ezin_redirect_auto($ar); |
| |
} |
| |
// end redirect for old access-key |
| $ezin_cgi['query_string'] = $args; |
$ezin_cgi['query_string'] = $args; |
| $ezin_cgi['input'] = 'article'; |
$ezin_cgi['input'] = 'article'; |
| } |
} |