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
include("config.php");
17
include("./includes/functions.inc.php");
18
include ("./languages/lang-$language.php");
19
 
20
if(validCookie($_COOKIE['gshout_auth'])){
21
//include("./includes/header.inc.php");
22
 
23
if ($_POST['action'] == "updateshout") {
24
    if (validCookie($_COOKIE['gshout_auth'])) {
25
		if(updateShout($_POST['id'],$_POST['comment'],$_POST['name'],$_POST['sex'],$_POST['uri'],$_POST['timestamp'],$_POST['ip'],$_POST['reply'])){
26
		$message = _SHOUT_UPDATED;
27
		echo "<script type='text/javascript'>opener.window.location.href='admin.php?page=".$_POST['gotopage']."&message="._SHOUT_UPDATED."';window.close();</script>";
28
		}else{
29
			$error = _ERROR_WRITE_DATA;
30
			header("Location: admin.php?id=".$_POST['id']."&page=".$_POST['gotopage']."&error="._ERROR_WRITE_DATA."");
31
		}
32
    }
33
}
34
 
35
?>
36
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
37
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
38
<head>
39
<title>G-Shout Control Panel&nbsp;&nbsp;&#8250;&nbsp;&nbsp;
40
Edit Shout</title>
41
 
42
 
43
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
44
<meta name="MSSmartTagsPreventParsing" content="TRUE" />
45
<meta http-equiv="expires" content="-1" />
46
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />
47
 
48
<meta name="Generator" content="G-Shout 1.3.1" />
49
 
50
 
51
<link rel="stylesheet" type="text/css" href="skins/default.css" />
52
 
53
<style type="text/css">
54
acronym {
55
  cursor: help;
56
}
57
label {
58
	cursor: pointer;
59
}
60
</style>
61
 
62
<script type="text/javascript">
63
<!--
64
function add_smiley_cp(smiley)
65
{
66
    opener.document.editshout.reply.value += " " + smiley + " ";
67
    opener.window.document.editshout.reply.focus();
68
    window.close();
69
}
70
function about(){
71
window.open('./about.php', 'About', 'width=310,height=395,location=0,menubar=0,toolbar=0,scrollbars=yes,resizable=0,status=0,screenx=245,screeny=103');
72
}
73
//-->
74
</script>
75
 
76
</head>
77
 
78
<body>
79
<?
80
 
81
if(!is_writable($datafile)){
82
	$error = _DATA_UNWRITABLE;
83
} else if (!is_writable("config.php")){
84
	$error = _CONF_UNWRITABLE;
85
} else if (!is_writable($logfile)){
86
	$error = _LOG_UNWRITABLE;
87
} else {
88
}
89
 
90
//stupid way to get data :p
91
$baris = getShoutByID($_GET['id']);
92
	$id = $GLOBALS['id'];
93
	$comment = $GLOBALS['com'];
94
	$name = $GLOBALS['nam'];
95
	$sex = $GLOBALS['sex'];
96
	$uri = $GLOBALS['uri'];
97
	$timestamp = $GLOBALS['timestamp'];
98
	$ip = $GLOBALS['ip'];
99
	$reply = $GLOBALS['reply'];
100
	$redate = $GLOBALS['redate'];
101
 
102
	//don't forget the page
103
	$page = $_GET['page'];
104
 
105
if($emoticons != true){
106
 
107
?>
108
 
109
<div id="content">
110
<table border='0'  cellspacing='0' cellpadding='0' style='width:100%;' >
111
 
112
<?
113
if(isset($_GET['message'])){
114
	echo "<tr><td  class='box'  colspan='2'><div class='itemWrapper'>";
115
	echo "<div class='success'>";
116
	echo $_GET['message'];
117
	echo "</div>";
118
	echo "</div></td></tr>";
119
} else if(isset($_GET['error'])) {
120
	echo "<tr><td  class='box'  colspan='2'><div class='itemWrapper'>";
121
	echo "<div class='alert'>".$_GET['error']."</div>";
122
	echo "</div></td></tr>";
123
} else if(isset($message)) {
124
	echo "<tr><td  class='box'  colspan='2'><div class='itemWrapper'>";
125
	echo "<div class='alert'>".$message."</div>";
126
	echo "</div></td></tr>";
127
} else if(isset($error)) {
128
	echo "<tr><td  class='box'  colspan='2'><div class='itemWrapper'>";
129
	echo "<div class='alert'>".$error."</div>";
130
	echo "</div></td></tr>";
131
} else {
132
	echo "<tr><td><div class='success'>&nbsp;</div></td></tr>";
133
}
134
?>
135
</table>
136
 
137
<form name="editshout" method="post" action="pop_editshout.php">
138
<input type="hidden" name="id" value="<?=$id?>" />
139
<input type="hidden" name="timestamp" value="<?=$timestamp?>" />
140
<input type="hidden" name="gotopage" value="<?=$page?>" />
141
<input type="hidden" name="redate" value="<?=$redate?>" />
142
  <table width="53%" border="0" cellspacing="0" cellpadding="2" class="">
143
  <tr align="left" valign="top"> 
144
    <td width="20%"><div class="itemTitle">ID</div></td>
145
    <td width="80%">
146
	<div class='default'><?=$id?></div>
147
	</td>
148
  </tr>
149
  <tr align="left" valign="top"> 
150
    <td width="20%"><div class="itemTitle"><?=_DATE?></div></td>
151
    <td width="80%">
152
	<div class='default'><?=formattanggal($timestamp)?></div>
153
	</td>
154
  </tr>
155
    <tr align="left" valign="top"> 
156
    <td width="20%"><div class="itemTitle"><?=_NAME?></div></td>
157
    <td width="80%">
158
      <input class="input" type="text" name="name" size="35" value="<?=$name?>" />
159
	  </td>
160
  </tr>
161
  <tr align="left" valign="top"> 
162
    <td width="20%"><div class="itemTitle"><?=_SEX?></div></td>
163
    <td width="80%"> 
164
      <input id="sexm" class="radio" type="radio" name="sex" size="35" value="m" <?if($sex=="m"){$checked="checked='checked'";echo $checked;}?> /><label for="sexm">&nbsp;<?=_MALE?>&nbsp;</label>&nbsp;&nbsp;
165
      <input id="sexf" class="radio" type="radio" name="sex" size="35" value="f" <?if($sex=="f"){$checked="checked='checked'";echo $checked;}?> /><label for="sexf">&nbsp;<?=_FEMALE?>&nbsp;</label>&nbsp;&nbsp;
166
    </td>
167
  </tr>
168
  <tr align="left" valign="top"> 
169
    <td width="20%"><div class="itemTitle"><?=_IP_ADDRESS?></div></td>
170
    <td width="80%"> 
171
      <input class="input" type="text" name="ip" size="35" value="<?=$ip?>" />
172
    </td>
173
  </tr>
174
  <tr align="left" valign="top"> 
175
    <td width="20%"><div class="itemTitle"><?=_WEB_EMAIL?></div></td>
176
    <td width="80%"> 
177
      <input class="input" type="text" name="uri" size="35" value="<?=$uri?>" />
178
    </td>
179
  </tr>
180
  <tr align="left" valign="top"> 
181
    <td width="20%"><div class="itemTitle"><?=_MESSAGE?></div></td>
182
    <td width="80%"> 
183
      <textarea class="textarea" name="comment" cols="35" wrap="VIRTUAL" rows="4"><?=stripslashes($comment)?></textarea>
184
    </td>
185
  </tr>
186
  <tr align="left" valign="top"> 
187
    <td>
188
	&nbsp;
189
    </td>
190
  </tr>
191
  <tr align="left" valign="top"> 
192
    <td width="20%"><div class="itemTitle"><?=_REPLYDATE?></div></td>
193
    <td width="80%"> 
194
      <div class='default'><? if($redate==""){echo formattanggal(time());}else{echo formattanggal($redate);}?></div>
195
    </td>
196
  </tr>
197
    <tr align="left" valign="top"> 
198
    <td width="20%"><div class="itemTitle"><?=_REPLY?></div></td>
199
    <td width="80%"> 
200
      <textarea class="textarea" name="reply" cols="35" wrap="VIRTUAL" rows="4"><?=stripslashes($reply)?></textarea>
201
	  <div align="right"><a href="pop_editshout.php?emoticons=true" onclick="window.open(this.href, '_blank', 'width=300,height=300,scrollbars=yes,resizable=no,status=yes,screenx=250,screeny=100');return false;">Emoticons</a></div>
202
    </td>
203
  </tr>
204
  <tr align="left" valign="top"> 
205
    <td width="20%"> 
206
      <input type="hidden" name="timestamp" value="<?=$timestamp?>" />
207
      <input type="hidden" name="action" value="updateshout" />
208
    </td>
209
    <td width="80%"> 
210
      <input type="submit" name="Submit" value="Update Shout" class="submit" />
211
    </td>
212
  </tr>
213
</table>
214
</form>
215
 
216
<?
217
} else if(validCookie($_COOKIE['gshout_auth']) AND $emoticons == TRUE) {
218
	array_walk ($smileys, 'alter_smiley', $smileydir);
219
	reset ($smileys);
220
	echo ("<div class=\"smileys\">");
221
	showEmoticons();
222
	echo ("</div>");
223
	echo("&nbsp;<a href=\"javascript:window.close()\">"._CLOSE_WINDOW."</a><br /><br />\n\n");
224
}
225
//include("./includes/footer.inc.php");
226
echo "
227
</body>
228
</html>
229
";
230
} else if (validCookie($_COOKIE['gshout_auth']) AND $_GET['update'] == "sukses") {
231
 
232
echo "";
233
 
234
echo "
235
<br /><br /><br />
236
</body>
237
</html>
238
";
239
} else {
240
	writeLogs_php($_SERVER["REMOTE_ADDR"],"_LOG_LOGIN_EXPIRED","");
241
	header("Location: admin.php?error="._RELOGIN."");
242
}
243
?>