1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-07 07:06:30 +02:00

Shortcode path fixes

This commit is contained in:
CaMer0n
2010-02-10 21:53:56 +00:00
parent 2d835f43d0
commit caa79b6454
18 changed files with 685 additions and 683 deletions

View File

@@ -2167,7 +2167,7 @@ function __autoload($className)
$end = array_pop($tmp); $end = array_pop($tmp);
if('shortcodes' == $end) if('shortcodes' == $end)
{ {
$filename = e_FILE.'shortcode/batch/'.$className.'.php'; // core shortcode batch $filename = e_CORE.'shortcodes/batch/'.$className.'.php'; // core shortcode batch
break; break;
} }

View File

@@ -154,7 +154,7 @@ if(SITECONTACTINFO && $CONTACT_INFO)
if(isset($pref['sitecontacts']) && $pref['sitecontacts'] != 255) if(isset($pref['sitecontacts']) && $pref['sitecontacts'] != 255)
{ {
require_once(e_FILE."shortcode/batch/contact_shortcodes.php"); require_once(e_CORE."shortcodes/batch/contact_shortcodes.php");
$text = $tp->parseTemplate($CONTACT_FORM, TRUE, $contact_shortcodes); $text = $tp->parseTemplate($CONTACT_FORM, TRUE, $contact_shortcodes);
if(trim($text) != "") if(trim($text) != "")

View File

@@ -771,7 +771,8 @@ class system_tools
$f = new e_file; $f = new e_file;
$scList = ''; $scList = '';
$fList = $f->get_files(e_FILE.'shortcode/override', '\.sc$');
$fList = $f->get_files(e_SYSTEM.'override/shortcodes', '\.sc$');
if(count($fList)) if(count($fList))
{ {
$tmp = array(); $tmp = array();

View File

@@ -798,7 +798,7 @@ class download
function create_download($sub_action, $id) function create_download($sub_action, $id)
{ {
global $cal,$tp, $sql, $fl, $rs, $ns, $file_array, $image_array, $thumb_array,$pst; global $cal,$tp, $sql, $fl, $rs, $ns, $file_array, $image_array, $thumb_array,$pst;
require_once(e_FILE."shortcode/batch/download_shortcodes.php"); require_once(e_CORE."shortcodes/batch/download_shortcodes.php");
$mirrorArray = array(); $mirrorArray = array();

View File

@@ -104,7 +104,7 @@ $text .= "
<table cellspacing='0' cellpadding='0'> <table cellspacing='0' cellpadding='0'>
<tr> <tr>
<td style='padding:0px'>"; <td style='padding:0px'>";
require_once (e_FILE."shortcode/batch/admin_shortcodes.php"); require_once (e_CORE."shortcodes/batch/admin_shortcodes.php");
$text .= $tp->parseTemplate("{ADMIN_LATEST}"); $text .= $tp->parseTemplate("{ADMIN_LATEST}");
$text .= "</td><td style='padding:0px'>"; $text .= "</td><td style='padding:0px'>";
$text .= $tp->parseTemplate("{ADMIN_STATUS}"); $text .= $tp->parseTemplate("{ADMIN_STATUS}");

View File

@@ -33,5 +33,5 @@ $codes = array(
'admin_menumanager', 'admin_menumanager',
); );
register_shortcode('admin_shortcodes', $codes, e_FILE.'shortcode/batch/admin_shortcodes_class.php'); register_shortcode('admin_shortcodes', $codes, e_CORE.'shortcodes/batch/admin_shortcodes_class.php');
?> ?>

View File

@@ -22,7 +22,7 @@ if (!defined('e107_INIT'))
} }
include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_comment.php"); include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_comment.php");
global $comment_shortcodes; global $comment_shortcodes;
require_once (e_FILE."shortcode/batch/comment_shortcodes.php"); require_once (e_CORE."shortcodes/batch/comment_shortcodes.php");
/** /**
* Enter description here... * Enter description here...
* *

View File

@@ -589,7 +589,7 @@ class news {
} }
$loop_uid = $news['news_author']; $loop_uid = $news['news_author'];
require_once(e_FILE.'shortcode/batch/news_shortcodes.php'); require_once(e_CORE.'shortcodes/batch/news_shortcodes.php');
setScVar('news_shortcodes', 'news_item', $news); setScVar('news_shortcodes', 'news_item', $news);
setScVar('news_shortcodes', 'param', $param); setScVar('news_shortcodes', 'param', $param);
$text = $e107->tp->parseTemplate($NEWS_PARSE, true); $text = $e107->tp->parseTemplate($NEWS_PARSE, true);

View File

@@ -80,14 +80,14 @@ function display_help($tagid="helpb", $mode = 1, $addtextfunc = "addtext", $help
$BBCODE_TEMPLATE = $temp[$mode]; $BBCODE_TEMPLATE = $temp[$mode];
} }
if(is_readable(e_FILE."shortcode/batch/bbcode_shortcodes.php")) if(is_readable(e_CORE."shortcodes/batch/bbcode_shortcodes.php"))
{ {
require_once(e_FILE."shortcode/batch/bbcode_shortcodes.php"); require_once(e_CORE."shortcodes/batch/bbcode_shortcodes.php");
return $tp->parseTemplate($BBCODE_TEMPLATE); return $tp->parseTemplate($BBCODE_TEMPLATE);
} }
else else
{ {
return "ERROR: ".e_FILE."shortcode/batch/bbcode_shortcodes.php IS NOT READABLE."; return "ERROR: ".e_CORE."shortcodes/batch/bbcode_shortcodes.php IS NOT READABLE.";
} }
} }

View File

@@ -165,10 +165,11 @@ class e_shortcode
} }
/** /**
* Register any shortcode from the shortcode/override/ directory * Register any shortcode from the shortcodes/override/ directory
* *
* @return void * @return void
*/ */
//FIXME - should use e_SYSTEM/override/
protected function loadOverrideShortcodes() protected function loadOverrideShortcodes()
{ {
$pref = e107::getConfig('core')->getPref(); $pref = e107::getConfig('core')->getPref();
@@ -295,7 +296,7 @@ class e_shortcode
$coreBatchList = array('admin_shortcodes.php'); $coreBatchList = array('admin_shortcodes.php');
foreach($coreBatchList as $cb) foreach($coreBatchList as $cb)
{ {
include_once(e_FILE.'shortcode/batch/'.$cb); include_once(e_CORE.'shortcodes/batch/'.$cb);
} }
} }
@@ -474,7 +475,7 @@ class e_shortcode
break; break;
case 'override': case 'override':
$scFile = e_FILE.'shortcode/override/'.strtolower($code).'.sc'; $scFile = e_FILE.'shortcodes/override/'.strtolower($code).'.sc';
break; break;
case 'theme': case 'theme':
@@ -487,12 +488,12 @@ class e_shortcode
{ {
// Code is not registered, let's look for .sc or .php file // Code is not registered, let's look for .sc or .php file
// .php file takes precedence over .sc file // .php file takes precedence over .sc file
if(is_readable(e_FILE.'shortcode/'.strtolower($code).'.php')) if(is_readable(e_CORE.'shortcodes/single/'.strtolower($code).'.php'))
{ {
$_function = strtolower($code).'_shortcode'; $_function = strtolower($code).'_shortcode';
$_class = strtolower($code); $_class = strtolower($code);
include_once(e_FILE.'shortcode/'.strtolower($code).'.php'); include_once(e_CORE.'shortcodes/single/'.strtolower($code).'.php');
if(class_exists($_class, false)) // prevent __autoload - performance if(class_exists($_class, false)) // prevent __autoload - performance
{ {
@@ -505,7 +506,7 @@ class e_shortcode
} }
else else
{ {
$scFile = e_FILE.'shortcode/'.strtolower($code).'.sc'; $scFile = e_CORE.'shortcodes/single/'.strtolower($code).'.sc';
} }
} }
if ($scFile && file_exists($scFile)) if ($scFile && file_exists($scFile))
@@ -523,7 +524,7 @@ class e_shortcode
if(E107_DBG_SC && $scFile) if(E107_DBG_SC && $scFile)
{ {
// echo (isset($scFile)) ? "<br />sc_file= ".str_replace(e_FILE.'shortcode/', '', $scFile).'<br />' : ''; // echo (isset($scFile)) ? "<br />sc_file= ".str_replace(e_CORE.'shortcodes/single/', '', $scFile).'<br />' : '';
// echo "<br />sc= <b>$code</b>"; // echo "<br />sc= <b>$code</b>";
} }
} }

View File

@@ -52,7 +52,7 @@ $menu_pref = e107::getConfig('menu')->getPref('');
if(isset($campaign)) if(isset($campaign))
{ {
$parm = $campaign; $parm = $campaign;
$bannersccode = file_get_contents(e_FILE.'shortcode/banner.sc'); $bannersccode = file_get_contents(e_CORE.'shortcodes/single/banner.sc');
$BANNER = eval($bannersccode); $BANNER = eval($bannersccode);
$txt = $BANNER_MENU_START; $txt = $BANNER_MENU_START;
$txt .= preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_MENU); $txt .= preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_MENU);
@@ -84,7 +84,7 @@ else
$txt = $BANNER_MENU_START; $txt = $BANNER_MENU_START;
foreach ($parms as $parm) foreach ($parms as $parm)
{ {
$bannersccode = file_get_contents(e_FILE.'shortcode/banner.sc'); $bannersccode = file_get_contents(e_CORE.'shortcodes/banner.sc');
$BANNER = eval($bannersccode); $BANNER = eval($bannersccode);
$txt .= preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_MENU); $txt .= preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_MENU);
} }

View File

@@ -2,7 +2,7 @@
//error_reporting(E_ALL); //error_reporting(E_ALL);
if (e_ADMIN_AREA !== TRUE) if (e_ADMIN_AREA !== TRUE && e107::isInstalled('facebook'))
{ {

View File

@@ -695,7 +695,7 @@ function show_newsarchive($newsAr, $i = 1)
global $ns, $gen, $pref, $tp, $news_archive_shortcodes, $NEWSARCHIVE, $news2; global $ns, $gen, $pref, $tp, $news_archive_shortcodes, $NEWSARCHIVE, $news2;
// do not show the news archive on the news.php?item.X page (but only on the news mainpage) // do not show the news archive on the news.php?item.X page (but only on the news mainpage)
require_once(e_FILE.'shortcode/batch/news_archives.php'); require_once(e_CORE.'shortcodes/batch/news_archives.php');
$textnewsarchive = ''; $textnewsarchive = '';
ob_start(); ob_start();

View File

@@ -41,7 +41,7 @@ $userMethods->deleteExpired(); // Delete time-expired partial registrations
require_once(e107::coreTemplatePath('signup')); //correct way to load a core template. require_once(e107::coreTemplatePath('signup')); //correct way to load a core template.
include_once(e_FILE.'shortcode/batch/signup_shortcodes.php'); include_once(e_CORE.'shortcodes/batch/signup_shortcodes.php');
$signup_imagecode = ($pref['signcode'] && extension_loaded('gd')); $signup_imagecode = ($pref['signcode'] && extension_loaded('gd'));
$text = ''; $text = '';

View File

@@ -28,7 +28,7 @@ header('Content-type: text/html; charset=utf-8');
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE); include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
require_once(e_FILE.'shortcode/batch/sitedown_shortcodes.php'); require_once(e_CORE.'shortcodes/batch/sitedown_shortcodes.php');
if (!$SITEDOWN_TABLE) if (!$SITEDOWN_TABLE)
{ {

View File

@@ -163,7 +163,7 @@ $text = "<div style='text-align:center'>
<td class='forumheader3'>".DOWLAN_11.":</td> <td class='forumheader3'>".DOWLAN_11.":</td>
<td class='forumheader3'>"; <td class='forumheader3'>";
require_once(e_FILE."shortcode/batch/download_shortcodes.php"); require_once(e_CORE."shortcodes/batch/download_shortcodes.php");
$dlparm = (isset($download_category)) ? $download_category : ""; $dlparm = (isset($download_category)) ? $download_category : "";
$text .= $tp->parseTemplate("{DOWNLOAD_CATEGORY_SELECT={$dlparm}}",true,$download_shortcodes); $text .= $tp->parseTemplate("{DOWNLOAD_CATEGORY_SELECT={$dlparm}}",true,$download_shortcodes);

View File

@@ -23,7 +23,7 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
global $user; global $user;
$user['user_id'] = USERID; $user['user_id'] = USERID;
require_once(e_FILE."shortcode/batch/user_shortcodes.php"); require_once(e_CORE."shortcodes/batch/user_shortcodes.php");
require_once(e_HANDLER."form_handler.php"); require_once(e_HANDLER."form_handler.php");
if (isset($_POST['delp'])) if (isset($_POST['delp']))

View File

@@ -57,7 +57,7 @@ $userMethods = e107::getSession();
require_once (e_HANDLER.'ren_help.php'); require_once (e_HANDLER.'ren_help.php');
include_once (e107::coreTemplatePath('usersettings')); //correct way to load a core template. include_once (e107::coreTemplatePath('usersettings')); //correct way to load a core template.
include_once (e_FILE.'shortcode/batch/usersettings_shortcodes.php'); include_once (e_CORE.'shortcodes/batch/usersettings_shortcodes.php');
require_once (e_HANDLER.'calendar/calendar_class.php'); require_once (e_HANDLER.'calendar/calendar_class.php');
$cal = new DHTML_Calendar(true); $cal = new DHTML_Calendar(true);