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)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* $Source: /cvs_backup/e107_0.8/e107_plugins/linkwords/linkwords.php,v $
|
2010-02-10 18:18:01 +00:00
|
|
|
* $Revision$
|
|
|
|
* $Date$
|
|
|
|
* $Author$
|
2009-11-17 10:46:35 +00:00
|
|
|
*/
|
|
|
|
/*
|
2007-01-17 21:29:28 +00:00
|
|
|
|
|
2008-12-07 21:55:02 +00:00
|
|
|
| This is just a stub so that systems migrated from 0.7 don't crash
|
|
|
|
| It auto-updates the prefs so that the newer routine is called in future.
|
|
|
|
|
|
2006-12-02 04:36:16 +00:00
|
|
|
+----------------------------------------------------------------------------+
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (!defined('e107_INIT')) { exit; }
|
2009-10-22 13:00:37 +00:00
|
|
|
// if (!plugInstalled('linkwords')) exit; // This will break a site completely under some circumstance.
|
2006-12-02 04:36:16 +00:00
|
|
|
|
2007-01-17 21:29:28 +00:00
|
|
|
|
2006-12-02 04:36:16 +00:00
|
|
|
class e_linkwords
|
|
|
|
{
|
|
|
|
function e_linkwords()
|
|
|
|
{
|
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
|
|
|
|
|
|
|
e107::lan('linkwords',e_LANGUAGE); // e_PLUGIN."linkwords/languages/".e_LANGUAGE.".php"
|
|
|
|
|
2008-12-07 21:55:02 +00:00
|
|
|
$hooks = explode(",",$pref['tohtml_hook']);
|
|
|
|
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
|
|
|
}
|
2008-12-07 21:55:02 +00:00
|
|
|
if (count($hooks) == 0)
|
|
|
|
{
|
|
|
|
unset($pref['tohtml_hook']);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$pref['tohtml_hook'] = implode(',',$hooks);
|
|
|
|
}
|
|
|
|
if (!isset($pref['e_tohtml_list']))
|
|
|
|
{
|
|
|
|
$pref['e_tohtml_list'] = array();
|
|
|
|
}
|
|
|
|
if (!in_array('linkwords',$pref['e_tohtml_list']))
|
|
|
|
{
|
|
|
|
$pref['e_tohtml_list'][] = 'linkwords';
|
2007-03-04 21:55:15 +00: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
|
|
|
}
|
|
|
|
|
|
|
|
?>
|