Exemplo n.º 1
0
                $defcatp = substr(md5($_POST['antispam']), 0, 5);
                $intcapt = $_POST['captcheckout'];
                if ($defcatp == $intcapt) {
                    $gallery->postComment($id, $_POST['comtext']);
                    echo '<script type="text/javascript">document.location.href=document.location.href;</script>';
                } else {
                    show_window(__('Error'), __('Invalid form data'));
                }
            } else {
                $gallery->postComment($id, $_POST['comtext']);
                echo '<script type="text/javascript">document.location.href=document.location.href;</script>';
            }
        }
    }
    if ((!empty($_POST['gcd']) || @$_POST['gcd'] === '0') && $system->checkForRight('GALLERY')) {
        $gallery->removeComment($id, $_POST['gcd']);
    }
    foreach ($gallery->getComments($id) as $message) {
        show_window('', rcms_parse_module_template('gallery-comment.tpl', $message), 'center');
    }
    if (isset($system->config['forum-guest']) and !LOGGED_IN) {
        show_window(__('Post comment'), __('You are not logined!'), 'center');
    } else {
        show_window(__('Post comment'), rcms_parse_module_template('gallery-form.tpl'), 'center');
    }
} else {
    $data['sizes'] = $gallery->getAvaiableValues('size');
    $data['types'] = $gallery->getAvaiableValues('type');
    $data['keywords'] = $gallery->getAvaiableValues('keywords');
    $linkdata = '?module=' . $module;
    if (!empty($_GET['size']) && !empty($_GET['type'])) {