2007-06-21 19:40:43 +00:00
|
|
|
<?php
|
2006-12-02 04:36:16 +00:00
|
|
|
/*
|
2009-11-17 10:46:35 +00:00
|
|
|
* e107 website system
|
|
|
|
*
|
2009-11-18 01:06:08 +00:00
|
|
|
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
2009-11-17 10:46:35 +00:00
|
|
|
* Released under the terms and conditions of the
|
|
|
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
|
|
|
*
|
|
|
|
*/
|
2006-12-02 04:36:16 +00:00
|
|
|
|
|
|
|
if (!defined('e107_INIT')) { exit; }
|
2015-02-07 13:38:29 -08:00
|
|
|
// if (!e107::isInstalled('linkwords')) exit; // This will break a site completely under some circumstance.
|
2006-12-02 04:36:16 +00:00
|
|
|
|
|
|
|
class e_linkwords
|
|
|
|
{
|
2020-12-10 15:52:48 -08:00
|
|
|
function __construct()
|
2006-12-02 04:36:16 +00:00
|
|
|
{
|
2008-12-07 21:55:02 +00:00
|
|
|
global $pref, $admin_log;
|
2006-12-02 04:36:16 +00:00
|
|
|
/* constructor */
|
2008-12-07 21:55:02 +00:00
|
|
|
// Do an auto-update on the variable used to hook parsers - so we should only be called once
|
2014-02-07 07:03:05 -08:00
|
|
|
|
2019-10-26 18:42:25 +02:00
|
|
|
e107::lan('linkwords', e_LANGUAGE); // e_PLUGIN."linkwords/languages/".e_LANGUAGE.".php"
|
|
|
|
|
|
|
|
$hooks = explode(",", $pref['tohtml_hook']);
|
2014-02-07 07:03:05 -08:00
|
|
|
|
2019-10-26 18:42:25 +02:00
|
|
|
if(($key=array_search('linkwords',$hooks)) !== FALSE)
|
2007-02-07 21:48:26 +00:00
|
|
|
{
|
2008-12-07 21:55:02 +00:00
|
|
|
unset($hooks[$key]);
|
2007-02-07 21:48:26 +00:00
|
|
|
}
|
2019-10-26 18:42:25 +02:00
|
|
|
|
2008-12-07 21:55:02 +00:00
|
|
|
if (count($hooks) == 0)
|
|
|
|
{
|
|
|
|
unset($pref['tohtml_hook']);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$pref['tohtml_hook'] = implode(',',$hooks);
|
|
|
|
}
|
2019-10-26 18:42:25 +02:00
|
|
|
|
2008-12-07 21:55:02 +00:00
|
|
|
if (!isset($pref['e_tohtml_list']))
|
|
|
|
{
|
|
|
|
$pref['e_tohtml_list'] = array();
|
|
|
|
}
|
2019-10-26 18:42:25 +02:00
|
|
|
|
2008-12-07 21:55:02 +00:00
|
|
|
if (!in_array('linkwords',$pref['e_tohtml_list']))
|
|
|
|
{
|
|
|
|
$pref['e_tohtml_list'][] = 'linkwords';
|
2007-03-04 21:55:15 +00:00
|
|
|
}
|
2019-10-26 18:42:25 +02:00
|
|
|
|
2008-12-07 21:55:02 +00:00
|
|
|
save_prefs();
|
2014-10-23 11:12:13 -07:00
|
|
|
e107::getLog()->add('LINKWD_05',LWLAN_58.'[!br!]'.$pref['tohtml_hook'],''); // Log that the update was done
|
2008-12-07 21:55:02 +00:00
|
|
|
return;
|
2006-12-02 04:36:16 +00:00
|
|
|
}
|
|
|
|
|
2007-01-17 21:29:28 +00:00
|
|
|
|
2008-12-07 21:55:02 +00:00
|
|
|
// This avoids confusing the parser!
|
|
|
|
function to_html($text,$area = 'olddefault')
|
2006-12-02 04:36:16 +00:00
|
|
|
{
|
2008-12-07 21:55:02 +00:00
|
|
|
return $text;
|
|
|
|
}
|
2007-01-17 21:29:28 +00:00
|
|
|
|
|
|
|
|
2008-12-07 21:55:02 +00:00
|
|
|
function linkwords($text,$area = 'olddefault')
|
|
|
|
{
|
|
|
|
return $text;
|
2007-01-17 21:29:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function linksproc($text,$first,$limit)
|
2008-12-07 21:55:02 +00:00
|
|
|
{
|
|
|
|
return $text; // Shouldn't get called - but just in case
|
|
|
|
}
|
2006-12-02 04:36:16 +00:00
|
|
|
}
|
|
|
|
|