[ Index ]

PHP Cross Reference of E107 v0.7.22 code documentation

title

Body

[close]

/ -> content.php (source)

   1  <?php
   2  /*
   3  + ----------------------------------------------------------------------------+
   4  |     e107 website system
   5  |
   6  |     ©Steve Dunstan 2001-2002
   7  |     http://e107.org
   8  |     jalist@e107.org
   9  |
  10  |     Released under the terms and conditions of the
  11  |     GNU General Public License (http://gnu.org).
  12  |
  13  |     $Source: /cvs_backup/e107_0.7/content.php,v $
  14  |     $Revision: 11346 $
  15  |     $Date: 2010-02-17 13:56:14 -0500 (Wed, 17 Feb 2010) $
  16  |     $Author: secretr $
  17  +----------------------------------------------------------------------------+
  18  */
  19      
  20  require_once ("class2.php");
  21  
  22  //##### REDIRECTION MANAGEMENT -----------------------------------------------------------------------------
  23  if($content_install = varset($pref['plug_installed']['content']))
  24  {
  25      //require_once($plugindir."handlers/content_class.php");
  26      //$aa = new content;
  27      
  28      $tmp = explode(".", e_QUERY);
  29      if($tmp[0]){
  30          //get type_id from the row with heading content, article or review
  31          //this will only work if the three main parents are not renamed !
  32          if(!$sql -> db_Select("pcontent", "content_id", "content_heading='".$tp -> toDB($tmp[0])."'")){
  33              header("location:".e_PLUGIN."content/content.php");
  34              exit;
  35          }else{
  36              $row = $sql -> db_Fetch();
  37          }
  38      }
  39      if ($tmp[0] == "content") {
  40          if (is_numeric($tmp[1])) {                        //content view
  41              
  42              $tmp[1] = intval($tmp[1]);
  43              header("location:".e_PLUGIN."content/content.php?content.".$tmp[1]);
  44              exit;
  45  
  46          }
  47          else
  48          {                                            //content recent page
  49              header("location:".e_PLUGIN."content/content.php?recent.".$row['content_id']);
  50              exit;
  51          }
  52  
  53      }elseif ($tmp[0] == "article" || $tmp[0] == "review") {
  54  
  55          if (is_numeric($tmp[1])) {                        //item view
  56              $tmp[1] = intval($tmp[1]);
  57              header("location:".e_PLUGIN."content/content.php?content.".$tmp[1]);
  58              exit;
  59          }
  60          elseif($tmp[1] == "cat" ) {                    //category page
  61              
  62              if(!$tmp[2] || $tmp[2] == "0") {            //all categories
  63                  //$mainparent = $aa -> getMainParent($tmp[2]);
  64                  //header("location:".e_PLUGIN."content/content.php?cat.list.".$mainparent."");
  65                  header("location:".e_PLUGIN."content/content.php");
  66                  exit;
  67              
  68              }else{                                        //view category
  69                  header("location:".e_PLUGIN."content/content.php?cat.".$tmp[2]);
  70                  exit;
  71              }
  72          
  73          }
  74          else
  75          {                                        //recent page
  76              header("location:".e_PLUGIN."content/content.php?recent.".$row['content_id']);
  77              exit;
  78          }
  79      }
  80      else
  81      {                                                //redirect to new content main page
  82          header("location:".e_PLUGIN."content/content.php");
  83          exit;
  84      }
  85  }
  86  header("location:".e_BASE."index.php");
  87  exit;
  88  //##### END REDIRECTION MANAGEMENT -------------------------------------------------------------------------
  89  ?>


Generated: Tue Aug 3 00:19:13 2010
Open Source related documentation for developers.