author | Dan |
Wed, 07 Nov 2007 16:33:26 -0500 | |
changeset 245 | 54392ae2c222 |
parent 166 | d53cc29308f4 |
child 263 | d57af0b0302e |
permissions | -rw-r--r-- |
1 | 1 |
<?php |
2 |
||
3 |
/* |
|
4 |
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between |
|
166
d53cc29308f4
Rebrand as 1.1.1; everything should now be bumped to "unstable" status
Dan
parents:
142
diff
changeset
|
5 |
* Version 1.1.1 |
1 | 6 |
* Copyright (C) 2006-2007 Dan Fuhry |
7 |
* |
|
8 |
* This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License |
|
9 |
* as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied |
|
12 |
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. |
|
13 |
*/ |
|
14 |
||
15 |
/** |
|
16 |
* Class that handles comments. Has HTML/Javascript frontend support. |
|
17 |
* @package Enano CMS |
|
18 |
* @subpackage Comment manager |
|
19 |
* @license GNU General Public License <http://www.gnu.org/licenses/gpl.html> |
|
20 |
*/ |
|
21 |
||
22 |
class Comments |
|
23 |
{ |
|
24 |
# |
|
25 |
# VARIABLES |
|
26 |
# |
|
27 |
||
28 |
/** |
|
29 |
* Current list of comments. |
|
30 |
* @var array |
|
31 |
*/ |
|
32 |
||
33 |
var $comments = Array(); |
|
34 |
||
35 |
/** |
|
36 |
* Object to track permissions. |
|
37 |
* @var object |
|
38 |
*/ |
|
39 |
||
40 |
var $perms; |
|
41 |
||
42 |
# |
|
43 |
# METHODS |
|
44 |
# |
|
45 |
||
46 |
/** |
|
47 |
* Constructor. |
|
48 |
* @param string Page ID of the page to load comments for |
|
49 |
* @param string Namespace of the page to load comments for |
|
50 |
*/ |
|
51 |
||
52 |
function __construct($page_id, $namespace) |
|
53 |
{ |
|
54 |
global $db, $session, $paths, $template, $plugins; // Common objects |
|
55 |
||
56 |
// Initialize permissions |
|
57 |
if ( $page_id == $paths->cpage['urlname_nons'] && $namespace == $paths->namespace ) |
|
58 |
$this->perms =& $GLOBALS['session']; |
|
59 |
else |
|
60 |
$this->perms = $session->fetch_page_acl($page_id, $namespace); |
|
61 |
||
62 |
$this->page_id = $db->escape($page_id); |
|
63 |
$this->namespace = $db->escape($namespace); |
|
64 |
} |
|
65 |
||
66 |
/** |
|
67 |
* PHP 4 constructor. |
|
68 |
* @see Comments::__construct |
|
69 |
*/ |
|
70 |
function Comments($page_id, $namespace) |
|
71 |
{ |
|
72 |
$this->__construct($page_id, $namespace); |
|
73 |
} |
|
74 |
||
75 |
/** |
|
76 |
* Processes a command in JSON format. |
|
77 |
* @param string The JSON-encoded input, probably something sent from the Javascript/AJAX frontend |
|
78 |
*/ |
|
79 |
||
80 |
function process_json($json) |
|
81 |
{ |
|
82 |
global $db, $session, $paths, $template, $plugins; // Common objects |
|
83 |
$parser = new Services_JSON(SERVICES_JSON_LOOSE_TYPE); |
|
84 |
$data = $parser->decode($json); |
|
78
4df25dfdde63
Modified Text_Wiki parser to fully support UTF-8 strings; several other UTF-8 fixes, international characters seem to work reasonably well now
Dan
parents:
74
diff
changeset
|
85 |
$data = decode_unicode_array($data); |
1 | 86 |
if ( !isset($data['mode']) ) |
87 |
{ |
|
86
c162ca39db8f
Finished pagination code (was incomplete in previous revision) and added a few hacks for an upcoming theme
Dan
parents:
78
diff
changeset
|
88 |
$ret = Array('mode'=>'error','error'=>'No mode defined!'); |
c162ca39db8f
Finished pagination code (was incomplete in previous revision) and added a few hacks for an upcoming theme
Dan
parents:
78
diff
changeset
|
89 |
echo $parser->encode($ret); |
c162ca39db8f
Finished pagination code (was incomplete in previous revision) and added a few hacks for an upcoming theme
Dan
parents:
78
diff
changeset
|
90 |
return $ret; |
c162ca39db8f
Finished pagination code (was incomplete in previous revision) and added a few hacks for an upcoming theme
Dan
parents:
78
diff
changeset
|
91 |
} |
c162ca39db8f
Finished pagination code (was incomplete in previous revision) and added a few hacks for an upcoming theme
Dan
parents:
78
diff
changeset
|
92 |
if ( getConfig('enable_comments') == '0' ) |
c162ca39db8f
Finished pagination code (was incomplete in previous revision) and added a few hacks for an upcoming theme
Dan
parents:
78
diff
changeset
|
93 |
{ |
c162ca39db8f
Finished pagination code (was incomplete in previous revision) and added a few hacks for an upcoming theme
Dan
parents:
78
diff
changeset
|
94 |
$ret = Array('mode'=>'error','error'=>'Comments are not enabled on this site.'); |
c162ca39db8f
Finished pagination code (was incomplete in previous revision) and added a few hacks for an upcoming theme
Dan
parents:
78
diff
changeset
|
95 |
echo $parser->encode($ret); |
c162ca39db8f
Finished pagination code (was incomplete in previous revision) and added a few hacks for an upcoming theme
Dan
parents:
78
diff
changeset
|
96 |
return $ret; |
1 | 97 |
} |
98 |
$ret = Array(); |
|
99 |
$ret['mode'] = $data['mode']; |
|
100 |
switch ( $data['mode'] ) |
|
101 |
{ |
|
102 |
case 'fetch': |
|
103 |
if ( !$template->theme_loaded ) |
|
104 |
$template->load_theme(); |
|
105 |
if ( !isset($data['have_template']) ) |
|
106 |
{ |
|
107 |
$ret['template'] = file_get_contents(ENANO_ROOT . '/themes/' . $template->theme . '/comment.tpl'); |
|
108 |
} |
|
108
1c7f59df9474
Implemented some extra functionality for friends/foes in comments; fixed lack of table_prefix in stats.php line 63
Dan
parents:
86
diff
changeset
|
109 |
$q = $db->sql_query('SELECT c.comment_id,c.name,c.subject,c.comment_data,c.time,c.approved,u.user_level,u.user_id,u.signature, b.buddy_id IS NOT NULL AS is_buddy, ( b.is_friend IS NOT NULL AND b.is_friend=1 ) AS is_friend FROM '.table_prefix.'comments AS c |
1 | 110 |
LEFT JOIN '.table_prefix.'users AS u |
111 |
ON (u.user_id=c.user_id) |
|
108
1c7f59df9474
Implemented some extra functionality for friends/foes in comments; fixed lack of table_prefix in stats.php line 63
Dan
parents:
86
diff
changeset
|
112 |
LEFT JOIN '.table_prefix.'buddies AS b |
1c7f59df9474
Implemented some extra functionality for friends/foes in comments; fixed lack of table_prefix in stats.php line 63
Dan
parents:
86
diff
changeset
|
113 |
ON ( ( b.user_id=' . $session->user_id.' AND b.buddy_user_id=c.user_id ) OR b.user_id IS NULL) |
1 | 114 |
WHERE page_id=\'' . $this->page_id . '\' |
108
1c7f59df9474
Implemented some extra functionality for friends/foes in comments; fixed lack of table_prefix in stats.php line 63
Dan
parents:
86
diff
changeset
|
115 |
AND namespace=\'' . $this->namespace . '\' |
1c7f59df9474
Implemented some extra functionality for friends/foes in comments; fixed lack of table_prefix in stats.php line 63
Dan
parents:
86
diff
changeset
|
116 |
GROUP BY c.comment_id |
1c7f59df9474
Implemented some extra functionality for friends/foes in comments; fixed lack of table_prefix in stats.php line 63
Dan
parents:
86
diff
changeset
|
117 |
ORDER BY c.time ASC;'); |
1 | 118 |
$count_appr = 0; |
119 |
$count_total = 0; |
|
120 |
$count_unappr = 0; |
|
121 |
$ret['comments'] = Array(); |
|
122 |
if (!$q) |
|
123 |
$db->die_json(); |
|
124 |
if ( $row = $db->fetchrow() ) |
|
125 |
{ |
|
126 |
do { |
|
127 |
||
128 |
// Increment counters |
|
129 |
$count_total++; |
|
130 |
( $row['approved'] == 1 ) ? $count_appr++ : $count_unappr++; |
|
131 |
||
132 |
if ( !$this->perms->get_permissions('mod_comments') && $row['approved'] == 0 ) |
|
133 |
continue; |
|
134 |
||
135 |
// Send the source |
|
136 |
$row['comment_source'] = $row['comment_data']; |
|
137 |
||
138 |
// Format text |
|
139 |
$row['comment_data'] = RenderMan::render($row['comment_data']); |
|
140 |
||
108
1c7f59df9474
Implemented some extra functionality for friends/foes in comments; fixed lack of table_prefix in stats.php line 63
Dan
parents:
86
diff
changeset
|
141 |
if ( $row['is_buddy'] == 1 && $row['is_friend'] == 0 ) |
1c7f59df9474
Implemented some extra functionality for friends/foes in comments; fixed lack of table_prefix in stats.php line 63
Dan
parents:
86
diff
changeset
|
142 |
{ |
1c7f59df9474
Implemented some extra functionality for friends/foes in comments; fixed lack of table_prefix in stats.php line 63
Dan
parents:
86
diff
changeset
|
143 |
$seed = md5(sha1(mt_rand() . microtime())); |
1c7f59df9474
Implemented some extra functionality for friends/foes in comments; fixed lack of table_prefix in stats.php line 63
Dan
parents:
86
diff
changeset
|
144 |
$wrapper = ' |
1c7f59df9474
Implemented some extra functionality for friends/foes in comments; fixed lack of table_prefix in stats.php line 63
Dan
parents:
86
diff
changeset
|
145 |
<div id="posthide_'.$seed.'" style="display: none;"> |
1c7f59df9474
Implemented some extra functionality for friends/foes in comments; fixed lack of table_prefix in stats.php line 63
Dan
parents:
86
diff
changeset
|
146 |
' . $row['comment_data'] . ' |
1c7f59df9474
Implemented some extra functionality for friends/foes in comments; fixed lack of table_prefix in stats.php line 63
Dan
parents:
86
diff
changeset
|
147 |
</div> |
1c7f59df9474
Implemented some extra functionality for friends/foes in comments; fixed lack of table_prefix in stats.php line 63
Dan
parents:
86
diff
changeset
|
148 |
<p><span style="opacity: 0.4; filter: alpha(opacity=40);">Post from foe hidden.</span> <span style="text-align: right;"><a href="#showpost" onclick="document.getElementById(\'posthide_'.$seed.'\').style.display=\'block\'; this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode); return false;">Display post</a></span></p> |
1c7f59df9474
Implemented some extra functionality for friends/foes in comments; fixed lack of table_prefix in stats.php line 63
Dan
parents:
86
diff
changeset
|
149 |
'; |
1c7f59df9474
Implemented some extra functionality for friends/foes in comments; fixed lack of table_prefix in stats.php line 63
Dan
parents:
86
diff
changeset
|
150 |
$row['comment_data'] = $wrapper; |
1c7f59df9474
Implemented some extra functionality for friends/foes in comments; fixed lack of table_prefix in stats.php line 63
Dan
parents:
86
diff
changeset
|
151 |
} |
1c7f59df9474
Implemented some extra functionality for friends/foes in comments; fixed lack of table_prefix in stats.php line 63
Dan
parents:
86
diff
changeset
|
152 |
|
1 | 153 |
// Format date |
154 |
$row['time'] = date('F d, Y h:i a', $row['time']); |
|
155 |
||
156 |
// Format signature |
|
157 |
$row['signature'] = ( !empty($row['signature']) ) ? RenderMan::render($row['signature']) : ''; |
|
158 |
||
159 |
// Add the comment to the list |
|
160 |
$ret['comments'][] = $row; |
|
161 |
||
162 |
} while ( $row = $db->fetchrow() ); |
|
163 |
} |
|
164 |
$db->free_result(); |
|
165 |
$ret['count_appr'] = $count_appr; |
|
166 |
$ret['count_total'] = $count_total; |
|
167 |
$ret['count_unappr'] = $count_unappr; |
|
168 |
$ret['auth_mod_comments'] = $this->perms->get_permissions('mod_comments'); |
|
169 |
$ret['auth_post_comments'] = $this->perms->get_permissions('post_comments'); |
|
170 |
$ret['auth_edit_comments'] = $this->perms->get_permissions('edit_comments'); |
|
171 |
$ret['user_id'] = $session->user_id; |
|
172 |
$ret['username'] = $session->username; |
|
173 |
$ret['logged_in'] = $session->user_logged_in; |
|
174 |
||
175 |
$ret['user_level'] = Array(); |
|
176 |
$ret['user_level']['guest'] = USER_LEVEL_GUEST; |
|
177 |
$ret['user_level']['member'] = USER_LEVEL_MEMBER; |
|
178 |
$ret['user_level']['mod'] = USER_LEVEL_MOD; |
|
179 |
$ret['user_level']['admin'] = USER_LEVEL_ADMIN; |
|
180 |
||
181 |
$ret['approval_needed'] = ( getConfig('approve_comments') == '1' ); |
|
182 |
$ret['guest_posting'] = getConfig('comments_need_login'); |
|
183 |
||
184 |
if ( $ret['guest_posting'] == '1' && !$session->user_logged_in ) |
|
185 |
{ |
|
186 |
$session->kill_captcha(); |
|
187 |
$ret['captcha'] = $session->make_captcha(); |
|
188 |
} |
|
189 |
break; |
|
190 |
case 'edit': |
|
191 |
$cid = (string)$data['id']; |
|
192 |
if ( !preg_match('#^([0-9]+)$#i', $cid) || intval($cid) < 1 ) |
|
193 |
{ |
|
194 |
echo '{"mode":"error","error":"HACKING ATTEMPT"}'; |
|
195 |
return false; |
|
196 |
} |
|
197 |
$cid = intval($cid); |
|
198 |
$q = $db->sql_query('SELECT c.user_id,c.approved FROM '.table_prefix.'comments c LEFT JOIN '.table_prefix.'users u ON (u.user_id=c.user_id) WHERE comment_id='.$cid.';'); |
|
199 |
if(!$q) |
|
200 |
$db->die_json(); |
|
201 |
$row = $db->fetchrow(); |
|
202 |
$uid = intval($row['user_id']); |
|
203 |
$can_edit = ( ( $uid == $session->user_id && $uid != 1 && $this->perms->get_permissions('edit_comments') ) || ( $this->perms->get_permissions('mod_comments') ) ); |
|
204 |
if(!$can_edit) |
|
205 |
{ |
|
206 |
echo '{"mode":"error","error":"HACKING ATTEMPT"}'; |
|
207 |
return false; |
|
208 |
} |
|
209 |
$data['data'] = str_replace("\r", '', $data['data']); // Windows compatibility |
|
210 |
$text = RenderMan::preprocess_text($data['data'], true, false); |
|
211 |
$text2 = $db->escape($text); |
|
212 |
$subj = $db->escape(htmlspecialchars($data['subj'])); |
|
213 |
$q = $db->sql_query('UPDATE '.table_prefix.'comments SET subject=\'' . $subj . '\',comment_data=\'' . $text2 . '\' WHERE comment_id=' . $cid . ';'); |
|
214 |
if(!$q) |
|
215 |
$db->die_json(); |
|
216 |
$ret = Array( |
|
217 |
'mode' => 'redraw', |
|
218 |
'id' => $data['local_id'], |
|
219 |
'subj' => htmlspecialchars($data['subj']), |
|
220 |
'text' => RenderMan::render($text), |
|
221 |
'src' => $text, |
|
222 |
'approved' => $row['approved'] |
|
223 |
); |
|
224 |
break; |
|
225 |
case 'delete': |
|
226 |
$cid = (string)$data['id']; |
|
227 |
if ( !preg_match('#^([0-9]+)$#i', $cid) || intval($cid) < 1 ) |
|
228 |
{ |
|
229 |
echo '{"mode":"error","error":"HACKING ATTEMPT"}'; |
|
230 |
return false; |
|
231 |
} |
|
232 |
$cid = intval($cid); |
|
233 |
$q = $db->sql_query('SELECT c.user_id FROM '.table_prefix.'comments c LEFT JOIN '.table_prefix.'users u ON (u.user_id=c.user_id) WHERE comment_id='.$cid.';'); |
|
234 |
if(!$q) |
|
235 |
$db->die_json(); |
|
236 |
$row = $db->fetchrow(); |
|
237 |
$uid = intval($row['user_id']); |
|
238 |
$can_edit = ( ( $uid == $session->user_id && $uid != 1 && $this->perms->get_permissions('edit_comments') ) || ( $this->perms->get_permissions('mod_comments') ) ); |
|
239 |
if(!$can_edit) |
|
240 |
{ |
|
241 |
echo '{"mode":"error","error":"HACKING ATTEMPT"}'; |
|
242 |
return false; |
|
243 |
} |
|
244 |
$q = $db->sql_query('DELETE FROM '.table_prefix.'comments WHERE comment_id='.$cid.';'); |
|
245 |
if(!$q) |
|
246 |
$db->die_json(); |
|
247 |
$ret = Array( |
|
248 |
'mode' => 'annihilate', |
|
249 |
'id' => $data['local_id'] |
|
250 |
); |
|
251 |
break; |
|
252 |
case 'submit': |
|
253 |
||
254 |
// Now for a huge round of security checks... |
|
255 |
||
256 |
$errors = Array(); |
|
257 |
||
258 |
// Authorization |
|
259 |
// Like the rest of the ACL system, this call is a one-stop check for ALL ACL entries. |
|
260 |
if ( !$this->perms->get_permissions('post_comments') ) |
|
74
68469a95658d
Various bugfixes and cleanups, too much to remember... see the diffs for what got changed :-)
Dan
parents:
73
diff
changeset
|
261 |
$errors[] = 'The site security policy prevents your user account from posting comments;'; |
1 | 262 |
|
263 |
// Guest authorization |
|
264 |
if ( getConfig('comments_need_login') == '2' && !$session->user_logged_in ) |
|
265 |
$errors[] = 'You need to log in before posting comments.'; |
|
266 |
||
267 |
// CAPTCHA code |
|
268 |
if ( getConfig('comments_need_login') == '1' && !$session->user_logged_in ) |
|
269 |
{ |
|
270 |
$real_code = $session->get_captcha($data['captcha_id']); |
|
271 |
if ( $real_code != $data['captcha_code'] ) |
|
272 |
$errors[] = 'The confirmation code you entered was incorrect.'; |
|
273 |
} |
|
274 |
||
275 |
if ( count($errors) > 0 ) |
|
276 |
{ |
|
277 |
$ret = Array( |
|
278 |
'mode' => 'error', |
|
279 |
'error' => implode("\n", $errors) |
|
280 |
); |
|
281 |
} |
|
282 |
else |
|
283 |
{ |
|
284 |
// We're authorized! |
|
285 |
||
286 |
// Preprocess |
|
287 |
$name = ( $session->user_logged_in ) ? htmlspecialchars($session->username) : htmlspecialchars($data['name']); |
|
288 |
$subj = htmlspecialchars($data['subj']); |
|
289 |
$text = RenderMan::preprocess_text($data['text'], true, false); |
|
290 |
$src = $text; |
|
291 |
$sql_text = $db->escape($text); |
|
292 |
$text = RenderMan::render($text); |
|
293 |
$appr = ( getConfig('approve_comments') == '1' ) ? '0' : '1'; |
|
294 |
$time = time(); |
|
295 |
$date = date('F d, Y h:i a', $time); |
|
296 |
||
297 |
// Send it to the database |
|
298 |
$q = $db->sql_query('INSERT INTO '.table_prefix.'comments(page_id,namespace,name,subject,comment_data,approved, time, user_id) VALUES' . |
|
299 |
"('$this->page_id', '$this->namespace', '$name', '$subj', '$sql_text', $appr, $time, $session->user_id);"); |
|
300 |
if(!$q) |
|
301 |
$db->die_json(); |
|
302 |
||
303 |
// Re-fetch |
|
304 |
$q = $db->sql_query('SELECT c.comment_id,c.name,c.subject,c.comment_data,c.time,c.approved,u.user_level,u.user_id,u.signature FROM '.table_prefix.'comments AS c |
|
305 |
LEFT JOIN '.table_prefix.'users AS u |
|
306 |
ON (u.user_id=c.user_id) |
|
307 |
WHERE page_id=\'' . $this->page_id . '\' |
|
308 |
AND namespace=\'' . $this->namespace . '\' |
|
309 |
AND time='.$time.' ORDER BY comment_id DESC LIMIT 1;'); |
|
310 |
if(!$q) |
|
311 |
$db->die_json(); |
|
312 |
||
313 |
$row = $db->fetchrow(); |
|
314 |
$db->free_result(); |
|
315 |
$row['time'] = $date; |
|
316 |
$row['comment_data'] = $text; |
|
317 |
$row['comment_source'] = $src; |
|
318 |
$ret = Array( |
|
319 |
'mode' => 'materialize' |
|
320 |
); |
|
321 |
$ret = enano_safe_array_merge($ret, $row); |
|
322 |
||
323 |
$ret['auth_mod_comments'] = $this->perms->get_permissions('mod_comments'); |
|
324 |
$ret['auth_post_comments'] = $this->perms->get_permissions('post_comments'); |
|
325 |
$ret['auth_edit_comments'] = $this->perms->get_permissions('edit_comments'); |
|
326 |
$ret['user_id'] = $session->user_id; |
|
327 |
$ret['username'] = $session->username; |
|
328 |
$ret['logged_in'] = $session->user_logged_in; |
|
329 |
$ret['signature'] = RenderMan::render($row['signature']); |
|
330 |
||
331 |
$ret['user_level_list'] = Array(); |
|
332 |
$ret['user_level_list']['guest'] = USER_LEVEL_GUEST; |
|
333 |
$ret['user_level_list']['member'] = USER_LEVEL_MEMBER; |
|
334 |
$ret['user_level_list']['mod'] = USER_LEVEL_MOD; |
|
335 |
$ret['user_level_list']['admin'] = USER_LEVEL_ADMIN; |
|
336 |
||
337 |
} |
|
338 |
||
339 |
break; |
|
340 |
case 'approve': |
|
341 |
if ( !$this->perms->get_permissions('mod_comments') ) |
|
342 |
{ |
|
343 |
$ret = Array( |
|
344 |
'mode' => 'error', |
|
345 |
'error' => 'You are not authorized to moderate comments.' |
|
346 |
); |
|
347 |
echo $parser->encode($ret); |
|
348 |
return $ret; |
|
349 |
} |
|
350 |
||
351 |
$cid = (string)$data['id']; |
|
352 |
if ( !preg_match('#^([0-9]+)$#i', $cid) || intval($cid) < 1 ) |
|
353 |
{ |
|
354 |
echo '{"mode":"error","error":"HACKING ATTEMPT"}'; |
|
355 |
return false; |
|
356 |
} |
|
357 |
$cid = intval($cid); |
|
358 |
$q = $db->sql_query('SELECT subject,approved FROM '.table_prefix.'comments WHERE comment_id='.$cid.';'); |
|
359 |
if(!$q || $db->numrows() < 1) |
|
360 |
$db->die_json(); |
|
361 |
$row = $db->fetchrow(); |
|
362 |
$db->free_result(); |
|
363 |
$appr = ( $row['approved'] == '1' ) ? '0' : '1'; |
|
364 |
$q = $db->sql_query('UPDATE '.table_prefix."comments SET approved=$appr WHERE comment_id=$cid;"); |
|
365 |
if (!$q) |
|
366 |
$db->die_json(); |
|
367 |
||
368 |
$ret = Array( |
|
369 |
'mode' => 'redraw', |
|
370 |
'approved' => $appr, |
|
371 |
'subj' => $row['subject'], |
|
29
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
21
diff
changeset
|
372 |
'id' => $data['local_id'], |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
21
diff
changeset
|
373 |
'approve_updated' => 'yes' |
1 | 374 |
); |
375 |
||
376 |
break; |
|
377 |
default: |
|
378 |
$ret = Array( |
|
379 |
'mode' => 'error', |
|
380 |
'error' => $data['mode'] . ' is not a valid request mode' |
|
381 |
); |
|
382 |
break; |
|
383 |
} |
|
384 |
echo $parser->encode($ret); |
|
385 |
return $ret; |
|
386 |
} |
|
387 |
||
388 |
} // class Comments |
|
389 |