2008-01-16 10:47:06 +00:00
|
|
|
<?php
|
|
|
|
/*
|
2009-12-10 22:46:46 +00:00
|
|
|
* e107 website system
|
|
|
|
*
|
|
|
|
* Copyright (c) 2008-2009 e107 Inc (e107.org)
|
|
|
|
* Released under the terms and conditions of the
|
|
|
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
|
|
|
*
|
|
|
|
* Call Shortcodes via AJAX request
|
|
|
|
*
|
|
|
|
* $Source: /cvs_backup/e107_0.8/e107_files/e_ajax.php,v $
|
2010-02-10 18:18:01 +00:00
|
|
|
* $Revision$
|
|
|
|
* $Date$
|
|
|
|
* $Author$
|
2009-12-10 22:46:46 +00:00
|
|
|
*
|
2008-01-16 10:47:06 +00:00
|
|
|
*/
|
2008-01-16 22:45:56 +00:00
|
|
|
$_E107['minimal'] = TRUE;
|
2008-01-16 10:47:06 +00:00
|
|
|
require_once("../class2.php");
|
2008-11-09 20:33:24 +00:00
|
|
|
//ob_start();
|
2008-01-27 11:02:34 +00:00
|
|
|
ob_implicit_flush(0);
|
2008-01-16 10:47:06 +00:00
|
|
|
|
|
|
|
// Ajax Short-code-Replacer Routine.
|
|
|
|
|
|
|
|
$shortcodes = "";
|
2009-11-06 18:37:23 +00:00
|
|
|
// FIXME - new .php shortcodes & security (require_once)
|
2008-01-16 10:47:06 +00:00
|
|
|
if($_POST['ajax_sc'] && $_POST['ajax_scfile'])
|
|
|
|
{
|
2009-12-10 22:46:46 +00:00
|
|
|
//include_once(e_HANDLER.'shortcode_handler.php');
|
|
|
|
$file = e107::getParser()->replaceConstants($_POST['ajax_scfile']);
|
|
|
|
$shortcodes = e107::getScParser()->parse_scbatch($file);
|
2008-01-16 10:47:06 +00:00
|
|
|
}
|
|
|
|
|
2009-11-06 18:37:23 +00:00
|
|
|
if(vartrue($_POST['ajax_sc']) && e_AJAX_REQUEST)
|
2008-01-16 10:47:06 +00:00
|
|
|
{
|
2010-07-27 10:45:55 +00:00
|
|
|
// temporary fix
|
|
|
|
global $register_sc;
|
2010-07-09 18:11:06 +00:00
|
|
|
if(isset($register_sc) && is_array($register_sc)) // Fix for missing THEME shortcodes.
|
|
|
|
{
|
2010-07-27 10:45:55 +00:00
|
|
|
// parse errror fix from the previous commit
|
|
|
|
e107::getScParser()->loadThemeShortcodes();
|
2010-07-09 18:11:06 +00:00
|
|
|
}
|
2009-11-06 18:37:23 +00:00
|
|
|
list($fld,$parm) = explode("=", $_POST['ajax_sc'], 2);
|
|
|
|
$prm = ($parm) ? "=".rawurldecode($parm) : ""; //var_dump($_GET);
|
|
|
|
echo e107::getParser()->parseTemplate("{".strtoupper($fld).$prm."}", true, $shortcodes);
|
2008-01-16 10:47:06 +00:00
|
|
|
exit;
|
|
|
|
}
|
2008-01-27 11:02:34 +00:00
|
|
|
?>
|