'.$lang_admin_add_user['User added successfully'].'/p>';
131 | else
132 | {
133 | $username = $_POST['req_username'];
134 | $email = $_POST['req_email'];
135 | $edit_identity = isset($_POST['edit_identity']);
136 | }
137 | }
138 |
139 | $buffer_old = ob_get_contents();
140 |
141 | ob_end_clean();
142 |
143 | ob_start();
144 |
145 | $pun_add_user_form_action = $base_url.'/userlist.php';
146 |
147 | // Get output buffer and insert form
148 | $pos = strpos($buffer_old, '
');
149 | echo substr($buffer_old, 0 , $pos);
150 | ?>
151 |
152 |
153 |
154 |
155 |
156 |
'.$errors_add_users[$err_num].'';
163 |
164 | ?>
165 |
171 |
172 |
215 |
216 |
221 |
222 |
223 |
224 |
--------------------------------------------------------------------------------
/pun_admin_clear_cache/functions.php:
--------------------------------------------------------------------------------
1 | /cache_*.php
25 | function pun_admin_clear_cache()
26 | {
27 | $count = 0; // The number of files actually removed
28 |
29 | $d = dir(FORUM_CACHE_DIR);
30 |
31 | while (($entry = $d->read()) !== false)
32 | {
33 | if (is_file(FORUM_CACHE_DIR.$entry) && is_writable(FORUM_CACHE_DIR.$entry) && (substr($entry, 0, 6) == 'cache_') && (substr($entry, -4) == '.php'))
34 | {
35 | if (unlink(FORUM_CACHE_DIR.$entry))
36 | $count++;
37 | }
38 | }
39 |
40 | $d->close();
41 |
42 | return $count;
43 | }
44 |
--------------------------------------------------------------------------------
/pun_admin_clear_cache/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
.
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_admin_clear_cache/lang/English/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
.
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_admin_clear_cache/lang/English/pun_admin_clear_cache.php:
--------------------------------------------------------------------------------
1 | 'Clear cache',
7 | 'Cleard' => 'All the /cache/cache_*.php files has been successfully removed.'
8 | );
--------------------------------------------------------------------------------
/pun_admin_clear_cache/lang/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
.
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_admin_clear_cache/manifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
26 |
27 |
28 | pun_admin_clear_cache
29 | Admin Clear Cache
30 | 1.1.5
31 | The link in the page footer to clear forum cache.
32 | PunBB Development Team
33 |
34 | 1.4RC1
35 | 1.4.2
36 |
37 |
38 |
39 | add_info($lang_pun_admin_clear_cache['Cleard']);
55 |
56 | redirect(forum_htmlencode($_GET['prev_url']), $lang_pun_admin_clear_cache['Cleard']);
57 | }
58 | ]]>
59 |
60 |
69 |
70 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/pun_admin_manage_extensions_improved/continue.php:
--------------------------------------------------------------------------------
1 | '
'
44 | );
45 | if (in_array($type, array('enable', 'disable', 'uninstall')) && isset($_POST['extens']))
46 | $forum_page['hidden_fields']['selected_extens'] = '
';
47 |
48 | require FORUM_ROOT.'header.php';
49 |
50 | // START SUBST -
51 | ob_start();
52 |
53 | ?>
54 |
55 |
56 |
57 |
58 |
59 |
126 |
127 | ', $tpl_temp, $tpl_main);
131 | ob_end_clean();
132 |
133 | require FORUM_ROOT.'footer.php';
134 |
135 |
--------------------------------------------------------------------------------
/pun_admin_manage_extensions_improved/functions.php:
--------------------------------------------------------------------------------
1 | 'id, dependencies',
19 | 'FROM' => 'extensions',
20 | 'WHERE' => 'disabled = 0'
21 | );
22 | $res = $forum_db->query_build($query) or error(__FILE__, __LINE__);
23 |
24 | $ext_dependencies = array();
25 | if ($forum_db->num_rows($res) > 0)
26 | while ($cur_ext = $forum_db->fetch_assoc($res))
27 | {
28 | $deps = explode('|', substr($cur_ext['dependencies'], 1, -1));
29 | $ext_dependencies[$cur_ext['id']] = empty($deps[0]) ? null : $deps;
30 | }
31 | if (empty($ext_dependencies))
32 | return array();
33 |
34 | $dependencies_error = array();
35 | foreach ($ext_dependencies as $dep_ext => $main_exts)
36 | {
37 | if ($main_exts == null)
38 | continue;
39 | foreach ($main_exts as $cur_main_ext)
40 | {
41 | //If we want to disable main extension, added dependend extension to error list
42 | if (in_array($cur_main_ext, $sel_extens) && !in_array($dep_ext, $sel_extens))
43 | {
44 | if (empty($dependencies_error[$dep_ext]))
45 | $dependencies_error[$dep_ext] = array();
46 | $dependencies_error[$dep_ext][] = $cur_main_ext;
47 | }
48 | }
49 | }
50 |
51 | return $dependencies_error;
52 | }
53 |
54 | function get_dependencies_error_enable($sel_extens)
55 | {
56 | global $forum_db;
57 |
58 | $query = array(
59 | 'SELECT' => 'id, dependencies, disabled',
60 | 'FROM' => 'extensions'
61 | );
62 | $res = $forum_db->query_build($query) or error(__FILE__, __LINE__);
63 |
64 | $ext_dependencies = array();
65 | $enabled_extensions = array();
66 | if ($forum_db->num_rows($res) > 0)
67 | while ($cur_ext = $forum_db->fetch_assoc($res))
68 | {
69 | $deps = explode('|', substr($cur_ext['dependencies'], 1, -1));
70 | $ext_dependencies[$cur_ext['id']] = empty($deps[0]) ? null : $deps;
71 | if ($cur_ext['disabled'] == '0')
72 | $enabled_extensions[] = $cur_ext['id'];
73 | }
74 | if (empty($ext_dependencies))
75 | return array();
76 |
77 | $dependencies_error = array();
78 | foreach ($sel_extens as $cur_ext)
79 | {
80 | if ($ext_dependencies[$cur_ext] == null)
81 | continue;
82 | foreach ($ext_dependencies[$cur_ext] as $main_ext)
83 | {
84 | if (in_array($main_ext, $enabled_extensions) || in_array($main_ext, $sel_extens))
85 | continue;
86 | if (empty($dependencies_error[$cur_ext]))
87 | $dependencies_error[$cur_ext] = array();
88 | $dependencies_error[$cur_ext][] = $main_ext;
89 | }
90 | }
91 |
92 | return $dependencies_error;
93 | }
94 |
95 | function get_dependencies_error_uninstall($sel_extens)
96 | {
97 | global $forum_db;
98 |
99 | $query = array(
100 | 'SELECT' => 'id, dependencies, disabled',
101 | 'FROM' => 'extensions'
102 | );
103 | $res = $forum_db->query_build($query) or error(__FILE__, __LINE__);
104 |
105 | $ext_dependencies = array();
106 | if ($forum_db->num_rows($res) > 0)
107 | while ($cur_ext = $forum_db->fetch_assoc($res))
108 | {
109 | $deps = explode('|', substr($cur_ext['dependencies'], 1, -1));
110 | $ext_dependencies[$cur_ext['id']] = empty($deps[0]) ? null : $deps;
111 | if ($cur_ext['disabled'] == '0')
112 | $enabled_extensions[] = $cur_ext['id'];
113 | }
114 | if (empty($ext_dependencies))
115 | return array();
116 |
117 | $dependencies_error = array();
118 | foreach ($sel_extens as $cur_ext)
119 | {
120 | foreach ($ext_dependencies as $dep_ext => $main_exts)
121 | {
122 | if ($main_exts == null)
123 | continue;
124 | if (in_array($cur_ext, $main_exts))
125 | {
126 | if (empty($dependencies_error[$dep_ext]))
127 | $dependencies_error[$dep_ext] = array();
128 | $dependencies_error[$dep_ext][] = $cur_ext;
129 | }
130 | }
131 | }
132 |
133 | return $dependencies_error;
134 | }
135 |
136 | function uninstall_extensions( $uninst_list )
137 | {
138 | global $forum_db;
139 |
140 | for ($ext_num = 0; $ext_num < count($uninst_list); $ext_num++)
141 | {
142 | // Fetch info about the extension
143 | $query = array(
144 | 'SELECT' => 'uninstall',
145 | 'FROM' => 'extensions',
146 | 'WHERE' => 'id = \''.$forum_db->escape( $uninst_list[$ext_num] ).'\''
147 | );
148 |
149 | $res = $forum_db->query_build($query) or error(__FILE__, __LINE__);
150 | if ( !$forum_db->num_rows($res) )
151 | continue;
152 |
153 | $ext_data = $forum_db->fetch_assoc($res);
154 |
155 | // Prevent errors when include files in the uninstall section
156 | $ext_info['path'] = FORUM_ROOT.'extensions/'.$uninst_list[$ext_num];
157 |
158 | eval($ext_data['uninstall']);
159 |
160 | // Now delete the extension and its hooks from the db
161 | $query = array(
162 | 'DELETE' => 'extension_hooks',
163 | 'WHERE' => 'extension_id = \''.$forum_db->escape( $uninst_list[$ext_num] ).'\''
164 | );
165 |
166 | ($hook = get_hook('aex_qr_uninstall_delete_hooks')) ? eval($hook) : null;
167 | $forum_db->query_build($query) or error(__FILE__, __LINE__);
168 |
169 | $query = array(
170 | 'DELETE' => 'extensions',
171 | 'WHERE' => 'id = \''.$forum_db->escape( $uninst_list[$ext_num] ).'\''
172 | );
173 |
174 | ($hook = get_hook('aex_qr_delete_extension')) ? eval($hook) : null;
175 | $forum_db->query_build($query) or error(__FILE__, __LINE__);
176 |
177 | // Empty the PHP cache
178 | forum_clear_cache();
179 |
180 | // Regenerate the hooks cache
181 | require_once FORUM_ROOT.'include/cache.php';
182 | generate_hooks_cache();
183 | }
184 |
185 | // Empty the PHP cache
186 | forum_clear_cache();
187 |
188 | // Regenerate the hooks cache
189 | require_once FORUM_ROOT.'include/cache.php';
190 | generate_hooks_cache();
191 | }
192 |
193 | function flip_extensions($type, $extensions)
194 | {
195 | global $forum_db;
196 |
197 | //First disable dependend extensions
198 | $query = array(
199 | 'UPDATE' => 'extensions',
200 | 'SET' => 'disabled = \''.$type.'\'',
201 | 'WHERE' => 'id IN (\''.implode('\',\'', $extensions).'\')'
202 | );
203 |
204 | $forum_db->query_build($query) or error(__FILE__, __LINE__);
205 |
206 | // Regenerate the hooks cache
207 | require_once FORUM_ROOT.'include/cache.php';
208 | generate_hooks_cache();
209 | }
210 |
211 | function validate_ext_list( $extensions )
212 | {
213 | $sel_extens = array();
214 | for ($sel_num = 0; $sel_num < count($extensions); $sel_num++)
215 | $sel_extens[$sel_num] = preg_replace('/[^0-9a-z_]/', '', $extensions[$sel_num]);
216 |
217 | return $sel_extens;
218 | }
219 |
220 | function regenerate_glob_vars()
221 | {
222 | global $forum_db, $forum_config, $forum_hooks;
223 |
224 | // Empty the PHP cache
225 | forum_clear_cache();
226 |
227 | // Config and hooks might be changed. Let's get them
228 |
229 | // Get the forum config from the DB
230 | $query = array(
231 | 'SELECT' => 'c.*',
232 | 'FROM' => 'config AS c'
233 | );
234 |
235 | $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
236 |
237 | $forum_config = array();
238 | while ($cur_config_item = $forum_db->fetch_row($result))
239 | $forum_config[$cur_config_item[0]] = $cur_config_item[1];
240 |
241 | // Get hooks from the DB
242 | $query = array(
243 | 'SELECT' => 'eh.id, eh.code, eh.extension_id',
244 | 'FROM' => 'extension_hooks AS eh',
245 | 'JOINS' => array(
246 | array(
247 | 'INNER JOIN' => 'extensions AS e',
248 | 'ON' => 'e.id=eh.extension_id'
249 | )
250 | ),
251 | 'WHERE' => 'e.disabled=0',
252 | 'ORDER BY' => 'eh.priority, eh.installed'
253 | );
254 |
255 | ($hook = get_hook('ch_qr_get_hooks')) ? eval($hook) : null;
256 |
257 | $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
258 |
259 | $forum_hooks = array();
260 | while ($cur_hook = $forum_db->fetch_assoc($result))
261 | {
262 | $load_ext_info = '$ext_info_stack[] = array('."\n".
263 | '\'id\' => \''.$cur_hook['extension_id'].'\','."\n".
264 | '\'path\' => FORUM_ROOT.\'extensions/'.$cur_hook['extension_id'].'\','."\n".
265 | '\'url\' => $GLOBALS[\'base_url\'].\'/extensions/'.$cur_hook['extension_id'].'\');'."\n".'
266 | $ext_info = $ext_info_stack[count($ext_info_stack) - 1];';
267 | $unload_ext_info = 'array_pop($ext_info_stack);'."\n".'$ext_info = empty($ext_info_stack) ? array() : $ext_info_stack[count($ext_info_stack) - 1];';
268 |
269 | $forum_hooks[$cur_hook['id']][] = $load_ext_info."\n\n".$cur_hook['code']."\n\n".$unload_ext_info."\n";
270 | }
271 | }
272 |
273 | function is_key_exists($arr, $keys)
274 | {
275 | foreach ($keys as $key)
276 | {
277 | if (array_key_exists($key, $arr))
278 | return $key;
279 | }
280 | return false;
281 | }
282 |
283 |
--------------------------------------------------------------------------------
/pun_admin_manage_extensions_improved/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
.
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_admin_manage_extensions_improved/js/collapse.js:
--------------------------------------------------------------------------------
1 | if (typeof FORUM === "undefined" || !FORUM) {
2 | var FORUM = {};
3 | }
4 |
5 | FORUM.toggle_ext = function() {
6 |
7 | Array.prototype.unique = function() {
8 | var a = [], l = this.length;
9 | for(var i=0; i
0) {
19 | createCookie('collapsed',collapsed.unique().join(":"),365);
20 | } else {
21 | eraseCookie('collapsed');
22 | }
23 | }
24 |
25 | function createCookie(name,value,days) {
26 | if (days) {
27 | var date = new Date();
28 | date.setTime(date.getTime()+(days*24*60*60*1000));
29 | var expires = "; expires="+date.toGMTString();
30 | }
31 | else var expires = "";
32 | document.cookie = name+"="+value+expires+"; path=/";
33 | }
34 |
35 | function readCookie(name) {
36 | var nameEQ = name + "=";
37 | var ca = document.cookie.split(';');
38 | for(var i=0;i < ca.length;i++) {
39 | var c = ca[i];
40 | while (c.charAt(0)==' ') c = c.substring(1,c.length);
41 | if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
42 | }
43 | return null;
44 | }
45 |
46 | function eraseCookie(name) {
47 | createCookie(name,"",-1);
48 | }
49 |
50 | return {
51 | init : function() {
52 |
53 | var collapsed = readCookie("collapsed");
54 | if (!collapsed || collapsed == undefined || collapsed.length < 1) {
55 | collapsed = new Array();
56 | } else {
57 | collapsed = collapsed.split(":");
58 | }
59 |
60 | $(".collapsable")
61 | .click(
62 | function() {
63 | var cid = $(this).attr("id");
64 |
65 | if (!cid) {
66 | return;
67 | }
68 |
69 | if ($(this).hasClass("collapsed")) {
70 | $(this).show(function() {
71 | $("."+cid).animate({
72 | height : "show"
73 | }, 200, "swing", function(){
74 | $.each(collapsed, function(i, val){
75 | if (val==cid){
76 | collapsed.splice(i,1);
77 | }
78 | });
79 | updateCookie(collapsed);
80 | });
81 | $(this).removeClass("collapsed");
82 | });
83 | } else {
84 | $("."+cid).animate({
85 | height : "hide"
86 | }, 200, "swing",function(){
87 | $(this).prev().addClass("collapsed");
88 | collapsed.push(cid);
89 | updateCookie(collapsed);
90 | });
91 | }
92 | });
93 | }
94 | };
95 | }();
96 | jQuery(function() {
97 | FORUM.toggle_ext.init();
98 | });
--------------------------------------------------------------------------------
/pun_admin_manage_extensions_improved/lang/English/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_admin_manage_extensions_improved/lang/English/pun_admin_manage_extensions_improved.php:
--------------------------------------------------------------------------------
1 | 'You can\'t reinstall this extension, because some other extensions depend on it ',
15 | 'Reinstall ext' => 'Reinstall/Refresh hooks of the extension "%s"',
16 | 'Reinstall' => 'Reinstall',
17 | 'Reinstall with deps' => 'Important! The extensions %s can work incorrectly, if you reinstall or refresh the hooks of the extension %s.',
18 | 'Extension reinstalled' => 'The extension "%s" was successfully reinstalled.',
19 | 'Disable selected' => 'Selected extensions was disabled.',
20 | 'Enable selected' => 'Selected extensions was enabled.',
21 | 'Uninstall selected' => 'Selected extensions was uninstalled.',
22 | 'Input error' => 'Form error!',
23 | 'Disable checked' => 'Disable selected extensions',
24 | 'Enable checked' => 'Enable selected extensions',
25 | 'Uninstall checked' => 'Uninstall selected extensions',
26 | 'Dependency error' => 'Important! Some extensions can\'t work correctly without one or more selected extensions.',
27 | 'Update error' => 'Important! Now available new version of %s. If you press \'continue\' extension will be updated.',
28 | 'Ext update' => 'Update extension',
29 | 'Ignore deps' => 'Ignore dependencies',
30 | 'Choose action' => 'Choose action',
31 | 'Disable deps extensions' => 'Disable dependent extensions',
32 | 'Enable main' => 'Enable "main" extensions, if they have been installed.',
33 | 'Uninstall all' => 'Uninstall all dependent extensions',
34 | 'No selected' => 'WARNING! No extensions selected!',
35 | 'Warnings' => 'WARNING! Important warnings:',
36 | 'Work dependencies' => '%s can\'t work properly without %s',
37 | //'Select extension' => 'Select extension',
38 | 'Button disable' => 'Disable selected',
39 | 'Button enable' => 'Enable selected',
40 | 'Button uninstall' => 'Uninstall selected',
41 | 'Only hooks' => 'Refresh hooks',
42 | 'Extension title' => 'Pun Manage Extensions Improved',
43 | 'Ext note' => 'When there are dependencies between extensions, you will see an alert. Use refresh hooks action to remove extension hooks from database and fetch them again from manifest.xml. No install/uninstall code will be executed. Useful to keep extension\'s data untouched while debugging.',
44 | 'Dep error message' => 'Warning! There are some dependency errors:',
45 | 'Title column' => 'Information',
46 | 'State column' => 'State',
47 | 'Uninstall column' => 'Uninstall',
48 | 'Action column' => 'Action',
49 | 'Install' => 'Install',
50 | 'Upgrade' => 'Upgrade',
51 |
52 | );
53 |
--------------------------------------------------------------------------------
/pun_admin_manage_extensions_improved/lang/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_admin_manage_extensions_improved/style/Oxygen/style.css:
--------------------------------------------------------------------------------
1 | .main-content th {
2 | padding: .5em 1.3em;
3 | }
4 | #ext-available-list .tc1 {
5 | width: 6em;
6 | }
7 | #ext-installed-list .tc2{
8 | width: 7em;
9 | text-align: center;
10 | }
11 | #ext-installed-list .tc3, #ext-available-list .tc3{
12 | width: 6em;
13 | text-align: center;
14 | }
15 | #ext-installed-list .tc1 {
16 | width: 8em;
17 | }
18 | #ext-available-list h3 span.head, #ext-installed-list h3 span.head{
19 | font-weight:bold;
20 | font-style:normal;
21 | color: #00579C;
22 | }
23 | #ext-available-list h3 span, #ext-installed-list h3 span{
24 | font-weight:normal;
25 | font-style:italic;
26 | border-bottom: 1px solid #DDE4EB;
27 | }
28 | #ext-available-list .tc0 div, #ext-installed-list .tc0 div{
29 | padding-top:8px;
30 | }
31 | tr.upgrade td , tr.upgrade td {
32 | background-color: #FEFFE6;
33 | }
34 | #ext-available-list tr.even td, #ext-installed-list tr.even td {
35 | background-color: #FFF;
36 | }
37 | #ext-available-list tr.odd td, , #ext-installed-list tr.odd td {
38 | background-color: #F4F9FD;
39 | }
40 | #ext-installed-list tr.odd.disabled td, #ext-installed-list tr.even.disabled td{
41 | background-color:#FFFFE1;
42 | }
43 | #ext-installed-list tr td {
44 | padding-top:4px;
45 | }
46 | #ext-available-list {
47 | border-bottom: 1px solid #DDE4EB;
48 | }
49 | #ext-installed-list {
50 | border-bottom: 1px solid #DDE4EB;
51 | border-top: 1px solid #DDE4EB;
52 | }
53 | #ext-installed-list li{
54 | list-style-type: none;
55 | }
56 | #ext-installed-list ul{
57 | padding:0 0;
58 | }
59 | .collapsed {
60 | white-space: nowrap;
61 | margin-bottom: .7em !important;
62 | opacity: .7;
63 | }
64 | .hidden.ext_installed, .hidden.ext_available {
65 | display:none;
66 | }
67 | .collapsable {
68 | cursor: pointer;
69 | }
70 | .toggler {
71 | width:9px;
72 | heigth: 9px;
73 | background:url(toggler.gif) -9px center no-repeat;
74 | }
75 | .collapsed .toggler{
76 | background:url(toggler.gif) left center no-repeat;
77 | }
78 | .collapsable:hover .toggler {
79 | background:url(toggler.gif) -27px center no-repeat;
80 | }
81 | .collapsable.collapsed:hover .toggler {
82 | background:url(toggler.gif) -18px center no-repeat;
83 | }
--------------------------------------------------------------------------------
/pun_admin_manage_extensions_improved/style/Oxygen/toggler.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/punbb/extensions/102c3ebc20fa2e94111d281197451e83be12fc28/pun_admin_manage_extensions_improved/style/Oxygen/toggler.gif
--------------------------------------------------------------------------------
/pun_attachment/attachments/.htaccess:
--------------------------------------------------------------------------------
1 |
2 | Order Allow,Deny
3 | Deny from All
4 |
--------------------------------------------------------------------------------
/pun_attachment/attachments/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | 403 - No access
4 |
5 |
6 | Error 403
7 | No access
8 |
9 |
--------------------------------------------------------------------------------
/pun_attachment/css/Oxygen/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_attachment/css/Oxygen/pun_attachment.css:
--------------------------------------------------------------------------------
1 | /**
2 | * CSS rules for Oxygen style
3 | *
4 | * @copyright Copyright (C) 2008 PunBB
5 | * @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
6 | * @package pun_attachment
7 | */
8 | div.attachments
9 | {
10 | border-style:solid;
11 | border-width:1px;
12 | padding:2px 6px 3px 6px;
13 | }
14 | .attachments div
15 | {
16 | padding:3px;
17 | }
18 | .attachments strong
19 | {
20 | visibility:hidden;
21 | display:none;
22 | }
23 | p.show-image, #brd-attachment-preview span.show-image, #brd-attachment-preview span.show-image img
24 | {
25 | width:100%;
26 | }
27 | p.show-image img
28 | {
29 | max-width:100%;
30 | }/**
31 | * CSS rules for Oxygen style
32 | *
33 | * @copyright Copyright (C) 2008 PunBB
34 | * @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
35 | * @package pun_attachment
36 | */
37 | div.attachments
38 | {
39 | background-color:#EDF1F5;
40 | }
--------------------------------------------------------------------------------
/pun_attachment/css/Oxygen/pun_attachment.min.css:
--------------------------------------------------------------------------------
1 | div.attachments{border-style:solid;border-width:1px;padding:2px 6px 3px 6px}.attachments div{padding:3px}.attachments strong{visibility:hidden;display:none}p.show-image,#brd-attachment-preview span.show-image,#brd-attachment-preview span.show-image img{width:100%}p.show-image img{max-width:100%}div.attachments{background-color:#edf1f5}
--------------------------------------------------------------------------------
/pun_attachment/css/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_attachment/img/audio.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/punbb/extensions/102c3ebc20fa2e94111d281197451e83be12fc28/pun_attachment/img/audio.png
--------------------------------------------------------------------------------
/pun_attachment/img/compress.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/punbb/extensions/102c3ebc20fa2e94111d281197451e83be12fc28/pun_attachment/img/compress.png
--------------------------------------------------------------------------------
/pun_attachment/img/doc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/punbb/extensions/102c3ebc20fa2e94111d281197451e83be12fc28/pun_attachment/img/doc.png
--------------------------------------------------------------------------------
/pun_attachment/img/image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/punbb/extensions/102c3ebc20fa2e94111d281197451e83be12fc28/pun_attachment/img/image.png
--------------------------------------------------------------------------------
/pun_attachment/img/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_attachment/img/text.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/punbb/extensions/102c3ebc20fa2e94111d281197451e83be12fc28/pun_attachment/img/text.png
--------------------------------------------------------------------------------
/pun_attachment/img/unknown.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/punbb/extensions/102c3ebc20fa2e94111d281197451e83be12fc28/pun_attachment/img/unknown.png
--------------------------------------------------------------------------------
/pun_attachment/img/video.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/punbb/extensions/102c3ebc20fa2e94111d281197451e83be12fc28/pun_attachment/img/video.png
--------------------------------------------------------------------------------
/pun_attachment/include/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_attachment/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_attachment/lang/English/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_attachment/lang/English/pun_attachment.php:
--------------------------------------------------------------------------------
1 | 'Display images',
17 | 'Display small' => 'Images will be displayed on the viewtopic/edit page, whose size is smaller than the parameters below.',
18 | 'Disable attachments' => 'Disable attachments',
19 | 'Display icons' => 'Enable displaying icons',
20 | 'Create orphans' => 'Enable it if you want to create orphans.',
21 | 'Always deny' => 'Always deny',
22 | 'Filesize' => 'File size',
23 | 'Filename' => 'File name',
24 | 'Max filesize' => 'Max file size',
25 | 'Max height' => 'Max height',
26 | 'Max width' => 'Max width',
27 | 'Manage icons' => 'Manage icons',
28 | 'Main options' => 'Main options',
29 | 'Attachment rules' => 'Attachment rules',
30 | 'Attachment page head' => 'Attachment %s',
31 | 'Delete button' => 'Delete',
32 | 'Attach button' => 'Attach',
33 | 'Rename button' => 'Rename',
34 | 'Detach button' => 'Detach',
35 | 'Uploaded date' => 'Uploaded date',
36 | 'MIME-type' => 'MIME-type',
37 | 'Post id' => 'Post id',
38 | 'Downloads' => 'Downloads',
39 | 'New name' => 'New name',
40 | 'Ascending' => 'Ascending',
41 | 'Descending' => 'Descending',
42 |
43 | 'Create orphans' => 'Create orphans',
44 | 'Orphans help' => 'If this option is enabled, attachments will not be removed from the database when a user wants to delete a post with these attachments.',
45 | 'Icons help' => 'Icons for attachment types are stored in FORUM_ROOT/extensions/attachment/img/. To add or change icons, use the following form. In the first coloumn enter the types, entering icon names into opposing cells. PunBB allows you to use icons in png, gif, jpeg, ico formats.',
46 |
47 |
48 | // la
49 | 'Attachment' => 'Attachments',
50 | 'Size:' => 'Size:',
51 | 'bytes' => 'bytes',
52 | 'Downloads:' => 'Downloads:',
53 | 'Kbytes' => ' kbytes',
54 | 'Mbytes' => ' mbytes',
55 | 'Bytes' => ' bytes',
56 | 'Kb' => ' kb',
57 | 'Mb' => ' mb',
58 | 'B' => ' b',
59 | 'Since' => '%s downloads since %s',
60 | 'Never download' => 'file has never been downloaded.',
61 | 'Since (title)' => '%s times downloaded since %s',
62 | 'Attachment icon' => 'Attachment icon',
63 |
64 | 'Number existing' => 'Existing attachment #%s',
65 |
66 | //edit.php
67 | 'Existing' => 'Existing attachments: ', //Used in edit.php, before the existing attachments that you're allowed to delete
68 |
69 | //attach.php
70 | 'Download:' => 'Download:',
71 | 'Attachment added' => 'Attachment added. Redirecting...',
72 | 'Attachment delete' => 'Attachment deleted. Redirecting...',
73 |
74 | //rules
75 | 'Group attach part' => 'Attachments permissions',
76 | 'Rules' => 'Attachment rules',
77 | 'Download' => 'Allow users to download files',
78 | 'Upload' => 'Allow users to upload files',
79 | 'Delete' => 'Allow users to delete files',
80 | 'Owner delete' => 'Allow users to delete their own files',
81 | 'Size' => 'Max file size',
82 | 'Size comment' => 'Max size of the uploaded file (in bytes).',
83 | 'Per post' => 'Attachments per post',
84 | 'Allowed files' => 'Allowed files',
85 | 'Allowed comment' => 'If empty, allow all files except those that are always denied.',
86 | 'File len err' => 'File name can\'t be longer than 255 chars',
87 | 'Ext len err' => 'File extension can\'t be longer than 64 chars.',
88 |
89 | // Notices
90 | 'Wrong post' => 'You have entered a wrong post id. Please correct it.',
91 | 'Too large ini' => 'The selected file was too large to upload. The server forbade the upload.',
92 | 'Wrong icon/name' => 'You have entered a wrong extension/icon name',
93 | 'No icons' => 'You have entered an empty value of extension/icon name. Please, go back and correct it.',
94 | 'Wrong deny' => 'You have entered a wrong list of denied extensions. Please, go back and correct it.',
95 | 'Wrong allowed' => 'You have entered a wrong list of allowed extensions. Please, go back and correct it.',
96 | 'Big icon' => 'The icon %s is too wide/high. Please, select another one.',
97 | 'Missing icons' => 'The following icons are missing:',
98 | 'Big icons' => 'The following icons are too wide/high:',
99 |
100 | 'Error: mkdir' => 'Unable to create new the subfolder with the name',
101 | 'Error: 0750' => 'with mode 0750',
102 | 'Error: .htaccess' => 'Unable to copy .htaccess file to the new subfolder with name',
103 | 'Error: index.html' => 'Unable to copy index.html file to the new subfolder with name',
104 | 'Some more salt keywords' => 'Some more salt keywords, change if you want to',
105 | 'Put salt' => 'put your salt here',
106 | 'Attachment options' => 'Attachment options',
107 | 'Rename attachment' => 'Rename attachment',
108 | 'Old name' => 'Old name',
109 | 'New name' => 'New name',
110 | 'Input new attachment name' => 'Input a new attachment name (without extension)',
111 | 'Attachments' => 'Attachments',
112 | 'Start at' => 'Start at',
113 | 'Number to show' => 'Number to show',
114 | 'to' => 'to',
115 | 'Owner' => 'Owner',
116 | 'Topic' => 'Topic',
117 | 'Order by' => 'Order by',
118 | 'Result sort order' => 'Result sort order',
119 | 'Orphans' => 'Orphans',
120 | 'Apply' => 'Apply',
121 | 'Show only "Orphans"' => 'Show only "Orphans"',
122 | 'Error creating attachment' => 'Error whilecreating attachment, inform the owner of this bulletin board about this problem',
123 | 'Use icons' => 'Use icons',
124 | 'Error while deleting attachment' => 'Error while deleting attachment. Attachment is not deleted.',
125 | 'Salt keyword' => 'Salt keyword, replace if you want to',
126 |
127 | 'Too short filename' => 'Please, enter an unempty filename if you want to rename this attachment.',
128 | 'Wrong post id' => 'You have entered a wrong post id. Please, correct it if you want to attach a file to this post.',
129 | 'Empty post id' => 'Please, enter an unempty post id if you want to attach this file to the post.',
130 | 'Attach error' => 'Warning! The following errors must be corrected before you can attach a file:',
131 | 'Rename error' => 'Warning! The following errors must be corrected before you can rename the attachment:',
132 |
133 | 'Edit attachments' => 'Edit attachments',
134 | 'Post attachments' => 'Post attachments',
135 | 'Image preview' => 'Image preview',
136 |
137 | 'Manage attahcments' => 'Manage attachments',
138 | 'Manage id' => 'Manage attachment %s',
139 |
140 | 'Permission denied' => 'The directory "FORUM_ROOT/extensions/pun_attachment/attachments" is not writable for a Web server!',
141 | 'Htaccess fail' => 'File "FORUM_ROOT/extensions/pun_attachment/attachments/.htaccess" does not exist.',
142 | 'Index fail' => 'File "FORUM_ROOT/extensions/pun_attachment/attachments/index.html" does not exist.',
143 | 'Errors notice' => 'Following errors have been encountered:',
144 |
145 | 'Del perm error' => 'You don\'t have the permission to delete this file.',
146 | 'Up perm error' => 'You don\'t have the permission to upload a file to this post.',
147 |
148 | 'Attach limit error' => 'You can add only %s attachments to this post.',
149 | 'Ext error' => 'You can\'t add an attachment with "%s" extension.',
150 | 'Filesize error' => 'You can\'t upload a file whose size is more than "%s" bytes.',
151 | 'Bad image' => 'Bad image! Try uploading it again.',
152 | 'Add file' => 'Add file',
153 | 'Post attachs' => 'Post\'s attachments',
154 | 'Download perm error' => 'You don\'t have the permssions to download the attachments of this post.',
155 | 'None' => 'None',
156 |
157 | 'Id' => 'Id',
158 | 'Owner' => 'Owner',
159 | 'Up date' => 'Uploaded date',
160 | 'Type' => 'Type'
161 |
162 | );
163 |
--------------------------------------------------------------------------------
/pun_attachment/lang/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_attachment/pun_attach.php:
--------------------------------------------------------------------------------
1 | '.$forum_config['attach_icon_folder'].$icon_name.'';
24 | else
25 | {
26 | list($width, $height,,) = getimagesize($ext_info['path'].'/img/'.$icon_name);
27 |
28 | if (($width > 20) || ($height > 20))
29 | $pun_attach_errors['big_images'][] = ''.$forum_config['attach_icon_folder'].$icon_name.'';
30 | }
31 | }
32 |
33 | // Setup the form
34 | $forum_page['group_count'] = $forum_page['item_count'] = $forum_page['fld_count'] = 0;
35 |
36 | // Setup breadcrumbs
37 | $forum_page['crumbs'] = array(
38 | array($forum_config['o_board_title'], forum_link($forum_url['index'])),
39 | array($lang_admin_common['Forum administration'], forum_link($forum_url['admin_index'])),
40 | array($lang_admin_common['Settings'], forum_link($forum_url['admin_settings_setup'])),
41 | array($lang_attach['Attachment'], forum_link($attach_url['admin_options_attach']))
42 | );
43 |
44 | define('FORUM_PAGE_SECTION', 'settings');
45 | define('FORUM_PAGE', 'admin-options-attach');
46 | require FORUM_ROOT.'header.php';
47 |
48 | // START SUBST -
49 | ob_start();
50 |
51 | ?>
52 |
178 |
--------------------------------------------------------------------------------
/pun_attachment/pun_attachment_page.php:
--------------------------------------------------------------------------------
1 | 'attach_files',
27 | 'SET' => 'post_id=0, topic_id=0, owner_id=0',
28 | 'WHERE' => 'id = '.$id
29 | );
30 | $result = $forum_db->query_build($query) or error(__FILE__,__LINE__);
31 | }
32 |
33 | if (isset($_POST['pun_attach_rename']))
34 | {
35 | if (!isset($_POST['csrf_token']) && (!isset($_GET['csrf_token']) || $_GET['csrf_token'] !== generate_form_token('delete'.$forum_user['id'])))
36 | csrf_confirm_form();
37 |
38 | $new_name = forum_htmlencode($_POST['pun_attach_new_name']);
39 | if (empty($new_name))
40 | {
41 | $pun_attach_rename_error = 1;
42 | $errors[] = $lang_attach['Too short filename'];
43 | }
44 |
45 | if (empty($errors))
46 | {
47 | $query = array(
48 | 'SELECT' => 'filename',
49 | 'FROM' => 'attach_files',
50 | 'WHERE' => 'id='.$id
51 | );
52 | $result = $forum_db->query_build($query) or error(__FILE__,__LINE__);
53 | $pun_attach_filename = $forum_db->fetch_assoc($result);
54 |
55 | if (!$pun_attach_filename)
56 | message($lang_common['Bad request']);
57 |
58 | preg_match('/\.[0-9a-zA-z]{1,}$/', $pun_attach_filename['filename'], $pun_attach_filename_ext);
59 |
60 | $new_name = $new_name.$pun_attach_filename_ext[0];
61 | $query = array(
62 | 'UPDATE' => 'attach_files',
63 | 'SET' => 'filename=\''.$forum_db->escape($new_name).'\'',
64 | 'WHERE' => 'id='.$id
65 | );
66 | $forum_db->query_build($query) or error(__FILE__,__LINE__);
67 | }
68 | }
69 |
70 | if (isset($_POST['pun_attach_delete']))
71 | {
72 | if (!isset($_POST['csrf_token']) && (!isset($_GET['csrf_token']) || $_GET['csrf_token'] !== generate_form_token('delete'.$forum_user['id'])))
73 | csrf_confirm_form();
74 |
75 | $attach_query = array(
76 | 'SELECT' => 'file_path',
77 | 'FROM' => 'attach_files',
78 | 'WHERE' => 'id = '.$id
79 | );
80 | $attach_result = $forum_db->query_build($attach_query) or error(__FILE__, __LINE__);
81 | $del_attach_info = $forum_db->fetch_assoc($attach_result);
82 |
83 | if (!$del_attach_info)
84 | message($lang_common['Bad request']);
85 |
86 | unlink(FORUM_ROOT.$forum_config['attach_basefolder'].$del_attach_info['file_path']);
87 |
88 | $attach_query = array(
89 | 'DELETE' => 'attach_files',
90 | 'WHERE' => 'id = '.$id
91 | );
92 | $forum_db->query_build($attach_query) or error(__FILE__, __LINE__);
93 |
94 | redirect(forum_link($attach_url['admin_attachment_manage']), $lang_attach['Attachment delete']);
95 | }
96 |
97 | if (isset($_POST['pun_attach_attach']))
98 | {
99 | $post_id = intval($_POST['pun_attach_new_post_id']);
100 |
101 | if ($post_id <= 0)
102 | {
103 | $pun_attach_attach_error = 1;
104 | $errors[] = $lang_attach['Empty post id'];
105 | }
106 |
107 | if (empty($errors))
108 | {
109 | $query = array(
110 | 'SELECT' => 't.id as topic_id, p.id as post_id',
111 | 'FROM' => 'posts as p',
112 | 'JOINS' => array(
113 | array(
114 | 'LEFT JOIN' => 'topics t',
115 | 'ON' => 'p.topic_id=t.id'
116 | )
117 | ),
118 | 'WHERE' => 'p.id='.$post_id
119 | );
120 | $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
121 | $pun_attach_topic_id = $forum_db->fetch_assoc($result);
122 |
123 | if (!$pun_attach_topic_id)
124 | {
125 | $pun_attach_attach_error = 1;
126 | $errors[] = $lang_attach['Wrong post id'];
127 | }
128 |
129 | if (empty($errors))
130 | {
131 | $query = array(
132 | 'UPDATE' => 'attach_files',
133 | 'SET' => 'topic_id = '.$pun_attach_topic_id['topic_id'].', post_id = '.$pun_attach_topic_id['post_id'],
134 | 'WHERE' => 'id = '.$id
135 | );
136 | $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
137 | }
138 | }
139 | }
140 |
141 | $query = array(
142 | 'SELECT' => 'af.*, u.username, u.id, t.subject, t.id AS topic_id',
143 | 'FROM' => 'attach_files AS af',
144 | 'JOINS' => array(
145 | array(
146 | 'LEFT JOIN' => 'topics t',
147 | 'ON' => 'af.topic_id=t.id'
148 | ),
149 | array(
150 | 'LEFT JOIN' => 'users u',
151 | 'ON' => 'u.id=af.owner_id'
152 | )
153 | ),
154 | 'WHERE' => 'af.id='.$id
155 | );
156 |
157 | $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
158 | $pun_current_attach = $forum_db->fetch_assoc($result);
159 |
160 | if (!$pun_current_attach)
161 | message($lang_common['Bad request']);
162 |
163 |
164 | $pun_attach_frm_buttons = array();
165 | $pun_attach_frm_buttons[] = '';
166 | $pun_attach_frm_buttons[] = '';
167 |
168 | if ($pun_current_attach['post_id'] == '0')
169 | $pun_attach_frm_buttons[] = '';
170 | else
171 | $pun_attach_frm_buttons[] = '';
172 |
173 | // Setup the form
174 | $forum_page['group_count'] = $forum_page['item_count'] = $forum_page['fld_count'] = 0;
175 |
176 | // Setup breadcrumbs
177 | $forum_page['crumbs'] = array(
178 | array($forum_config['o_board_title'], forum_link($forum_url['index'])),
179 | array($lang_admin_common['Forum administration'], forum_link($forum_url['admin_index'])),
180 | array($lang_attach['Manage attahcments'], forum_link($attach_url['admin_attachment_manage'])),
181 | array(sprintf($lang_attach['Manage id'], $pun_current_attach['filename']), forum_link($attach_url['admin_attachment_edit'], $id))
182 | );
183 |
184 | define('FORUM_PAGE_SECTION', 'management');
185 | define('FORUM_PAGE', 'admin-attachment-manage');
186 | require FORUM_ROOT.'header.php';
187 |
188 | // START SUBST -
189 | ob_start();
190 |
191 | ?>
192 |
193 |
284 |
285 | ', $tpl_temp, $tpl_main);
289 | ob_end_clean();
290 | // END SUBST -
291 |
292 | require FORUM_ROOT.'footer.php';
293 | }
294 |
295 | ?>
--------------------------------------------------------------------------------
/pun_attachment/url.php:
--------------------------------------------------------------------------------
1 | 'extensions/attachment/rules.php',
15 | 'admin_attachment_manage' => 'admin/settings.php?section=pun_list_attach',
16 | 'admin_attach_orphans' => 'extensions/attachment/attachment.php?section=orphans',
17 | 'admin_attach_rules' => 'extensions/attachment/attachment.php?section=rules',
18 | 'admin_attach_file' => 'extensions/attachment/attach_file.php',
19 | 'admin_attach_delete' => 'admin/settings.php?section=list_attach&action=delete&id=$1&csrf_token=$2',
20 | 'admin_attach_detach' => 'admin/settings.php?section=list_attach&action=detach&id=$1&pid=$2&csrf_token=$3',
21 | 'admin_attach_rename' => 'admin/settings.php?section=list_attach&action=rename&id=$1&csrf_token=$2',
22 | 'admin_options_attach' => 'admin/settings.php?section=pun_attach',
23 | 'admin_attachment_edit' => 'admin/settings.php?section=pun_list_attach&id=$1',
24 | 'misc_admin' => 'misc.php?action=pun_attachment&item=$1',
25 | 'misc_download' => 'misc.php?action=pun_attachment&item=$1&download=1',
26 | 'misc_view' => 'misc.php?action=pun_attachment&item=$1&download=0',
27 | 'misc_preview' => 'misc.php?action=pun_attachment&item=$1&preview',
28 | 'misc_download_secure' => 'misc.php?action=pun_attachment&item=$1&download=1&secure_str=$2',
29 | 'misc_view_secure' => 'misc.php?action=pun_attachment&item=$1&download=0&secure_str=$2',
30 | 'misc_preview_secure' => 'misc.php?action=pun_attachment&item=$1&preview&secure_str=$2',
31 | );
32 |
33 | ?>
34 |
--------------------------------------------------------------------------------
/pun_bbcode/bar.php:
--------------------------------------------------------------------------------
1 | buttons = array();
22 | }
23 |
24 |
25 | //
26 | public function add_button($button = NULL) {
27 | if (is_null($button) || !is_array($button))
28 | {
29 | return false;
30 | }
31 |
32 | // Default button
33 | $default_button = array(
34 | //
35 | 'name' => array(
36 | 'default' => null,
37 | ),
38 |
39 | // Default as name
40 | 'title' => array(
41 | 'default' => null,
42 | ),
43 |
44 | // Default as name
45 | 'tag' => array(
46 | 'default' => null,
47 | ),
48 |
49 | // without_attr, with_attr
50 | 'type' => array(
51 | 'default' => 'without_attr',
52 | ),
53 |
54 | // default weight is 100
55 | 'weight' => array(
56 | 'default' => 100,
57 | ),
58 |
59 | //
60 | 'onclick' => array(
61 | 'default' => null,
62 | ),
63 |
64 | // boolean
65 | 'image' => array(
66 | 'default' => false,
67 | ),
68 |
69 | //
70 | 'group' => array(
71 | 'default' => 'default',
72 | )
73 | );
74 |
75 | $length = count($default_button);
76 | $keys = array_keys($default_button);
77 |
78 | for ($i = 0; $i < $length; $i++)
79 | {
80 | $key = $keys[$i];
81 | if (!isset($button[$key]))
82 | {
83 | $default_button[$keys[$i]] = $default_button[$keys[$i]]['default'];
84 | continue;
85 | }
86 |
87 | $default_button[$keys[$i]] = $button[$key];
88 | }
89 |
90 | // Do not add button without name
91 | if (is_null($default_button['name'])) {
92 | return false;
93 | }
94 |
95 | // Title
96 | if (is_null($default_button['title'])) {
97 | $default_button['title'] = forum_trim($default_button['name']);
98 | }
99 |
100 | // Tag
101 | if (is_null($default_button['tag'])) {
102 | $default_button['tag'] = forum_trim($default_button['name']);
103 | }
104 |
105 | // Tweak weight
106 | $default_button['weight'] += count($this->buttons) / 1000;
107 |
108 | $this->buttons[$default_button['name']] = $default_button;
109 |
110 | return $this->buttons;
111 | }
112 |
113 |
114 | public function render() {
115 | global $forum_config, $forum_user, $ext_info, $smilies, $base_url;
116 |
117 | ob_start();
118 | ?>
119 |
120 |
>
121 |
125 |
126 | add_button(array('name' => 'b', 'group' => 'text-decoration', 'weight' => 30, 'image' => true));
128 | $this->add_button(array('name' => 'i', 'group' => 'text-decoration', 'weight' => 32, 'image' => true));
129 | $this->add_button(array('name' => 'u', 'group' => 'text-decoration', 'weight' => 34, 'image' => true));
130 |
131 | $this->add_button(array('name' => 'list', 'group' => 'lists', 'weight' => 40, 'image' => true));
132 | $this->add_button(array('name' => 'list item', 'title' => '*', 'tag' => '*', 'group' => 'lists', 'weight' => 42, 'image' => true));
133 |
134 | $this->add_button(array('name' => 'quote', 'weight' => 50, 'image' => true));
135 | $this->add_button(array('name' => 'code', 'weight' => 52, 'image' => true));
136 | $this->add_button(array('name' => 'email', 'weight' => 54, 'image' => true));
137 | $this->add_button(array('name' => 'url', 'weight' => 56, 'image' => true));
138 | $this->add_button(array('name' => 'img', 'weight' => 58, 'image' => true));
139 | $this->add_button(array('name' => 'color', 'type' => 'with_attr', 'weight' => 60, 'image' => true));
140 |
141 | ($hook = get_hook('pun_bbcode_pre_buttons_output')) ? eval($hook) : null;
142 |
143 | // Sort buttons
144 | uasort($this->buttons, array('Pun_bbcode', 'sort_buttons'));
145 |
146 | if (!empty($this->buttons))
147 | {
148 | $current_group = '';
149 | $pun_bbcode_tabindex = 1;
150 | foreach ($this->buttons as $name => $button)
151 | {
152 | ($hook = get_hook('pun_bbcode_buttons_output_loop_start')) ? eval($hook) : null;
153 |
154 | // Group class
155 | $button_class = '';
156 | if ($current_group != '' && $current_group != $button['group']) {
157 | $button_class .= ' group_start';
158 | }
159 |
160 | // JS handler
161 | if (!is_null($button['onclick'])) {
162 | $onclick_handler = $button['onclick'];
163 | } else {
164 | if ($button['type'] == 'without_attr') {
165 | $onclick_handler = 'PUNBB.pun_bbcode.insert_text(\'['.$button['tag'].']\',\'[/'.$button['tag'].']\')';
166 | } else {
167 | $onclick_handler = 'PUNBB.pun_bbcode.insert_text(\'['.$button['tag'].'=]\',\'[/'.$button['tag'].']\')';
168 | }
169 | }
170 |
171 | // Graphical?
172 | $title = '';
173 | if ($forum_user['pun_bbcode_use_buttons'] && $button['image']) {
174 | $button_class .= ' image';
175 | $title = $button['title'];
176 | $button['title'] = '';
177 | }
178 |
179 | // Element ID attr can not content space — thats why we replace space in NAME with underscore
180 | echo '';
181 |
182 | $pun_bbcode_tabindex++;
183 | $current_group = $button['group'];
184 | }
185 | }
186 | ?>
187 |
188 |
191 |
192 |
193 | $b['weight'])
210 | {
211 | return 1;
212 | }
213 | else
214 | {
215 | return 0;
216 | }
217 | }
218 | }
219 |
220 | ?>
221 |
--------------------------------------------------------------------------------
/pun_bbcode/css/Oxygen/img/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_bbcode/css/Oxygen/img/sprite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/punbb/extensions/102c3ebc20fa2e94111d281197451e83be12fc28/pun_bbcode/css/Oxygen/img/sprite.png
--------------------------------------------------------------------------------
/pun_bbcode/css/Oxygen/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_bbcode/css/Oxygen/pun_bbcode.css:
--------------------------------------------------------------------------------
1 | /* Styles for pun_bbcode extension */
2 |
3 | #pun_bbcode_bar {
4 | margin: .45em 0 -.1em 1em;
5 | position: relative;
6 | }
7 |
8 | .oldie #pun_bbcode_bar {
9 | margin: .45em 0 -.45em 1em;
10 | }
11 |
12 | #pun_bbcode_bar input[type="button"] {
13 | background: #F3F3F3;
14 | background: -moz-linear-gradient(top, #fff, #F3F3F3);
15 | background: -o-linear-gradient(top, #fff, #F3F3F3);
16 | background: -webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#F3F3F3));
17 | background: -webkit-linear-gradient(top, #fff, #F3F3F3);
18 | background: -ms-linear-gradient(top, #fff, #F3F3F3);
19 | background: linear-gradient(top, #fff, #F3F3F3);
20 | border-radius: 1px;
21 | border-color: #E3E3E3;
22 | padding: .45em .5em;
23 | margin-right: 1px;
24 | margin-bottom: -1.5px;
25 | }
26 |
27 | #pun_bbcode_bar input[type="button"]:active {
28 | position: relative;
29 | top: 1px;
30 | }
31 |
32 | #pun_bbcode_bar input[type="button"]:hover
33 | #pun_bbcode_bar input[type="button"]:focus {
34 | -moz-box-shadow: 0 1px 2px rgba(0,0,0, .1);
35 | -webkit-box-shadow: 0 1px 2px rgba(0,0,0, .1);
36 | box-shadow: 0 1px 2px rgba(0,0,0, .1);
37 | }
38 |
39 | #pun_bbcode_bar input.image {
40 | width: 26px;
41 | height: 26px;
42 | border-color: #eee;
43 | }
44 |
45 | #pun_bbcode_bar input[type="button"]:hover {
46 | border-color: #84BCE4;
47 | }
48 |
49 | #pun_bbcode_bar input[type="button"]:first-child {
50 | margin-left: 0;
51 | }
52 |
53 | #pun_bbcode_bar input.group_start {
54 | margin-left: 2px;
55 | }
56 |
57 | #pun_bbcode_button_b {
58 | font-weight: bold;
59 | }
60 |
61 | #pun_bbcode_button_i {
62 | font-style: italic;
63 | }
64 |
65 | #pun_bbcode_button_u {
66 | text-decoration: underline;
67 | }
68 |
69 | #pun_bbcode_bar #pun_bbcode_wrapper {
70 | width: 95%;
71 | position: relative;
72 | }
73 |
74 |
75 | #pun_bbcode_bar input[name="b"].image,
76 | #pun_bbcode_bar input[name="i"].image,
77 | #pun_bbcode_bar input[name="u"].image,
78 | #pun_bbcode_bar input[name="list"].image,
79 | #pun_bbcode_bar input[name="list item"].image,
80 | #pun_bbcode_bar input[name="color"].image,
81 | #pun_bbcode_bar input[name="code"].image,
82 | #pun_bbcode_bar input[name="quote"].image,
83 | #pun_bbcode_bar input[name="img"].image,
84 | #pun_bbcode_bar input[name="url"].image,
85 | #pun_bbcode_bar input[name="email"].image {
86 | background: url(img/sprite.png) 0 0 no-repeat;
87 | }
88 |
89 |
90 | #pun_bbcode_bar input[name="i"].image {
91 | background-position: -132px 0;
92 | }
93 |
94 | #pun_bbcode_bar input[name="b"].image {
95 | background-position: 0 0;
96 | }
97 |
98 | #pun_bbcode_bar input[name="u"].image {
99 | background-position: -261px 0;
100 | }
101 |
102 | #pun_bbcode_bar input[name="list"].image {
103 | background-position: -183px 0;
104 | }
105 |
106 | #pun_bbcode_bar input[name="list item"].image {
107 | background-position: -157px 0;
108 | }
109 |
110 | #pun_bbcode_bar input[name="color"].image {
111 | background-position: -53px 0;
112 | }
113 |
114 | #pun_bbcode_bar input[name="code"].image {
115 | background-position: -27px 0;
116 | }
117 |
118 | #pun_bbcode_bar input[name="quote"].image {
119 | background-position: -209px 0;
120 | }
121 |
122 | #pun_bbcode_bar input[name="img"].image {
123 | background-position: -105px 0;
124 | }
125 |
126 | #pun_bbcode_bar input[name="url"].image {
127 | background-position: -286px 0;
128 | }
129 |
130 | #pun_bbcode_bar input[name="email"].image {
131 | background-position: -79px 0;
132 | }
133 |
--------------------------------------------------------------------------------
/pun_bbcode/css/Oxygen/pun_bbcode.min.css:
--------------------------------------------------------------------------------
1 | #pun_bbcode_bar{margin:.45em 0 -.1em 1em;position:relative}.oldie #pun_bbcode_bar{margin:.45em 0 -.45em 1em}#pun_bbcode_bar input[type="button"]{background:#f3f3f3;background:-moz-linear-gradient(top,#fff,#f3f3f3);background:-o-linear-gradient(top,#fff,#f3f3f3);background:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#f3f3f3));background:-webkit-linear-gradient(top,#fff,#f3f3f3);background:-ms-linear-gradient(top,#fff,#f3f3f3);background:linear-gradient(top,#fff,#f3f3f3);border-radius:1px;border-color:#e3e3e3;padding:.45em .5em;margin-right:1px;margin-bottom:-1.5px}#pun_bbcode_bar input[type="button"]:active{position:relative;top:1px}#pun_bbcode_bar input[type="button"]:hover #pun_bbcode_bar input[type="button"]:focus{-moz-box-shadow:0 1px 2px rgba(0,0,0,.1);-webkit-box-shadow:0 1px 2px rgba(0,0,0,.1);box-shadow:0 1px 2px rgba(0,0,0,.1)}#pun_bbcode_bar input.image{width:26px;height:26px;border-color:#eee}#pun_bbcode_bar input[type="button"]:hover{border-color:#84bce4}#pun_bbcode_bar input[type="button"]:first-child{margin-left:0}#pun_bbcode_bar input.group_start{margin-left:2px}#pun_bbcode_button_b{font-weight:bold}#pun_bbcode_button_i{font-style:italic}#pun_bbcode_button_u{text-decoration:underline}#pun_bbcode_bar #pun_bbcode_wrapper{width:95%;position:relative}#pun_bbcode_bar input[name="b"].image,#pun_bbcode_bar input[name="i"].image,#pun_bbcode_bar input[name="u"].image,#pun_bbcode_bar input[name="list"].image,#pun_bbcode_bar input[name="list item"].image,#pun_bbcode_bar input[name="color"].image,#pun_bbcode_bar input[name="code"].image,#pun_bbcode_bar input[name="quote"].image,#pun_bbcode_bar input[name="img"].image,#pun_bbcode_bar input[name="url"].image,#pun_bbcode_bar input[name="email"].image{background:url(img/sprite.png) 0 0 no-repeat}#pun_bbcode_bar input[name="i"].image{background-position:-132px 0}#pun_bbcode_bar input[name="b"].image{background-position:0 0}#pun_bbcode_bar input[name="u"].image{background-position:-261px 0}#pun_bbcode_bar input[name="list"].image{background-position:-183px 0}#pun_bbcode_bar input[name="list item"].image{background-position:-157px 0}#pun_bbcode_bar input[name="color"].image{background-position:-53px 0}#pun_bbcode_bar input[name="code"].image{background-position:-27px 0}#pun_bbcode_bar input[name="quote"].image{background-position:-209px 0}#pun_bbcode_bar input[name="img"].image{background-position:-105px 0}#pun_bbcode_bar input[name="url"].image{background-position:-286px 0}#pun_bbcode_bar input[name="email"].image{background-position:-79px 0}
--------------------------------------------------------------------------------
/pun_bbcode/css/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_bbcode/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_bbcode/js/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_bbcode/js/pun_bbcode.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides inserting of BBcodes and smilies
3 | *
4 | * @copyright (C) 2008-2011 PunBB
5 | * @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
6 | * @package pun_bbcode
7 | */
8 | /*jslint browser: true, maxerr: 50, indent: 4 */
9 | /*global PUNBB: true */
10 |
11 | PUNBB.pun_bbcode = (function () {
12 | 'use strict';
13 |
14 | return {
15 |
16 | //
17 | init: function () {
18 |
19 | return true;
20 | },
21 |
22 | //
23 | insert_text: function (open, close) {
24 | var sel, sel_length, msgfield = (document.all) ? document.all.req_message : ((document.getElementById('afocus') !== null) ? (document.getElementById('afocus').req_message) : (document.getElementsByName('req_message')[0]));
25 |
26 | if (!msgfield) {
27 | return false;
28 | }
29 |
30 | // IE support
31 | if (document.selection && document.selection.createRange) {
32 | msgfield.focus();
33 | sel = document.selection.createRange();
34 | sel.text = open + sel.text + close;
35 | msgfield.focus();
36 | } else if (msgfield.selectionStart || msgfield.selectionStart === 0) {
37 | // Moz support
38 | var startPos = msgfield.selectionStart,
39 | endPos = msgfield.selectionEnd,
40 | old_top = msgfield.scrollTop;
41 |
42 | msgfield.value = msgfield.value.substring(0, startPos) + open + msgfield.value.substring(startPos, endPos) + close + msgfield.value.substring(endPos, msgfield.value.length);
43 |
44 | // For tag with attr set cursor after '='
45 | if (open.charAt(open.length - 2) === '=') {
46 | msgfield.selectionStart = (startPos + open.length - 1)
47 | } else if (startPos === endPos) {
48 | msgfield.selectionStart = endPos + open.length;
49 | } else {
50 | msgfield.selectionStart = endPos + open.length + close.length;
51 | }
52 |
53 | msgfield.selectionEnd = msgfield.selectionStart;
54 | msgfield.scrollTop = old_top;
55 | msgfield.focus();
56 | } else {
57 | // Fallback support for other browsers
58 | msgfield.value += open + close;
59 | msgfield.focus();
60 | }
61 | }
62 | };
63 | }());
64 |
65 | // One onload handler
66 | PUNBB.common.addDOMReadyEvent(PUNBB.pun_bbcode.init);
67 |
--------------------------------------------------------------------------------
/pun_bbcode/js/pun_bbcode.min.js:
--------------------------------------------------------------------------------
1 | PUNBB.pun_bbcode=(function(){return{init:function(){return true;},insert_text:function(d,h){var g,f,e=(document.all)?document.all.req_message:((document.getElementById("afocus")!==null)?(document.getElementById("afocus").req_message):(document.getElementsByName("req_message")[0]));if(!e){return false;}if(document.selection&&document.selection.createRange){e.focus();g=document.selection.createRange();g.text=d+g.text+h;e.focus();}else{if(e.selectionStart||e.selectionStart===0){var c=e.selectionStart,b=e.selectionEnd,a=e.scrollTop;e.value=e.value.substring(0,c)+d+e.value.substring(c,b)+h+e.value.substring(b,e.value.length);if(d.charAt(d.length-2)==="="){e.selectionStart=(c+d.length-1);}else{if(c===b){e.selectionStart=b+d.length;}else{e.selectionStart=b+d.length+h.length;}}e.selectionEnd=e.selectionStart;e.scrollTop=a;e.focus();}else{e.value+=d+h;e.focus();}}}};}());PUNBB.common.addDOMReadyEvent(PUNBB.pun_bbcode.init);
--------------------------------------------------------------------------------
/pun_bbcode/lang/English/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_bbcode/lang/English/pun_bbcode.php:
--------------------------------------------------------------------------------
1 | 'Use BBCode Bar',
7 | 'Notice BBCode Bar' => 'Enable BBCode Bar when writing posts',
8 | 'BBCode Graphical' => 'Use graphical buttons',
9 | 'BBCode Graphical buttons' => 'Use graphical buttons in BBcode Bar'
10 | )
11 |
12 | ?>
13 |
--------------------------------------------------------------------------------
/pun_bbcode/lang/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_bbcode/manifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
15 |
16 |
17 | pun_bbcode
18 | BBCode buttons
19 | 1.4.18
20 | Pretty buttons for easy BBCode formatting.
21 | PunBB Development Team
22 |
23 | 1.4RC1
24 | 1.4.2
25 |
26 | query('ALTER TABLE '.$forum_db->prefix.'users
31 | CHANGE use_bbcode_bar pun_bbcode_enabled TINYINT(1) DEFAULT 1,
32 | CHANGE bbcode_style pun_bbcode_use_buttons TINYINT(1) DEFAULT 1') or error(__FILE__, __LINE__);
33 | }
34 | else
35 | {
36 | $forum_db->add_field('users', 'pun_bbcode_enabled', 'TINYINT(1)', false, 1);
37 | $forum_db->add_field('users', 'pun_bbcode_use_buttons', 'TINYINT(1)', false, 1);
38 | }
39 | ]]>
40 |
41 |
42 | drop_field('users', 'pun_bbcode_enabled');
44 | $forum_db->drop_field('users', 'pun_bbcode_use_buttons');
45 | ]]>
46 |
47 |
48 |
49 | add_css($ext_info['url'].'/css/'.$forum_user['style'].'/pun_bbcode.min.css', array('type' => 'url', 'weight' => '90', 'media' => 'screen'));
58 | else
59 | $forum_loader->add_css($ext_info['url'].'/css/Oxygen/pun_bbcode.min.css', array('type' => 'url', 'weight' => '90', 'media' => 'screen'));
60 |
61 | // CSS for disabled JS hide bar
62 | $forum_loader->add_css('#pun_bbcode_bar { display: none; }', array('type' => 'inline', 'noscript' => true));
63 |
64 | // Load JS
65 | $forum_loader->add_js('PUNBB.pun_bbcode=(function(){return{init:function(){return true;},insert_text:function(d,h){var g,f,e=(document.all)?document.all.req_message:((document.getElementById("afocus")!==null)?(document.getElementById("afocus").req_message):(document.getElementsByName("req_message")[0]));if(!e){return false;}if(document.selection&&document.selection.createRange){e.focus();g=document.selection.createRange();g.text=d+g.text+h;e.focus();}else{if(e.selectionStart||e.selectionStart===0){var c=e.selectionStart,b=e.selectionEnd,a=e.scrollTop;e.value=e.value.substring(0,c)+d+e.value.substring(c,b)+h+e.value.substring(b,e.value.length);if(d.charAt(d.length-2)==="="){e.selectionStart=(c+d.length-1);}else{if(c===b){e.selectionStart=b+d.length;}else{e.selectionStart=b+d.length+h.length;}}e.selectionEnd=e.selectionStart;e.scrollTop=a;e.focus();}else{e.value+=d+h;e.focus();}}}};}());PUNBB.common.addDOMReadyEvent(PUNBB.pun_bbcode.init);', array('type' => 'inline'));
66 |
67 | ($hook = get_hook('pun_bbcode_styles_loaded')) ? eval($hook) : null;
68 | }
69 | ]]>
70 |
71 |
72 | render();
79 | }
80 | ]]>
81 |
82 |
83 |
87 |
88 |
89 |
97 |
111 |
113 |
114 |
115 |
--------------------------------------------------------------------------------
/pun_colored_usergroups/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_colored_usergroups/lang/English/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_colored_usergroups/lang/English/pun_colored_usergroups.php:
--------------------------------------------------------------------------------
1 | 'Link colour',
15 | 'hover' => 'Hover colour',
16 | );
17 |
18 | ?>
19 |
--------------------------------------------------------------------------------
/pun_colored_usergroups/lang/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_colored_usergroups/main.php:
--------------------------------------------------------------------------------
1 | 'g.g_id, g.link_color, g.hover_color',
19 | 'FROM' => 'groups AS g'
20 | );
21 |
22 | $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
23 | $output = array();
24 |
25 | while ($all_groups = $forum_db->fetch_assoc($result))
26 | {
27 | if (isset($all_groups['link_color']))
28 | {
29 | $link_color = ' color: '.$all_groups['link_color'].';';
30 | $output[] = '.group_color_'.$all_groups['g_id'].' a:link, .group_color_'.$all_groups['g_id'].' { color: '.$all_groups['link_color'].' !important; }'."\n";
31 | $output[] = '.group_color_'.$all_groups['g_id'].' a:visited { color: '.$all_groups['link_color'].'; }'."\n";
32 | }
33 | else
34 | {
35 | $link_color='';
36 | }
37 |
38 | if (isset($all_groups['hover_color']))
39 | {
40 | $output[] = '.group_color_'.$all_groups['g_id'].' a:hover { color: '.$all_groups['hover_color'].'; }'."\n";
41 | $output[] = '.group_color_'.$all_groups['g_id'].' { color: '.$all_groups['hover_color'].'; }'."\n\n";
42 | };
43 | }
44 |
45 |
46 | // WRITE CACHE
47 | if (!empty($output))
48 | {
49 | if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
50 | require FORUM_ROOT.'include/cache.php';
51 |
52 | if (!write_cache_file(FORUM_CACHE_DIR.'cache_pun_coloured_usergroups.php', ''))
53 | {
54 | error('Unable to write configuration cache file to cache directory. Please make sure PHP has write access to the directory \'cache\'.', __FILE__, __LINE__);
55 | }
56 | }
57 | }
58 |
59 | define('CACHE_PUN_COLOURED_USERGROUPS_LOADED', 1);
60 |
--------------------------------------------------------------------------------
/pun_colored_usergroups/manifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
13 |
14 |
15 | pun_colored_usergroups
16 | Colored usergroups
17 | 1.2.4
18 | This extension allows setting specific colors for user groups.
19 | PunBB Development Team
20 |
21 | 1.4RC1
22 | 1.4.2
23 |
24 |
25 | field_exists('groups', 'link_color'))
27 | {
28 | $forum_db->add_field('groups', 'link_color', 'VARCHAR(20)', true);
29 | $forum_db->add_field('groups', 'hover_color', 'VARCHAR(20)', true);
30 | }
31 | ]]>
32 |
33 | drop_field('groups', 'link_color');
35 | $forum_db->drop_field('groups', 'hover_color');
36 |
37 | if (file_exists(FORUM_CACHE_DIR.'cache_pun_coloured_usergroups.php'))
38 | {
39 | unlink(FORUM_CACHE_DIR.'cache_pun_coloured_usergroups.php');
40 | }
41 | ]]>
42 |
43 |
44 |
45 | 'users AS u',
49 | 'ON' => 'u.id=o.user_id'
50 | );
51 | ]]>
52 |
53 |
54 |
60 |
70 |
72 |
73 |
74 |
78 |
79 |
80 | escape($link_color).'\'';
85 | }
86 |
87 | if (!empty($hover_color))
88 | {
89 | $query['INSERT'] .= ', hover_color';
90 | $query['VALUES'] .= ',\''.$forum_db->escape($hover_color).'\'';
91 | }
92 | ]]>
93 |
94 |
95 | escape($link_color).'\'';
98 | else
99 | $query['SET'] .= ', link_color = NULL';
100 | if (!empty($hover_color))
101 | $query['SET'] .= ', hover_color = \''.$forum_db->escape($hover_color).'\'';
102 | else
103 | $query['SET'] .= ', hover_color = NULL';
104 | ]]>
105 |
106 |
107 | query_build($query) or error(__FILE__, __LINE__);
110 |
111 | while ($forum_user_online = $forum_db->fetch_assoc($result))
112 | {
113 | if ($forum_user_online['user_id'] > 1)
114 | {
115 | $users[] = ($forum_user['g_view_users'] == '1') ? ''.forum_htmlencode($forum_user_online['ident']).'' : forum_htmlencode($forum_user_online['ident']);
116 | };
117 | };
118 | ]]>
119 |
120 |
121 |
130 |
131 |
132 | add_css($pun_colored_usergroups_cache, array('type' => 'inline', 'media' => 'screen'));
137 | }
138 | ]]>
139 |
140 |
141 | 1)
143 | $forum_page['post_ident']['byline'] = ''.sprintf((($cur_post['id'] == $cur_topic['first_post_id']) ? $lang_topic['Topic byline'] : $lang_topic['Reply byline']), (($forum_user['g_view_users'] == '1') ? ''.forum_htmlencode($cur_post['username']).'' : ''.forum_htmlencode($cur_post['username']).'')).'';
144 | else
145 | $forum_page['post_ident']['byline'] = ''.sprintf((($cur_post['id'] == $cur_topic['first_post_id']) ? $lang_topic['Topic byline'] : $lang_topic['Reply byline']), ''.forum_htmlencode($cur_post['username']).'').'';
146 | ]]>
147 |
148 |
149 | '.forum_htmlencode($user_data['username']).'';
151 | ]]>
152 |
153 |
154 | '.forum_htmlencode($user['username']).'';
156 | ]]>
157 |
158 |
159 |
165 |
166 |
167 |
--------------------------------------------------------------------------------
/pun_forum_news/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_forum_news/lang/English/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_forum_news/lang/English/pun_forum_news.php:
--------------------------------------------------------------------------------
1 | 'Forum news',
17 | 'Permission text' => 'Allow users to add forum news',
18 | 'Post mark' => 'Mark as news.',
19 | 'Forum news' => 'News',
20 | 'No news' => 'No news found.',
21 | 'RSS news feed' => 'RSS news feed'
22 | );
23 |
24 | ?>
--------------------------------------------------------------------------------
/pun_forum_news/lang/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_jquery/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_jquery/js/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_jquery/lang/English/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_jquery/lang/English/lang.php:
--------------------------------------------------------------------------------
1 | 'jQuery (version %s)',
8 | 'Setup jquery legend' => 'jQuery (version %s)',
9 |
10 | 'Include method' => 'Include method',
11 |
12 | 'Include method local label' => 'Local',
13 | 'Include method google label' => 'Google Ajax API CDN ',
14 | 'Include method microsoft label' => 'Microsoft CDN',
15 | 'Include method jquery label' => 'jQuery CDN',
16 | );
17 |
18 | ?>
19 |
--------------------------------------------------------------------------------
/pun_jquery/lang/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_jquery/manifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | pun_jquery
7 | jQuery
8 | A PunBB extension that provide jQuery lib (version 1.7.1)
9 | PunBB Development Team
10 | 1.1.5
11 |
12 | 1.4RC1
13 | 1.4.2
14 |
15 |
16 |
19 |
20 |
23 |
24 |
25 |
26 |
27 |
28 |
36 |
37 |
38 |
50 |
51 |
52 |
53 |
54 |
78 |
79 |
81 |
82 |
83 |
84 | PUN_JQUERY_INCLUDE_METHOD_JQUERY_CDN))
89 | {
90 | $form['pun_jquery_include_method'] = PUN_JQUERY_INCLUDE_METHOD_LOCAL;
91 | }
92 | }
93 | else
94 | {
95 | $form['pun_jquery_include_method'] = PUN_JQUERY_INCLUDE_METHOD_LOCAL;
96 | }
97 | ]]>
98 |
99 |
100 |
101 | add_js($ext_pun_jquery_url, array('type' => 'url', 'async' => false, 'weight' => 75));
123 | ]]>
124 |
125 |
126 |
127 |
--------------------------------------------------------------------------------
/pun_move_posts/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_move_posts/lang/English/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_move_posts/lang/English/pun_move_posts.php:
--------------------------------------------------------------------------------
1 | 'Destination forum',
15 | 'Destination topic' => 'Destination topic',
16 | 'Move selected' => 'Move selected posts',
17 | 'Move posts' => 'Move posts',
18 | 'Ignore dates' => 'Ignore dates',
19 | 'Ignore text' => 'The time and date of the moved posts will change to the time of moving'
20 | );
21 |
22 | ?>
23 |
--------------------------------------------------------------------------------
/pun_move_posts/lang/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_move_posts/manifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
13 |
14 |
15 | pun_move_posts
16 | Pun Move Posts
17 | 1.1.4
18 | This extension allows moderators to move posts to other topics.
19 | PunBB Development Team
20 |
21 | 1.4RC1
22 | 1.4.2
23 |
24 |
25 | '), $forum_page['mod_options']);
27 | ]]>
28 |
29 |
32 |
33 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/pun_move_posts/move_posts.php:
--------------------------------------------------------------------------------
1 | 't.subject, t.poster, t.first_post_id, t.posted, t.num_replies',
19 | 'FROM' => 'topics AS t',
20 | 'WHERE' => 't.id='.$tid.' AND t.moved_to IS NULL'
21 | );
22 |
23 | ($hook = get_hook('move_post_qr_get_topic_info')) ? eval($hook) : null;
24 |
25 | $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
26 | $cur_topic = $forum_db->fetch_assoc($result);
27 |
28 | if (!$cur_topic)
29 | message($lang_common['Bad request']);
30 |
31 | $posts = isset($_POST['posts']) && !empty($_POST['posts']) ? $_POST['posts'] : array();
32 | $posts = array_map('intval', (is_array($posts) ? $posts : explode(',', $posts)));
33 |
34 | if (isset($_POST['move_posts']))
35 | {
36 | if (empty($posts))
37 | message($lang_misc['No posts selected']);
38 |
39 | // Get topics we can move the posts into
40 | $query = array(
41 | 'SELECT' => 'c.id AS cid, c.cat_name, f.id AS fid, f.forum_name',
42 | 'FROM' => 'categories AS c',
43 | 'JOINS' => array(
44 | array(
45 | 'INNER JOIN' => 'forums AS f',
46 | 'ON' => 'c.id=f.cat_id'
47 | ),
48 | array(
49 | 'LEFT JOIN' => 'forum_perms AS fp',
50 | 'ON' => '(fp.forum_id=f.id AND fp.group_id='.$forum_user['g_id'].')'
51 | )
52 | ),
53 | 'WHERE' => '(fp.read_forum IS NULL OR fp.read_forum=1) AND f.redirect_url IS NULL AND f.num_topics!=0',
54 | 'ORDER BY' => 'c.disp_position, c.id, f.disp_position'
55 | );
56 |
57 | ($hook = get_hook('move_post_qr_get_forums_can_move_to')) ? eval($hook) : null;
58 |
59 | $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
60 |
61 | $forum_list = array();
62 | while ($cur_sel_forum = $forum_db->fetch_assoc($result))
63 | $forum_list[] = $cur_sel_forum;
64 |
65 | $forum_page['form_action'] = forum_link($forum_url['moderate_topic'], array($fid, $tid));
66 | $forum_page['group_count'] = $forum_page['item_count'] = $forum_page['fld_count'] = 0;
67 | $forum_page['hidden_fields'] = array(
68 | 'csrf_token' => '',
69 | 'posts' => '',
70 | 'fid' => '',
71 | 'tid' => '',
72 | );
73 |
74 | $forum_page['crumbs'] = array(
75 | array($forum_config['o_board_title'], forum_link($forum_url['index'])),
76 | array($cur_forum['forum_name'], forum_link($forum_url['forum'], array($fid, sef_friendly($cur_forum['forum_name'])))),
77 | array($lang_misc['Moderate forum'], forum_link($forum_url['moderate_forum'], $fid)),
78 | $lang_pun_move_posts['Move posts']
79 | );
80 |
81 | //Setup main heading
82 | define('FORUM_PAGE', 'dialogue');
83 | require FORUM_ROOT.'header.php';
84 |
85 | // START SUBST -
86 | ob_start();
87 |
88 | ?>
89 |
90 |
91 |
92 |
130 |
131 | ', $tpl_temp, $tpl_main);
137 | ob_end_clean();
138 | // END SUBST -
139 |
140 | require FORUM_ROOT.'footer.php';
141 | }
142 |
143 | if (isset($_POST['move_posts_s']))
144 | {
145 | $move_to_forum = isset($_POST['move_to_forum']) && !empty($_POST['move_to_forum']) ? $_POST['move_to_forum'] : array();
146 |
147 | if (empty($posts))
148 | message($lang_misc['No posts selected']);
149 |
150 | // Get topics we can move the posts into
151 | $query = array(
152 | 'SELECT' => 'f.id AS fid, f.forum_name as f_name, t.id AS tid, t.subject AS topic_subject',
153 | 'FROM' => 'forums AS f',
154 | 'JOINS' => array(
155 | array(
156 | 'INNER JOIN' => 'topics AS t',
157 | 'ON' => 'f.id=t.forum_id'
158 | ),
159 | ),
160 | 'WHERE' => 'f.id='.$move_to_forum.' AND t.id!='.$tid,
161 | 'ORDER BY' => 't.last_post DESC'
162 | );
163 |
164 | ($hook = get_hook('move_post_qr_get_topics_can_move_to')) ? eval($hook) : null;
165 |
166 | $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
167 |
168 | $forum_list = array();
169 | while ($cur_sel_forum = $forum_db->fetch_assoc($result))
170 | $forum_list[] = $cur_sel_forum;
171 |
172 | $forum_page['form_action'] = forum_link($forum_url['moderate_topic'], array($fid, $tid));
173 | $forum_page['group_count'] = $forum_page['item_count'] = $forum_page['fld_count'] = 0;
174 | $forum_page['hidden_fields'] = array(
175 | 'csrf_token' => '',
176 | 'posts' => '',
177 | 'tid' => '',
178 | 'fid' => '',
179 | 'move_to_forum' => ''
180 | );
181 |
182 | $forum_page['crumbs'] = array(
183 | array($forum_config['o_board_title'], forum_link($forum_url['index'])),
184 | array($cur_forum['forum_name'], forum_link($forum_url['forum'], array($fid, sef_friendly($cur_forum['forum_name'])))),
185 | array($lang_misc['Moderate forum'], forum_link($forum_url['moderate_forum'], $fid)),
186 | $lang_pun_move_posts['Move posts']
187 | );
188 |
189 | //Setup main heading
190 | define('FORUM_PAGE', 'dialogue');
191 | require FORUM_ROOT.'header.php';
192 |
193 | // START SUBST -
194 | ob_start();
195 |
196 | ?>
197 |
198 |
199 |
200 |
246 |
247 | ', $tpl_temp, $tpl_main);
253 | ob_end_clean();
254 | // END SUBST -
255 |
256 | require FORUM_ROOT.'footer.php';
257 | }
258 |
259 | if (isset($_POST['move_posts_to']))
260 | {
261 | $move_to_topic = isset($_POST['move_to_topic']) && !empty($_POST['move_to_topic']) ? $_POST['move_to_topic'] : array();
262 |
263 | if (empty($posts))
264 | message($lang_misc['No posts selected']);
265 |
266 | // Move the posts
267 | $query = array(
268 | 'UPDATE' => 'posts',
269 | 'SET' => 'topic_id='.$move_to_topic,
270 | 'WHERE' => 'id IN('.implode(',', $posts).')'
271 | );
272 |
273 | if (isset($_POST['change_time']))
274 | $query['SET'] .= ', posted='.time();
275 |
276 | ($hook = get_hook('move_post_qr_update_post')) ? eval($hook) : null;
277 |
278 | $forum_db->query_build($query) or error(__FILE__, __LINE__);
279 |
280 | $query = array(
281 | 'SELECT' => '*',
282 | 'FROM' => 'posts',
283 | 'WHERE' => 'id IN('.implode(',', $posts).')',
284 | 'ORDER BY' => 'posted'
285 | );
286 |
287 | ($hook = get_hook('move_post_qr_get_posts_info')) ? eval($hook) : null;
288 |
289 | $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
290 |
291 | while ($cur_post = $forum_db->fetch_assoc($result))
292 | {
293 | $values = array();
294 |
295 | foreach ($cur_post as $k => $v)
296 | {
297 | if (!(empty($v)||$k=='id'))
298 | $values[$k]='\''.$forum_db->escape($v).'\'';
299 | }
300 |
301 | $query = array(
302 | 'INSERT' => implode(',', array_keys($values)),
303 | 'INTO' => 'posts',
304 | 'VALUES' => implode(',', $values)
305 | );
306 |
307 | ($hook = get_hook('move_post_qr_insert_post')) ? eval($hook) : null;
308 |
309 | $forum_db->query_build($query);// or error(__FILE__, __LINE__);
310 |
311 | $new_post_id = $forum_db->insert_id();
312 |
313 | ($hook = get_hook('move_post_loop_insert_end')) ? eval($hook) : null;
314 | }
315 |
316 | $query = array(
317 | 'DELETE' => 'posts',
318 | 'WHERE' => 'id IN('.implode(',', $posts).')'
319 | );
320 |
321 | ($hook = get_hook('move_post_qr_delete_posts')) ? eval($hook) : null;
322 |
323 | $forum_db->query_build($query) or error(__FILE__, __LINE__);
324 |
325 | sync_topic($tid);
326 | sync_topic($move_to_topic);
327 | sync_forum($fid);
328 |
329 | ($hook = get_hook('move_post_end_pre_redirect')) ? eval($hook) : null;
330 |
331 | redirect(forum_link($forum_url['topic'], array($tid, sef_friendly($cur_topic['subject']))), 'Move posts');
332 | }
333 |
--------------------------------------------------------------------------------
/pun_pm/css/Oxygen/icons/draft.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/punbb/extensions/102c3ebc20fa2e94111d281197451e83be12fc28/pun_pm/css/Oxygen/icons/draft.png
--------------------------------------------------------------------------------
/pun_pm/css/Oxygen/icons/inbox_delivered.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/punbb/extensions/102c3ebc20fa2e94111d281197451e83be12fc28/pun_pm/css/Oxygen/icons/inbox_delivered.png
--------------------------------------------------------------------------------
/pun_pm/css/Oxygen/icons/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_pm/css/Oxygen/icons/outbox_delivered.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/punbb/extensions/102c3ebc20fa2e94111d281197451e83be12fc28/pun_pm/css/Oxygen/icons/outbox_delivered.png
--------------------------------------------------------------------------------
/pun_pm/css/Oxygen/icons/read.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/punbb/extensions/102c3ebc20fa2e94111d281197451e83be12fc28/pun_pm/css/Oxygen/icons/read.png
--------------------------------------------------------------------------------
/pun_pm/css/Oxygen/icons/sent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/punbb/extensions/102c3ebc20fa2e94111d281197451e83be12fc28/pun_pm/css/Oxygen/icons/sent.png
--------------------------------------------------------------------------------
/pun_pm/css/Oxygen/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_pm/css/Oxygen/pun_pm.css:
--------------------------------------------------------------------------------
1 | /* Styles for pun_pm extension */
2 |
3 | /* Message list styles */
4 |
5 | .pun_pm_list {
6 | width: 100%;
7 | border-collapse: collapse;
8 | }
9 |
10 | .pun_pm_list td,
11 | .pun_pm_list th {
12 | height: auto;
13 | width: auto;
14 | margin: 0;
15 | padding: 0.3em 1em;
16 | }
17 |
18 | .pun_pm_list .pm_new td {
19 | font-weight: bold;
20 | }
21 |
22 | .pun_pm_list .td1,
23 | .pun_pm_list .td2 {
24 | width: 2.3em;
25 | text-align: center;
26 | padding-left: 0;
27 | padding-right: 0;
28 | vertical-align: middle;
29 | }
30 |
31 | .pun_pm_list .td5,
32 | .pun_pm_list .td3 {
33 | width: 14em;
34 | }
35 |
36 | .pun_pm_list .td1 {
37 | border-left-style: none;
38 | border-left-width: 0;
39 | }
40 |
41 | .pun_pm_list td.td3 {
42 | border-style: solid none none solid;
43 | }
44 |
45 | .pun_pm_list td.td4 {
46 | border-style: solid none none none;
47 | }
48 |
49 | .pun_pm_list td.td5 {
50 | border-style: solid none none none;
51 | }
52 |
53 |
54 | .pun_pm_list .td4 span {
55 | overflow: hidden;
56 | display: block;
57 | height: 1.3em;
58 | }
59 |
60 | .pun_pm_list .td4 a.mess {
61 | text-decoration: none;
62 | color: #999;
63 | }
64 |
65 | .pun_pm_list .selected td {
66 | background: #FFFFCC;
67 | }
68 |
69 |
70 | /* Message styles */
71 | .pun_pm_msg table td {
72 | width: auto;
73 | border-width: 0;
74 | padding: 0.3em 0;
75 | }
76 |
77 | .pun_pm_msg .td1 {
78 | font-weight: bold;
79 | width: 17.7em;
80 | padding-right: 1em;
81 | text-align: right;
82 | vertical-align: top;
83 | }
84 |
85 | .pun_pm_msg .post-entry {
86 | margin: 0;
87 | padding: 0;
88 | margin-bottom: 1.5em;
89 | }
90 |
91 | .pun_pm_msg,
92 | .pun_pm_msg .post-entry .entry-content {
93 | margin: 1em 0.7em;
94 | width: auto !important;
95 | }
96 |
97 | .pun-pm-ct-box {
98 | border-style: solid;
99 | border-width: 1px;
100 | border-color: #DBE0E4;
101 | -moz-border-radius: .35em;
102 | -webkit-border-radius: .35em;
103 | -khtml-border-radius: .35em;
104 | border-radius: .35em;
105 | margin: 1.417em;
106 | padding: 0.5em 1em;
107 | position: relative;
108 | }
109 |
--------------------------------------------------------------------------------
/pun_pm/css/Oxygen/pun_pm.min.css:
--------------------------------------------------------------------------------
1 | .pun_pm_list{width:100%;border-collapse:collapse}.pun_pm_list td,.pun_pm_list th{height:auto;width:auto;margin:0;padding:.3em 1em}.pun_pm_list .pm_new td{font-weight:bold}.pun_pm_list .td1,.pun_pm_list .td2{width:2.3em;text-align:center;padding-left:0;padding-right:0;vertical-align:middle}.pun_pm_list .td5,.pun_pm_list .td3{width:14em}.pun_pm_list .td1{border-left-style:none;border-left-width:0}.pun_pm_list td.td3{border-style:solid none none solid}.pun_pm_list td.td4{border-style:solid none none none}.pun_pm_list td.td5{border-style:solid none none none}.pun_pm_list .td4 span{overflow:hidden;display:block;height:1.3em}.pun_pm_list .td4 a.mess{text-decoration:none;color:#999}.pun_pm_list .selected td{background:#ffc}.pun_pm_msg table td{width:auto;border-width:0;padding:.3em 0}.pun_pm_msg .td1{font-weight:bold;width:17.7em;padding-right:1em;text-align:right;vertical-align:top}.pun_pm_msg .post-entry{margin:0;padding:0;margin-bottom:1.5em}.pun_pm_msg,.pun_pm_msg .post-entry .entry-content{margin:1em .7em;width:auto!important}.pun-pm-ct-box{border-style:solid;border-width:1px;border-color:#dbe0e4;-moz-border-radius:.35em;-webkit-border-radius:.35em;-khtml-border-radius:.35em;border-radius:.35em;margin:1.417em;padding:.5em 1em;position:relative}
--------------------------------------------------------------------------------
/pun_pm/css/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_pm/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_pm/js/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_pm/js/pun_pm.shortcut.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides keybord shortcuts for send form in pun_pm
3 | *
4 | * @copyright (C) 2008-2009 PunBB
5 | * @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
6 | * @package pun_pm
7 | */
8 |
9 | (function(global){
10 | // Setup variables
11 | var ua = navigator.userAgent.toLowerCase(),
12 | isIE = (ua.indexOf("msie") != -1 && ua.indexOf("opera") == -1),
13 | isSafari = ua.indexOf("safari") != -1,
14 | isGecko = (ua.indexOf("gecko") != -1 && !isSafari);
15 |
16 |
17 | function add_handler(event, handler) {
18 | if (document.addEventListener)
19 | document.addEventListener(event, handler, false);
20 | else if (document.attachEvent)
21 | document.attachEvent('on' + event, handler);
22 | else
23 | return false;
24 |
25 | return true;
26 | }
27 |
28 |
29 | function key_handler(e) {
30 | e = e || window.event;
31 | var key = e.keyCode || e.which;
32 |
33 | if (e.ctrlKey && (isGecko && key == 115 || !isGecko && key == 83)) {
34 | if (e.preventDefault)
35 | e.preventDefault();
36 | e.returnValue = false;
37 |
38 | document.forms.pun_pm_sendform.send_action.value = 'draft';
39 | document.forms.pun_pm_sendform.submit();
40 |
41 | return false;
42 | }
43 |
44 | if (e.ctrlKey && (key == 13 || key == 10)) {
45 | if (e.preventDefault)
46 | e.preventDefault();
47 | e.returnValue = false;
48 |
49 | document.forms.pun_pm_sendform.send_action.value = 'send';
50 | document.forms.pun_pm_sendform.submit();
51 |
52 | return false;
53 | }
54 | }
55 |
56 |
57 | function pun_pm_onload() {
58 | var result = isIE || isSafari ? add_handler("keydown", key_handler) : add_handler("keypress", key_handler);
59 |
60 | if (result) {
61 | setTimeout("document.forms.pun_pm_sendform.pm_send.title = 'Ctrl + Enter'", 500);
62 | setTimeout("document.forms.pun_pm_sendform.pm_draft.title = 'Ctrl + S'", 500);
63 | }
64 | }
65 |
66 |
67 | // Run on page load
68 | PUNBB.common.addDOMReadyEvent(pun_pm_onload);
69 | })(window);
70 |
--------------------------------------------------------------------------------
/pun_pm/js/pun_pm.shortcut.min.js:
--------------------------------------------------------------------------------
1 | (function(g){var d=navigator.userAgent.toLowerCase(),f=(d.indexOf("msie")!=-1&&d.indexOf("opera")==-1),c=d.indexOf("safari")!=-1,b=(d.indexOf("gecko")!=-1&&!c);function h(j,i){if(document.addEventListener){document.addEventListener(j,i,false);}else{if(document.attachEvent){document.attachEvent("on"+j,i);}else{return false;}}return true;}function e(j){j=j||window.event;var i=j.keyCode||j.which;if(j.ctrlKey&&(b&&i==115||!b&&i==83)){if(j.preventDefault){j.preventDefault();}j.returnValue=false;document.forms.pun_pm_sendform.send_action.value="draft";document.forms.pun_pm_sendform.submit();return false;}if(j.ctrlKey&&(i==13||i==10)){if(j.preventDefault){j.preventDefault();}j.returnValue=false;document.forms.pun_pm_sendform.send_action.value="send";document.forms.pun_pm_sendform.submit();return false;}}function a(){var i=f||c?h("keydown",e):h("keypress",e);if(i){setTimeout("document.forms.pun_pm_sendform.pm_send.title = 'Ctrl + Enter'",500);setTimeout("document.forms.pun_pm_sendform.pm_draft.title = 'Ctrl + S'",500);}}PUNBB.common.addDOMReadyEvent(a);})(window);
--------------------------------------------------------------------------------
/pun_pm/lang/English/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_pm/lang/English/pun_pm.php:
--------------------------------------------------------------------------------
1 | 'Private messages',
6 | 'New message' => 'Create new message',
7 | 'Edit message' => 'Edit message',
8 | 'Delete message' => 'Delete message',
9 | 'Compose message' => 'Compose message',
10 | 'Delete draft' => 'Delete draft',
11 | 'Inbox' => 'Inbox',
12 | 'Outbox' => 'Outbox',
13 | 'Write' => 'Write',
14 | 'Message' => 'Message',
15 | 'Send button' => 'Send',
16 | 'Save draft' => 'Save as draft',
17 | 'To' => 'To',
18 | 'Subject' => 'Subject',
19 | 'Preview' => 'Preview',
20 | 'Empty body' => 'The Message field should not be empty.',
21 | 'Empty receiver' => 'The Receiver field should not be empty.',
22 | 'Non-existent username' => 'Username \'%s\' does not exist. Please, verify the receiver\'s username.',
23 | 'Empty all fields' => 'Empty message cannot be saved as draft.',
24 | 'Empty' => '<Empty>',
25 | 'Receiver' => 'To',
26 | 'Edit date' => 'Last edited',
27 | 'Sender' => 'From',
28 | 'Not sent' => '<Not sent>',
29 | 'Messsage send errors' => 'Warning! The following errors must be corrected before your message can be saved or sent:',
30 | 'Messsage edit errors' => 'Warning! The message cannot be edited because of the following errors:',
31 | 'Delivered message' => 'The delivered message cannot be edited.',
32 | 'Non-existent message' => 'The specified message does not exist.',
33 | 'Select all' => 'Select all',
34 | 'Delete selected' => 'Delete selected',
35 | 'Selected messages' => 'Selected messages:',
36 | 'Delete confirmation' => 'Are you sure you want to delete these messages?',
37 | 'Delete confirmation 1' => 'Are you sure you want to delete this message?',
38 | 'Confirm delete draft' => 'Are you sure you want to delete this draft?',
39 | 'Not selected' => 'No message is selected. You have to select messages to delete.',
40 | 'Too long message' => 'Your message length is %s bytes. This exceeds the %s bytes limit.',
41 | 'Sent' => 'Sent',
42 | 'Read' => 'Read',
43 | 'Not sent' => 'Not sent (draft)',
44 | 'Not read' => 'Not read',
45 | 'Status' => 'Status',
46 | 'sent' => 'sent',
47 | 'draft' => 'draft',
48 | 'read' => 'read',
49 | 'delivered' => 'delivered',
50 | 'Quick reply' => 'Reply',
51 | 'Incoming message' => 'Incoming message',
52 | 'Outgoing message' => 'Outgoing message',
53 | 'Sent -> draft' => 'Note! The message status has been changed from \'sent\' to \'draft\'. It will not be delivered until you send it again.',
54 | 'Message to yourself' => 'You cannot send messages to yourself.',
55 | 'Inbox limit' => 'Inbox limit',
56 | 'Outbox limit' => 'Outbox limit',
57 | 'Features title' => 'Private Messages',
58 | 'Outbox full' => 'The message count of the Outbox has exceeded the established limit of %s messages. Please, delete old and unnecessary messages from the Outbox.',
59 | 'Inbox almost full' => 'Notice! The message count of your Inbox is close to the limit of %s messages. Please, delete old and unnecessary messages. Otherwise, you cannot receive new messages if the limit is reached.',
60 | 'Inbox overflow' => 'Warning! The message count of your Inbox has reached the limit of %s messages. You cannot receive new messages. Please, delete old and unnecessary messages.',
61 | 'Outbox almost full' => 'Notice! The message count of your Outbox is close to the limit of %s messages. Please, delete old and unnecessary messages. Otherwise, you cannot send messages if the limit is reached.',
62 | 'Inbox limit info' => 'Maximum quantity of messages in the Inbox. 0 - no limit.',
63 | 'Outbox limit info' => 'Maximum quantity of messages in the Outbox. 0 - no limit.',
64 | 'Empty box' => 'This box is empty.',
65 | 'Preview message' => 'This is how your message will be displayed:',
66 | 'Invalid message save' => 'You have tried to edit a non-existent message. Save it again.',
67 | 'Invalid message send' => 'You have tried to edit a non-existent message. Send it again.',
68 | 'Message saved' => 'Your message is saved.',
69 | 'Message sent' => 'Your message is sent.',
70 | 'Message deleted' => 'Deleting is complete.',
71 | 'New link' => 'PM',
72 | 'New link full' => 'New PM (!)',
73 | 'PM' => 'PM',
74 | 'Snow new count' => 'Display \'New messages (N)\' link at the top of every page.',
75 | 'Show global link' => 'Put the PM Inbox link into the main navigation menu.',
76 | 'Navigation links' => 'Navigation links',
77 | 'Send PM' => 'Send a private message',
78 | 'Sent note' => 'The message status is \'sent\'. It means that the message has not been delivered yet because either the receiver has not visited forum since you sent this message or receiver\'s Inbox is overfilled. You can still edit this message or cancel its sending.',
79 | 'Begin message quote' => 'Quote the beginning of the message in message lists.',
80 | 'PM settings' => 'Private messages settings',
81 | );
82 |
83 | ?>
84 |
--------------------------------------------------------------------------------
/pun_pm/lang/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_pm/url/Default.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/pun_pm/url/File_based.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/pun_pm/url/File_based_(fancy).php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/pun_pm/url/Folder_based.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/pun_pm/url/Folder_based_(fancy).php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/pun_pm/url/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_poll/css/Oxygen/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_poll/css/Oxygen/pun_poll.css:
--------------------------------------------------------------------------------
1 | .pun_poll_item {
2 | padding: 1em .75em .75em;
3 | margin: .75em 1em;
4 | border: solid 1px #eee !important;
5 | border-radius: .2em;
6 | background: #fff;
7 | }
8 |
9 | .pun_poll_item.unvotted {
10 | padding-bottom: 0em;
11 | }
12 |
13 | .pun_poll_header {
14 | font-size: 1.1em;
15 | padding: 0 0 0 17.6em;
16 | margin-bottom: 1em;
17 | position: relative;
18 | color: #D93315;
19 | text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
20 | }
21 |
22 | .votted .pun_poll_header {
23 | padding: 0;
24 | text-align: center;
25 | position: static;
26 | }
27 |
28 | .pun_poll_item dl {
29 | clear: both;
30 | float: left;
31 | width: 100%;
32 | padding: .5em 0;
33 | }
34 |
35 | .pun_poll_item dl dt {
36 | color: #CCCCCC;
37 | float: left;
38 | text-align: right;
39 | width: 15%;
40 | }
41 |
42 | .pun_poll_item dl dt strong {
43 | color: #404040;
44 | text-align: right;
45 | }
46 |
47 | .pun_poll_item dl dd {
48 | float: left;
49 | margin-left: 1em;
50 | width: 80%;
51 | }
52 |
53 | .pun_poll_item dd div {
54 | background: #F0F0F0;
55 | border: solid 1px #E3E3E3;
56 | height: 7px;
57 | margin-top: .1em;
58 | border-radius: 2px;
59 | }
60 |
61 | .pun_poll_item .winner {
62 | background-color: #F8D67E;
63 | border-color: #FBC01D;
64 | }
65 |
66 | .pun_poll_item .poll-empty {
67 | visibility: hidden;
68 | }
69 |
70 | .pun_poll_total {
71 | color: #999;
72 | text-align: center;
73 | }
74 |
75 | #brd-post #pun_poll_form_block {
76 | display: none;
77 | }
78 |
79 |
80 | #pun_poll_switcher_block .js_link {
81 | margin-left: 19em;
82 | }
83 |
84 | #pun_poll_add_options_link {
85 | margin-left: 18em;
86 | }
87 |
88 | .pun_poll_item .submit input {
89 | font-size: 1em;
90 | }
91 |
--------------------------------------------------------------------------------
/pun_poll/css/Oxygen/pun_poll.min.css:
--------------------------------------------------------------------------------
1 | .pun_poll_item{padding:1em .75em .75em;margin:.75em 1em;border:solid 1px #eee!important;border-radius:.2em;background:#fff}.pun_poll_item.unvotted{padding-bottom:0}.pun_poll_header{font-size:1.1em;padding:0 0 0 17.6em;margin-bottom:1em;position:relative;color:#d93315;text-shadow:0 1px 0 rgba(0,0,0,0.1)}.votted .pun_poll_header{padding:0;text-align:center;position:static}.pun_poll_item dl{clear:both;float:left;width:100%;padding:.5em 0}.pun_poll_item dl dt{color:#ccc;float:left;text-align:right;width:15%}.pun_poll_item dl dt strong{color:#404040;text-align:right}.pun_poll_item dl dd{float:left;margin-left:1em;width:80%}.pun_poll_item dd div{background:#f0f0f0;border:solid 1px #e3e3e3;height:7px;margin-top:.1em;border-radius:2px}.pun_poll_item .winner{background-color:#f8d67e;border-color:#fbc01d}.pun_poll_item .poll-empty{visibility:hidden}.pun_poll_total{color:#999;text-align:center}#brd-post #pun_poll_form_block{display:none}#pun_poll_switcher_block .js_link{margin-left:19em}#pun_poll_add_options_link{margin-left:18em}.pun_poll_item .submit input{font-size:1em}
--------------------------------------------------------------------------------
/pun_poll/css/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_poll/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_poll/js/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_poll/js/pun_poll.js:
--------------------------------------------------------------------------------
1 | /*jslint browser: true, maxerr: 50, indent: 4 */
2 | /*global PUNBB: true */
3 |
4 | // INSTALL
5 | PUNBB.pun_poll = (function () {
6 | "use strict";
7 |
8 | //
9 | function visible(el) {
10 | return (el && el.offsetWidth !== 0);
11 | }
12 |
13 | function get(el) {
14 | return document.getElementById(el);
15 | }
16 |
17 | //
18 | function switcher_link_onclick_handler() {
19 | var poll_block = get("pun_poll_form_block"),
20 | switcher_link = get("pun_poll_switcher_link"),
21 | el_status = get("pun_poll_block_status");
22 |
23 | //
24 | if (!poll_block || !switcher_link || !el_status) {
25 | return true;
26 | }
27 |
28 | if (!visible(poll_block)) {
29 | poll_block.style.display = "block";
30 | switcher_link.innerHTML = switcher_link.getAttribute("data-lang-hide");
31 | el_status.value = "1";
32 | } else {
33 | poll_block.style.display = "none";
34 | switcher_link.innerHTML = switcher_link.getAttribute("data-lang-show");
35 | el_status.value = "0";
36 | }
37 |
38 | return false;
39 | }
40 |
41 | //
42 | function el_add_options_onclick_handler() {
43 | var el_template = get("pun_poll_add_option_template"),
44 | new_poll_options_el = "",
45 | i,
46 | cl,
47 | max_fld_count = 0,
48 | max_item_count = 0,
49 | div_list,
50 | lbl,
51 | inp;
52 |
53 | if (!el_template) {
54 | return true;
55 | }
56 |
57 | new_poll_options_el = document.createElement("div");
58 | PUNBB.common.addClass(new_poll_options_el, "sf-set");
59 | new_poll_options_el.innerHTML = el_template.innerHTML;
60 |
61 | // Find all Poll options block
62 | div_list = document.getElementsByTagName("div");
63 |
64 | for (i = 0, cl = div_list.length; i < cl; i += 1) {
65 | var el = div_list[i];
66 | if (el.getAttribute('data-item-count') !== null && el.getAttribute('data-fld-count') !== null) {
67 | if (el.getAttribute('data-item-count') > max_item_count) {
68 | max_item_count = parseInt(el.getAttribute('data-item-count'), 10);
69 | }
70 |
71 | if (el.getAttribute('data-fld-count') > max_fld_count) {
72 | max_fld_count = parseInt(el.getAttribute('data-fld-count'), 10);
73 | }
74 | }
75 | }
76 |
77 | // Add class item and fld
78 | max_fld_count += 1;
79 | new_poll_options_el.setAttribute('data-fld-count', max_fld_count.toString());
80 |
81 | max_item_count += 1;
82 | PUNBB.common.addClass(new_poll_options_el, 'set' + max_item_count.toString());
83 | new_poll_options_el.setAttribute('data-item-count', max_item_count.toString());
84 |
85 | // Add fld for label and input
86 | lbl = new_poll_options_el.getElementsByTagName('label')[0];
87 | inp = new_poll_options_el.getElementsByTagName('input')[0];
88 |
89 | lbl.setAttribute('for', 'fld' + max_fld_count.toString());
90 | inp.setAttribute('id', 'fld' + max_fld_count.toString());
91 |
92 | el_template.parentNode.insertBefore(new_poll_options_el, el_template);
93 |
94 | inp.focus();
95 | return false;
96 | }
97 |
98 |
99 | //
100 | function vote_submit_button_handler_init() {
101 | var poll_list,
102 | fn;
103 |
104 | var fn_poll_item_filter = function (el) {
105 | return (PUNBB.common.hasClass(el, 'pun_poll_item') && PUNBB.common.hasClass(el, 'unvotted'));
106 | };
107 |
108 | // Find all Poll Items
109 | poll_list = PUNBB.common.arrayOfMatched(fn_poll_item_filter, document.getElementsByTagName('div'));
110 | PUNBB.common.map(vote_submit_button_handler, poll_list);
111 | }
112 |
113 |
114 | //
115 | function vote_submit_button_handler(poll_item) {
116 | var radio_btn,
117 | vote_btn,
118 | fn_validator;
119 |
120 | fn_validator = function (poll_item, submit_btn) {
121 | return function () {
122 | var checked_rb = PUNBB.common.arrayOfMatched(function (el) {
123 | return (el.type === 'radio' && el.name && el.name === 'answer' && el.checked);
124 | }, poll_item.getElementsByTagName('input'));
125 |
126 | if (checked_rb.length > 0) {
127 | vote_btn.removeAttribute('disabled');
128 | } else {
129 | vote_btn.setAttribute('disabled', 'disabled');
130 | }
131 | };
132 | };
133 |
134 | // Find vote button inside poll
135 | vote_btn = PUNBB.common.arrayOfMatched(function (el) {
136 | return (el.type === "submit" && el.name && el.name === "vote");
137 | }, poll_item.getElementsByTagName("input"))[0];
138 |
139 | // Find radio butons inside poll
140 | radio_btn = PUNBB.common.arrayOfMatched(function (el) {
141 | return (el.type === "radio" && el.name && el.name === "answer");
142 | }, poll_item.getElementsByTagName("input"));
143 |
144 | // Attach validator to radio buttons change
145 | if (vote_btn && radio_btn.length > 0) {
146 | PUNBB.common.map(function (x) {
147 | x.onchange = fn_validator(poll_item, vote_btn);
148 | }, radio_btn);
149 |
150 | // Run first time maualy for set status
151 | fn_validator(poll_item, vote_btn)();
152 | }
153 | }
154 |
155 |
156 | return {
157 |
158 | //
159 | init: function () {
160 | if (PUNBB.env.page === "post" || PUNBB.env.page === "postedit") {
161 | var switcher_link = get("pun_poll_switcher_link"),
162 | el_status = get("pun_poll_block_status"),
163 | el_add_options = get("pun_poll_add_options_link");
164 |
165 | if (switcher_link) {
166 | switcher_link.onclick = switcher_link_onclick_handler;
167 | }
168 |
169 | if (el_status) {
170 | el_status.value = visible(get("pun_poll_form_block")) ? "1" : "0";
171 | }
172 |
173 | if (el_add_options) {
174 | el_add_options.onclick = el_add_options_onclick_handler;
175 | }
176 | }
177 |
178 | if (PUNBB.env.page === "viewtopic") {
179 | vote_submit_button_handler_init();
180 | }
181 | }
182 |
183 | };
184 | }());
185 |
186 | // One onload handler
187 | PUNBB.common.addDOMReadyEvent(PUNBB.pun_poll.init);
188 |
--------------------------------------------------------------------------------
/pun_poll/js/pun_poll.min.js:
--------------------------------------------------------------------------------
1 | PUNBB.pun_poll=(function(){function f(g){return(g&&g.offsetWidth!==0);}function b(g){return document.getElementById(g);}function a(){var i=b("pun_poll_form_block"),h=b("pun_poll_switcher_link"),g=b("pun_poll_block_status");if(!i||!h||!g){return true;}if(!f(i)){i.style.display="block";h.innerHTML=h.getAttribute("data-lang-hide");g.value="1";}else{i.style.display="none";h.innerHTML=h.getAttribute("data-lang-show");g.value="0";}return false;}function d(){var q=b("pun_poll_add_option_template"),n="",h,p,j=0,o=0,k,m,l;if(!q){return true;}n=document.createElement("div");PUNBB.common.addClass(n,"sf-set");n.innerHTML=q.innerHTML;k=document.getElementsByTagName("div");for(h=0,p=k.length;ho){o=parseInt(g.getAttribute("data-item-count"),10);}if(g.getAttribute("data-fld-count")>j){j=parseInt(g.getAttribute("data-fld-count"),10);}}}j+=1;n.setAttribute("data-fld-count",j.toString());o+=1;PUNBB.common.addClass(n,"set"+o.toString());n.setAttribute("data-item-count",o.toString());m=n.getElementsByTagName("label")[0];l=n.getElementsByTagName("input")[0];m.setAttribute("for","fld"+j.toString());l.setAttribute("id","fld"+j.toString());q.parentNode.insertBefore(n,q);l.focus();return false;}function e(){var i,g;var h=function(j){return(PUNBB.common.hasClass(j,"pun_poll_item")&&PUNBB.common.hasClass(j,"unvotted"));};i=PUNBB.common.arrayOfMatched(h,document.getElementsByTagName("div"));PUNBB.common.map(c,i);}function c(g){var j,h,i;i=function(l,k){return function(){var m=PUNBB.common.arrayOfMatched(function(n){return(n.type==="radio"&&n.name&&n.name==="answer"&&n.checked);},l.getElementsByTagName("input"));if(m.length>0){h.removeAttribute("disabled");}else{h.setAttribute("disabled","disabled");}};};h=PUNBB.common.arrayOfMatched(function(k){return(k.type==="submit"&&k.name&&k.name==="vote");},g.getElementsByTagName("input"))[0];j=PUNBB.common.arrayOfMatched(function(k){return(k.type==="radio"&&k.name&&k.name==="answer");},g.getElementsByTagName("input"));if(h&&j.length>0){PUNBB.common.map(function(k){k.onchange=i(g,h);},j);i(g,h)();}}return{init:function(){if(PUNBB.env.page==="post"||PUNBB.env.page==="postedit"){var h=b("pun_poll_switcher_link"),g=b("pun_poll_block_status"),i=b("pun_poll_add_options_link");if(h){h.onclick=a;}if(g){g.value=f(b("pun_poll_form_block"))?"1":"0";}if(i){i.onclick=d;}}if(PUNBB.env.page==="viewtopic"){e();}}};}());PUNBB.common.addDOMReadyEvent(PUNBB.pun_poll.init);
--------------------------------------------------------------------------------
/pun_poll/lang/English/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_poll/lang/English/pun_poll.php:
--------------------------------------------------------------------------------
1 | 'Poll question',
15 | 'Voting answer' => 'Poll option',
16 | 'Able revote' => 'Allow users to change their opinions.',
17 |
18 | //page Administration -> Settings -> Features
19 | 'Name plugin' => 'Settings for polls',
20 | 'Maximum answers' => 'Maximum answers in poll (2-100).',
21 | 'Disable revoting' => 'Allow vote change.',
22 | 'Disable see results' => 'Enable read results',
23 | 'Maximum answers info' => 'Maximum answers',
24 | 'Disable see results info' => 'Users can see poll results without voting.',
25 | 'Disable revoting info' => 'Enable revoting',
26 | 'Poll add' => 'Allow users to use polls in their topics.',
27 | 'Permission' => 'Voting permission',
28 |
29 | // general
30 | 'Users count' => 'Votes: ',
31 | 'Preview poll' => 'Preview of your edited poll.',
32 | 'Preview poll question' => '%s',
33 | 'Revote' => 'Revote poll',
34 | 'Summary count' => 'Number of poll options',
35 | 'Allow days' => 'Run poll for (days)',
36 | 'Votes needed' => 'Votes count',
37 | 'Input error' => 'You should enter the number of days for the voting, or the count of votes.',
38 | 'Count' => 'Count',
39 | 'Button note' => 'Update poll',
40 | 'Show poll res' => 'Showing poll results',
41 | 'All ch vote' => 'Allow to change voting',
42 | 'Max cnt options' => 'Count of answers can\'t be more than %s.',
43 | 'Min cnt options' => 'Count of answers can\'t be less than 2.',
44 | 'Days limit' => 'Count of poll days can\'t be more than 90 and less than 1.',
45 | 'Votes count' => 'Count of votes can\'t be more than 500 and less than 10.',
46 | 'Header note' => 'Voting',
47 | 'Options' => 'Vote options',
48 | 'Results' => 'Voting results: ',
49 | 'No votes' => 'There is no votes in this poll yet.',
50 | 'Dis read vote' => 'You can\'t see the votes until you vote yourself.',
51 | 'But note' => 'Vote',
52 | 'User vote error' => 'You have already voted.',
53 | 'End of vote' => 'You can\'t vote here as the poll is already ended.',
54 | 'Reset res' => 'Reset voting results',
55 | 'Reset res notice' => 'Reset voting results.',
56 | 'Remove v' => 'Remove voting',
57 | 'Remove v notice' => 'Remove voting.',
58 | 'Empty question' => 'You should enter a question of poll.',
59 | 'Empty answers' => 'You should enter a answers of poll.',
60 | 'Merge error' => 'You can\'t merge these topics, because 2 or more topics include voting. Remove the voting before merging.',
61 | 'Edit voting' => 'If you want to edit question or answers of voting send e-mail to administrator of Forum %s.',
62 | 'Empty option count' => 'You should enter count of poll options.',
63 |
64 | 'Question len limit' => 'A question\'s length can\'t be less than 5 symbols.',
65 |
66 | 'Maximum votes note' => 'Maximum count of votes in poll',
67 | 'Days voting note' => 'Count of days for voting',
68 |
69 | 'Poll redirect' => 'Poll added.',
70 | 'Days, votes count' => 'Count of days and count of votes can\'t ...',
71 |
72 | 'Hide poll' => 'Hide poll block',
73 | 'Show poll' => 'Show poll block',
74 | 'Add poll option' => 'Add poll option',
75 | );
76 |
--------------------------------------------------------------------------------
/pun_poll/lang/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_repository/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_repository/lang/English/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_repository/lang/English/pun_repository.php:
--------------------------------------------------------------------------------
1 | 'ERROR! PunBB Repository is inaccessible now. Try to check it later.',
15 | 'PunBB Repository' => 'PunBB repository',
16 | 'Files mode and owner' => 'NOTE! Web server\'s system user will be set as an owner of the files and directories created while extension downloading and installation. Access mode for directories created will be set to 0777.',
17 | 'Download and install' => 'Download and install extension',
18 | 'Can\'t create directory' => 'ERROR! Cannot create directory \'%s\'. Probably, directory \'extensions\' has not enough rights.',
19 | 'Directory already exists' => 'ERROR! Directory \'%s\' already exists.',
20 | 'Extension download failed' => 'ERROR! Extension download failed.',
21 | 'No writting right' => 'ERROR! Directory \'extensions\' has not enough rights to create a file.',
22 | 'Can\'t extract' => 'ERROR! Files could not be extracted from the downloaded archive.',
23 | 'Download successful' => 'Archive download is successful. The extension is ready to be installed.',
24 | 'Incorrect manifest.xml' => 'Archive download is uccessful, but manifest.xml is incorrect.',
25 | 'Extract errors:' => 'The next errors appear while extracting:',
26 | 'Direct download links:' => 'Direct download links:',
27 | 'Can\'t write to cache file' => 'ERROR! Cannot write a file to cache.',
28 | 'All installed or downloaded' => 'NOTE! You have installed or downloaded all available extensions. Congratulations!',
29 | 'Download and update' => 'Download and update',
30 | 'Unable to rename old dir' => 'ERROR!. Unable to rename directory \'%s\' to update extension.',
31 | 'Dependencies:' => 'Dependencies:',
32 | 'Resolve dependencies:' => 'Please resolve next dependencies first to install this extension:',
33 | 'Clear cache' => 'Clear cache',
34 | 'Unable to remove cached file' => 'Unable to remove cached file.',
35 | 'Cache has been successfully cleared' => 'Cache has been successfully cleared.',
36 |
37 | 'Unsupported compression type' => 'Unsupported compression type',
38 | 'Supported types are' => 'Supported types are \'gz\' and \'bz2\'',
39 | 'The extension couldn\'t be found' => 'The extension \'%s\' couldn\'t be found',
40 | 'Please make sure your version of PHP was built with' => 'Please make sure your version of PHP was built with \'%s\' support',
41 | 'Invalid string list' => 'Invalid string list',
42 | 'Unable to open in read mode' => 'Unable to open in read mode',
43 | 'Unable to open in write mode' => 'Unable to open in write mode',
44 | 'Unknown or missing compression type' => 'Unknown or missing compression type',
45 | 'Invalid file descriptor' => 'Invalid file descriptor',
46 | 'File does not exist' => 'File \'%s\' does not exist',
47 | 'Directory can not be read' => 'Directory \'%s\' can not be read',
48 | 'Invalid file name' => 'Invalid file name',
49 | 'Unable to open file in binary read mode' => 'Unable to open file \'%s\' in binary read mode',
50 | 'Invalid block size' => 'Invalid block size',
51 | 'Invalid checksum for file' => 'Invalid checksum for file',
52 | 'calculated' => 'calculated',
53 | 'expected' => 'expected',
54 | 'Malicious .tar detected, file' => 'Malicious .tar detected, file \' %s \' will not install in desired directory tree',
55 | 'Invalid extract mode' => 'Invalid extract mode',
56 | 'File already exists as a directory' => 'File \'%s\' already exists as a directory',
57 | 'Directory already exists as a file' => 'Directory \'%s\' already exists as a file',
58 | 'File already exists and is write protected' => 'File \'%s\' already exists and is write protected',
59 | 'Unable to create path for' => 'Unable to create path for',
60 | 'Unable to create directory' => 'Unable to create directory',
61 | 'Unable to extract symbolic link' => 'Unable to extract symbolic link',
62 | 'Error while opening {} in write binary mode' => 'Error while opening {\'%s\'} in write binary mode',
63 | 'Extracted file does not have the correct file size' => 'Extracted file \'%s\' does not have the correct file size',
64 | 'Archive may be corrupted' => 'Archive may be corrupted.',
65 | 'Copy fail' => 'Can\'t copy new files of the extension to the old directory %s.',
66 | );
67 |
68 |
69 |
--------------------------------------------------------------------------------
/pun_repository/lang/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_repository/pun_repository.php:
--------------------------------------------------------------------------------
1 | ');
60 |
61 | fclose($fh);
62 |
63 | return true;
64 | }
65 |
66 | // Remove directory recursively
67 | function pun_repository_rm_recursive($file)
68 | {
69 | if (is_file($file))
70 | return unlink($file);
71 | if (!is_dir($file))
72 | return true;
73 | $dir = opendir($file);
74 | while (($cur_file = readdir($dir)) !== false)
75 | {
76 | if ($cur_file == '.' || $cur_file == '..')
77 | continue;
78 |
79 | if (is_dir($file.'/'.$cur_file))
80 | pun_repository_rm_recursive($file.'/'.$cur_file);
81 | else
82 | unlink($file.'/'.$cur_file);
83 | }
84 | closedir($dir);
85 | rmdir($file);
86 | }
87 |
88 | // Download extension from remote repository
89 | // Put extension data to $ext_data
90 | // Returns error string on any problems or '' on success
91 | function pun_repository_download_extension($ext_id, &$ext_data, $ext_path = FALSE)
92 | {
93 | global $base_url, $lang_pun_repository;
94 |
95 | ($hook = get_hook('pun_repository_download_extension_start')) ? eval($hook) : null;
96 |
97 | clearstatcache();
98 |
99 | if (!$ext_path)
100 | {
101 | $ext_path = FORUM_ROOT.'extensions/'.$ext_id;
102 | $extract_folder = FORUM_ROOT.'extensions/';
103 | $manifiest_path = $ext_path.'/manifest.xml';
104 | }
105 | else
106 | {
107 | $extract_folder = $ext_path;
108 | $manifiest_path = $ext_path.'/'.$ext_id.'/manifest.xml';
109 | }
110 |
111 | if (!is_dir($ext_path))
112 | {
113 | // Create new directory with 777 mode
114 | if (@mkdir($ext_path) == false)
115 | return sprintf($lang_pun_repository['Can\'t create directory'], $ext_path);
116 | @chmod($ext_path, 0777);
117 | }
118 | else
119 | return sprintf($lang_pun_repository['Directory already exists'], $ext_path);
120 |
121 | // Download extension archive
122 | $pun_repository_archive = get_remote_file(PUN_REPOSITORY_URL.'/'.$ext_id.'/'.$ext_id.'.tgz', 10);
123 | if (empty($pun_repository_archive) || empty($pun_repository_archive['content']))
124 | {
125 | rmdir($ext_path);
126 | return $lang_pun_repository['Extension download failed'];
127 | }
128 |
129 | // Save extension to file
130 | $pun_repository_archive_file = @fopen(FORUM_ROOT.'extensions/'.$ext_id.'.tgz', 'wb');
131 | if ($pun_repository_archive_file === false)
132 | return $lang_pun_repository['No writting right'];
133 |
134 | fwrite($pun_repository_archive_file, $pun_repository_archive['content']);
135 | fclose($pun_repository_archive_file);
136 |
137 | if (!defined('PUN_REPOSITORY_TAR_EXTRACT_INCLUDED'))
138 | require 'pun_repository_tar_extract.php';
139 |
140 | // Extract files from archive
141 | $pun_repository_tar = new Archive_Tar_Ex(FORUM_ROOT.'extensions/'.$ext_id.'.tgz');
142 | if (!$pun_repository_tar->extract($extract_folder, 0777))
143 | {
144 | $error = $lang_pun_repository['Can\'t extract'];
145 |
146 | if (isset($pun_repository_tar->errors))
147 | $error .= ' '.$lang_pun_repository['Extract errors:'] . '
' . implode('
', $pun_repository_tar->errors);
148 |
149 | unlink(FORUM_ROOT.'extensions/'.$ext_id.'.tgz');
150 | @pun_repository_rm_recursive($ext_path);
151 |
152 | return $error;
153 | }
154 |
155 | // Remove archive
156 | unlink(FORUM_ROOT.'extensions/'.$ext_id.'.tgz');
157 |
158 | // Verify downloaded and extracted extension
159 | $ext_data = xml_to_array(@file_get_contents($manifiest_path));
160 |
161 | ($hook = get_hook('pun_repository_download_extension_end')) ? eval($hook) : null;
162 |
163 | return '';
164 | }
165 |
166 | // Check for correct dependency ID's and get the list of unresolved dependencies
167 | // $inst_exts must contain an array of installed extensions
168 | // $dependencies['dependency'] must contain an array of extension ID's
169 | // Unresolved dependencies are added to the $dependencies['unresolved'] array
170 | function pun_repository_check_dependencies($inst_exts, $dependencies)
171 | {
172 | ($hook = get_hook('pun_repository_check_dependencies_start')) ? eval($hook) : null;
173 |
174 | if (empty($dependencies))
175 | return false;
176 |
177 | //print_r($dependencies);
178 |
179 | if (isset($dependencies['dependency']) && is_string($dependencies['dependency']))
180 | $dependencies = array($dependencies['dependency']);
181 | else
182 | {
183 | $dependencies = reset($dependencies);
184 |
185 | if (isset($dependencies['dependency']) && is_string($dependencies['dependency']))
186 | $dependencies = array($dependencies['dependency']);
187 | else
188 | $dependencies = $dependencies['dependency'];
189 | }
190 |
191 | $unresolved = array();
192 |
193 | foreach ($dependencies as $dependency)
194 | {
195 | $dependency = preg_replace('~[^\w_]~', '', $dependency);
196 |
197 | // Add the dependency to the list of unresolved ones
198 | if (!isset($inst_exts[$dependency]))
199 | $unresolved[] = $dependency;
200 | }
201 |
202 | ($hook = get_hook('pun_repository_check_dependencies_end')) ? eval($hook) : null;
203 |
204 | return compact('dependencies', 'unresolved');
205 | }
206 |
207 | function pun_repository_dir_copy($src, $dest)
208 | {
209 | $dir = opendir($src);
210 | if (!file_exists($dest))
211 | mkdir($dest);
212 | while (($file = readdir($dir)) !== false)
213 | {
214 | if ($file == '.' || $file == '..')
215 | continue;
216 |
217 | if (is_dir($src.'/'.$file))
218 | pun_repository_dir_copy($src.'/'.$file, $dest.'/'.$file);
219 | else
220 | copy($src.'/'.$file, $dest.'/'.$file);
221 | }
222 | closedir($dir);
223 | }
224 |
225 |
--------------------------------------------------------------------------------
/pun_stop_bots/functions.php:
--------------------------------------------------------------------------------
1 | 'id, question, answers',
22 | 'FROM' => 'pun_stop_bots_questions'
23 | );
24 | $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
25 |
26 | $output = $questions = array();
27 | while ($row = $forum_db->fetch_assoc($result))
28 | {
29 | $questions[] = $row;
30 | }
31 |
32 | if (!empty($questions))
33 | {
34 | foreach ($questions as $cur_item)
35 | {
36 | $output['questions'][$cur_item['id']] = array('question' => $cur_item['question'], 'answers' => $cur_item['answers']);
37 | }
38 | }
39 | $output['cached'] = time();
40 |
41 | if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
42 | require FORUM_ROOT.'include/cache.php';
43 |
44 | if (!write_cache_file(FORUM_CACHE_DIR.'cache_pun_stop_bots.php', ''))
45 | {
46 | error('Unable to write cache_pun_stop_bots cache file to cache directory.
Please make sure PHP has write access to the directory \'cache\'.', __FILE__, __LINE__);
47 | }
48 | }
49 |
50 |
51 | function pun_stop_bots_add_question($question, $answers)
52 | {
53 | global $forum_db, $pun_stop_bots_questions, $lang_pun_stop_bots;
54 |
55 | if (!empty($pun_stop_bots_questions['questions']) && array_search($question, array_map(create_function('$data', 'return $data[\'question\'];'), $pun_stop_bots_questions['questions'])) !== FALSE)
56 | return $lang_pun_stop_bots['Management err dupe question'];
57 |
58 | $query = array(
59 | 'INSERT' => 'question, answers',
60 | 'INTO' => 'pun_stop_bots_questions',
61 | 'VALUES' => '\''.$forum_db->escape($question).'\', \''.$forum_db->escape($answers).'\''
62 | );
63 | $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
64 |
65 | return true;
66 | }
67 |
68 |
69 | function pun_stop_bots_update_question($question_id, $question, $answers)
70 | {
71 | global $forum_db, $pun_stop_bots_questions, $lang_pun_stop_bots;
72 |
73 | $query = array(
74 | 'SELECT' => 'question, answers',
75 | 'FROM' => 'pun_stop_bots_questions',
76 | 'WHERE' => 'id = '.$question_id
77 | );
78 | $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
79 |
80 | $ids = array_keys($pun_stop_bots_questions['questions']);
81 | if (($cache_index = array_search($question_id, $ids)) === FALSE)
82 | return $lang_pun_stop_bots['Management err no question'];
83 | else
84 | {
85 | $old_question = $pun_stop_bots_questions['questions'][$ids[$cache_index]]['question'];
86 | $old_answers = $pun_stop_bots_questions['questions'][$ids[$cache_index]]['answers'];
87 | }
88 |
89 | $update_fields = array();
90 | if ($old_question != $question)
91 | $update_fields[] = 'question = \''.$forum_db->escape($question).'\'';
92 | if ($old_answers != $answers)
93 | $update_fields[] = 'answers = \''.$forum_db->escape($answers).'\'';
94 |
95 | if (!empty($update_fields))
96 | {
97 | $query = array(
98 | 'UPDATE' => 'pun_stop_bots_questions',
99 | 'SET' => implode(',', $update_fields),
100 | 'WHERE' => 'id = '.$question_id
101 | );
102 | $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
103 | }
104 |
105 | return true;
106 | }
107 |
108 |
109 | function pun_stop_bots_delete_question($question_id)
110 | {
111 | global $forum_db, $pun_stop_bots_questions, $lang_pun_stop_bots;
112 |
113 | if (!empty($pun_stop_bots_questions['questions']) && (array_search($question_id, array_keys($pun_stop_bots_questions['questions'])) === FALSE))
114 | return $lang_pun_stop_bots['Management err no question'];
115 |
116 | $query = array(
117 | 'DELETE' => 'pun_stop_bots_questions',
118 | 'WHERE' => 'id = '.$question_id
119 | );
120 | $forum_db->query_build($query) or error(__FILE__, __LINE__);
121 |
122 | return true;
123 | }
124 |
125 |
126 | function pun_stop_bots_compare_answers($answer, $question_id)
127 | {
128 | global $forum_db, $forum_user, $pun_stop_bots_questions, $lang_pun_stop_bots;
129 |
130 | return in_array($answer, explode(',', $pun_stop_bots_questions['questions'][$question_id]['answers']));
131 | }
132 |
133 |
134 | function pun_stop_bots_set_cookie($question_id)
135 | {
136 | global $forum_user, $cookie_name, $cookie_path, $cookie_domain, $cookie_secure;
137 |
138 | $now = time();
139 | $expire_time = $now + 1209600;
140 | $expire_hash = sha1($forum_user['salt'].forum_hash($expire_time, $forum_user['salt']));
141 | $question_hash = forum_hash($question_id, $forum_user['salt']);
142 |
143 | forum_setcookie(PUN_STOP_BOTS_COOKIE_NAME, base64_encode($forum_user['id'].'|'.$question_hash.'|'.$expire_time.'|'.$expire_hash), $expire_time);
144 | }
145 |
146 |
147 | function pun_stop_bots_check_cookie()
148 | {
149 | global $forum_user, $forum_db;
150 |
151 | $query = array(
152 | 'SELECT' => 'pun_stop_bots_question_id',
153 | 'FROM' => 'users',
154 | 'WHERE' => 'id = '.$forum_user['id']
155 | );
156 | $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
157 | $row = $forum_db->fetch_assoc($result);
158 |
159 | if ($row)
160 | {
161 | $question_id = $row['pun_stop_bots_question_id'];
162 | $pun_stop_bots_cookie = explode('|', base64_decode($_COOKIE[PUN_STOP_BOTS_COOKIE_NAME]));
163 | if (count($pun_stop_bots_cookie) != 4)
164 | {
165 | return FALSE;
166 | }
167 | else
168 | {
169 | list($user_id, $question_hash, $expire_time, $expire_hash) = $pun_stop_bots_cookie;
170 | if ($forum_user['id'] == $user_id && forum_hash($question_id, $forum_user['salt']) == $question_hash && sha1($forum_user['salt'].forum_hash($expire_time, $forum_user['salt'])) == $expire_hash)
171 | return TRUE;
172 | else
173 | return FALSE;
174 | }
175 | }
176 | else
177 | {
178 | return FALSE;
179 | }
180 | }
181 |
182 |
183 | function pun_stop_bots_generate_guest_question_id()
184 | {
185 | global $forum_db, $forum_user, $pun_stop_bots_questions;
186 |
187 | $question_ids = array_keys($pun_stop_bots_questions['questions']);
188 | $new_question_id = $question_ids[array_rand($question_ids)];
189 | unset($question_ids);
190 |
191 | $pun_stop_bots_query = array(
192 | 'UPDATE' => 'online',
193 | 'SET' => 'pun_stop_bots_question_id = '.$new_question_id,
194 | 'WHERE' => 'ident = \''.$forum_user['ident'].'\''
195 | );
196 | $forum_db->query_build($pun_stop_bots_query) or error(__FILE__, __LINE__);
197 |
198 | return $new_question_id;
199 | }
200 |
201 |
202 | function pun_stop_bots_generate_user_question_id()
203 | {
204 | global $forum_db, $forum_user, $pun_stop_bots_questions;
205 |
206 | $question_ids = array_keys($pun_stop_bots_questions['questions']);
207 | $new_question_id = $question_ids[array_rand($question_ids)];
208 | unset($question_ids);
209 |
210 | $pun_stop_bots_query = array(
211 | 'UPDATE' => 'users',
212 | 'SET' => 'pun_stop_bots_question_id = '.$new_question_id,
213 | 'WHERE' => 'id = '.$forum_user['id']
214 | );
215 | $forum_db->query_build($pun_stop_bots_query) or error(__FILE__, __LINE__);
216 |
217 | return $new_question_id;
218 | }
219 |
220 |
221 | function pun_stop_bots_prepare_answers($answers)
222 | {
223 | return preg_replace('~,[\s]+~', ',', $answers);
224 | }
225 |
226 | ?>
--------------------------------------------------------------------------------
/pun_stop_bots/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_stop_bots/lang/English/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_stop_bots/lang/English/pun_stop_bots.php:
--------------------------------------------------------------------------------
1 | 'There is no question with such id.',
15 | 'Management err dupe question' => 'The entered question already exists.',
16 | 'Management err empty fields' => 'You must enter both text to question and text to answers.',
17 | 'Management question' => 'Question',
18 | 'Management answers' => 'Answers',
19 | 'Management add question' => 'Add new question',
20 | 'Management btn add' => 'Add question',
21 | 'Management subhead' => 'Add, edit or remove questions (pun_stop_bots)',
22 | 'Management notice' => 'Enter the question you want to add and the corresponding answers. The answers should be separated with commas. Answer comparison is case-insensitive.',
23 | 'Management existing question' => 'Existing question',
24 | 'Management existing question legend' => 'Edit or remove existing questions.',
25 | 'Management btn update' => 'Update',
26 | 'Management btn remove' => 'Remove',
27 | 'Management tab' => 'Stop bots questions',
28 | 'Management question add' => 'New question was added.',
29 | 'Management question update' => 'The question and answers was updated.',
30 | 'Management question remove' => 'The question was removed.',
31 | 'Mangement error notice' => 'Warning! The following errors must be corrected before questions can be updated:',
32 | 'Err no record' => 'The question id was not found in the "online" table. Perhaps, this happened because the online timeout was reached. Please, try again.',
33 | 'Stop bots question' => 'Pun stop bots question',
34 | 'Your answer' => 'Your answer',
35 | 'Answer' => 'Answer',
36 | 'Stop bots question legend' => 'Pun stop bots question'
37 | );
38 |
39 | ?>
--------------------------------------------------------------------------------
/pun_stop_bots/lang/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_stop_bots/url/Default.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/pun_stop_bots/views/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_stop_bots/views/management.php:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
25 |
26 |
53 |
54 |
89 |
90 |
--------------------------------------------------------------------------------
/pun_stop_bots/views/question_page.php:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
36 |
--------------------------------------------------------------------------------
/pun_tags/functions.php:
--------------------------------------------------------------------------------
1 | 'tt.topic_id, tt.tag_id, tg.tag, forum_id',
22 | 'FROM' => 'topic_tags AS tt',
23 | 'JOINS' => array(
24 | array(
25 | 'LEFT JOIN' => 'topics AS t',
26 | 'ON' => 'tt.topic_id = t.id'
27 | ),
28 | array(
29 | 'LEFT JOIN' => 'tags AS tg',
30 | 'ON' => 'tt.tag_id = tg.id'
31 | )
32 | )
33 | );
34 | $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
35 |
36 | $pun_tags = array();
37 | $pun_tags['cached'] = time();
38 | $pun_tags['index'] = $pun_tags['topics'] = $pun_tags['forums'] = array();
39 |
40 | // Process all topics
41 | while ($cur_tag = $forum_db->fetch_assoc($result))
42 | {
43 | if (!isset($pun_tags['index'][$cur_tag['tag_id']]))
44 | $pun_tags['index'][$cur_tag['tag_id']] = $cur_tag['tag'];
45 |
46 | if (!isset($pun_tags['topics'][$cur_tag['topic_id']]))
47 | $pun_tags['topics'][$cur_tag['topic_id']] = array();
48 |
49 | $pun_tags['topics'][$cur_tag['topic_id']][] = intval($cur_tag['tag_id']);
50 | if (!isset($pun_tags['forums'][$cur_tag['forum_id']]))
51 | $pun_tags['forums'][$cur_tag['forum_id']] = array();
52 |
53 | if (!isset($pun_tags['forums'][$cur_tag['forum_id']][$cur_tag['tag_id']]))
54 | $pun_tags['forums'][$cur_tag['forum_id']][$cur_tag['tag_id']] = 1;
55 | else
56 | $pun_tags['forums'][$cur_tag['forum_id']][$cur_tag['tag_id']]++;
57 | }
58 |
59 | // Output pun tags as PHP code
60 | $fh = @fopen(FORUM_CACHE_DIR.'cache_pun_tags.php', 'wb');
61 | if (!$fh)
62 | error('Unable to write tags cache file to cache directory. Please make sure PHP has write access to the directory \'cache\'.', __FILE__, __LINE__);
63 | fwrite($fh, '');
64 | fclose($fh);
65 | }
66 |
67 | // Generate groups permissions cache
68 | function pun_tags_generate_forum_perms_cache()
69 | {
70 | global $forum_db;
71 |
72 | $query = array(
73 | 'SELECT' => 'id',
74 | 'FROM' => 'forums'
75 | );
76 | $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
77 | $forums = array();
78 |
79 | while ($cur_forum = $forum_db->fetch_row($result))
80 | $forums[] = $cur_forum[0];
81 |
82 | if (!empty($forums))
83 | {
84 | $pun_tags_groups_perms = array();
85 | $pun_tags_groups_perms['cached'] = time();
86 | //Get all groups
87 | $query = array(
88 | 'SELECT' => 'g_id',
89 | 'FROM' => 'groups'
90 | );
91 | $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
92 | while ($cur_group = $forum_db->fetch_row($result))
93 | $pun_tags_groups_perms[$cur_group[0]] = $forums;
94 |
95 | $query = array(
96 | 'SELECT' => 'group_id, forum_id',
97 | 'FROM' => 'forum_perms',
98 | 'WHERE' => 'read_forum = 0'
99 | );
100 | $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
101 | while ($cur_perm = $forum_db->fetch_assoc($result))
102 | unset($pun_tags_groups_perms[$cur_perm['group_id']][array_search($cur_perm['forum_id'], $forums)]);
103 |
104 | if (!empty($pun_tags_groups_perms))
105 | {
106 | foreach ($pun_tags_groups_perms as $group => $perms)
107 | {
108 | if ($group != 'cached')
109 | $pun_tags_groups_perms[$group] = array_values($perms);
110 | }
111 | }
112 | }
113 |
114 | // Output pun tags as PHP code
115 | $fh = @fopen(FORUM_CACHE_DIR.'cache_pun_tags_groups_perms.php', 'wb');
116 | if (!$fh)
117 | error('Unable to write tags cache file to cache directory. Please make sure PHP has write access to the directory \'cache\'.', __FILE__, __LINE__);
118 | fwrite($fh, '');
119 | fclose($fh);
120 | }
121 |
122 | // Remove orphaned tags
123 | function pun_tags_remove_orphans()
124 | {
125 | global $forum_db;
126 |
127 | // Get orphaned tags
128 | $query = array(
129 | 'SELECT' => 't.id, COUNT(tt.tag_id) AS cnt',
130 | 'FROM' => 'tags AS t',
131 | 'JOINS' => array(
132 | array(
133 | 'LEFT JOIN' => 'topic_tags AS tt',
134 | 'ON' => 't.id = tt.tag_id GROUP BY t.id'
135 | )
136 | ),
137 | 'HAVING' => 'COUNT(tt.tag_id) = 0'
138 | );
139 | $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
140 |
141 | // Remove orphaned tags
142 | $ids = array();
143 | while ($row = $forum_db->fetch_assoc($result))
144 | {
145 | $ids[] = $row['id'];
146 | }
147 |
148 | if (!empty($ids))
149 | {
150 | $query_tags = array(
151 | 'DELETE' => 'tags',
152 | 'WHERE' => 'id IN ('.implode(',', $ids).')'
153 | );
154 | $forum_db->query_build($query_tags) or error(__FILE__, __LINE__);
155 | }
156 | }
157 |
158 | // Function for generating link for tags
159 | function pun_tags_get_link($size, $tag_id, $weight, $tag)
160 | {
161 | global $forum_url;
162 | return ''.$tag.'';
163 | }
164 |
165 | // Get array of tags from input string
166 | function pun_tags_parse_string($text)
167 | {
168 | global $lang_pun_tags;
169 |
170 | if (utf8_strlen(forum_trim($text)) > 100)
171 | message($lang_pun_tags['Count error']);
172 |
173 | // Remove symbols and multiple whitespace
174 | $text = preg_replace('/[\'\^\$&\(\)<>`"\|@_\?%~\+\[\]{}:=\/#\\\\;!\*\.]+/', '', preg_replace('/[\s]+/', ' ', $text));
175 | $text = censor_words($text);
176 | $text = explode(',', $text);
177 |
178 | $results = array();
179 | foreach ($text as $tag)
180 | {
181 | $tmp_tag = utf8_trim($tag);
182 | if (!empty($tmp_tag))
183 | $results[] = utf8_substr_replace($tmp_tag, '', 50);
184 | }
185 |
186 | return array_unique($results);
187 | }
188 |
189 | // Remove topic tags
190 | function pun_tags_remove_topic_tags($topic_id)
191 | {
192 | global $forum_db;
193 |
194 | $query = array(
195 | 'DELETE' => 'topic_tags',
196 | 'WHERE' => 'topic_id = '.$topic_id
197 | );
198 | $forum_db->query_build($query) or error(__FILE__, __LINE__);
199 | }
200 |
201 | function pun_tags_add_new($tag, $topic_id)
202 | {
203 | global $forum_db;
204 |
205 | $pun_tags_query = array(
206 | 'INSERT' => 'tag',
207 | 'INTO' => 'tags',
208 | 'VALUES' => '\''.$forum_db->escape($tag).'\''
209 | );
210 | $forum_db->query_build($pun_tags_query) or error(__FILE__, __LINE__);
211 | $new_tagid = $forum_db->insert_id();
212 |
213 | $pun_tags_query = array(
214 | 'INSERT' => 'topic_id, tag_id',
215 | 'INTO' => 'topic_tags',
216 | 'VALUES' => $topic_id.', '.$new_tagid
217 | );
218 | $forum_db->query_build($pun_tags_query) or error(__FILE__, __LINE__);
219 |
220 | return $new_tagid;
221 | }
222 |
223 | function pun_tags_add_existing_tag($tag_id, $topic_id)
224 | {
225 | global $forum_db;
226 |
227 | // Insert into topic_tags table
228 | $pun_tags_query = array(
229 | 'INSERT' => 'topic_id, tag_id',
230 | 'INTO' => 'topic_tags',
231 | 'VALUES' => $topic_id.', '.$tag_id
232 | );
233 | $forum_db->query_build($pun_tags_query) or error(__FILE__, __LINE__);
234 | }
235 |
236 | function compare_tags($tag_info1, $tag_info2)
237 | {
238 | return strcmp($tag_info1['tag'], $tag_info2['tag']);
239 | }
240 |
241 | function array_tags_slice($tags)
242 | {
243 | global $forum_config;
244 |
245 | if (version_compare(PHP_VERSION, '5.02', '>='))
246 | return array_slice($tags, 0, $forum_config['o_pun_tags_count_in_cloud'], TRUE);
247 |
248 | $counter = count($tags) - $forum_config['o_pun_tags_count_in_cloud'];
249 | while ($counter > 0)
250 | {
251 | array_pop($tags);
252 | $counter--;
253 | }
254 | return $tags;
255 | }
256 |
257 | function min_max_tags_weights($tags)
258 | {
259 | $max_pop = -10000000;
260 | foreach ($tags as $tag_id => $tag_info)
261 | if ($tag_info['weight'] > $max_pop)
262 | $max_pop = $tag_info['weight'];
263 | $min_pop = 10000000;
264 | foreach ($tags as $tag_id => $tag_info)
265 | if ($tag_info['weight'] < $min_pop)
266 | $min_pop = $tag_info['weight'];
267 | return array($min_pop, $max_pop);
268 | }
269 | function tag_cache_index($edited_tag)
270 | {
271 | global $pun_tags;
272 |
273 | foreach ($pun_tags['index'] as $index_tag_id => $index_tag_value)
274 | {
275 | if (strcmp($index_tag_value, $edited_tag) == 0)
276 | return $index_tag_id;
277 | }
278 | return FALSE;
279 | }
280 |
281 | ?>
282 |
--------------------------------------------------------------------------------
/pun_tags/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_tags/lang/English/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_tags/lang/English/pun_tags.php:
--------------------------------------------------------------------------------
1 | 'Pun Tags',
16 | 'Settings' => 'Pun Tags settings',
17 | 'Topic tags' => 'Topic tags',
18 | 'Tags warning' => 'You will be able to add tags after the topic is approved.',
19 | 'Enter tags' => 'Enter a few words (called tags) separated by commas to help someone find your topic.',
20 | 'Show Pun Tags' => 'Show Pun Tags',
21 | 'Pun Tags notice' => 'Display list of tags at the pages',
22 | 'Count error' => 'Total length of tags can\'t be more than 100.',
23 | 'Tags count' => 'Limit of tags cloud',
24 | 'Tags count info' => 'Maximum count of tags in the cloud.',
25 | 'Separator' => 'Tags separator',
26 | 'Separator info' => 'The separator of tags in the cloud.',
27 | 'Permissions' => 'Tags permission',
28 | 'Name check' => 'Allow users to tag topics.',
29 | 'Title' => 'Tags: ',
30 | 'Create tags perms' => 'Create tags',
31 | 'Section pun_tags' => 'Pun Tags',
32 | 'Section tags' => 'Tags',
33 | 'ID topic' => 'ID',
34 | 'Name topic' => 'Topic name',
35 | 'Tags of topic' => 'Tags list',
36 | 'Submit changes' => 'Submit changes',
37 | 'Redirect with changes' => 'The list of tags updated.',
38 | 'No tags' => 'There are no tags.'
39 | );
40 |
41 | ?>
--------------------------------------------------------------------------------
/pun_tags/lang/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_tags/pun_tags_url.php:
--------------------------------------------------------------------------------
1 | 'admin/extensions.php?section=manage_tags',
13 | 'Section tags' => 'admin/extensions.php?section=manage_tags&tags=1',
14 | );
15 | ?>
--------------------------------------------------------------------------------
/pun_tags/style/Oxygen/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_tags/style/Oxygen/pun_tags.css:
--------------------------------------------------------------------------------
1 | /**
2 | * CSS-Styles for pun_tags extension
3 | *
4 | * @copyright Copyright (C) 2011 PunBB
5 | * @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
6 | * @package pun_tags
7 | */
8 | #brd-pun_tags {
9 | margin-bottom: 1em;
10 | padding-left: 0;
11 | overflow: auto;
12 | display: block;
13 | margin-top: 1em;
14 | text-align: left;
15 | }
16 |
17 | #pun_tags_table input[type="text"] {
18 | width: 100%;
19 | }
20 |
21 | #brd-pun_tags ul {
22 | list-style: none outside none;
23 | padding-left: 0;
24 | }
25 |
26 | #brd-pun_tags li {
27 | display: inline;
28 | margin-right: .25em;
29 | line-height: 2.7em;
30 | white-space: nowrap;
31 | }
32 |
33 | #brd-pun_tags li a,
34 | #brd-pun_tags li a:active,
35 | #brd-pun_tags li a:focus,
36 | #brd-pun_tags li a:visited {
37 | font-size: .95em;
38 | background: #f4f4f4;
39 | border-radius: 4px;
40 | color: #888888;
41 | padding: 0.5em 0.8em;
42 | -moz-transition: all 300ms;
43 | -webkit-transition: all 300ms;
44 | transition: all 300ms;
45 | text-decoration: none;
46 | }
47 |
48 | #brd-pun_tags li a:hover {
49 | background: #F56F4E;
50 | color: #fff;
51 | text-decoration: none;
52 | }
53 |
--------------------------------------------------------------------------------
/pun_tags/style/Oxygen/pun_tags.min.css:
--------------------------------------------------------------------------------
1 | #brd-pun_tags{margin-bottom:1em;padding-left:0;overflow:auto;display:block;margin-top:1em;text-align:left}#pun_tags_table input[type="text"]{width:100%}#brd-pun_tags ul{list-style:none outside none;padding-left:0}#brd-pun_tags li{display:inline;margin-right:.25em;line-height:2.7em;white-space:nowrap}#brd-pun_tags li a,#brd-pun_tags li a:active,#brd-pun_tags li a:focus,#brd-pun_tags li a:visited{font-size:.95em;background:#f4f4f4;border-radius:4px;color:#888;padding:.5em .8em;-moz-transition:all 300ms;-webkit-transition:all 300ms;transition:all 300ms;text-decoration:none}#brd-pun_tags li a:hover{background:#f56f4e;color:#fff;text-decoration:none}
--------------------------------------------------------------------------------
/pun_tags/style/Oxygen/style.css:
--------------------------------------------------------------------------------
1 | /**
2 | * CSS-Styles for pun_tags extension
3 | *
4 | * @copyright Copyright (C) 2011 PunBB
5 | * @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
6 | * @package pun_tags
7 | */
8 | #brd-pun_tags {
9 | margin-bottom: 1em;
10 | }
11 |
12 | #brd-pun_tags {
13 | padding: 0.5em 1.5em;
14 | overflow: auto;
15 | display: block;
16 | margin-top: 1em;
17 | text-align: left;
18 | }
19 |
20 | #pun_tags_table input[type="text"] {
21 | width: 100%;
22 | }
--------------------------------------------------------------------------------
/pun_tags/style/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------
/pun_tags/url/Default.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/pun_tags/url/File_based.php:
--------------------------------------------------------------------------------
1 |
13 |
--------------------------------------------------------------------------------
/pun_tags/url/File_based_(fancy).php:
--------------------------------------------------------------------------------
1 |
13 |
--------------------------------------------------------------------------------
/pun_tags/url/Folder_based.php:
--------------------------------------------------------------------------------
1 |
13 |
--------------------------------------------------------------------------------
/pun_tags/url/Folder_based_(fancy).php:
--------------------------------------------------------------------------------
1 |
13 |
--------------------------------------------------------------------------------
/pun_tags/url/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 |
5 |
6 | .
7 |
8 |
--------------------------------------------------------------------------------