Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Utorok, 16. apríl 2024

Rozdiely pre Metafox/rewrite.php medzi verziami 1.4 a 1.10

verzia 1.4, 2012/09/28 18:49:48 verzia 1.10, 2014/01/02 11:02:26
Riadok 43 
Riadok 43 
 $link = $_GET['link'];  $link = $_GET['link'];
 require_once 'cfgldr.inc.php';  require_once 'cfgldr.inc.php';
   
   //ezin_cgi_parse(); trouble with link type 1 and redirects, for link type 2 no need
   
 $link_file_type = -1;  $link_file_type = -1;
   
 // type 0  // type 0
Riadok 63  if ($link == 'index.php'
Riadok 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)) {
Riadok 107  if ($link == 'index.php'
Riadok 108  if ($link == 'index.php'
                 if (strlen($link) == 0) {                  if (strlen($link) == 0) {
                         $link = 'index.php';                          $link = 'index.php';
                 }                  }
                   if ($ezin_cfg['redirect_equal_url'] == 1) {
                           // 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;
         }          }
 }  }
   
 // type 1  // 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;          $link_file_type = 1;
         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();
Riadok 135  if (in_array($link, array('section.php',
Riadok 155  if (in_array($link, array('section.php',
                                 $article_id = Platon::parse_id_param();                                  $article_id = Platon::parse_id_param();
                                 ezin_redirect_print($article_id);                                  ezin_redirect_print($article_id);
                                 break;                                  break;
                           case 'message.php':
                                   $message_id = Platon::parse_id_param();
                                   ezin_redirect_message($message_id);
                                   break;
                 }                  }
   
         } else { // normal          } else { // normal
                   if ($ezin_cfg['redirect_equal_url'] == 1) {
                           // 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;
                                   case 'message.php':
                                           $ar = ezin_validate_IDs(array('message_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;
         }          }
 }  }
Riadok 159  if (strlen($link) > 0
Riadok 206  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
Riadok 176  if (strlen($link) > 0
Riadok 231  if (strlen($link) > 0
                                 ezin_redirect_print($args[1]);                                  ezin_redirect_print($args[1]);
                                 $showed = true;                                  $showed = true;
                         }                          }
               if (ezin_get_rewrite_key($args[0]) == 'message') {
                                   ezin_redirect_message($args[1]);
                                   $showed = true;
                           }
                         if (!$showed) {                          if (!$showed) {
                                 ezin_redirect_article($args[1]);                                  ezin_redirect_article($args[1]);
                         }                          }
Riadok 196  if (strlen($link) > 0
Riadok 255  if (strlen($link) > 0
                         && strlen($args[0]) > 0)                          && strlen($args[0]) > 0)
                 {                  {
                         require_once 'cfgldr.inc.php';                          require_once 'cfgldr.inc.php';
                         $ar = ezin_validate_IDs(array('article_id' => $args[0]));                          // check article
                           if (ezin_exists_article($args[0])
                                   && ezin_exists_section($args[0]))
                           {
                                   $ar = ezin_validate_IDs(array('article_id' => $args[0]));
                           } else {
                                   $ar = ezin_validate_IDs(array('section_id' => $args[0]));
                           }
                           if ($ezin_cfg['redirect_equal_url'] == 1) {
                                   // redirect for old access-key
                                   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';
Riadok 216  if (strlen($link) > 0
Riadok 292  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);
                                   if ($ezin_cfg['redirect_equal_url'] == 1) {
                                           // 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;
Riadok 226  if (strlen($link) > 0
Riadok 312  if (strlen($link) > 0
                                 $ezin_cgi['input'] = 'print';                                  $ezin_cgi['input'] = 'print';
                                 $showed = true;                                  $showed = true;
                         }                          }
                         if (!$showed) {              if (ezin_get_rewrite_key($args[0]) == 'message') {
                                 array_shift($args);                                  array_shift($args);
                                 $ezin_cgi['query_string'] = $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
                                           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'])
                                           {
                                                   ezin_redirect_auto($ar);
                                           }
                                           // end redirect for old access-key
                                   }
                                   $ezin_cgi['query_string'] = $args;
                                 $ezin_cgi['input'] = 'article';                                  $ezin_cgi['input'] = 'article';
                         }                          }
   

Legend:
Odstranené z verzie1.4  
zmenené riadky
  Pridané vo verzii1.10

Platon Group <platon@platon.sk> http://platon.sk/
Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok