forked from e107inc/guestbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
guestbook_shortcodes.php
152 lines (129 loc) · 4.01 KB
/
guestbook_shortcodes.php
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
<?php
if (!defined('e107_INIT'))
{
exit;
}
include_once(e_HANDLER . 'shortcode_handler.php');
$guestbook_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
/*
SC_BEGIN ENTRIES_TOTAL
global $entries_total;
return $entries_total;
SC_END
SC_BEGIN GUEST_NAME
global $row,$name;
$name = $row['name'];
return $name;
SC_END
SC_BEGIN GB_COMMENT
global $row,$tp,$pref;
$comment = $tp->toEmail($row['comment']);
if(!$pref['guestbook_bbcode'])
{
$comment = strip_tags($comment, "<br>");
}
return $comment;
SC_END
SC_BEGIN DATE
global $row;
$con = new convert;
$gb_date = $con -> convert_date($row['date'], long);
return $gb_date;
SC_END
SC_BEGIN WEBSITE_IMG
global $row,$pref,$gb_url;
$gb_url = ($row['url'] ? "http://".eregi_replace("http://", "", $row['url']) : "");
$gb_url = ((!$pref['guestbook_hideurl'] || USER)? $row['url'] : "");
$gb_url_img = ($row['url'] ? "<a href='".$row['url']."' rel='external'><img style='border:0' src='".FTHEME."website.png' alt='' title='".GB_LAN_WEBSITE."' /></a>" : "");
return $gb_url_img;
SC_END
SC_BEGIN WEBSITE_TEXT
global $row;
$gb_url_text = ($row['url']?"<a href='".$row['url']."' rel='external'>".GB_LAN_WEBSITE."</a>":"");
return $gb_url_text;
SC_END
SC_BEGIN EMAIL_IMG
global $row;
$email_img = (($row['email'] && ADMIN)?"<a href='mailto:".$row['email']."'><img style='border:0' src='".FTHEME."email.png' alt='' title='".GB_LAN_EMAIL."' /></a>" : "");
return $email_img;
SC_END
SC_BEGIN EMAIL_TEXT
global $row;
$email_text = (($row['email'] && ADMIN)?"<a href='mailto:".$row['email']."'>".GB_LAN_EMAIL."</a>" : "");
return $email_text;
SC_END
SC_BEGIN PROFILE_IMG
global $row,$pref;
if($row['user'] != 0 && (!$pref['memberlist_access']))
{
$profile_img = "<a href='".e_BASE."user.php?id.".$row['user']."'><img style='border:0' src='".FTHEME."profile.png' alt='' title='".GB_LAN_PROFILE."' /></a>";
}
return $profile_img;
SC_END
SC_BEGIN PROFILE_TEXT
global $row,$pref;
if($row['user'] != 0 && (!$pref['memberlist_access']))
{
$profile_text = "<a href='".e_BASE."user.php?id.".$row['user']."'>".GB_LAN_PROFILE."</a>";
}
return $profile_text;
SC_END
SC_BEGIN EDIT_IMG
global $row,$pref;
if( getperms("P") || check_class($pref['guestbook_moderator_class']) || ( $row['date'] > ($time - (60*$pref['guestbook_edittime'])) && $row['host'] == substr($host, 0, strlen($guestbook_host)) ) )
{
$edit_img = "<a href='$_SERVER[PHP_SELF]?edit.".$row['id']."'><img style='border:0' src='".FTHEME."admin_edit.png' alt='' title='".GB_LAN_EDIT."' /></a>";
}
return $edit_img;
SC_END
SC_BEGIN EDIT_TEXT
global $row,$pref;
if( getperms("P") || check_class($pref['guestbook_moderator_class']) || ( $guestbook_date > ($time - (60*$pref['guestbook_edittime'])) && $guestbook_host == substr($host, 0, strlen($guestbook_host)) ) )
{
$edit_text = "<a href='$_SERVER[PHP_SELF]?edit.".$row['id']."'>".GB_LAN_EDIT."</a>";
}
return $edit_text;
SC_END
SC_BEGIN DELETE_IMG
global $row,$pref;
if( getperms("P") || check_class($pref['guestbook_moderator_class']) )
{
$delete_img = "<a href='$_SERVER[PHP_SELF]?delete.".$row['id']."'><img style='border:0' src='".FTHEME."admin_delete.png' alt='' title='".GB_LAN_DELETE."' /></a>";
}
return $delete_img;
SC_END
SC_BEGIN DELETE_TEXT
global $row,$pref;
if( getperms("P") || check_class($pref['guestbook_moderator_class']) )
{
$delete_text = "<a href='$_SERVER[PHP_SELF]?delete.".$row['id']."'>".GB_LAN_DELETE."</a>";
}
return $delete_text;
SC_END
SC_BEGIN IP_PRIVATE
global $row,$pref;
$ip_private = ( (getperms("P") || check_class($pref['guestbook_moderator_class'])) ? $row['ip']:"");
return $ip_private;
SC_END
SC_BEGIN IP_PUBLIC
global $row,$pref;
$ip_public =$row['ip'];
return $ip_public;
SC_END
SC_BEGIN HOST_PRIVATE
global $row,$pref;
$host_private = ( (getperms("P") || check_class($pref['guestbook_moderator_class'])) ? $row['host']:"");
return $host_private;
SC_END
SC_BEGIN HOST_PUBLIC
global $row,$pref;
$host_public = $row['host'];
return $host_public;
SC_END
SC_BEGIN GBOOK_ID
global $row;
$gbook_id = $row['id'];
return $gbook_id;
SC_END
*/
?>