-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
208 lines (181 loc) · 5.76 KB
/
index.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
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
<?php
$usedtemplates='right_side_forum';
require ('global.php');
$title='Mr7a World Of Fun | ãÑÍÇ ¡ ÚÇáã ãä ÇáãÑÍ';
$action=($_GET['act'])?$_GET['act']:'home';
if($action == 'thread')
{
$id=$_GET['id'];
header('location:/cc/showthread.php?t='.$id);
die();
}
elseif($action == 'rss')
{
Echo "<?xml version=\"1.0\" encoding=\"windows-1256\"?>
<rss version=\"2.0\">
<channel>
<title>:: Mr7a World Of Fun | ãÑÍÇ ¡ ÚÇáã ãä ÇáãÑÍ ::</title>
<description>ÃÝáÇã ÇÛÇäí ÈÑÇãÌ ãÓáÓáÇÊ ãæÇÖíÚ ËÞÇÝÉ ÊÑÝíå ãÞÇØÚ ÇáÚÇÈ ÌæÇáÇÊ movies songs programs video games</description>
<link>http://www.mr7a.com/</link>
<pubDate>".date("D, d M Y h:m:s",time())."</pubDate>
<ttl>20</ttl>
<image>
<title>:: Mr7a World Of Fun | ãÑÍÇ ¡ ÚÇáã ãä ÇáãÑÍ ::</title>
<url>http://www.mr7a.com/MR-logo.png</url>
<link>http://www.mr7a.com/index.html</link>
</image>
";
$query=$DB->query("select * from forum where parentid != '-1'");
while($forum=$DB->fetch_array($query))
{
Echo " <item>
<title>".$forum['title_clean']."</title>
<link>http://www.mr7a.com/ff$forum[forumid]/".str_replace($fnd,$rpl,$forum['title_clean']).".html</link>
<description><![CDATA[ $forum[description_clean] ]]></description>
<pubDate>".date("D, d M Y h:m:s",$forum['lastpost'])." GMT</pubDate>
<guid>http://www.mr7a.com/ff$forum[forumid]/".str_replace($fnd,$rpl,$forum['title_clean']).".html</guid>
</item>"; $forums[$fetchf[parentid]][$fetchf[displayorder]][$fetchf[forumid]]=$fetchf;
}
Echo "
</channel>
</rss>";
die();
}
elseif($action == 'home')
{
$left_bits='';
$query=$DB->query("select * from thread where 1=1 order by lastpost desc limit 0,20");
while($row = $DB->fetch_array($query))
{
//$row['url']='/tt'.$row['threadid'].'/'.cleartitle($row['title']).'.html';
$row['url']='/cc/threads/'.$row['threadid'].'-'.cleartitle($row['title']);
$row['desc']="By : $row[postusername] -
Replies : $row[replycount] -
Views: $row[views] -
Last Post By: $row[lastposter]";
$link=array( 'title' => $row['title'],
'url' => $row['url'],
'desc' => $row['desc']);
$TP->ass('art',$link);
$left_bits.=$TP->GetTemp('right_side_bit');
}
$TP->ass('right_last_bits',$left_bits);
$left_bits='';
$query=$DB->query("select * from thread where 1=1 order by rand() desc limit 0,10");
while($row = $DB->fetch_array($query))
{
$row['url']='/cc/threads/'.$row['threadid'].'-'.cleartitle($row['title']);
//$row['url']='/tt'.$row['threadid'].'/'.cleartitle($row['title']).'.html';
$row['desc']="By : $row[postusername] -
Replies : $row[replycount] -
Views: $row[views] -
Last Post By: $row[lastposter]";
$link=array( 'title' => $row['title'],
'url' => $row['url'],
'desc' => $row['desc']);
$TP->ass('art',$link);
$left_bits.=$TP->GetTemp('right_side_bit');
}
$TP->ass('right_rand_bits',$left_bits);
$TP->ass('right_contents',$TP->GetTemp('right_side'));
}
elseif($action == 'forum')
{
$id=intval($_GET['id']);
$q=$DB->query('select * from forum where forumid='."'$id'");
$forum=$DB->fetch_array($q);
$TP->ass('forum',$forum);
$right_bits='';
$page=($_GET['page'])?$_GET['page']:1;
if($page > 1){ $etc = ' - Page '.$page; }
$title=$forum['title_clean'].$etc;
$start=($page*20)-20;
$query=$DB->query("select * from thread where forumid='$forum[forumid]' order by lastpost desc limit $start,20");
while($row = $DB->fetch_array($query))
{
//$row['url']='/tt'.$row['threadid'].'/'.cleartitle($row['title']).'.html';
$row['url']='/cc/threads/'.$row['threadid'].'-'.cleartitle($row['title']);
$row['desc']="By : $row[postusername] -
Replies : $row[replycount] -
Views: $row[views] -
Last Post By: $row[lastposter]";
$link=array( 'title' => $row['title'],
'url' => $row['url'],
'desc' => $row['desc']);
$TP->ass('art',$link);
$right_bits.=$TP->GetTemp('right_side_bit');
}
$TP->ass('right_bits',$right_bits);
$quu=$DB->query('select threadid from thread where forumid=\''.$forum['forumid'].'\'');
$num = $DB->num_rows($quu);
$pages = ceil($num / 20);
$right_pages='';
if($pages < 20)
{
for($i=1;$i<=$pages;$i++)
{
if($page != $i)
{
$right_pages.=" <a href='/ff$forum[forumid]-$i/".str_replace($fnd,$rpl,$forum['title_clean']).".html'>[ $i ]</a> ";
}
else
{
$right_pages.=" [ $i ] ";
}
}
}
else
{
for($i=1;$i<=5;$i++)
{
if($page != $i)
{
$right_pages.=" <a href='/ff$forum[forumid]-$i/".str_replace($fnd,$rpl,$forum['title_clean']).".html'>[ $i ]</a> ";
}
else
{
$right_pages.=" [ $i ] ";
}
}
if(($page > 5 ) && ($page < ($pages-5)))
{
if($page > 8){ $right_pages.=" <a href='/ff$forum[forumid]-8/".str_replace($fnd,$rpl,$forum['title_clean']).".html'> [ ..... ] </a> "; }
for($i=($page-3);$i<=($page+3);$i++)
{
if(($i > 5 ) && ($i < ($pages-5)))
{
if($page != $i)
{
$right_pages.=" <a href='/ff$forum[forumid]-$i/".str_replace($fnd,$rpl,$forum['title_clean']).".html'>[ $i ]</a> ";
}
else
{
$right_pages.=" [ $i ] ";
}
}
}
$right_pages.=" <a href='/ff$forum[forumid]-".($page+6)."/".str_replace($fnd,$rpl,$forum['title_clean']).".html'> [ ..... ] </a> ";
}
else
{
$right_pages.=" <a href='/ff$forum[forumid]-".ceil($pages/2)."/".str_replace($fnd,$rpl,$forum['title_clean']).".html'> [ ..... ] </a> ";
}
for($i=($pages-5);$i<=$pages;$i++)
{
if($page != $i)
{
$right_pages.=" <a href='/ff$forum[forumid]-$i/".str_replace($fnd,$rpl,$forum['title_clean']).".html'>[ $i ]</a> ";
}
else
{
$right_pages.=" [ $i ] ";
}
}
}
$TP->ass('right_pages',$right_pages);
$TP->ass('right_contents',$TP->GetTemp('right_side_forum'));
}
$TP->ass('title',$title);
$TP->WebTemp("main");
$TP->print_page();
?>