コード例 #1
0
         $i = $work->Fetch(1);
         $i = unserialize($i->messagetext);
         // print_r($i);
         // Figure out what the work items is and Do It!
         switch ($i['Action']) {
             case WL_NEW_PROD:
                 new_product($i['Details']);
                 break;
             case WL_DEL_PROD:
                 delete_product($i['Details']);
                 break;
             case WL_NEW_COMMENT:
                 new_comment($i['Details']);
                 break;
             case WL_DEL_COMMENT:
                 delete_comment($i['Details']);
                 break;
             case WL_CODE_GIVEN:
                 // FILL IN
                 break;
             case WL_CODE_VENDOR_REDEEMED:
                 // FILL IN
                 break;
         }
     }
     $timer->mark('end_work_check');
 } catch (Exception $e) {
     echo "\n**** Error somewhere in worklist queue check (worker.php:74) ***";
 }
 /*
  * STOP LOOKING FOR WORK TO DO
コード例 #2
0
ファイル: comment.php プロジェクト: CelineABong/FloralDiary
<?php

include "../model/commentdb.php";
if ($_POST['method'] == "insert") {
    insert_comment();
}
if ($_POST['method'] == "getall") {
    get_comment();
}
if ($_POST['method'] == "getImgComm") {
    get_imgComment();
}
if ($_POST['method'] == "getUserComm") {
    get_userComment();
}
if ($_POST['method'] == "deleteComment") {
    delete_comment();
}
if ($_POST['method'] == "updateComment") {
    update_comment();
}
コード例 #3
0
        echo get_text('Add');
        ?>
" name="add_comment"/>
                </form>
            </div>
        <?php 
    } else {
        $poll = $_GET['Poll'];
        $poll_status = get_poll_status($poll);
        $reviewee_id = get_poll_reviewee($poll);
        $reviewer_id = get_poll_reviewer($poll);
        $reviewee = get_user_by_id($reviewee_id);
        $reviewer = get_user_by_id($reviewer_id);
        if (isset($_GET['delete_comment'])) {
            if ($_SESSION['user_id'] == $reviewer_id) {
                delete_comment($poll);
            }
        }
        if (isset($_POST['answer_questions']) || isset($_POST['save_questions']) || isset($_POST['add_comment'])) {
            if ($_SESSION['user_id'] == $reviewer_id) {
                if (!isset($_POST['add_comment'])) {
                    $poll = get_poll_by_reviewer_reviewee_batch($_SESSION['user_id'], $reviewee_id, get_running2_batch_id());
                    for ($question = 1; $question < 30; $question++) {
                        $answer = $_POST[$question];
                        answer($poll, $question, $answer);
                    }
                    if (isset($_POST['answer_questions'])) {
                        change_poll_status($poll, 'Ingestuurd');
                        $result = "<p>" . get_text('Poll_send_successfully') . "</p>";
                        if (isset($_POST['comment'])) {
                            $comment = $_POST['comment'];
コード例 #4
0
ファイル: _comments.php プロジェクト: justincawthorne/mt-test
    $title = !empty($article_id) ? ' to ' . $articles_list[$article_id]['title'] : '';
    $initial_content = '
					<h4>Posting a new comment' . $title . '</h4>' . show_comment_form_admin($article_id);
} elseif (isset($_GET['action']) && $_GET['action'] == 'reply') {
    // reply to an existing comment
    $right_text = 'Replying';
    $initial_content = '
					<h4>Replying to a comment</h4>
					<p>(n.b. the comment you\'re replying to is listed below)</p>' . show_comment_form_admin($article_id, $comment_id);
} elseif (isset($_GET['action']) && $_GET['action'] == 'delete') {
    // deletion of a comment
    if (isset($_POST['confirm_delete']) && $_POST['confirm_delete'] == 'Yes') {
        $right_text = 'Deleting';
        $del_comment_id = isset($_POST['comment_id']) ? (int) $_POST['comment_id'] : 0;
        if (!empty($del_comment_id)) {
            $delete = delete_comment($del_comment_id);
            $initial_content = $delete == true ? '<h4>The comment has been deleted</h4>' : '<h4>The comment was not deleted</h4>';
        } else {
            $initial_content = '
							<h4>The comment was not deleted because an invalid id was sent</h4>';
        }
    } else {
        $right_text = 'Delete';
        $initial_content = '
					<h2>Are you sure you want to delete this comment?</h2>
					<form action="' . current_url() . '" method="post" name="confirm_delete">
						<input name="comment_id" type="hidden" value="' . (int) $comment_id . '"/>
						<input name="confirm_delete" type="submit" value="Yes"/>
						<input name="cancel_delete" type="button" value="No" onclick="javascript:history.back();"/>
					</form>
					';
コード例 #5
0
ファイル: delete.php プロジェクト: BlitzFirePlayz/Luna
        // Redirect towards the comment
        redirect('thread.php?pid=' . $id . '#p' . $id);
    }
}
if (isset($_POST['delete'])) {
    // Make sure they got here from the site
    confirm_referrer('delete.php');
    require LUNA_ROOT . 'include/search_idx.php';
    if ($is_thread_comment) {
        // Delete the thread and all of its comments
        delete_thread($cur_comment['tid'], "hard");
        update_forum($cur_comment['fid']);
        redirect('viewforum.php?id=' . $cur_comment['fid']);
    } else {
        // Delete just this one comment
        delete_comment($id, $cur_comment['tid'], $cur_comment['commenter_id']);
        update_forum($cur_comment['fid']);
        // Redirect towards the previous comment
        $result = $db->query('SELECT id FROM ' . $db->prefix . 'comments WHERE thread_id=' . $cur_comment['tid'] . ' AND id < ' . $id . ' ORDER BY id DESC LIMIT 1') or error('Unable to fetch comment info', __FILE__, __LINE__, $db->error());
        $comment_id = $db->result($result);
        redirect('thread.php?pid=' . $comment_id . '#p' . $comment_id);
    }
}
$page_title = array(luna_htmlspecialchars($luna_config['o_board_title']), __('Delete comment', 'luna'));
define('LUNA_ACTIVE_PAGE', 'delete');
require LUNA_ROOT . 'include/parser.php';
$cur_comment['message'] = parse_message($cur_comment['message']);
require load_page('header.php');
if ($action == "reset") {
    require load_page('reset.php');
}
コード例 #6
0
ファイル: users.php プロジェクト: BlitzFirePlayz/Luna
 // Remove them from the online list (if they happen to be logged in)
 $db->query('DELETE FROM ' . $db->prefix . 'online WHERE user_id IN (' . implode(',', $user_ids) . ')') or error('Unable to remove users from online list', __FILE__, __LINE__, $db->error());
 // Should we delete all comments made by these users?
 if (isset($_POST['delete_comments'])) {
     require LUNA_ROOT . 'include/search_idx.php';
     @set_time_limit(0);
     // Find all comments made by this user
     $result = $db->query('SELECT p.id, p.commenter_id, p.thread_id, t.forum_id FROM ' . $db->prefix . 'comments AS p INNER JOIN ' . $db->prefix . 'threads AS t ON t.id=p.thread_id INNER JOIN ' . $db->prefix . 'forums AS f ON f.id=t.forum_id WHERE p.commenter_id IN (' . implode(',', $user_ids) . ')') or error('Unable to fetch comments', __FILE__, __LINE__, $db->error());
     if ($db->num_rows($result)) {
         while ($cur_comment = $db->fetch_assoc($result)) {
             // Determine whether this comment is the "thread comment" or not
             $result2 = $db->query('SELECT id FROM ' . $db->prefix . 'comments WHERE thread_id=' . $cur_comment['thread_id'] . ' ORDER BY commented LIMIT 1') or error('Unable to fetch comment info', __FILE__, __LINE__, $db->error());
             if ($db->result($result2) == $cur_comment['id']) {
                 delete_thread($cur_comment['thread_id']);
             } else {
                 delete_comment($cur_comment['id'], $cur_comment['thread_id'], $cur_comment['commenter_id']);
             }
             update_forum($cur_comment['forum_id']);
         }
     }
 } else {
     // Set all their comments to guest
     $db->query('UPDATE ' . $db->prefix . 'comments SET commenter_id=1 WHERE commenter_id IN (' . implode(',', $user_ids) . ')') or error('Unable to update comments', __FILE__, __LINE__, $db->error());
 }
 // Delete the users
 $db->query('DELETE FROM ' . $db->prefix . 'users WHERE id IN (' . implode(',', $user_ids) . ')') or error('Unable to delete users', __FILE__, __LINE__, $db->error());
 // Delete user avatars
 foreach ($user_ids as $user_id) {
     delete_avatar($user_id);
 }
 // Regenerate the users info cache
コード例 #7
0
ファイル: comment_delete.php プロジェクト: khanhnnvn/OKMS
<?php

//Delete comment
require_once '../includes/functions.inc.php';
$comid = isset($_POST['comid']) ? $_POST['comid'] : '';
delete_comment($comid);
コード例 #8
0
    header("location: index.php");
    die;
}
//----------------------------------end register and login------------------------------//
//-----------------------------begin wall post and comment page-------------------------//
if (isset($_POST['action']) && $_POST['action'] == "message") {
    post_message($_POST);
}
if (isset($_POST['action']) && $_POST['action'] == "comment") {
    comment($_POST);
}
if (isset($_POST['action']) && $_POST['action'] == "delete_post") {
    delete_post($_POST);
}
if (isset($_POST['action']) && $_POST['action'] == "delete_comment") {
    delete_comment($_POST);
}
if (isset($_SESSION['main_errors'])) {
    header("location: main.php");
}
//===========================below all methods===========================//
function has_number($str)
{
    for ($i = 0; $i < strlen($str); $i++) {
        if (is_numeric($str[$i])) {
            return true;
        }
    }
    return false;
}
function register($post)
コード例 #9
0
ファイル: settings.php プロジェクト: BlitzFirePlayz/Luna
 // Remove him/her from the online list (if they happen to be logged in)
 $db->query('DELETE FROM ' . $db->prefix . 'online WHERE user_id=' . $id) or error('Unable to remove user from online list', __FILE__, __LINE__, $db->error());
 // Should we delete all comments made by this user?
 if (isset($_POST['delete_comments'])) {
     require LUNA_ROOT . 'include/search_idx.php';
     @set_time_limit(0);
     // Find all comments made by this user
     $result = $db->query('SELECT p.id, p.thread_id, t.forum_id FROM ' . $db->prefix . 'comments AS p INNER JOIN ' . $db->prefix . 'threads AS t ON t.id=p.thread_id INNER JOIN ' . $db->prefix . 'forums AS f ON f.id=t.forum_id WHERE p.commenter_id=' . $id) or error('Unable to fetch comments', __FILE__, __LINE__, $db->error());
     if ($db->num_rows($result)) {
         while ($cur_comment = $db->fetch_assoc($result)) {
             // Determine whether this comment is the "thread comment" or not
             $result2 = $db->query('SELECT id FROM ' . $db->prefix . 'comments WHERE thread_id=' . $cur_comment['thread_id'] . ' ORDER BY commented LIMIT 1') or error('Unable to fetch comment info', __FILE__, __LINE__, $db->error());
             if ($db->result($result2) == $cur_comment['id']) {
                 delete_thread($cur_comment['thread_id']);
             } else {
                 delete_comment($cur_comment['id'], $cur_comment['thread_id'], $id);
             }
             update_forum($cur_comment['forum_id']);
         }
     }
 } else {
     // Set all his/her comments to guest
     $db->query('UPDATE ' . $db->prefix . 'comments SET commenter_id=1 WHERE commenter_id=' . $id) or error('Unable to update comments', __FILE__, __LINE__, $db->error());
 }
 // Delete the user
 $db->query('DELETE FROM ' . $db->prefix . 'users WHERE id=' . $id) or error('Unable to delete user', __FILE__, __LINE__, $db->error());
 // Delete user avatar
 delete_avatar($id);
 // Regenerate the users info cache
 if (!defined('LUNA_CACHE_FUNCTIONS_LOADED')) {
     require LUNA_ROOT . 'include/cache.php';
コード例 #10
0
 case 'allcomments':
 case 'adminreplied':
     //Manager variables
     $manager_title = 'Approved Comments';
     //Comments variables
     $status = 'APPROVED';
     break;
 case 'pendingcomments':
     //Manager variables
     $manager_title = 'Pending Comments';
     //Comments variables
     $status = 'PENDING';
     break;
 case 'deletecomment':
     if (isset($_GET['commentid']) && isset($_GET['status'])) {
         if (delete_comment($_GET['commentid'])) {
             $alert_msg = '<div class="success-msg"><p>Comment has been deleted successfully.</p></div>';
         } else {
             $alert_msg = '<div class="warning-msg"><p>Comment could not be deleted, please try again.</p></div>';
         }
         $manager_title = ucfirst(strtolower($_GET['status'])) . ' comments';
         $status = $_GET['status'];
     }
     break;
 case 'approvecomment':
     if (isset($_GET['commentid']) && $_GET['status'] == 'PENDING') {
         if (approve_comment($_GET['commentid'])) {
             $alert_msg = '<div class="success-msg"><p>Comment was approved successfully. Now is under <strong>All Comments</strong> section.</p></div>';
         } else {
             $alert_msg = '<div class="warning-msg"><p>Unable to approved comment, please try again.</p></div>';
         }
コード例 #11
0
ファイル: bug.php プロジェクト: stof/pearweb
    exit;
}
$previous = $current = array();
// Delete comment
if ($edit === 1 && isset($auth_user) && $auth_user && $auth_user->registered) {
    $addon = '';
    if (isset($_GET['hide_comment']) && auth_check('pear.dev')) {
        hide_comment($id, (int) $_GET['hide_comment']);
        $addon = '&thanks=1';
    }
    if (isset($_GET['show_comment']) && auth_check('pear.bug.admin')) {
        show_comment($id, (int) $_GET['show_comment']);
        $addon = '&thanks=1';
    }
    if (isset($_GET['delete_comment']) && auth_check('pear.bug.admin')) {
        delete_comment($id, (int) $_GET['delete_comment']);
        $addon = '&thanks=1';
    }
    if ($addon !== '') {
        localRedirect("bug.php?id={$id}&edit=1{$addon}");
        exit;
    }
}
// handle any updates, displaying errors if there were any
$errors = array();
if (isset($_POST['addpatch'])) {
    //handle patch upload
    require 'handle-patch.php';
} else {
    if (isset($_POST['ncomment']) && !isset($_POST['preview']) && $edit == 3) {
        // Submission of additional comment by others
コード例 #12
0
    exit;
}
/*
 * On vérifie que le paramètre passé dans l'url est bien un entier car l'identifiant est un entier
 */
if (isset($_REQUEST['promote']) && is_numeric($_REQUEST['promote'])) {
    promote_user($_REQUEST['promote']);
}
if (isset($_REQUEST['delete']) && is_numeric($_REQUEST['delete'])) {
    delete_user($_REQUEST['delete']);
}
if (isset($_REQUEST['validComment']) && is_numeric($_REQUEST['validComment'])) {
    accept_comment($_REQUEST['validComment']);
}
if (isset($_REQUEST['deleteComment']) && is_numeric($_REQUEST['deleteComment'])) {
    delete_comment($_REQUEST['deleteComment']);
}
?>
<html lang="fr">
    <head>
        <meta charset="utf8" />
        <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
        <link href='https://fonts.googleapis.com/css?family=Righteous' rel='stylesheet' type='text/css'>
    </head>
    <body>
        <header>
            <h1>The Festival</h1>
            <nav>
                <ul class="nav nav-tabs">
                    <li class="nav-tabs li"><a href="artists.php">Artiste</a></li>
                    <li class="nav-tabs li"><a href="index.php">Acceuil</a></li>
コード例 #13
0
ファイル: delete-comment.php プロジェクト: xeewi/xwBugTracker
<?php

if (!defined("_BASE_URL")) {
    die("Pirate reconnu !");
}
if (!empty($_SESSION['user_ID']) && !empty($_SESSION['team_ID'])) {
    if (!empty($_GET['projet'])) {
        if (isset($_GET['com_ID'])) {
            require_once 'model/comment/delete-comment.php';
            $com = delete_comment($_GET['com_ID']);
            if ($com) {
                header('Location: ?module=bug&action=simple-bug&projet=' . $_GET['projet'] . '&bugid=' . $_GET['bugid'] . '&notif=deleted');
            } else {
                header('Location: ?module=bug&action=simple-bug&projet=' . $_GET['projet'] . '&bugid=' . $_GET['bugid'] . '&notif=notdeleted');
            }
        } else {
            header('Location: ?module=home');
        }
    } else {
        header('Location: ?module=home');
    }
} else {
    header('Location: ?module=auth');
}
コード例 #14
0
require_once MODULE_DIR . "productcatalog/mod.variable.inc";
require_once MODULE_DIR . "productcatalog/mod.product.substructure.inc";
//require_once(MODULE_DIR . "sitevariables/mod.sitevariables.inc");
if (!$objIPAccess->fnValidate($arrAllowIP["access"], $_SERVER["REMOTE_ADDR"]) or $objIPAccess->fnValidate($arrAllowIP["deny"], $_SERVER["REMOTE_ADDR"])) {
    header("Location: " . LOGINCENTER_PATH);
}
if (!is_object($_SESSION["user"])) {
    header("Location: " . LOGINCENTER_PATH);
}
require_once CONFIG_DIR . $_SESSION["lang"] . ".translation.inc";
if ($_GET['action'] == "delete") {
    if ($_GET['items']) {
        $items_arr = explode(";", $_GET["items"]);
        while (list($key, $val) = @each($items_arr)) {
            if (strlen($val) > 0) {
                delete_comment($val);
            }
        }
        header("location: frame.productcomments.php");
        exit;
    }
}
$strTemplate = "content.productcomments.tpl";
$comments = get_all_comments();
$engSmarty->assign("comments", $comments);
// $engSmarty->debug_tpl = "debug.tpl";
//	$engSmarty->debugging = 1;
//	$engSmarty->error_reporting = 512;
$engSmarty->assign("_GET", $_GET);
$engSmarty->assign("boolRefreshTree", $_GET["refreshtree"]);
$engSmarty->assign("arrTranslation", $arrTranslation);
コード例 #15
0
ファイル: functions.inc.php プロジェクト: khanhnnvn/OKMS
function delete_comments_from_pid($pid)
{
    //Delete comments belonged to a post
    $comments = comments_load_by_pid($pid);
    sort($comments);
    foreach ($comments as $comment) {
        delete_comment($comment['Comment_ID']);
    }
}
コード例 #16
0
    check_actions('comment_deleted', $vars);
    $comments = $db->get_results($sql = "SELECT comment_id FROM " . table_comments . " WHERE `comment_parent` = '{$key}'");
    foreach ($comments as $comment) {
        $vars = array('comment_id' => $comment->comment_id);
        check_actions('comment_deleted', $vars);
    }
    $db->query('DELETE FROM `' . table_comments . '` WHERE `comment_parent` = "' . $key . '"');
    $db->query('DELETE FROM `' . table_comments . '` WHERE `comment_id` = "' . $key . '"');
    $link = new Link();
    $link->id = $link_id;
    $link->read();
    $link->recalc_comments();
    $link->store();
}
$sql_query = "SELECT comment_id FROM " . table_comments . " WHERE comment_status = 'discard'";
$result = mysql_query($sql_query);
$num_rows = mysql_num_rows($result);
while ($comment = mysql_fetch_object($result)) {
    delete_comment($comment->comment_id);
}
echo '<div style="padding:8px;margin:14px 2px;border:1px solid #bbb;background:#eee;">';
echo '	<h2 style="font-size: 18px;margin:0;padding:0;border-bottom:1px solid #629ACB;">' . $num_rows . ' ' . $main_smarty->get_config_vars("PLIGG_Visual_AdminPanel_Discarded_Comments_Removed") . '</h2>';
$query = "OPTIMIZE TABLE comments";
mysql_query($query);
if (mysql_error()) {
    echo '	<p style=\'font:13px arial, "Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif;\'>' . mysql_error() . '</p>';
} else {
    echo '	<p style=\'font:13px arial, "Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif;\'>' . $main_smarty->get_config_vars("PLIGG_Visual_AdminPanel_Discarded_Comments_Removed_Message") . '</p>';
}
echo '	<p style=\'font:13px arial, "Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif;\'><a style="color:#094F89;" href="admin_index.php" onclick="parent.$.fn.colorbox.close(); return false;">' . $main_smarty->get_config_vars("PLIGG_Visual_AdminPanel_Return_Comment_Management") . '</a></p>';
echo '</div>';
コード例 #17
0
ファイル: ajax.php プロジェクト: AnthonyReese/Refresh
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
	
	Contact : nicolas.seichepine.org/?action=contact
*/
session_start();
include_once "config.php";
include_once "script_php/pages_secondlevel/actions.php";
$privileges = user_privilege_level();
$login = $_SESSION['login_c'];
// Demande
if (isset($_GET["action"]) && is_string($_GET["action"])) {
    $ccar_to_treat = htmlentities($_GET["action"]);
}
// Appel de la fonction associée à la demande
switch ($ccar_to_treat) {
    // appel de la fonction post par Ajax
    case "post":
        post($_POST['title'], $_POST['message'], $_POST['anonymization'], $_POST['category'], $login, $valid = 0, $output = 'JSON');
        break;
    case "comments":
        get_comments($_POST['thread_id'], $privileges, $login, $output = 'JSON');
        break;
    case "delete_comment":
        delete_comment($_POST['comment_id'], $privileges, $login, $output = 'JSON');
        break;
        // Message d'erreur
    // Message d'erreur
    default:
        // unexistent_page();
        break;
}
コード例 #18
0
ファイル: delete.php プロジェクト: jesus143/fs-dev
<?php

session_start();
require "../../../php_functions/connect.php";
require "../../../php_functions/function.php";
require "../../../php_functions/library.php";
require "../../../php_functions/source.php";
require "../../../php_functions/myclass.php";
$mc = new myclass();
delete_comment($_GET['plcno']);
function delete_comment($plcno)
{
    $deleted = delete('posted_looks_comments', array('plcno', $plcno));
    $deleted = delete('posted_looks_comments_like_dislike', array('plcno', $plcno));
    $deleted = delete('fs_plcm_dislike', array('plcno', $plcno));
    $deleted = delete('fs_cflag', array('plcno', $plcno));
    $creplies = selectV1('*', 'fs_plcm_reply', array('plcno' => $plcno));
    // print_r($creplies);
    if (!empty($creplies)) {
        for ($i = 0; $i < count($creplies); $i++) {
            $plcrno = $creplies[$i]['plcr_no'];
            $rlike = delete('fs_plcm_rlike', array('plcrno', $plcrno));
            $rflag = delete('fs_plcm_rflag', array('plcrno', $plcrno));
            $reply = delete('fs_plcm_reply', array('plcr_no', $plcrno));
            $rdislike = delete('fs_plcm_rdislike', array('plcrno', $plcrno));
        }
        echo "main comment successfully deleted and ( " . count($creplies) . " ) total reply deleted with their specific like , dislike , flagged <br>";
    }
}
$_SESSION['cTblens'] = get_total_len_comment($_SESSION['plno']);
コード例 #19
0
ファイル: index.php プロジェクト: arh922/ain
 case "add_comment":
     $valid = add_comment($_REQUEST['aid'], $_REQUEST['username'], $_REQUEST['comment'], @$_REQUEST['client_id']);
     $response = '{"success":"1","message":"success"}';
     if (!$valid) {
         $response = $callback . '({"proposals":{"success":"0","message":"failed"}})';
     } else {
         $response = get_comments_article($_REQUEST['aid'], @$_REQUEST['callback']);
     }
     echo $response;
     break;
 case "get_comments_article":
     $response = get_comments_article($_REQUEST['aid']);
     echo $response;
     break;
 case "delete_comment":
     $valid = delete_comment($_REQUEST['comment_id'], $_REQUEST['uid']);
     $response = '{"success":"1","message":"success"}';
     if (!$valid) {
         $response = '{"success":"0","message":"failed"}';
     }
     //$callback = trim(@$_REQUEST['callback']);
     /*  $json = $callback . '({
             "proposals": 
         ';   */
     $json .= $response;
     /* $json .= '})';       */
     echo $json;
     break;
 case "edit_comment":
     $valid = edit_comment($_REQUEST['id'], $_REQUEST['uid'], $_REQUEST['comment']);
     $response = '{"success":"1","message":"success"}';
コード例 #20
0
ファイル: bug.php プロジェクト: phpsource/web-bugs
            }
            redirect("bug.php?id={$bug_id}&thanks={$thanks}");
        }
    }
    // If we get here, display errors
    response_header('Error in subscription');
    display_bug_error($errors);
    response_footer();
    exit;
}
// Delete comment
if ($edit == 1 && $is_trusted_developer && isset($_GET['delete_comment'])) {
    $delete_comment = (int) $_GET['delete_comment'];
    $addon = '';
    if ($delete_comment) {
        delete_comment($bug_id, $delete_comment);
        $addon = '&thanks=1';
    }
    redirect("bug.php?id={$bug_id}&edit=1{$addon}");
}
// captcha is not necessary if the user is logged in
if (!$logged_in) {
    require_once 'Text/CAPTCHA/Numeral.php';
    $numeralCaptcha = new Text_CAPTCHA_Numeral();
}
$trytoforce = isset($_POST['trytoforce']) ? (int) $_POST['trytoforce'] : 0;
// fetch info about the bug into $bug
if (!isset($bug)) {
    $bug = bugs_get_bug($bug_id);
}
// DB error
コード例 #21
0
ファイル: index.php プロジェクト: Harrmalik/vacation-blog
     include 'views/edit.php';
 } else {
     if ($action == 'commentEdited') {
         //Edits the desired comment and saves it to the databse then reloads the vacation spots page
         $newContent = nl2br($_POST['content']);
         $cleanHTML = sanitize_html_string($newContent);
         $commentID = $_POST['commentID'];
         $destinationID = $_POST['destinationID'];
         edit_comment($cleanHTML, $commentID);
         header('Location: ?action=viewDestination&destinationID=' . $destinationID);
     } else {
         if ($action == 'deleteComment') {
             //Deletes the desired comment
             $commentID = $_POST['commentID'];
             $destinationID = $_POST['destinationID'];
             delete_comment($commentID);
             header('Location: ?action=viewDestination&destinationID=' . $destinationID);
         } else {
             if ($action == 'logIn') {
                 //loads the log in page
                 if (isset($_POST['action'])) {
                     $logUserName = $_POST['logUserName'];
                     $logPassword = $_POST['logPassword'];
                     $num = clarify($logUserName, $logPassword);
                     if ($num == 1) {
                         //User endtered correct details
                         $_SESSION['loggedIn'] = true;
                         $_SESSION['user'] = $logUserName;
                         header('Location: index.php');
                     } else {
                         //user entered false details