-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathe_shortcode.php
More file actions
735 lines (713 loc) · 18.7 KB
/
Copy pathe_shortcode.php
File metadata and controls
735 lines (713 loc) · 18.7 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
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
<?php
/**
* +---------------------------------------------------------------+
* | Enhanced Guestbook for e107 VV2.0 - by Barry Keal G4HDU
* |
* | This module for the e107 V2.0 website system
* | Copyright Barry Keal 2004-2016
* |
* +---------------------------------------------------------------+
*/
if (!defined('e107_INIT')) {
exit;
}
class guestbook_shortcodes extends e_shortcode
{
public $override = false; // when set to true, existing core/plugin shortcodes matching methods below will be overridden.
public $current;
public $fields;
public $datarow;
public $multiBlock;
/**
* Constructor
*/
function __construct()
{
}
/**
* guestbook_shortcodes::sc_gb_sendpm()
*
* @return
*/
function sc_gb_sendpm()
{
global $guestbook_obj, $guestbook_pmto, $gbpref;
if ($gbpref['plug_installed']['pm'] && $guestbook_obj->prefs['sc_gb_notifymethod'] >
0) {
if ($guestbook_pmto > 0) {
$retval = "<a href='" . e_PLUGIN . "pm/pm.php?send.{$guestbook_pmto}' ><img src='" .
e_PLUGIN . "pm/images/pm.png' style='border:0;' alt='" . sc_gb_123 . "' title='" .
sc_gb_123 . "' /></a>";
} else {
$retval = '';
}
}
return $retval;
}
/**
* guestbook_shortcodes::sc_gb_edit()
*
* @return
*/
function sc_gb_edit()
{
global $guestbook_obj, $guestbook_itemid, $guestbook_thisrec;
if (check_class($guestbook_obj->prefs['sc_gb_create']) || check_class($guestbook_obj->
prefs['sc_gb_admin'])) {
$retval = "<a href='" . e_PLUGIN .
"guestbook/manage_adds.php?action=godo&catid=$guestbook_thisrec&actvar=edit' rel='external' ><img src='" .
e_IMAGE . "admin_images/edit_16.png' style='border:0;' alt='" . sc_gb_36 .
"' title='" . sc_gb_36 . "'/></a>";
}
return $retval;
}
function sc_view_ip()
{
$ip = e107::ipdecode($this->datarow['guestbook_ip'], true);
return $ip;
}
function sc_view_posted()
{
$date = $this->datarow['guestbook_date'];
return $date;
}
/**
* guestbook_shortcodes::sc_gb_sign()
*
* @return
*/
function sc_gb_sign()
{
$retval = "
<a href='#' id='guestbookLinkSwap' ><i class='fa fa-pencil-square-o' aria-hidden='true'></i><br>Sign our guestbook</a>";
return $retval;
}
function sc_gb_back()
{
$link = e107::url('guestbook', 'index');
$retval = "
<span class='guestbookBackIcon'>
<a href='" . $link . "' id='guestbookLink' >
<i class='fa fa-arrow-circle-o-left' aria-hidden='true'></i>
</a>
</span>";
return $retval;
}
function sc_gb_addnew()
{
$retval = ' ';
if (!$this->multiBlock && $this->poster) {
if ($this->datarow['guestbook_add']) {
$retval = "<span class='guestbookNewEntryIcon'><a href='" . $this->datarow['guestbook_addnew'] .
"' ><i class='fa fa-pencil-square-o' aria-hidden='true'></i></a></span>";
}
}
return $retval;
}
function sc_gb_record_approved()
{
if ($this->datarow['guestbook_approved']) {
$retval = "
<a href='" . $this->datarow['guestbook_unapprove'] .
"' id='guestbookApproveButton' >
<button type='button' class='btn btn-default gbmodGreen'>
<span class='glyphicon glyphicon-ban-circle ' aria-hidden='false'></span> Hide
</button>
</a>";
$retval = "<button type='button' id='guestbookApproveButton' onclick=\"location.href='" .
$this->datarow['guestbook_unapprove'] . "'\" class='btn btn-default gbmodGreen'>
<span class='glyphicon glyphicon-ban-circle' aria-hidden='false'></span> Hide</button>";
} else {
$retval = "
<a href='" . $this->datarow['guestbook_approve'] .
"' id='guestbookApproveButton' >
<button type='button' class='btn btn-default gbmod'>
<span class='glyphicon glyphicon-ok-circle gbmodRed' aria-hidden='false'></span> Show
</button>
</a>";
$retval = "<button type='button' id='guestbookApproveButton' onclick=\"location.href='" .
$this->datarow['guestbook_approve'] . "'\" class='btn btn-default gbmod'>
<span class='glyphicon glyphicon-ok-circle gbmodRed' aria-hidden='false'></span> Show</button>";
}
return $retval;
}
function sc_gb_record_delete()
{
$retval = "
<a href='" . $this->datarow['guestbook_delete'] .
"' id='guestbookDelButton' class='btn btn-default gbmodRed' >
<button type='button' class='btn btn-default gbmodRed'>
<span class='glyphicon glyphicon-remove-circle gbmodRed' aria-hidden='false'></span> Delete
</button>
</a>";
$retval = "<button type='button' id='guestbookDelButton' onclick=\"location.href='" .
$this->datarow['guestbook_delete'] . "'\" class='btn btn-default gbmodRed'>
<span class='glyphicon glyphicon-remove-circle gbmodRed' aria-hidden='false'></span> Delete</button>";
return $retval;
}
function sc_gb_record_edit()
{
$retval = "
<a href='" . $this->datarow['guestbook_edit'] .
"' id='guestbookEditButton' >
<button type='button' class='btn btn-default gbmodBlue'>
<span class='glyphicon glyphicon-edit gbmodBlue' aria-hidden='false'></span> Edit
</button>
</a>";
$retval = "<button type='button' id='guestbookEditButton' onclick=\"location.href='" .
$this->datarow['guestbook_edit'] . "'\" class='btn btn-default gbmodBlue'>
<span class='glyphicon glyphicon-edit gbmodBlue' aria-hidden='false'></span> Edit</button>";
return $retval;
}
function sc_gb_user_edit()
{
$retval = "
<a href='" . $this->datarow['guestbook_edit'] .
"' id='guestbookEditButton' >
<button type='button' class='btn btn-default gbmodBlue'>
<span class='glyphicon glyphicon-edit gbmodBlue' aria-hidden='false'></span> Edit
</button>
</a>";
$retval = "<button type='button' id='guestbookEditButton' onclick=\"location.href='" .
$this->datarow['guestbook_edit'] . "'\" class='btn btn-default gbmodBlue'>
<span class='glyphicon glyphicon-edit gbmodBlue' aria-hidden='false'></span> Edit</button>";
return $retval;
}
/**
* guestbook_shortcodes::sc_gb_sign_name()
*
* @param mixed $parm
* @return
*/
function sc_sign_name()
{
return $this->datarow['guestbook_name'];
}
/**
* guestbook_shortcodes::sc_gb_sign_name()
*
* @param mixed $parm
* @return
*/
function sc_view_name()
{
return e107::getParser()->toHTML($this->datarow['guestbook_name'], false);
}
function sc_view_id()
{
return e107::getParser()->toHTML($this->datarow['guestbook_id'], false);
}
function sc_view_partcomment()
{
return e107::getParser()->html_truncate(e107::getParser()->toHTML($this->
datarow['guestbook_comment'], false), 30, '...');
}
function sc_delete_ok()
{
return $this->datarow['guestbook_delok'];
}
function sc_delete_canc()
{
return $this->datarow['guestbook_delcanc'];
}
/**
* guestbook_shortcodes::sc_gb_sign_email()
*
* @return
*/
function sc_sign_email()
{
return $this->datarow['guestbook_email'];
}
function sc_view_email()
{
return e107::getParser()->emailObfuscate($this->datarow['guestbook_email']);
}
/**
* guestbook_shortcodes::sc_gb_sign_website()
*
* @return
*/
function sc_gb_sign_website()
{
return $this->datarow['guestbook_url'];
}
/**
* guestbook_shortcodes::sc_gb_sign_comments()
*
* @return
*/
function sc_gb_sign_comments()
{
return $this->datarow['guestbook_comment'];
}
function sc_gb_view_comments()
{
return $this->datarow['guestbook_comment'];
}
function sc_gb_sign_approved()
{
return $this->datarow['guestbook_approved'];
}
function sc_gb_id()
{
return $this->datarow['guestbook_id'];
}
/**
* guestbook_shortcodes::sc_gb_sign_image()
*
* @return
*/
function sc_gb_imagecode_number()
{
//
if ($this->use_imagecode && $this->guest) { {
return e107::getSecureImg()->renderImage();
}
return '';
}
}
function sc_gb_imagecode_box($parm = '')
{
// var_dump($this->use_imagecode );
if ($this->use_imagecode && $this->guest) {
return e107::getSecureImg()->renderInput();
}
return '';
}
/**
* guestbook_shortcodes::sc_gb_sign_udf1_name()
*
* @return
*/
function sc_udf_name($param)
{
return $this->datarow['udf_name'][$param];
}
function sc_view_udf($param)
{
return e107::getParser()->toHTML($this->datarow['udf'][$param], false);
}
/**
* guestbook_shortcodes::sc_gb_sign_udf1()
*
* @return
*/
function sc_sign_udf($param)
{
return $this->datarow['guestbook_udf'][$param];
}
/**
*
* @param $
* @return
* @author
* @version
*/
function sc_udf2_name()
{
return $this->datarow['udf2_name'];
}
function sc_view_udf2()
{
return e107::getParser()->toHTML($this->datarow['udf2'], false);
}
/**
*
* @param $
* @return
* @author
* @version
*/
function sc_sign_udf2()
{
return $this->datarow['guestbook_udf2'];
}
/**
*
* @param $
* @return
* @author
* @version
*/
function sc_udf3_name()
{
return $this->datarow['udf3_name'];
}
/**
*
* @param $
* @return
* @author
* @version
*/
function sc_sign_udf3()
{
return $this->datarow['guestbook_udf3'];
}
function sc_view_udf3()
{
return e107::getParser()->toHTML($this->datarow['udf3'], false);
}
/**
*
* @param $
* @return
* @author
* @version
*/
function sc_udf4_name()
{
return $this->datarow['udf4_name'];
}
/**
*
* @param $
* @return
* @author
* @version
*/
function sc_sign_udf4()
{
return $this->datarow['guestbook_udf4'];
}
function sc_view_udf4()
{
return e107::getParser()->toHTML($this->datarow['udf4'], false);
}
/**
*
* @param $
* @return
* @author
* @version
*/
/**
*
* @param $
* @return
* @author
* @version
*/
function sc_udf5_name()
{
return $this->datarow['udf5_name'];
}
function sc_view_udf5()
{
return e107::getParser()->toHTML($this->datarow['udf5'], false);
}
function sc_sign_udf5()
{
return $this->datarow['guestbook_udf5'];
}
function sc_udf6_name()
{
return $this->datarow['udf6_name'];
}
function sc_view_udf6()
{
return e107::getParser()->toHTML($this->datarow['udf6'], false);
}
function sc_sign_udf6()
{
return $this->datarow['guestbook_udf6'];
}
/**
*
* @param $
* @return
* @author
* @version
*/
function sc_sign_submit()
{
return $this->datarow['guestbook_submit'];
}
/**
*
* @param $
* @return
* @author
* @version
*/
function sc_gb_edit_submit()
{
return "<input class='button' type='submit' name='sc_gb_edsubit' id='sc_gb_edsubit' />";
}
/**
* guestbook_shortcodes::sc_gb_name()
*
* @return
*/
function sc_gb_name()
{
return $this->datarow['guestbook_name'];
}
/**
*
* @param $
* @return
* @author
* @version
*/
function sc_gb_comments()
{
return $this->datarow['guestbook_comment'];
}
/**
*
* @param $
* @return
* @author
* @version
*/
function sc_gb_posted()
{
return $this->datarow['guestbook_listdate'];
}
/**
*
* @param $
* @return
* @author
* @version
*/
function sc_gb_ip()
{
global $guestbook_obj, $tp, $guestbook_row;
if ($guestbook_obj->sc_gb_admin) {
// return $tp->toHTML( $guestbook_row['sc_gb_ip'], false );
}
return $this->datarow['guestbook_ip'];
}
/**
* guestbook_shortcodes::sc_gb_host()
*
* @return
*/
function sc_gb_host()
{
global $guestbook_obj, $tp, $guestbook_row;
if ($guestbook_obj->sc_gb_admin) {
// return $tp->toHTML( $guestbook_row['sc_gb_host'], false );
}
return $this->datarow['guestbook_host'];
}
/**
*
* @param $
* @return
* @author
* @version
*/
function sc_gb_mod()
{
global $guestbook_obj, $tp, $guestbook_row;
// sort out url
$url = '';
if ($guestbook_row['sc_gb_url'] == '' || $guestbook_row['sc_gb_url'] ==
'http://') {
$url = '';
$website = '';
} else {
if (strpos($guestbook_row['sc_gb_url'], 'http://') === false) {
$url = 'http://' . $guestbook_row['sc_gb_url'];
} else {
$url = $guestbook_row['sc_gb_url'];
}
$website = "<a href='" . $url . "' rel='external' ><img src='" . e_PLUGIN_ABS .
"forum/images/lite/website.png' style='height:16px;width:16px;border:0px;' alt='" .
sc_gb_SIGN_007 . "' title='" . sc_gb_SIGN_007 . "' /></a>";
}
if ($guestbook_obj->sc_gb_admin) {
// we are admin so show allsorts
$mail = 'mailto:' . $guestbook_row['sc_gb_email'];
$retval .= "
{$website}
<a href='" . $mail . "' ><img src='" . e_PLUGIN_ABS .
"forum/images/lite/email.png' style='height:16px;width:16px;border:0px;' alt='" .
sc_gb_SIGN_010 . "' title='" . sc_gb_SIGN_010 . "' /></a>
<a href='" . e_SELF . "?{$guestbook_obj->from}.edit.{$guestbook_row['sc_gb_id']}' ><img src='" .
e_PLUGIN_ABS . "forum/images/lite/admin_edit.png' style='height:16px;width:16px;border:0px;' alt='" .
sc_gb_SIGN_008 . "' title='" . sc_gb_SIGN_008 . "' /></a>
<a href='" . e_SELF . "?{$guestbook_obj->from}.delete.{$guestbook_row['sc_gb_id']}' ><img src='" .
e_PLUGIN_ABS . "forum/images/lite/admin_delete.png' style='height:16px;width:16px;border:0px;' alt='" .
sc_gb_SIGN_009 . "' title='" . sc_gb_SIGN_009 . "' /></a>";
} elseif (USER) {
$retval .= $website;
} elseif (!USER && !$guestbook_obj->sc_gb_showsites) {
$retval .= $website;
}
return $retval;
}
/**
*
* @param $
* @return
* @author
* @version
*/
function sc_gb_np()
{
return $this->datarow['guestbook_nextprev'];
}
/**
*
* @param $
* @return
* @author
* @version
*/
function sc_gb_MESSAGE_HTML()
{
return sc_gb_MESSAGE_HTML;
}
/**
*
* @param $
* @return
* @author
* @version
*/
function sc_gb_MESSAGE_LINK()
{
global $guestbook_obj;
if (!$guestbook_obj->sc_gb_links) {
return sc_gb_MESSAGE_LINK;
}
}
/**
*
* @param $
* @return
* @author
* @version
*/
function sc_gb_MESSAGE_TIME()
{
global $guestbook_obj;
if ($guestbook_obj->sc_gb_edittime > 0) {
return sc_gb_MESSAGE_TIME_1 . ' ' . (int)($guestbook_obj->sc_gb_edittime / 60) .
' ' . sc_gb_MESSAGE_TIME_2;
}
}
/**
*
* @param $
* @return
* @author
* @version
*/
function sc_gb_MESSAGE_EMAIL()
{
return sc_gb_MESSAGE_EMAIL;
}
/**
*
* @param $
* @return
* @author
* @version
*/
function sc_gb_delete_name()
{
global $guestbook_row, $tp;
$name = $tp->toFORM($guestbook_row['sc_gb_name']);
return $name;
}
/**
*
* @param $
* @return
* @author
* @version
*/
function sc_gb_delete_id()
{
global $guestbook_row, $tp;
$id = $tp->toFORM($guestbook_row['sc_gb_id']);
return $id;
}
/**
*
* @param $
* @return
* @author
* @version
*/
function sc_deleteok()
{
return "<input type='submit' class='button' name='sc_gb_delok' id='sc_gb_delok' value='" .
sc_gb_DELETE_02 . "' />";
}
/**
*
* @param $
* @return
* @author
* @version
*/
function sc_deletecanc()
{
return "<input type='submit' class='button' name='sc_gb_delcanc' id='sc_gb_delcanc' value='" .
sc_gb_DELETE_03 . "' />";
}
/**
*
* @param $
* @return
* @author
* @version
*/
function sc_gb_viewall()
{
return "<a href='" . e_SELF . "'>" . LAN_GB_005 . "</a>";
}
function sc_sign_cancel()
{
return $this->datarow['guestbook_cancel'];
}
function sc_gb_sign_approve()
{
return $this->datarow['guestbook_approve'];
}
function sc_gb_sign_delete()
{
return $this->datarow['guestbook_delete'];
}
/**
*
* @param $
* @return
* @author
* @version
*/
function sc_gb_sign_save()
{
return $this->datarow['guestbook_submit'];
}
function sc_gb_emailname()
{
return $this->datarow['guestbook_name'];
}
function sc_gb_sitename()
{
return $this->datarow['guestbook_sitename'];
}
function sc_gb_confirmlink()
{
return $this->datarow['emailConfirmationlink'];
}
function sc_gb_copylink()
{
return $this->datarow['guestbook_copylink'];
}
function sc_timeout_display($param)
{
$retval = "
<div id='countdownContainer'>
</div>";
return $retval;
}
}