=================================================================== RCS file: /home/cvsd/home/cvs/Metafox/rewrite.php,v retrieving revision 1.8 retrieving revision 1.10 diff -u -p -r1.8 -r1.10 --- Metafox/rewrite.php 2012/10/10 18:28:51 1.8 +++ Metafox/rewrite.php 2014/01/02 11:02:26 1.10 @@ -132,7 +132,7 @@ if ($link == 'index.php' } // type 1 -if (in_array($link, array('section.php', 'article.php', 'author.php', 'print.php'))) { +if (in_array($link, array('section.php', 'article.php', 'author.php', 'print.php', 'message.php'))) { $link_file_type = 1; if ( $ezin_cfg['link_file_type'] != 1 && $ezin_cfg['link_redirect'] > 0) @@ -155,13 +155,16 @@ if (in_array($link, array('section.php', $article_id = Platon::parse_id_param(); ezin_redirect_print($article_id); break; - + case 'message.php': + $message_id = Platon::parse_id_param(); + ezin_redirect_message($message_id); + break; } } else { // normal if ($ezin_cfg['redirect_equal_url'] == 1) { // redirect for old access-key - $id_param = Platon::parse_id_param(); + $id_param = Platon::parse_id_param(); switch($link) { case 'article.php': $ar = ezin_validate_IDs(array('article_id' => $id_param)); @@ -172,6 +175,9 @@ if (in_array($link, array('section.php', case 'author.php': $ar = ezin_validate_IDs(array('author_id' => $id_param)); break; + case 'message.php': + $ar = ezin_validate_IDs(array('message_id' => $id_param)); + break; } if (isset($ar['redirect']) && $ar['redirect']) @@ -225,6 +231,10 @@ if (strlen($link) > 0 ezin_redirect_print($args[1]); $showed = true; } + if (ezin_get_rewrite_key($args[0]) == 'message') { + ezin_redirect_message($args[1]); + $showed = true; + } if (!$showed) { ezin_redirect_article($args[1]); } @@ -302,11 +312,22 @@ if (strlen($link) > 0 $ezin_cgi['input'] = 'print'; $showed = true; } - if (!$showed) { + if (ezin_get_rewrite_key($args[0]) == 'message') { array_shift($args); + $ezin_cgi['query_string'] = $args; + $ezin_cgi['input'] = 'message'; + $showed = true; + } + if (!$showed) { + $section_id = array_shift($args); if ($ezin_cfg['redirect_equal_url'] == 1) { // redirect for old access-key - $ar = ezin_validate_IDs(array('article_id' => $args[0])); + if ($section_id == $args[0]) { + $ar = ezin_validate_IDs(array('section_id' => $args[0])); + $ar['redirect'] = true; + } else { + $ar = ezin_validate_IDs(array('article_id' => $args[0])); + } if (isset($ar['redirect']) && $ar['redirect']) {