-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreadme.txt
executable file
·181 lines (137 loc) · 6.36 KB
/
readme.txt
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
##
##
## Mod title: Flood Protection for Guests
##
## Mod version: 1.0
## Works on FluxBB: 1.2.*
## Release date: 2007-05-19
## Author: Smartys (smartys@punbb-hosting.com)
##
## Description: This mod allows administrators to limit how often Guests can make new posts.
##
## Affected files: post.php
## admin_groups.php
## include/functions.php
##
## Affects DB: Yes
##
## Notes: This mod tracks last post for Guests using IP addresses, so if you have many
## Guests visiting from the same IP, this may not be a good mod for you.
##
## DISCLAIMER: Please note that "mods" are not officially supported by
## FluxBb. Installation of this modification is done at your
## own risk. Backup your forum database and any and all
## applicable files before proceeding.
##
##
#
#---------[ 1. UPLOAD ]-------------------------------------------------------
#
install_mod.php to /
#
#---------[ 2. RUN ]----------------------------------------------------------
#
install_mod.php
#
#---------[ 3. DELETE ]-------------------------------------------------------
#
install_mod.php
#
#---------[ 4. OPEN ]---------------------------------------------------------
#
post.php
#
#---------[ 5. FIND (lines: 80-81) ]------------------------------------------
#
if (!$pun_user['is_guest'] && !isset($_POST['preview']) && $pun_user['last_post'] != '' && (time() - $pun_user['last_post']) < $pun_user['g_post_flood'])
$errors[] = $lang_post['Flood start'].' '.$pun_user['g_post_flood'].' '.$lang_post['flood end'];
#
#---------[ 6. AFTER, ADD ]---------------------------------------------------
#
else if ($pun_user['is_guest'] && !isset($_POST['preview']) && $pun_user['o_last_post'] != '' && (time() - $pun_user['o_last_post']) < $pun_user['g_post_flood'])
$errors[] = $lang_post['Flood start'].' '.$pun_user['g_post_flood'].' '.$lang_post['flood end'];
#
#---------[ 7. FIND (lines: 316-321) ]------------------------------------------
#
// If the posting user is logged in, increment his/her post count
if (!$pun_user['is_guest'])
{
$low_prio = ($db_type == 'mysql') ? 'LOW_PRIORITY ' : '';
$db->query('UPDATE '.$low_prio.$db->prefix.'users SET num_posts=num_posts+1, last_post='.$now.' WHERE id='.$pun_user['id']) or error('Unable to update user', __FILE__, __LINE__, $db->error());
}
#
#---------[ 8. AFTER, ADD ]---------------------------------------------------
#
else
{
$db->query('UPDATE '.$db->prefix.'online SET last_post='.$now.' WHERE ident=\''.$db->escape(get_remote_address()).'\'') or error('Unable to update user', __FILE__, __LINE__, $db->error());
}
#
#---------[ 9. OPEN ]---------------------------------------------------------
#
include/functions.php
#
#---------[ 10. FIND (line: 125) ]---------------------------------------------
#
$result = $db->query('SELECT u.*, g.*, o.logged FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON u.group_id=g.g_id LEFT JOIN '.$db->prefix.'online AS o ON o.ident=\''.$remote_addr.'\' WHERE u.id=1') or error('Unable to fetch guest information', __FILE__, __LINE__, $db->error());
#
#---------[ 11. REPLACE WITH ]---------------------------------------------------
#
$result = $db->query('SELECT u.*, g.*, o.logged, o.last_post AS o_last_post FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON u.group_id=g.g_id LEFT JOIN '.$db->prefix.'online AS o ON o.ident=\''.$remote_addr.'\' WHERE u.id=1') or error('Unable to fetch guest information', __FILE__, __LINE__, $db->error());
#
#---------[ 12. OPEN ]---------------------------------------------------------
#
admin_groups.php
#
#---------[ 13. FIND (line: 125) ]---------------------------------------------
#
<?php if ($group['g_id'] != PUN_GUEST): ?> <tr>
<th scope="row">Edit subjects interval</th>
<td>
<input type="text" name="edit_subjects_interval" size="5" maxlength="5" value="<?php echo $group['g_edit_subjects_interval'] ?>" tabindex="23" />
<span>Number of seconds after post time that users in this group may edit the subject of topics they've posted. Set to 0 to allow edits indefinitely.</span>
</td>
</tr>
<tr>
<th scope="row">Post flood interval</th>
<td>
<input type="text" name="post_flood" size="5" maxlength="4" value="<?php echo $group['g_post_flood'] ?>" tabindex="24" />
<span>Number of seconds that users in this group have to wait between posts. Set to 0 to disable.</span>
</td>
</tr>
<tr>
<th scope="row">Search flood interval</th>
<td>
<input type="text" name="search_flood" size="5" maxlength="4" value="<?php echo $group['g_search_flood'] ?>" tabindex="25" />
<span>Number of seconds that users in this group have to wait between searches. Set to 0 to disable.</span>
</td>
</tr>
<?php endif; ?>
#
#---------[ 14. REPLACE WITH ]---------------------------------------------------
#
<?php if ($group['g_id'] != PUN_GUEST): ?> <tr>
<th scope="row">Edit subjects interval</th>
<td>
<input type="text" name="edit_subjects_interval" size="5" maxlength="5" value="<?php echo $group['g_edit_subjects_interval'] ?>" tabindex="23" />
<span>Number of seconds after post time that users in this group may edit the subject of topics they've posted. Set to 0 to allow edits indefinitely.</span>
</td>
<?php endif; ?> </tr>
<tr>
<th scope="row">Post flood interval</th>
<td>
<input type="text" name="post_flood" size="5" maxlength="4" value="<?php echo $group['g_post_flood'] ?>" tabindex="24" />
<span>Number of seconds that users in this group have to wait between posts. Set to 0 to disable.</span>
</td>
</tr>
<?php if ($group['g_id'] != PUN_GUEST): ?> <tr>
<th scope="row">Search flood interval</th>
<td>
<input type="text" name="search_flood" size="5" maxlength="4" value="<?php echo $group['g_search_flood'] ?>" tabindex="25" />
<span>Number of seconds that users in this group have to wait between searches. Set to 0 to disable.</span>
</td>
</tr>
<?php endif; ?>
#
#---------[ 15. SAVE/UPLOAD ]-------------------------------------------------
#