1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00
php-e107/content.php

81 lines
2.6 KiB
PHP
Raw Normal View History

2006-12-02 04:36:16 +00:00
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <EFBFBD>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/content.php,v $
2007-12-28 01:17:00 +00:00
| $Revision: 1.2 $
| $Date: 2007-12-28 01:17:00 $
2006-12-02 04:36:16 +00:00
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("class2.php");
//##### REDIRECTION MANAGEMENT -----------------------------------------------------------------------------
if($content_install = $sql -> db_Select("plugin", "*", "plugin_path = 'content' AND plugin_installflag = '1' ")){
//require_once($plugindir."handlers/content_class.php");
//$aa = new content;
$tmp = explode(".", e_QUERY);
if($tmp[0]){
//get type_id from the row with heading content, article or review
//this will only work if the three main parents are not renamed !
if(!$sql -> db_Select("pcontent", "content_id", "content_heading='".$tp -> toDB($tmp[0])."'")){
header("location:".e_PLUGIN."content/content.php");
2007-12-28 01:17:00 +00:00
exit;
2006-12-02 04:36:16 +00:00
}else{
$row = $sql -> db_Fetch();
}
}
if ($tmp[0] == "content") {
if (is_numeric($tmp[1])) { //content view
$tmp[1] = intval($tmp[1]);
header("location:".e_PLUGIN."content/content.php?content.".$tmp[1]);
2007-12-28 01:17:00 +00:00
exit;
2006-12-02 04:36:16 +00:00
}else{ //content recent page
header("location:".e_PLUGIN."content/content.php?recent.".$row['content_id']);
2007-12-28 01:17:00 +00:00
exit;
2006-12-02 04:36:16 +00:00
}
}elseif ($tmp[0] == "article" || $tmp[0] == "review") {
if (is_numeric($tmp[1])) { //item view
$tmp[1] = intval($tmp[1]);
header("location:".e_PLUGIN."content/content.php?content.".$tmp[1]);
2007-12-28 01:17:00 +00:00
exit;
2006-12-02 04:36:16 +00:00
}elseif($tmp[1] == "cat" ) { //category page
if(!$tmp[2] || $tmp[2] == "0") { //all categories
//$mainparent = $aa -> getMainParent($tmp[2]);
//header("location:".e_PLUGIN."content/content.php?cat.list.".$mainparent."");
header("location:".e_PLUGIN."content/content.php");
2007-12-28 01:17:00 +00:00
exit;
2006-12-02 04:36:16 +00:00
}else{ //view category
header("location:".e_PLUGIN."content/content.php?cat.".$tmp[2]);
2007-12-28 01:17:00 +00:00
exit;
2006-12-02 04:36:16 +00:00
}
} else { //recent page
header("location:".e_PLUGIN."content/content.php?recent.".$row['content_id']);
2007-12-28 01:17:00 +00:00
exit;
2006-12-02 04:36:16 +00:00
}
}else{ //redirect to new content main page
header("location:".e_PLUGIN."content/content.php");
2007-12-28 01:17:00 +00:00
exit;
2006-12-02 04:36:16 +00:00
}
}
//##### END REDIRECTION MANAGEMENT -------------------------------------------------------------------------
2007-12-28 01:17:00 +00:00
header("location:".e_BASE."index.php");
exit;
2006-12-02 04:36:16 +00:00
?>