-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkbase_shortcodes.php
More file actions
436 lines (387 loc) · 11.2 KB
/
Copy pathkbase_shortcodes.php
File metadata and controls
436 lines (387 loc) · 11.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
<?php
include_once(e_HANDLER . 'shortcode_handler.php');
return;
$kbase_shortcodes = $tp->e_sc->parse_scbatch(__FILE__);
/*
SC_BEGIN KBASE_STATS_LINK
global $kbase_obj;
if ($kbase_obj->kbase_viewstats)
{
return "<a href='".e_PLUGIN."kbase/kbase_stats.php'>".KBASELAN_135."</a>";
}
else
{
return "";
}
SC_END
SC_BEGIN KBASE_PDF
global $kbase_id,$sql,$pref;
if ($pref['plug_installed'][pdf])
{
return "<a href='".e_PLUGIN."pdf/pdf.php?plugin:kbase.$kbase_id'><img src='".e_PLUGIN."pdf/images/pdf_16.png' style='border:0;' alt='pdf' /></a>";
}
else
{
return "";
}
SC_END
SC_BEGIN KBASE_MESSAGE
global $message;
return $message;
SC_END
SC_BEGIN KBASE_EDIT_USER
return "<input type='text' name='kbase_submittedby' class='tbox' style='width:50%;' />";
SC_END
SC_BEGIN KBASE_LOGO
if (file_exists(e_PLUGIN."kbase/images/kbase_logo.png"))
{
return "<img src='images/kbase_logo.png' style='border:0;' alt='logo'/>";
}
else
{
return "";
}
SC_END
SC_BEGIN KBASE_EDIT_CAPTION
global $idx;
return (is_numeric($idx)? KBASELAN_43." ".$idx: KBASELAN_59. KBASELAN_50);
SC_END
SC_BEGIN KBASE_EDIT_SUBMIT
$retval = "<input class='button' type='submit' name='kbase_submit' value='" . KBASE_ADLAN_53 ." '/>";
return $retval;
SC_END
SC_BEGIN KBASE_EDIT_COMMENTS
global $kbase_comment,$KBASE_PREF;
require_once(e_HANDLER . "userclass_class.php");
if (!is_numeric($kbase_comment))
{
$kbase_comment = $KBASE_PREF['kbase_defcomments'];
}
$retval = r_userclass("kbase_comment", $kbase_comment, "", "public,guest,nobody,member,admin,classes");
return $retval;
SC_END
SC_BEGIN KBASE_EDIT_PICTURE
$text ="<a style='cursor: pointer; cursor: hand' onclick='expandit(this);'>".KBASE_IMGLAN_03."</a>
<div style='display: none;'>
<div id='up_container' >
<span id='upline' style='white-space:nowrap'>
<input class='tbox' type='file' name='kbase_gfile[]' size='70%' />\n
</span>
</div>";
$text .="
<table style='width:100%'>
<tr>
<td><input type='button' class='button' value='".KBASE_IMGLAN_01."' onclick=\"duplicateHTML('upline','up_container');\" /></td>
<td><input class='button' type='submit' name='submitupload' value='".KBASE_IMGLAN_02."' /></td>
</tr>
</table>
</div>";
return $text;
SC_END
SC_BEGIN KBASE_EDIT_QUESTION
global $kbase_question,$tp;
return "<input class='tbox' type='text' name='kbase_question' style='width:90%;' value='".$tp->toFORM($kbase_question)."' />";
SC_END
SC_BEGIN KBASE_EDIT_ANSWER
global $tp,$pref,$KBASE_PREF,$kbase_answer,$e_wysiwyg;
require_once(e_HANDLER . "ren_help.php");
$insertjs = (!$pref['wysiwyg'])?"rows='10' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'":
"rows='20' style='width:100%' ";
$kbase_answer = $tp->toForm($kbase_answer);
$retval .= "<textarea class='tbox' id='data' name='data' cols='80' style='width:95%' $insertjs>" . (strstr($kbase_answer, "[img]http") ? $kbase_answer : str_replace("[img]../", "[img]", $kbase_answer)) . "</textarea>";
if (!e_WYSIWYG)
{
$retval .= "
<div style='text-align:left'>" . display_help("helpb","comment"). "</div>";
}
return $retval;
SC_END
SC_BEGIN KBASE_EDIT_CATEGORY
global $tp,$sql,$kbase_parent,$id,$kbase_action,$kbase_obj;
if ($kbase_action=="new")
{
$kbase_sl=$id;
}
else
{
$kbase_sl=$kbase_parent;
}
if ($kbase_obj->kbase_simple)
{
// in simple mode only give the option for the available category
$kbase_where="and kbase_info_id = ".$kbase_obj->kbase_simpleid;
}
else
{
$kbase_where="";
}
$retval = "<select class='tbox' id='kbase_parent' name='kbase_parent' >";
$sql->db_Select("kbase_info", "*", "where kbase_info_parent !='0' $kbase_where and find_in_set(kbase_info_class,'" . USERCLASS_LIST . "') ","nowhere",false);
while ($prow = $sql->db_Fetch())
{
extract($row);
$selected = $prow['kbase_info_id'] == $kbase_sl ? " selected='selected'" : "";
$retval .= "<option value=\"" . $prow['kbase_info_id'] . "\" $selected >" . $tp->toFORM($prow['kbase_info_title']) . "</option>";
}
$retval .= " </select>";
return $retval;
SC_END
SC_BEGIN KBASE_UPDIR
global $kbase_obj,$kbase_action,$kbase_parent,$kbase_from,$id,$idx,$kbase_simple;
if ($kbase_action=="edit" || $kbase_action=="reedit")
{
return "<a href='" . e_SELF . "?$kbase_from.cat.$id.$idx.$kbase_parent'><img src='./images/updir.png' alt='" . KBASELAN_46 . "' title='" . KBASELAN_46 . "' style='border:0;' /></a>";
}
if ($idx>0)
{
return "<a href='" . e_SELF . "?$kbase_from.cat.$kbase_parent'><img src='./images/updir.png' alt='" . KBASELAN_46 . "' title='" . KBASELAN_46 . "' style='border:0;' /></a>";
}
else
{
if (!$kbase_obj->kbase_simple)
{
return "<a href='" . e_SELF . "?0.main.$id'><img src='./images/updir.png' alt='" . KBASELAN_46 . "' title='" . KBASELAN_46 . "' style='border:0;' /></a>";
}
else
{
return"";
}
}
SC_END
SC_BEGIN KBASE_ITEM_UNIQUE
global $kbase_unique;
return $kbase_unique;
SC_END
SC_BEGIN KBASE_ITEM_RATE
global $kbase_rate_text;
return $kbase_rate_text;
SC_END
SC_BEGIN KBASE_ITEM_VIEWS
global $kbase_views;
return $kbase_views;
SC_END
SC_BEGIN KBASE_ITEM_POSTED
global $kbase_datestamp;
if(empty($parm))
{
$parm='short';
}
if($kbase_datestamp>0)
{
require_once(e_HANDLER . "date_handler.php");
$con = new convert;
return $con->convert_date($kbase_datestamp, $parm);
}
else
{
return '';
}
SC_END
SC_BEGIN KBASE_ITEM_UPDATED
global $kbase_updated,$kbase_datestamp;
if(empty($parm))
{
$parm='short';
}
if($kbase_updated>0)
{
require_once(e_HANDLER . "date_handler.php");
$con = new convert;
return $con->convert_date($kbase_updated, $parm);
}
elseif($kbase_datestamp>0)
{
require_once(e_HANDLER . "date_handler.php");
$con = new convert;
return $con->convert_date($kbase_datestamp, $parm);
}
{
return '';
}
SC_END
SC_BEGIN KBASE_ITEM_AUTHOR
global $kbase_author;
$kbase_tmp = explode(".", $kbase_author,2);
if ($kbase_tmp[0]>0)
{
return "<a href='../../user.php?id.".$kbase_tmp[0]."' >".$kbase_tmp[1]."</a>";
}
else
{
return $kbase_tmp[1];
}
SC_END
SC_BEGIN KBASE_ITEM_QUESTION
global $tp, $kbase_question;
return $tp->toHTML($kbase_question, false, "no_make_clickable no_replace emotes_off");
SC_END
SC_BEGIN KBASE_ITEM_ANSWER
global $tp, $kbase_answer;
return $tp->toHTML($kbase_answer, true,"constants body");
SC_END
SC_BEGIN KBASE_ITEM_QICON
return "<img src='" . e_PLUGIN . "kbase/images/q.png' alt='' />";
SC_END
SC_BEGIN KBASE_ITEM_AICON
return"<img src='" . e_PLUGIN . "kbase/images/a.png' alt='' />";
SC_END
SC_BEGIN KBASE_ITEM_PRINT
global $idx;
return "<a href='../../print.php?plugin:kbase.$idx' ><img src='" . e_IMAGE . "generic/" . IMODE . "/printer.png' style='border:0;' title='" . KBASELAN_60 . "' alt='" . KBASELAN_60 . "' /></a>";
SC_END
SC_BEGIN KBASE_ITEM_CAPTION
global $kbase_id;
return " KBASE #" . $kbase_id;
SC_END
SC_BEGIN KBASE_ITEM_EDIT
global $kbase_obj,$kbase_authid, $kbase_from, $kbase_parent, $kbase_id;
if ($kbase_obj->kbase_super || ($kbase_obj->kbase_ownedit && $kbase_authid == USERID))
{
return "<a href='" . e_SELF . "?$kbase_from.edit.$kbase_parent." . $kbase_id . "'><img src='" . e_IMAGE . "generic/" . IMODE . "/edit.png' style='border:0' alt='" . KBASELAN_43 . "' title='" . KBASELAN_43 . "' /></a>";
}
else
{
return "";
}
SC_END
SC_BEGIN KBASE_EMAIL
global $kbase_id,$kbase_obj;
if ($kbase_obj->kbase_sendto)
{
return "<a href='../../email.php?plugin:kbase." . $kbase_id . "'><img src='" . e_IMAGE . "generic/" . IMODE . "/email.png' style='border:0' alt='" . KBASELAN_68 . "' title='" . KBASELAN_68 . "' /></a>";
}
else
{
return "";
}
SC_END
SC_BEGIN KBASE_NEXTPREV
global $kbase_count, $KBASE_PREF, $kbase_from, $tp, $id;
$kbase_action = "cat.$id.";
$parms = $kbase_count . "," . $KBASE_PREF['kbase_perpage'] . "," . $kbase_from . "," . e_SELF . '?' . "[FROM]." . $kbase_action;
$kbase_nextprev = $tp->parseTemplate("{NEXTPREV={$parms}}");
if (!empty($kbase_nextprev))
{
$retval = $kbase_nextprev;
}
else
{
$retval = "";
}
return $retval;
SC_END
SC_BEGIN KBASE_LIST_RATE
global $kbase_view_rating;
return $kbase_view_rating;
SC_END
SC_BEGIN KBASE_CAPTION
global $tp, $kbase_cat_name;
$caption = KBASELAN_51 . ": " .$tp->toHTML($kbase_cat_name,false, "no_make_clickable no_replace emotes_off") . " " ;
return $caption;
SC_END
SC_BEGIN KBASE_LIST_KBASE
global $res, $tp, $kbase_question, $id, $kbase_id, $kbase_from;
if ($res > 0)
{
return "<a href='" . e_SELF . "?$kbase_from.cat.$id.$kbase_id'>" . $tp->toHTML($kbase_question, false, "no_make_clickable no_replace emotes_off") . "</a>";
}
else
{
return KBASELAN_103;
}
SC_END
SC_BEGIN KBASE_LIST_ICON
global $res;
if ($res > 0)
{
return "<img src='" . e_PLUGIN . "kbase/images/kbase.png' style='border:0;' alt='' />";
}
else
{
return "";
}
SC_END
SC_BEGIN KBASE_NEW
global $id, $KBASE_PREF,$kbase_from;
if (check_class($KBASE_PREF['add_kbase']))
{
return "<a href=\"". e_PLUGIN ."kbase/kbase.php?$kbase_from.new.{$id}\"><img src='./images/new.gif' style='border:0;' alt='" . KBASELAN_47 . "' title='" . KBASELAN_47 . "' /></a>";
}
else
{
return "";
}
SC_END
SC_BEGIN KBASE_PARENT_TITLE
global $tp, $kbase_info_title, $kbase_info_about;
return ($kbase_info_title ? $tp->toHTML($kbase_info_title,false, "no_make_clickable no_replace emotes_off") : "[" . KBASELAN_102 . "]") ;
SC_END
SC_BEGIN KBASE_PARENT_CATICON
global $kbase_info_icon,$kbase_info_title,$tp;
if (empty($kbase_info_icon))
{
$kbase_info_icon="kbase.png";
}
return "<img src='" . e_PLUGIN . "kbase/images/caticons/".$tp->toFORM($kbase_info_icon)."' alt='".$tp->toFORM($kbase_info_title)."' title='".$tp->toFORM($kbase_info_title)."' />";
SC_END
SC_BEGIN KBASE_PARENT_ICON
global $kbase_info_icon,$kbase_info_title,$tp,$kbase_info_id;
if (empty($kbase_info_icon))
{
$kbase_info_icon="kbase.png";
}
if ($parm=="link")
{
return "<a href='".e_SELF."?0.cat.$kbase_info_id' ><img src='" . e_PLUGIN . "kbase/images/caticons/".$tp->toFORM($kbase_info_icon)."' style='border:0;' alt='".$tp->toFORM($kbase_info_title)."' title='".$tp->toFORM($kbase_info_title)."' /></a>";
}
else
{
return "<img src='" . e_PLUGIN . "kbase/images/caticons/".$tp->toFORM($kbase_info_icon)."' style='border:0;' alt='".$tp->toFORM($kbase_info_title)."' title='".$tp->toFORM($kbase_info_title)."' />";
}
SC_END
SC_BEGIN KBASE_PARENT_ABOUT
global $tp, $kbase_from, $kbase_info_id, $kbase_info_title, $kbase_info_about, $subparents;
if ($subparents)
{
return $tp->toHTML($kbase_info_about,false, "no_make_clickable no_replace emotes_off " );
}
else
{
return " ";
}
SC_END
SC_BEGIN KBASE_PARENT_KBASE
global $tp, $kbase_from, $kbase_info_id, $kbase_info_title, $kbase_info_about, $subparents,$cnt;
if ($subparents>0)
{
if ($cnt==0)
{
return $tp->toHTML($kbase_info_title,false, "no_make_clickable no_replace emotes_off");
}
else
{
return "<a href='" . e_SELF . "?0.cat.$kbase_info_id' title='" . KBASELAN_78 . " " . $cnt . " " . KBASELAN_79 . "' >" . ($kbase_info_title ? $tp->toHTML($kbase_info_title,false, "no_make_clickable no_replace emotes_off") : "[" . KBASELAN_102 . "]") . "</a>";
}
}
else
{
return KBASE_ADLAN_75;
}
SC_END
SC_BEGIN KBASE_PARENT_ABOUT
global $kbase_info_about;
return $kbase_info_about;
SC_END
SC_BEGIN KBASE_PARENT_COUNT
global $cnt, $subparents;
if ($subparents)
{
return "$cnt";
}
else
{
return " ";
}
SC_END
*/
?>