|
Revision 60, 0.9 KB
(checked in by daris, 3 years ago)
|
|
added hidden_code extension
|
| Line | |
|---|
| 1 | <?xml version="1.0" encoding="utf-8"?> |
|---|
| 2 | |
|---|
| 3 | <extension engine="1.0"> |
|---|
| 4 | <id>hidden_code</id> |
|---|
| 5 | <title>Hidden code</title> |
|---|
| 6 | <version>1.0</version> |
|---|
| 7 | <description>Hides code tag for guests.</description> |
|---|
| 8 | <author>daris</author> |
|---|
| 9 | <minversion>1.3</minversion> |
|---|
| 10 | <maxtestedon>1.3.2</maxtestedon> |
|---|
| 11 | <hooks> |
|---|
| 12 | |
|---|
| 13 | <hook id="ps_parse_message_pre_split"><![CDATA[ |
|---|
| 14 | global $forum_url; |
|---|
| 15 | |
|---|
| 16 | if ($forum_user['is_guest']) |
|---|
| 17 | { |
|---|
| 18 | if (file_exists($ext_info['path'].'/lang/'.$forum_user['language'].'/hidden_code.php')) |
|---|
| 19 | require $ext_info['path'].'/lang/'.$forum_user['language'].'/hidden_code.php'; |
|---|
| 20 | else |
|---|
| 21 | require $ext_info['path'].'/lang/English/hidden_code.php'; |
|---|
| 22 | |
|---|
| 23 | $text = preg_replace('#\[code\](.*?)\[\/code\]#si', '[code]'.sprintf($lang_hidden_code['Must login message'], '<a href="'.forum_link($forum_url['login']).'">'.$lang_hidden_code['login'].'</a>').'[/code]', $text); |
|---|
| 24 | } |
|---|
| 25 | ]]></hook> |
|---|
| 26 | |
|---|
| 27 | </hooks> |
|---|
| 28 | </extension> |
|---|