-
Notifications
You must be signed in to change notification settings - Fork 0
/
post.php
164 lines (140 loc) · 6.93 KB
/
post.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
153
154
155
156
157
158
159
160
161
162
163
164
<?php
/*******************************************************************\
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ #
# @ ArBB V 1.0.0 Beta 1 @ #
# @ All Copyrights are saved Arabian bulletin board team @ #
# @ Copyright © 2009 ArBB Team @ #
# @ ArBB Is Free Bulletin Board and not for sale @ #
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ #
\*******************************************************************/
#
# post File started
#
/*
File name -> post.php
File Version -> 1.0.0 Beta 1
File Programmer -> Thaer
File type -> file
*/
$templatelist='post,thread_attachmentbit';
$phrasearray=array('forum','thread','showteam','profile','post');
require('global.php');
$plugins->cache('post_start,post_post,post_complete');
$post_page='';
($evalp = $plugins->load('post_start'))?eval($evalp):'';
$pid=intval($arbb->input['pid']);
$posts_query=$DB->query("select p.*,u.usergroupid,u.joindate,u.posts,u.birthday,u.usertitle,u.avatarid,u.signature,u.location,u.ipaddress,u.username as musername,t.open,ug.opentag,ug.usertitle as gusertitle,ug.closetag from "._PREFIX_."post p
LEFT JOIN "._PREFIX_."users u on (u.userid=p.userid)
LEFT JOIN "._PREFIX_."usergroup ug on (ug.usergroupid=u.usergroupid)
LEFT JOIN "._PREFIX_."thread t on(t.threadid=p.threadid)
where p.postid='$pid' limit 1");
$i=$start;
$modquery=$DB->query("select userid from "._PREFIX_."moderator where forumid in('$thread[forumid]'$modsqladd)");
while($mod=$DB->fetch_array($modquery))
{
if($local['userid']==$mod['userid'])
{
if($post['open']==1)
{
$show['replylink']=1;
}
$show['editlink']=1;
}
}
while($post=$DB->fetch_array($posts_query))
{
$i++;
$post['posttime'] = mydate($post['dateline'],'last');
$post['threadpostid'] = $i;
$post['joindate'] = mydate($post['joindate'],'date');
$post['title'] = $bbcode->clearhtml($post['title']);
if($post['showsignature']>0)
{
$post['signature'] = $bbcode->build($post['signature']);
}
$pbday=explode("-",$post['birthday']);
$ptday=explode("-",mydate(TIMENOW,'date'));
$post['age']=$ptday[2]-$pbday[2];
if(($ptday[1]-$pbday[1]) < 0)
{
$post['age']--;
}
if(($local['userid']==$post['userid'])&&($localgroup['caneditpost']==1))
{
$show['editlink']=1;
}
if(($localgroup['canpost']==1)&&($post['open']==1))
{
$show['replylink']=1;
}
if($post['userid']>0)
{
$show['profile']=1;
}
else
{
$show['profile']=0;
}
if($post['userid']>0)
{
if(empty($post['usertitle']))
{
$post['usertitle']=$post['gusertitle'];
}
if(empty($post['usertitle']))
{
$post['usertitle']=build_title($post['posts']);
}
}
else
{
$post['usertitle']=$lang['guest'];
}
if(get_user_status($post['userid'])>0)
{
$statusbutton='online';
}
else
{
$statusbutton='offline';
}
$post['user_status']=$lang[$statusbutton];
$post['onlinestatus']="<img src=\"$stylevar[dir]/status/user_$statusbutton.gif\" alt=\"$post[musername] $lang[$statusbutton]\">";
if($localgroup['canviewip'])
{
$post['user_ip']="<img src=\"$stylevar[dir]/status/user_ip.gif\" alt=\"$post[ipaddress]\">";
}
$post['post']=$bbcode->build($post['post'],$post['allowsmilie']);
$attach_query=$DB->query("select * from "._PREFIX_."attachment where postid='$post[postid]'");
while($at = $DB->fetch_array($attach_query))
{
if($at['filesize']>1024)
{
$at['filesize']=ceil($at['filesize']/1024);
if($at['filesize']>1024)
{
$at['filesize']=ceil($at['filesize']/1024).' MB';
}
else
{
$at['filesize'].=' KB';
}
}
else
{
$at['filesize'].=' Byte';
}
$at['img']="<img src=\"images/attach/$at[filetype].gif\">";
$show['attachment']=1;
$post['attachments'].=$TP->GetTemp('thread_attachmentbit');
}
$titleetc="$lang[viewing_post] : $post[title] -- ";
$local['whereurl']='post.php?pid='.$pid;
$local['wheretitle']=addslashes($post['title']);
update_online();
($evalp = $plugins->load('post_post'))?eval($evalp):'';
$post_page.= $TP->GetTemp('post');
}
($evalp = $plugins->load('post_complete'))?eval($evalp):'';
print_page($post_page);
?>