[geeklog-cvs] geeklog: Source code cosmetics - no change in functionality
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Sun Aug 28 11:08:52 EDT 2011
changeset 8361:378bdebe026f
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/378bdebe026f
user: Dirk Haun <dirk at haun-online.de>
date: Sun Jun 19 10:00:50 2011 +0200
description:
Source code cosmetics - no change in functionality
diffstat:
public_html/comment.php | 77 ++++++++++++++++++++++++------------------------
1 files changed, 38 insertions(+), 39 deletions(-)
diffs (96 lines):
diff -r fbac38af8fc7 -r 378bdebe026f public_html/comment.php
--- a/public_html/comment.php Sun Jun 19 09:43:46 2011 +0200
+++ b/public_html/comment.php Sun Jun 19 10:00:50 2011 +0200
@@ -105,54 +105,53 @@
*/
function handleSubmit()
{
- global $_CONF, $_TABLES, $_USER, $LANG03;
+ global $_CONF, $_TABLES, $LANG03;
$display = '';
$type = COM_applyFilter($_POST['type']);
$sid = COM_applyFilter($_POST['sid']);
+ $pid = COM_applyFilter($_POST['pid'], true);
+ $postmode = COM_applyFilter($_POST['postmode']);
$title = strip_tags(COM_stripslashes($_POST['title']));
- switch ( $type ) {
- case 'article':
- $commentcode = DB_getItem ($_TABLES['stories'], 'commentcode',
- "sid = '$sid'" . COM_getPermSQL('AND')
- . " AND (draft_flag = 0) AND (date <= NOW()) "
- . COM_getTopicSQL('AND'));
- if (!isset($commentcode) || ($commentcode != 0)) {
- return COM_refresh($_CONF['site_url'] . '/index.php');
- }
+ if ($type == 'article') {
- $ret = CMT_saveComment ( $title,
- $_POST['comment'], $sid, COM_applyFilter ($_POST['pid'], true),
- 'article', COM_applyFilter ($_POST['postmode']));
+ $commentcode = DB_getItem($_TABLES['stories'], 'commentcode',
+ "(sid = '$sid') AND (draft_flag = 0) AND (date <= NOW())"
+ . COM_getPermSQL('AND') . COM_getTopicSQL('AND'));
+ if (!isset($commentcode) || ($commentcode != 0)) {
+ return COM_refresh($_CONF['site_url'] . '/index.php');
+ }
- if ($ret == -1) {
- $url = COM_buildUrl($_CONF['site_url'] . '/article.php?story='
- . $sid);
- $url .= (strpos($url, '?') ? '&' : '?') . 'msg=15';
- $display = COM_refresh($url);
- } elseif ( $ret > 0 ) { // failure //FIXME: some failures should not return to comment form
- $display .= COM_siteHeader ('menu', $LANG03[1])
- . CMT_commentForm ($title, $_POST['comment'],
- $sid, COM_applyFilter($_POST['pid']), $type,
- $LANG03[14], COM_applyFilter($_POST['postmode']))
- . COM_siteFooter();
- } else { // success
- $comments = DB_count ($_TABLES['comments'], 'sid', $sid);
- DB_change ($_TABLES['stories'], 'comments', $comments, 'sid', $sid);
- COM_olderStuff (); // update comment count in Older Stories block
- $display = COM_refresh (COM_buildUrl ($_CONF['site_url']
- . "/article.php?story=$sid"));
- }
- break;
- default: // assume plugin
- if ( !($display = PLG_commentSave($type, $title,
- $_POST['comment'], $sid, COM_applyFilter ($_POST['pid'], true),
- COM_applyFilter ($_POST['postmode']))) ) {
- $display = COM_refresh ($_CONF['site_url'] . '/index.php');
- }
- break;
+ $ret = CMT_saveComment($title, $_POST['comment'], $sid, $pid,
+ 'article', $postmode);
+ if ($ret == -1) {
+ $url = COM_buildUrl($_CONF['site_url'] . '/article.php?story='
+ . $sid);
+ $url .= (strpos($url, '?') ? '&' : '?') . 'msg=15';
+ $display = COM_refresh($url);
+ } elseif ($ret > 0) { // failure
+ // FIXME: some failures should not return to comment form
+ $display .= COM_siteHeader('menu', $LANG03[1])
+ . CMT_commentForm($title, $_POST['comment'], $sid, $pid,
+ $type, $LANG03[14], $postmode)
+ . COM_siteFooter();
+ } else { // success
+ $comments = DB_count($_TABLES['comments'], 'sid', $sid);
+ DB_change($_TABLES['stories'], 'comments', $comments, 'sid', $sid);
+ COM_olderStuff(); // update comment count in Older Stories block
+ $display = COM_refresh(COM_buildUrl($_CONF['site_url']
+ . "/article.php?story=$sid"));
+ }
+
+ } else { // assume plugin
+
+ if (!($display = PLG_commentSave($type, $title, $_POST['comment'],
+ $sid, $pid, $postmode))) {
+ $display = COM_refresh($_CONF['site_url'] . '/index.php');
+ }
+
}
return $display;
More information about the geeklog-cvs
mailing list