* of the License, or (at your option) any later version.\r
* (see nucleus/documentation/index.html#license for more info)\r
*\r
- * $Id: globalfunctions.php,v 1.4 2005-03-15 07:59:27 kimitake Exp $\r
- * $NucleusJP$\r
+ * $Id: globalfunctions.php,v 1.5 2005-03-19 09:05:40 kimitake Exp $\r
+ * $NucleusJP: globalfunctions.php,v 1.4 2005/03/15 07:59:27 kimitake Exp $\r
*/\r
\r
// needed if we include globalfunctions from install.php\r
$obj = mysql_fetch_object($res);\r
\r
// if a different blog id has been set through the request or selectBlog(),\r
- // deny access\r
- if ($blogid && (intval($blogid) != $obj->iblog))\r
- doError(_ERROR_NOSUCHITEM);\r
+ // jump to correct url\r
+// if ($blogid && (intval($blogid) != $obj->iblog))\r
+// doError(_ERROR_NOSUCHITEM);\r
+ if ($blogid && (intval($blogid) != $obj->iblog)) {\r
+ if (!headers_sent()) {\r
+ $b =& $manager->getBlog($obj->iblog);\r
+ $correctURL = $b->getURL();\r
+\r
+ if ($CONF['URLMode'] == 'pathinfo') {\r
+ if (substr($correctURL,strlen($correctURL)-1,1)=='/')\r
+ $correctURL .= 'item/' . $itemid;\r
+ else\r
+ $correctURL .= '/item/' . $itemid;\r
+ }\r
+ else\r
+ $correctURL .= '?itemid=' . $itemid;\r
+\r
+ redirect('Location: ' . $correctURL);\r
+ exit;\r
+ }\r
+ else doError(_ERROR_NOSUCHITEM);\r
+ }\r
\r
$blogid = $obj->iblog;\r
$timestamp = strtotime($obj->itime);\r