From 82d0866c2166a6745c9ac9998a3e2cf0e9a98754 Mon Sep 17 00:00:00 2001 From: CaMer0n Date: Wed, 4 May 2011 09:19:50 +0000 Subject: [PATCH] Linkwords Issue corrected. --- e107_handlers/plugin_class.php | 3 ++- e107_plugins/linkwords/e_tohtml.php | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/e107_handlers/plugin_class.php b/e107_handlers/plugin_class.php index 2f59de4d0..68d2b6a62 100644 --- a/e107_handlers/plugin_class.php +++ b/e107_handlers/plugin_class.php @@ -49,7 +49,8 @@ class e107plugin 'e_url', 'e_cron', 'e_mailout', - 'e_sitelink' + 'e_sitelink', + 'e_tohtml' ); // List of all plugin variables which need to be checked - install required if one or more set and non-empty diff --git a/e107_plugins/linkwords/e_tohtml.php b/e107_plugins/linkwords/e_tohtml.php index a923eaeba..252e54559 100755 --- a/e107_plugins/linkwords/e_tohtml.php +++ b/e107_plugins/linkwords/e_tohtml.php @@ -32,6 +32,7 @@ if (!defined('e107_INIT')) { exit; } define('LW_CACHE_ENABLE', TRUE); + class e_tohtml_linkwords { var $lw_enabled = FALSE; // Default to disabled to start @@ -49,6 +50,7 @@ class e_tohtml_linkwords /* constructor */ function e_tohtml_linkwords() { + global $pref, $tp, $e107; // See whether they should be active on this page - if not, no point doing anything! if ((strpos(e_SELF, ADMINDIR) !== FALSE) || (strpos(e_PAGE, "admin_") !== FALSE)) return; // No linkwords on admin directories @@ -74,7 +76,7 @@ class e_tohtml_linkwords // Will probably need linkwords on this page - so get the info define('LW_CACHE_TAG', 'nomd5_linkwords'); // Put it here to avoid conflict on admin pages - if (LW_CACHE_ENABLE && ($temp = $e107->ecache->retrieve_sys(LW_CACHE_TAG))) + if (LW_CACHE_ENABLE && ($temp = e107::getCache()->retrieve_sys(LW_CACHE_TAG))) { $ret = eval($temp); if ($ret) @@ -141,8 +143,9 @@ class e_tohtml_linkwords function to_html($text,$area = 'olddefault') { + if (!$this->lw_enabled || !array_key_exists($area,$this->area_opts) || !$this->area_opts[$area]) return $text; // No linkwords in disabled areas - + // Split up by HTML tags and process the odd bits here $ptext = ""; $lflag = FALSE;