-
Notifications
You must be signed in to change notification settings - Fork 5
/
install.xml
147 lines (145 loc) · 5.18 KB
/
install.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<?xml version="1.0"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
<id>Sorunome:OmnomIRC</id>
<version>0.1</version>
<file name="$sourcedir/Subs-Post.php">
<operation>
<search position="before"><![CDATA[ updateStats('topic', true);
updateStats('subject', $topicOptions['id'], $msgOptions['subject']);
]]></search>
<add><![CDATA[
// Send the new topic to OmnomIRC start
if($msgOptions['approved'] && !empty($modSettings['oirc_topics']) && !empty($modSettings['oirc_topicnotification']))
{
$chan = getOircSendToChan($topicOptions['board']);
if($chan !== false)
{
sendToOmnomIRC(strtr($modSettings['oirc_topicnotification'],array(
'{COLOR}' => "\x03",
'{NAME}' => getDisplayName($posterOptions['id']),
'{TOPIC}' => html_entity_decode($msgOptions['subject']),
'{SUBJECT}' => html_entity_decode($msgOptions['subject']),
'{TOPICID}' => $topicOptions['id'],
'{POSTID}' => $msgOptions['id']
)),$chan);
}
}
// Send the new topic to OmnomIRC end
]]></add>
</operation>
<operation>
<search position="before"><![CDATA[ // One new post has been added today.
trackStats(array('posts' => '+'));
]]></search>
<add><![CDATA[
// Send the new post to OmnomIRC start
if($msgOptions['approved'] && !empty($modSettings['oirc_posts']) && !empty($modSettings['oirc_postnotification']))
{
$chan = getOircSendToChan($topicOptions['board']);
if($chan !== false)
{
$topicname = '';
if(strpos($modSettings['oirc_postnotification'],'{TOPIC}') !== false){
$topicname = getTopicName($topicOptions['id']);
}
sendToOmnomIRC(strtr($modSettings['oirc_postnotification'],array(
'{COLOR}' => "\x03",
'{NAME}' => getDisplayName($posterOptions['id']),
'{TOPIC}' => html_entity_decode($topicname),
'{SUBJECT}' => html_entity_decode($msgOptions['subject']),
'{TOPICID}' => $topicOptions['id'],
'{POSTID}' => $msgOptions['id']
)),$chan);
}
}
// Send the new post to OmnomIRC end
]]></add>
</operation>
<operation>
<search position="after"><![CDATA[
// Mark the edited post as read.
if (!empty($topicOptions['mark_as_read']) && !$user_info['is_guest'])]]></search>
<add><![CDATA[
// Send the new edit to OmnomIRC start
if(!empty($msgOptions['modify_time']) && !empty($modSettings['oirc_edits']) && !empty($modSettings['oirc_editnotification']))
{
$chan = getOircSendToChan($topicOptions['board']);
if($chan !== false)
{
$topicname = '';
if(strpos($modSettings['oirc_editnotification'],'{TOPIC}') !== false){
$topicname = getTopicName($topicOptions['id']);
}
sendToOmnomIRC(strtr($modSettings['oirc_editnotification'],array(
'{COLOR}' => "\x03",
'{NAME}' => $update_parameters['var_modified_name'],
'{TOPIC}' => html_entity_decode($topicname),
'{SUBJECT}' => html_entity_decode($msgOptions['subject']),
'{TOPICID}' => $topicOptions['id'],
'{POSTID}' => $msgOptions['id']
)),$chan);
}
}
// Send the new edit to OmnomIRC end
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[function approvePosts($msgs, $approve = true)
{
global $sourcedir, $smcFunc;]]></search>
<add><![CDATA[function approvePosts($msgs, $approve = true)
{
global $sourcedir, $smcFunc, $modSettings;]]></add>
</operation>
<operation>
<search position="before"><![CDATA[// If it's the first message then the topic state changes!
if ($row['id_msg'] == $row['id_first_msg'])
{]]></search>
<add><![CDATA[
if($approve && !empty($modSettings['oirc_topics']) && !empty($modSettings['oirc_topicnotification'])) // new topic notification
{
$chan = getOircSendToChan($row['id_board']);
if($chan !== false)
{
sendToOmnomIRC(strtr($modSettings['oirc_topicnotification'],array(
'{COLOR}' => "\x03",
'{NAME}' => $row['poster_name'],
'{TOPIC}' => html_entity_decode($row['subject']),
'{SUBJECT}' => html_entity_decode($row['subject']),
'{TOPICID}' => $row['id_topic'],
'{POSTID}' => $row['id_msg']
)),$chan);
}
}
]]></add>
</operation>
<operation>
<search position="before"><![CDATA[ }
else
{
$topic_changes[$row['id_topic']]['replies'] += $approve ? 1 : -1;]]></search>
<add><![CDATA[
if($approve && !empty($modSettings['oirc_posts']) && !empty($modSettings['oirc_postnotification']))
{
$chan = getOircSendToChan($row['id_board']);
if($chan !== false)
{
$topicname = '';
if(strpos($modSettings['oirc_postnotification'],'{TOPIC}') !== false){
$topicname = getTopicName($row['id_topic']);
}
sendToOmnomIRC(strtr($modSettings['oirc_postnotification'],array(
'{COLOR}' => "\x03",
'{NAME}' => $row['poster_name'],
'{TOPIC}' => html_entity_decode($topicname),
'{SUBJECT}' => html_entity_decode($row['subject']),
'{TOPICID}' => $row['id_topic'],
'{POSTID}' => $row['id_msg']
)),$chan);
}
}
]]></add>
</operation>
</file>
</modification>