mirror of
https://github.com/e107inc/e107.git
synced 2025-08-28 08:39:57 +02:00
Linkwords - code-clean-up (no functional changes)
Tabs, spacing, readability
This commit is contained in:
@@ -6,25 +6,11 @@
|
||||
* 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 $
|
||||
* $Revision$
|
||||
* $Date$
|
||||
* $Author$
|
||||
*/
|
||||
/*
|
||||
|
|
||||
| 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.
|
||||
|
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
// if (!e107::isInstalled('linkwords')) exit; // This will break a site completely under some circumstance.
|
||||
|
||||
|
||||
class e_linkwords
|
||||
{
|
||||
function e_linkwords()
|
||||
@@ -33,13 +19,15 @@ class e_linkwords
|
||||
/* constructor */
|
||||
// Do an auto-update on the variable used to hook parsers - so we should only be called once
|
||||
|
||||
e107::lan('linkwords',e_LANGUAGE); // e_PLUGIN."linkwords/languages/".e_LANGUAGE.".php"
|
||||
e107::lan('linkwords', e_LANGUAGE); // e_PLUGIN."linkwords/languages/".e_LANGUAGE.".php"
|
||||
|
||||
$hooks = explode(",",$pref['tohtml_hook']);
|
||||
if (($key=array_search('linkwords',$hooks)) !== FALSE)
|
||||
$hooks = explode(",", $pref['tohtml_hook']);
|
||||
|
||||
if(($key=array_search('linkwords',$hooks)) !== FALSE)
|
||||
{
|
||||
unset($hooks[$key]);
|
||||
}
|
||||
|
||||
if (count($hooks) == 0)
|
||||
{
|
||||
unset($pref['tohtml_hook']);
|
||||
@@ -48,14 +36,17 @@ class e_linkwords
|
||||
{
|
||||
$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';
|
||||
}
|
||||
|
||||
save_prefs();
|
||||
e107::getLog()->add('LINKWD_05',LWLAN_58.'[!br!]'.$pref['tohtml_hook'],''); // Log that the update was done
|
||||
return;
|
||||
|
Reference in New Issue
Block a user