Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

Rev Author Line No. Line
6 kaklik 1
<?php
2
 
3
/************************************************************************/
4
/* G-Shout : Gravitasi Shoutbox                                         */
5
/* ============================================                         */
6
/*                                                                      */
7
/* Copyright (c) 2005 by Yohanes Pradono                                */
8
/* http://gravitasi.com                                                 */
9
/*                                                                      */
10
/* This program is free software. You can redistribute it and/or modify */
11
/* it under the terms of the GNU General Public License as published by */
12
/* the Free Software Foundation; either version 2 of the License.       */
13
/*                                                                      */
14
/************************************************************************/
15
 
16
header("Expires: Sun, 10 Jan 1982 05:00:00 GMT"); // donie's birthday
17
header("Last-Modified: ".gmdate("D, d M Y H:i:s"). " GMT"); // always modified
18
if($SERVER_PROTOCOL == "HTTP/1.0"){
19
header("Pragma: no-cache"); // HTTP/1.0
20
}else{
21
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
22
}
23
 
24
include("config.php");
25
include("./includes/functions.inc.php");
26
include ("./languages/lang-".$language.".php");
27
 
28
/* this is useful if the form becomes one with shoutbox.
29
if($usecookie && $formsubmitted) {
30
 
31
	SetCookie ("gnamec", $gname, time()+2592000);
32
	SetCookie ("guric", $guri, time()+2592000);
33
	SetCookie ("gsexc", $gsex, time()+2592000);
34
	$gnamec = $gname;
35
	$guric = $guri;
36
	$gsexc = $gsex;
37
 
38
} else if (!$usecookie && $formsubmitted) {
39
	SetCookie ("gnamec", $gname, time()-2592000);
40
	SetCookie ("guric", $guri, time()-2592000);
41
	SetCookie ("gsexc", $gsex, time()-2592000);
42
	SetCookie ("gname", $gname, time());
43
	SetCookie ("guri", $guri, time());
44
	SetCookie ("gsex", $gsex, time());
45
}
46
*/
47
 
48
// antiflood system, started from version 1.1
49
if($formsubmitted && !isset($blockflooder) && getTimestampByIP($_SERVER["REMOTE_ADDR"]) >= time()-ceil($floodwait*60)) {
50
	$blockflood = TRUE;
51
} else {
52
	$blockflood = FALSE;
53
}
54
 
55
// DELETION IS SUCCESS OR NOT
56
if ($action == "deleteshout"){
57
        if ($_SERVER["REMOTE_ADDR"] == getIP($id)) {
58
			deleteShout($id);
59
			$message = _PROCESS_DELETED;
60
			} else {
61
				$error = _PROCESS_DELETEFAILED;
62
				}
63
}
64
 
65
?>
66
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
67
<html>
68
<head>
69
<title>G-Shout</title>
70
<meta http-equiv="Content-Type" content="text/html; charset=<?=_CHARSET?>" />
71
<?
72
// to check the HTTP version
73
if($SERVER_PROTOCOL == "HTTP/1.0"){
74
echo("<meta http-equiv=\"pragma\" content=\"no-cache\" />\n");
75
}else{
76
echo("<meta http-equiv=\"Cache-Control\" content=\"no-cache, must-revalidate\" />\n");
77
}
78
?>
79
<meta name="Generator" content="G-Shout <?=$version?>" />
80
 
81
<?
82
// if you want your shoutbox depends on skins when you update skins from admin cpanel, uncomment this out
83
/*
84
<link rel="stylesheet" type="text/css" href="<?echo "skins/".$skin.".css";$hr = "no";?>"/>
85
*/
86
?>
87
 
88
<style type="text/css">
89
<!--
90
.textfield, input, textarea {
91
	font-family: verdana, arial, helvetica, sans-serif;
92
	font-size: 9px;
93
	color: #333333;
94
	background-color: #ffffff;
95
	border: #333333; 
96
	border-style: solid; 
97
	border-top-width: 1px; 
98
	border-right-width: 1px; 
99
	border-bottom-width: 1px; 
100
	border-left-width: 1px;
101
	width: 130;
102
}
103
 
104
html, body, p, td {
105
	scrollbar-face-color: #ffffff; 
106
	scrollbar-shadow-color: #ffffff; 
107
	scrollbar-highlight-color: #ffffff; 
108
	scrollbar-3dlight-color: #ffffff; 
109
	scrollbar-darkshadow-color: #838b8b; 
110
	scrollbar-track-color: #ededed; 
111
	scrollbar-arrow-color: #4169aa;
112
 
113
	font-family: verdana, arial, helvetica, sans-serif;
114
	font-size: 9px;
115
	color: #333333;
116
	background: #fff;
117
}
118
 
119
a {
120
	text-decoration: none;
121
	color: #FF8800;
122
}
123
 
124
a:link {
125
	color: #f30;
126
	text-decoration: none;
127
}
128
 
129
a:vlink {
130
	color: #f30;
131
}
132
 
133
a:alink {
134
	color: #f30;
135
}
136
 
137
a:visited {
138
	color: #f30;
139
}
140
 
141
a:hover {
142
	color: #fff;
143
	background-color:#f30;
144
}
145
 
146
hr {
147
	color: #999999;
148
	width: 100%;
149
	height: 1px;
150
}
151
#yahoo a, #yahoo a:link, #yahoo a:active, #yahoo a:visited, #yahoo a:hover {
152
	color: #ff0000;
153
	font-family: "Courier New", Courier, mono;
154
	font-weight: bold;
155
	font-size: small;
156
	background: none;
157
}
158
div.smileys a.icon, div.smileys a:link.icon, div.smileys a:active.icon, div.smileys a:visited.icon, div.smileys a:hover.icon {
159
	background: none;
160
}
161
 
162
.success {
163
	background: #f0f8ff;
164
	border: 1px solid #69c;
165
	padding: 0.2em 1em 0.2em 1em;
166
}
167
.alert {
168
	background: #fff0f8;
169
	border: 1px solid #cc666f;
170
	padding: 0.2em 1em 0.2em 1em;
171
}
172
 
173
a.delete:link, a.delete:visited {
174
	background: none;
175
	color: red;
176
	font-weight: bold;
177
}
178
a.delete:hover {
179
	background: #c00;
180
	color: #fff;
181
	font-weight: bold;
182
}
183
 
184
a.edit, a.delete, a.edit:hover, a.delete:hover {
185
	border-bottom: none;
186
	display: block;
187
	padding: 5px 0;
188
	text-align: center;
189
	width: 100%;
190
}
191
 
192
label {
193
	cursor: pointer;
194
}
195
-->
196
</style>
197
<script type="text/javascript">
198
<!--
199
function add_smiley(smiley)
200
{
201
	// if help page opened in new window, use this
202
    opener.document.newguest.gcomment.value += " " + smiley + " ";
203
    opener.window.document.newguest.gcomment.focus();
204
    window.close();
205
 
206
	// if help page opened inside the IFRAME, use this
207
	//parent.document.newguest.gcomment.value += " " + smiley + " ";
208
    //parent.window.document.newguest.gcomment.focus();
209
}
210
//-->
211
</script>
212
</head>
213
<body>
214
 
215
<?
216
 
217
// just checking if there is a datafile or not
218
if (is_writable($datafile) AND filesize($datafile) <= 35) {
219
	if($file = fopen($datafile, "w+")) {
220
		fwrite($file, "".$id."#%Hi :D. You can delete this shout from Control Panel. Check G-Shout Website for update. Thanx for using G-Shout.#%");
221
		fwrite($file, "donie#%m#%http://gravitasi.com#%".time()."#%#%#%#%\n");
222
		fclose($file);
223
	}
224
} else if (!is_writable($datafile)) {
225
	$error = _DATA_UNWRITABLE;
226
} else {}
227
 
228
if($formsubmitted && $blockflood && ($floodwait > 0)) {
229
	$error = _PLEASE_WAIT;
230
} else if($formsubmitted) {
231
	$gname = strip_tags($gname);
232
	// if ok, then write the shout to datafile
233
	writeTag($gname, $gsex, $guri, $gcomment);
234
} else {}
235
 
236
// to show success/error message
237
if(isset($message)){
238
	echo "<div class='success'>";
239
	echo $message;
240
	echo "</div><br /><br />";
241
} else if(isset($error)) {
242
	echo "<div class='alert'>".$error."</div><br /><br />";
243
} else {}
244
 
245
 
246
// this function used to show ShoutBox
247
viewShoutBox();
248
 
249
include ("./languages/lang-$language.php");
250
if($help == TRUE){
251
	//echo("<a href=\"javascript:history.go(-1)\">BACK</a><br /><br />\n\n");
252
	echo("<a href=\"javascript:window.close()\">"._CLOSE_WINDOW."</a><br /><br />\n\n");
253
	echo ("<div class=\"smileys\">");
254
	showHelp();
255
	echo ("</div>");
256
    //echo("<a href=\"javascript:history.go(-1)\">BACK</a><br /><br />\n\n");
257
	echo("<a href=\"javascript:window.close()\">"._CLOSE_WINDOW."</a><br /><br />\n\n");
258
} else {
259
 
260
/*******************
261
BEGIN OF PAGINATION
262
*******************/
263
echo "<div align=\"center\">";
264
$shoutcount = countShouts();
265
if (!isset($page)||$page==0) {
266
	//$page=floor($shoutcount/20)+1;
267
	$page=1;
268
	}
269
 
270
$entry = ($commentshown * $page)-$commentshown;
271
$selesai = $commentshown*$page;
272
$output = getShouts($start,20,1);
273
 
274
        if ($page != 1) {
275
            echo "<a href='".$PHP_SELF."?page=1'>[ &lt;&lt; ]</a> <a href='".$PHP_SELF."?page=".($page-1)."&amp;commentshown=".$commentshown."'>[ &lt; ]</a> ";
276
        } else {
277
            echo "<font color='#666666'>[ &lt;&lt; ] [ &lt; ]</font> ";            
278
        }
279
        for ($count=0;$count<$shoutcount;$count=$count+$commentshown) {
280
            $newpage = floor($count/$commentshown) + 1;
281
            if ($page == $newpage) {
282
                echo $newpage." ";
283
            } else {
284
                echo "<a href='".$PHP_SELF."?page=".$newpage."&amp;commentshown=".$commentshown."'>".$newpage."</a> ";
285
            }
286
        }
287
		if ($page != floor($shoutcount/$commentshown)+1) {
288
            echo "<a href='".$PHP_SELF."?page=".($page+1)."&amp;commentshown=".$commentshown."'>[ &gt; ]</a> <a href='".$PHP_SELF."?page=".(floor($shoutcount/$commentshown)+1)."&amp;commentshown=".$commentshown."'>[ &gt;&gt; ]</a>";
289
        } else {
290
            echo "<font color='#666666'>[ &gt; ] [ &gt;&gt; ]</font>";
291
        }
292
echo "</div>";
293
// end of pagination
294
}
295
 
296
?>
297
<br />
298
</body>
299
</html>