uawdijnntqw1x1x1
IP : 216.73.217.142
Hostname : localhost.localdomain
Kernel : Linux localhost.localdomain 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
OS : Linux
PATH:
/
var
/
www
/
forum-e-syn
/
FUDforum
/
plugins
/
wikilinks.plugin
/
/
<?php /** * copyright : (C) 2001-2013 Advanced Internet Designs Inc. * email : forum@prohost.org * $Id: wikilinks.plugin 5770 2014-04-02 07:30:23Z naudefj $ * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; version 2 of the License. **/ // Initialize plugin. plugin_add_hook('BBCODE2HTML', 'plugin_wikilinks_tag_to_html'); plugin_add_hook('HTML2BBCODE', 'plugin_wikilinks_html_to_tag'); // Convert [[wikilink]]s to html code (post message). function plugin_wikilinks_tag_to_html($array) { list($bbcode) = $array; if ((@include_once $GLOBALS['PLUGIN_PATH'] .'wikilinks.ini') === false) { die('ERROR: Please configure the wikilinks plugin from the Plugin Manager Control panel.'); } // Use PCRE Unicode regex (required for languages like Russian) or the old crappy ones. if (@preg_match('/\p{L}/u', 'a') == 1) { $re1 = '!\[\[([\p{L}\p{N}\p{P}\p{Z}]+?)\]\](\w*)!ui'; $re2 = '!\[\[([\p{L}\p{N}\p{P}\p{Z}]+?)\|([\p{L}\p{N}\p{P}\p{Z}]+?)\]\]!ui'; } else { $re1 = '!\[\[([\w\s\*\/\.:-]+?)\]\](\w*)!i'; $re2 = '!\[\[([\w\s\*\/\.:-]+?)\|([\w\s\/-]+)\]\]!i'; } // Remove [notag] blocks. $notag_pre = NULL; $i = 0; if (preg_match_all('#\[notag\](.*?)\[\/notag\]#si', $bbcode, $notags, PREG_SET_ORDER)) { foreach ($notags as $notag) { $bbcode = str_replace($notag[0], '***nOtAg_sTrInG'. $i .'***', $bbcode); $notag_pre[$i++] = $notag[0]; } } // Remove [code] blocks. $code_pre = NULL; $i = 0; if (preg_match_all('#\[code\](.*?)\[\/code\]#si', $bbcode, $codes, PREG_SET_ORDER)) { foreach ($codes as $code) { $bbcode = str_replace($code[0], '***cOdE_sTrInG'. $i .'***', $bbcode); $code_pre[$i++] = $code[0]; } } // Convert wiki-style links into BBcode links. while (preg_match($re1, $bbcode, $res)) { $m = str_replace(' ', '_', $res[1]); $bbcode = str_replace($res[0], '[url='. $ini['WIKILINKS_URL'] . $m .']'. $res[1] . $res[2] .'[/url]', $bbcode); } while (preg_match($re2, $bbcode, $res)) { $m = str_replace(' ', '_', $res[1]); $bbcode = str_replace($res[0], '[url='. $ini['WIKILINKS_URL'] . $m .']'. $res[2] .'[/url]', $bbcode); } // Reinsert [notag] blocks. if (is_array($notag_pre)) { foreach($notag_pre as $i => $notag) { $bbcode = str_replace('***nOtAg_sTrInG'. $i .'***', $notag, $bbcode); } } // Reinsert [code] blocks. if (is_array($code_pre)) { foreach($code_pre as $i => $code) { $bbcode = str_replace('***cOdE_sTrInG'. $i .'***', $code, $bbcode); } } return array($bbcode); } // Convert html back to [[wikilink]] tags (edit message). function plugin_wikilinks_html_to_tag($array) { list($bbcode) = $array; if ((@include_once $GLOBALS['PLUGIN_PATH'] .'wikilinks.ini') === false) { die('ERROR: Please configure the wikilinks plugin from the Plugin Manager Control panel.'); } while (preg_match('!<a href="'. str_replace('://', '://', $ini['WIKILINKS_URL']) .'(.+?)"( target="_blank")?>(.+?)</a>!ui', $bbcode, $res)) { $m = str_replace('_', ' ', $res[1]); if ( strpos($res[3], $m) === 0 ) { // start with $x = substr($res[3], strlen($m)); $bbcode = str_replace($res[0], '[['. $m .']]'. $x, $bbcode); } else { $bbcode = str_replace($res[0], '[['. $m .'|'. $res[3] .']]', $bbcode); } } return array($bbcode); } function wikilinks_info() { return array('name' => 'Wikilink tags', 'desc' => 'Allow forum users to use [[wikilink]] tags as shorthand to link to articles on the site\'s wiki (or any other wiki for that matter).', 'cat' => 'BBcode', 'version' => '1.2'); } function wikilinks_enable() { if ((@include_once $GLOBALS['PLUGIN_PATH'] .'wikilinks.ini') === false) { return array(null, 'Please configure the wikilinks plugin before enabling it.'); // OK, Err. } } function wikilinks_config() { if ((@include $GLOBALS['PLUGIN_PATH'] .'wikilinks.ini') === false) { $ini = NULL; } if (isset($_POST['Set'])) { foreach (array_keys($_POST) as $key) { if (substr($key,0,10) == 'WIKILINKS_') { $ini[$key] = trim($_POST[$key]); } } $fp = fopen($GLOBALS['PLUGIN_PATH'] .'wikilinks.ini', 'w'); fwrite($fp, '<?php $ini = '. var_export($ini, 1) .'; ?>'); fclose($fp); pf(successify('Settings successfully saved.')); } ?> <p>Base URL to your wiki:<br /> <input type="url" name="WIKILINKS_URL" value="<?php echo $ini['WIKILINKS_URL'] ?>" size="60" /><br /> <font size="-1">For example, enter <i>http://en.wikipedia.org/wiki/</i> to link tags like <b>[[FUDforum]]</b> to Wikipedia articles.</font></p> <?php }
/var/www/forum-e-syn/FUDforum/plugins/wikilinks.plugin