-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanifest.xml
executable file
·110 lines (94 loc) · 3.42 KB
/
manifest.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE extension SYSTEM "ext-1.0.dtd">
<!--
/**
* Allows users to create rolling dices
*
* @copyright Copyright (C) 2009 Raul Ferriz
* @license http://www.gnu.org/licenses/gpl.html GPL version 3
* @package pun_dice
*
* Changelog
* v0.6
* Added support for Critics (use [dice="critic"]...[/dice])
* When a result is the max result, add a dice
* v0.5
* Added support for objecttive dice (do)
* v0.4
* Added support for multiplication and division
* v0.3.3
* Added support for parentesis
* v0.3.2
* Added support for quoting rolling dices
* v0.3.1
* Fixed bug with interaction agains bbcode [code][/code]
* v0.3
* Added support for conditions checks
* v0.2
* Fix include of functions file
* v0.1
* Initial release
*/
-->
<extension engine="1.0">
<id>pun_dice</id>
<title>Pun dice roller</title>
<version>0.6</version>
<description>Adds dice rolle feature for topics.<br/>Supports objective dice, parentesis, bjective dices ([dice]3do10[/dice]), critics ([dice="critic"]1d8+3)[/dice])</description>
<author>Raúl Ferriz Candela</author>
<minversion>1.3</minversion>
<maxtestedon>1.3.4</maxtestedon>
<install></install>
<uninstall></uninstall>
<hooks>
<hook id="co_common"><![CDATA[
// Add this extension to the sting of used extensions
$pun_extensions_used = array_merge(isset($pun_extensions_used) ? $pun_extensions_used : array(), array($ext_info['id']));
// Include language files
if (file_exists($ext_info['path'].'/lang/'.$forum_user['language'].'/'.$ext_info['id'].'.php'))
include_once $ext_info['path'].'/lang/'.$forum_user['language'].'/'.$ext_info['id'].'.php';
else
include_once $ext_info['path'].'/lang/English/'.$ext_info['id'].'.php';
// We need to include early the functions
include $ext_info['path'].'/functions.php';
// Sets global active post
$dr_active_post = 0;
]]></hook>
<hook id="ed_main_output_start"><![CDATA[
global $dr_active_post;
$dr_active_post = $id;
]]></hook>
<hook id="vt_post_loop_start, po_topic_review_pre_item_indent_merge"><![CDATA[
global $dr_active_post;
$dr_active_post = $cur_post['id'];
]]></hook>
<hook id="ps_preparse_tags_start"><![CDATA[
$tags[] = 'dice';
$tags_opened[] = 'dice';
$tags_closed[] = 'dice';
$tags_inline[] = 'dice';
$tags_limit_bbcode['*'][] = 'dice';
$tags_limit_bbcode['url'][] = 'dice';
$tags_limit_bbcode['email'][] = 'dice';
]]></hook>
<hook id="ps_do_bbcode_replace"><![CDATA[
$text = dr_parse($text);
// Prepare replacement
if (strpos($text, '[dice') !== false)
{
$text = preg_replace('#\[dice=("|"|\'|)(.*?)\\1\]#e', '"</p><strong><!--' . (string)$ext_info['id'] . '--><p>"', $text);
$text = preg_replace('#\[dice\]\s*#', '</p><strong><!--' . (string)$ext_info['id'] . '--><p>', $text);
$text = preg_replace('#\s*\[\/dice\]#S', '</p><!--' . (string)$ext_info['id'] . '--></strong><p>', $text);
}
]]></hook>
<hook id="po_modify_quote_info"><![CDATA[
if (!defined('FORUM_PARSER_LOADED'))
require FORUM_ROOT.'include/parser.php';
$pattern[] = '#\[dice\](.*?)\[/dice\]#ms';
$replace[] = '[b][i]Trusted roll ' .$ext_info['id'] . ' [/i] : $1 [/b]';
$dr_active_post = $qid;
$q_message = dr_parse($q_message);
$q_message = preg_replace($pattern, $replace, $q_message);
]]></hook>
<hooks>
</extension>