function get_comments($file_id)
{
    include 'database.php';
    $result = mysqli_query($connect, "SELECT * FROM `comments` WHERE `file_id`='{$file_id}' AND `is_child`=FALSE ORDER BY `date` DESC");
    $row_cnt = mysqli_num_rows($result);
    echo '<h1>Comments (' . $row_cnt . ')</h1>';
    echo '<div class="comment">';
    new_comment();
    echo '</div>';
    foreach ($result as $item) {
        $date = new dateTime($item['date']);
        $date = date_format($date, 'M j, Y | H:i:s');
        $auth = $item['author'];
        $par_code = $item['com_code'];
        $chi_result = mysqli_query($connect, "SELECT * FROM `comments` WHERE `par_code`='{$par_code}' AND `is_child`=TRUE");
        $chi_cnt = mysqli_num_rows($chi_result);
        echo '<div class="comment" name="' . $item['com_code'] . '">' . '<span class="author">' . $auth . '</span><br />' . $item['comment'] . '<br />' . '<span class="date">Posted: ' . $date . '</span><br />';
        if ($chi_cnt == 0) {
            echo '<span class="replies">No replies</span>' . '<span class="replies">&emsp;Reply</span>';
        } else {
            echo '<span class="replies">[+] ' . $chi_cnt . ' replies</span>' . '<span class="replies"&emsp;Reply</span>';
            add_comment($item['author'], $item['com_code']);
            echo '<div name="children" id="children">';
            foreach ($chi_result as $com) {
                $chi_date = new dateTime($com['date']);
                $chi_date = date_format($chi_date, 'M j, Y | H:i:s');
                echo '<div class="child" name="' . $com['com_code'] . '">' . '<span class="author">' . $com['author'] . '</span><br />' . $com['comment'] . '<br />' . '<span class="date">Posted: ' . $chi_date . '</span><br />' . '</div>';
            }
            echo '</div>';
        }
        echo '</div>';
    }
    mysqli_close($connect);
}
Exemple #2
0
function module_info_main()
{
    switch (post('cmd')) {
        case 'add_message':
            add_message();
            break;
        case 'add_comment':
            add_comment();
            break;
    }
}
Exemple #3
0
<?php

if (!defined("_BASE_URL")) {
    die("Pirate reconnu !");
}
if (!empty($_SESSION['user_ID']) && !empty($_SESSION['team_ID'])) {
    if (!empty($_GET['projet'])) {
        if (!isset($_POST['bug_ID'])) {
            header('Location: ?module=home');
        } else {
            if ($_POST['com_content'] == "") {
                header('Location: ?module=bug&action=simple-bug&projet=' . $_GET['projet'] . '&bugid=' . $_POST['bug_ID'] . '&notif=empty');
            } else {
                require_once 'model/comment/add-comment.php';
                $form = $_POST;
                $form['com_date'] = date('Y-m-d');
                $form['user_ID'] = $_SESSION['user_ID'];
                $com = add_comment($form);
                if ($com) {
                    header('Location: ?module=bug&action=simple-bug&projet=' . $_GET['projet'] . '&bugid=' . $_POST['bug_ID'] . '&notif=com_add');
                } else {
                    header('Location: ?module=bug&action=simple-bug&projet=' . $_GET['projet'] . '&bugid=' . $_POST['bug_ID'] . '&notif=com_bug');
                }
            }
        }
    } else {
        header('Location: ?module=home');
    }
} else {
    header('Location: ?module=auth');
}
 protected function setInfoJigoshop()
 {
     include_once PLUGIN_PATH_SHIPWORKSWORDPRESS . 'functions/jigoshop/functionsJigoshop.php';
     global $wpdb;
     $status = $this->status;
     $table = $wpdb->prefix . "term_taxonomy";
     $row = $wpdb->get_row("SELECT * FROM " . $table . " WHERE term_id = " . $status, ARRAY_A);
     $table = $wpdb->prefix . "term_relationships";
     $this->result = $wpdb->update($table, array('term_taxonomy_id' => $row['term_taxonomy_id']), array('object_id' => $this->order));
     if ($this->result === false) {
         $this->code = 'ERR004';
         $this->description = "The Status coudn't be update in the database";
     } else {
         if ($this->comment != '') {
             add_comment($this->comment, $this->order);
         }
     }
 }
Exemple #5
0
<?php

if (isset($_POST['post'])) {
    $user = trim($_POST['name']);
    $comments = trim($_POST['comments']);
    if (!empty($user) and !empty($comments)) {
        add_comment($page, $user, $comments);
    }
}
$comments = get_comments($page);
?>


<html>
	<head>
		<style>
			/*td{width:120px;}*/
			.form-group {
				max-width: 330px;
				padding: 15px;
				margin: 0 auto;
			}
			.comment {color:black;}
			.date {font-size:1.0em;color:green;}
			.name {color:blue;} 
		</style>
	</head>
	<body>
	<div style="margin:0 auto; padding:10px 0 10px 0; background-color:#3399ff; border: #fff 2px solid; padding:24px; filter:alpha(opacity=10); -moz-opacity=.7; opacity:.9; border-radius:20px;">
		<table border="0" class="table table-striped">
		<caption><b><font style="color:green;">&nbsp;&nbsp;&nbsp;Educational Bakground:</font></b></caption>
Exemple #6
0
    $url = $_POST["url"];
} else {
    if (check_url($_POST["url"]) == "nohttp") {
        $url = "http://" . $_POST["url"];
    } else {
        $url = "";
    }
}
global $config;
$parent_id = intval($_POST["parent"]);
require_once 'plog-functions.php';
$redirect = str_replace("&amp;", "&", generate_url("picture", $parent_id, array(), true));
// If the captcha is required, check it here
if ($_SESSION['require_captcha'] == true) {
    if ($_POST['captcha'] != $_SESSION['captcha'] || !$_POST['captcha']) {
        $_SESSION["comment_post_error"] = "CAPTCHA check failed!";
        header("Location: {$redirect}");
        exit;
    }
}
$rv = add_comment($parent_id, $_POST["author"], $_POST["email"], $url, $_POST["comment"]);
// redirect back to picture page
if ($rv["errors"]) {
    // will this work?
    $_SESSION["comment_post_error"] = $rv["errors"];
} else {
    if ($config['comments_moderate']) {
        $_SESSION["comment_moderated"] = 1;
    }
}
header("Location: {$redirect}");
Exemple #7
0
                            if ($_SESSION['user_id'] > 0) {
                                $sql = "SELECT o.order_id" . " FROM " . $ecs->table('order_info') . " AS o, " . $ecs->table('order_goods') . " AS og " . " WHERE o.order_id = og.order_id" . " AND o.user_id = '" . $_SESSION['user_id'] . "'" . " AND og.goods_id = '" . $cmt->id . "'" . " AND (o.order_status = '" . OS_CONFIRMED . "' or o.order_status = '" . OS_SPLITED . "') " . " AND (o.pay_status = '" . PS_PAYED . "' OR o.pay_status = '" . PS_PAYING . "') " . " AND (o.shipping_status = '" . SS_SHIPPED . "' OR o.shipping_status = '" . SS_RECEIVED . "') " . " LIMIT 1";
                                $tmp = $db->getOne($sql);
                                if (empty($tmp)) {
                                    $result['error'] = 1;
                                    $result['message'] = $_LANG['comment_brought'];
                                }
                            } else {
                                $result['error'] = 1;
                                $result['message'] = $_LANG['comment_brought'];
                            }
                    }
                }
                /* 无错误就保存留言 */
                if (empty($result['error'])) {
                    add_comment($cmt);
                    $_SESSION['send_time'] = $cur_time;
                }
            }
        }
    }
} else {
    /*
     * act 参数不为空
     * 默认为评论内容列表
     * 根据 _GET 创建一个静态对象
     */
    $cmt = new stdClass();
    $cmt->id = !empty($_GET['id']) ? intval($_GET['id']) : 0;
    $cmt->type = !empty($_GET['type']) ? intval($_GET['type']) : 0;
    $cmt->page = isset($_GET['page']) && intval($_GET['page']) > 0 ? intval($_GET['page']) : 1;
    if (isset($_GET['id'])) {
        $id = htmlentities($_GET['id']);
    } else {
        if (isset($_POST['id'])) {
            $id = htmlentities($_POST['id']);
        }
    }
    // Get the details of the risk
    $risk = get_risk_by_id($id);
    $subject = htmlentities($risk[0]['subject']);
}
// Check if a new risk mitigation was submitted
if (isset($_POST['submit'])) {
    $comment = addslashes($_POST['comment']);
    // Add the comment
    add_comment($id, $_SESSION['uid'], $comment);
    // Audit log
    $risk_id = $id;
    $message = "A comment was added to risk ID \"" . $risk_id . "\" by username \"" . $_SESSION['user'] . "\".";
    write_log($risk_id, $_SESSION['uid'], $message);
    // Redirect to plan mitigations page
    header('Location: /management/view.php?id=' . $id . '&comment=true');
}
?>

<!doctype html>
<html>
  
  <head>
    <script src="/js/jquery.min.js"></script>
    <script src="/js/bootstrap.min.js"></script>
Exemple #9
0
<?php

header('Location:search_post.php');
require_once 'db.php';
// this is a person.
if (count($_POST) != 0) {
    if (isset($_POST['action']) && $_POST['action'] == 'comment') {
        add_comment($_GET['id'], $_POST);
    } elseif (isset($_POST['action']) && $_POST['action'] == 'photo') {
        handle_upload($_GET['id']);
    } else {
        update_record($_GET['id'], $_POST);
    }
}
if (!isset($_GET['id'])) {
    header('Location: /');
    exit;
}
$person = load_record($_GET['id']);
if (empty($person)) {
    header('Location: /');
    exit;
}
$updates = get_updates($_GET['id']);
$comments = get_comments($_GET['id']);
$photos = get_photos($_GET['id']);
$searcher = get_searcher($_GET['id']);
$title = $person['fullname'];
//$title = msg('People');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
Exemple #10
0
$post_id = $_GET['id'];
$post = get_post_by_id($post_id);
if (!$post) {
    display_not_found_page();
}
$comments = get_post_comments($post_id);
$comment_text = '';
$errors = [];
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $comment_text = $_POST['comment'];
    if ($comment_text == '') {
        $errors[] = "Коментар не може бути порожнім.";
    }
    if (!$errors) {
        $user_id = get_current_user_id();
        add_comment($post_id, $user_id, $comment_text);
        redirect(APP_URL . '/view_post.php?id=' . $post_id);
    }
}
?>

<!DOCTYPE html>
<head>
    <meta charset="utf-8">
    <title>Tubogram</title>
    <?php 
echo js_and_css();
?>
</head>

<?php 
                            add_poll_comment($poll, $comment);
                            $result = "<p>" . get_text('Comment_added_successfully') . "</p>";
                        }
                    } else {
                        if (isset($_POST['save_questions'])) {
                            change_poll_status($poll, 'Opgeslagen');
                            if (isset($_POST['comment']) && !empty($_POST['comment']) && trim($_POST['comment']) != '') {
                                $comment = $_POST['comment'];
                                add_poll_comment($poll, $comment);
                                $result = "<p>" . get_text('Comment_added_successfully') . "</p>";
                            }
                            $result = "<p>" . get_text('Poll_saved_successfully') . "</p>";
                        }
                    }
                } else {
                    add_comment($reviewee_id, $_POST['comment']);
                }
            }
            ?>
                <div class="topContent">
                    <?php 
            if ($result) {
                echo $result;
            }
            ?>
                    <p><?php 
            echo get_text('Click_next_to_select_new_poll');
            ?>
</p>

                    <p><?php 
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR  TORT 
(INCLUDING  NEGLIGENCE  OR  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
if (!(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest')) {
    die("Call not allowed");
}
//
// Change this email to the real moderator's email
//
$moderator_email = "*****@*****.**";
$flag = processText($_POST["flag"]);
if ($flag === "1") {
    add_comment($moderator_email);
}
if ($flag === "2") {
    read_comment();
}
function strleft($s1, $s2)
{
    return substr($s1, 0, strpos($s1, $s2));
}
function add_comment($moderator_email)
{
    $caller = strtolower($_POST["url"]);
    //$_SERVER['HTTP_REFERER'];
    $filename = md5($caller);
    $abs_comment_file = realpath('.') . '/' . $filename . '.xml';
    $date_value = time();
Exemple #13
0
     }
     $callback = trim($_REQUEST['callback']);
     $json = $callback . '({
                     "proposals": 
             ';
     $json .= $response;
     $json .= '})';
     echo $json;
     break;
 case "check_user_status":
     echo check_user_status($_REQUEST['phone'], $_REQUEST['client_id'], $_REQUEST['callback']);
     break;
     //**********************COMMENTS******************************************************************************
 //**********************COMMENTS******************************************************************************
 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"}';
Exemple #14
0
function comment_add()
{
    date_default_timezone_set('PRC');
    // 中国时区
    if (add_comment(user_name(), _post('content'), date('Y-m-d H:i:s'), _post('tid')) > 0) {
        return ajax_echo('评论成功');
    }
}
<?php

defined("CATALOG") or die("Access denied");
include 'models/main_model.php';
include "models/{$view}_model.php";
echo add_comment();
Exemple #16
0
<?php

require_once "includes.php";
if (!isset($_GET["event"])) {
    header("Location: /" . SITE_ROOT);
}
$event = get_event($_GET["event"]);
if (isset($_POST["text"])) {
    if ($account === false) {
        add_comment($_POST["name"], $_POST["text"], $event["id"]);
    } else {
        $a = get_account_info($account);
        add_comment($a["first_name"] . " " . $a["last_name"], $_POST["text"], $event["id"]);
    }
}
header("Location: view?event=" . $_GET["event"] . "#discussion");
        showmessage('no_privilege_comment', '', array(), array('return' => true));
    }
    cknewuser();
    $waittime = interval_check('post');
    if ($waittime > 0) {
        showmessage('operating_too_fast', '', array('waittime' => $waittime), array('return' => true));
    }
    $id = intval($_POST['id']);
    $idtype = $_POST['idtype'];
    $message = getstr($_POST['message'], 0, 1, 1, 2);
    $cid = empty($_POST['cid']) ? 0 : intval($_POST['cid']);
    if (strlen($message) < 2) {
        showmessage('content_is_too_short', '', array(), array('return' => true));
    }
    require_once libfile('function/comment');
    $cidarr = add_comment($message, $id, $idtype, $cid);
    if ($cidarr['cid'] != 0) {
        showmessage($cidarr['msg'], dreferer(), $cidarr['magvalues'], $_G['gp_quickcomment'] ? array('msgtype' => 3, 'showmsg' => true) : array('showdialog' => 3, 'showmsg' => true, 'closetime' => true));
    } else {
        showmessage('no_privilege_comment', '', array(), array('return' => true));
    }
}
$cid = empty($_GET['cid']) ? 0 : intval($_GET['cid']);
if ($_GET['op'] == 'edit') {
    if ($_G['adminid'] != 1 && $_G['gp_modcommentkey'] != modauthkey($_G['gp_cid'])) {
        $sqladd = "AND authorid='{$_G['uid']}'";
    } else {
        $sqladd = '';
    }
    $query = DB::query("SELECT * FROM " . DB::table('home_comment') . " WHERE cid='{$cid}' {$sqladd}");
    if (!($comment = DB::fetch($query))) {
Exemple #18
0
}
$counter = 1;
while ($blogs = mysql_fetch_array($tagged_blogs)) {
    //this if statement will only allow for the first 3 to be fully displayed
    if ($counter < 4) {
        echo "<div class=\"content\"><h2>" . $blogs['page_name'] . "</h2>\n";
        //author and date
        echo author_date($blogs['date'], $blogs['author']);
        //content
        echo $blogs['content'] . "\n";
        //tag area: the fucntion will get all of the individual strings from the tag field
        echo "<p><span class=\"small\">Tags: " . explode_tags($blogs['tags']) . "</span></p> \n";
        //this will post the comments if they exist
        echo post_comments($blogs['id']);
        // the user to the comment or login page depending on log in status
        echo add_comment($_SESSION['update_authority'], $blogs['id']);
        echo "</p>\n";
        echo "<hr/>\n";
        if ($counter == 3 && $number_returned != 3) {
            echo '<div class= "content"><h3>Older Posts containing the tag: <em>' . $_GET['tag'] . "</em></h3>  \n";
        }
        $value++;
        $counter++;
    } else {
        echo "<h3><a href = \"index.php?page=" . $blogs['id'] . "\">" . $blogs['page_name'] . "</a></h3>\n";
        //author and date
        $date = date("n/j/Y", strtotime($blogs['date']));
        echo "<p><span class = \"small\">by <em>" . $blogs['author'] . "</em> posted: " . $date . "</span></p> \n<hr />  \n</div>";
    }
}
?>
Exemple #19
0
         // should we strip tags out for now and put limited allowability in later?
         $comment = strip_tags(SmartStripSlashes($_POST['comment']));
     } else {
         $comment = '';
         $errors[] = plog_tr('You forgot to enter a comment.');
         $error_field[] = 'comment';
     }
     // If the captcha is required, check it here
     if (isset($_SESSION['require_captcha']) && $_SESSION['require_captcha'] === true) {
         if (!isset($_POST['captcha']) || !isset($_SESSION['captcha']) || $_POST['captcha'] != $_SESSION['captcha']) {
             $errors[] = plog_tr('CAPTCHA check failed.');
             $error_field[] = 'captcha';
         }
     }
     if (empty($errors)) {
         $rv = add_comment($parent_id, $author, $email, $url, $comment);
         // We're done with this so empty it out to stop double posts
         unset($_POST);
         if (isset($rv['errors'])) {
             $errors = $rv['errors'];
         } else {
             if ($config['comments_moderate']) {
                 $_SESSION['comment_moderated'] = 1;
             }
         }
     }
     unset($_SESSION['plogger-token']);
 } else {
     // Missing form token
     $errors = array(plog_tr('Spam token missing or does not match!'));
 }
    return $ft->igberrorpage('Sorry, that complex was not found.');
}
# load this complex
$sched = load_run_schedid($id, $schedid);
if (is_null($sched)) {
    return $ft->igberrorpage('Sorry, that complex scheduled run was not found.');
}
# no comment?
$comment = $_POST['comment'];
if (!$comment) {
    return $ft->igberrorpage('Sorry, you must type something in the comment box.');
}
# see if they are allowed to make comments
# FIXME: implement
if (0) {
    return $ft->igberrorpage('Sorry, you must be an accountant or director in your corporation in order to schedule a run.');
}
# add the comment
add_comment($id, $schedid, $obj->id, $comment);
# store output here
$out = "<center><b><font color='#ffff00'>Plexer - The Complex Scheduler</font></b><br />";
$out .= "<font color='#ff0000'><b>{$plex->name}</b> in <b>{$plex->system}</b> rated <b>{$plex->rating}/10</b></font><br />";
$out .= "[ <a href='{$_WEB_URL}/'>Back to Top</a> ] [ <a href='{$_WEB_URL}/igb-showcomplex.php?id={$id}'>Back to Complex</a> ] ";
$out .= "[ <a href='{$_WEB_URL}/igb-scheduleinfo.php?id={$id}&schedid={$schedid}'>Back to Scheduled Run</a> ]";
$out .= "</center><br />";
$out .= "<p>Your comment has been recorded.  Use one of the links above to continue.</p>";
# all done
echo "<html><title>Plexer - The Complex Scheduler</title><body>{$out}</body></html>";
?>

/**
 * Quick example function of adding a comment.
 */
function add_comment($comment_info, EventDispatcher $EventDispatcher)
{
    // insert the comment into the database
    $sql = sprintf('INSERT INTO comments SET created_by = %d, comment = %s, created_ts = %s', $comment_info['created_by'], '"' . mysql_real_escape_string($comment_info['comment']) . '"', '"' . time() . '"');
    // myqsl_query($sql);
    // notify any event listeners of onCommentAdded
    $EventDispatcher->onCommentAdded->notify($comment_info);
}
// load up an instance of the event handler
$EventDispatcher = new EventDispatcher();
// watch for comment being added and attach notification and logging
$EventDispatcher->onCommentAdded->bind(new EmailNotification(), 'notify');
$EventDispatcher->onCommentAdded->bind(new CommentLogger(), 'comment');
// trigger the bound events for add_comment
add_comment(array('created_by' => 1, 'comment' => 'Lorem ipsum dolor sir amet.'), $EventDispatcher);
/*
You can perform the same thing above by doing the following:

// add a new event
$Events->add('onCommentAdded');

// bind some event handlers to the event
$Events->get('onCommentAdded')->attach(new EmailNotification());
$Events->get('onCommentAdded')->attach(new CommentLogger());

This avoids using the magic method __get(), which is particularly slow.
It really depends on if you want to decrease readability.
*/
Exemple #22
0
     $destinationContent = $destination['destinationContent'];
     //Get image URL and alternate text
     $destinationImage = 'images/' . $imageName . '.jpg';
     $imageAlt = 'Image: ' . $imageName . '.jpg';
     include 'specificDestination.php';
 } else {
     if ($action == 'addComment') {
         //Adds the users comment then reloads the page
         $content = nl2br($_POST['content']);
         $cleanHTML = sanitize_html_string($content);
         $destinationID = $_POST['destinationID'];
         $userAdding = $_SESSION['user'];
         if (empty($cleanHTML)) {
             $error = 'You must type a comment first.';
         } else {
             add_comment($cleanHTML, $destinationID, $userAdding);
             header('Location: ?action=viewDestination&destinationID=' . $destinationID);
         }
     } else {
         if ($action == 'editComment') {
             //loads the edit comment page
             $commentID = $_POST['commentID'];
             $comment = get_comment_By_ID($commentID);
             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'];
Exemple #23
0
    $page = $_GET['p'];
    load($cat, $page);
} else {
    if (isset($_GET['cat'])) {
        $cat = $_GET['cat'];
        $page = 1;
        load($cat, $page);
    } else {
        if (isset($_GET['p']) && is_numeric($_GET['p'])) {
            $cat = 'def';
            $page = $_GET['p'];
            load($cat, $page);
        } else {
            if (isset($_COOKIE['MyCookie']) && isset($_COOKIE['PHPSESSID']) && isset($_COOKIE['Auth']) && check_cookie($_COOKIE['MyCookie'], $_COOKIE['PHPSESSID'], $_COOKIE['Auth']) && isset($_GET['id']) && isset($_POST['comment'])) {
                $id = $_GET['id'];
                add_comment($id, $_POST['comment']);
                load_id($id);
            } else {
                if (isset($_GET['id'])) {
                    $id = $_GET['id'];
                    load_id($id);
                } else {
                    if (isset($_COOKIE['MyCookie']) && isset($_COOKIE['PHPSESSID']) && isset($_COOKIE['Auth']) && check_cookie($_COOKIE['MyCookie'], $_COOKIE['PHPSESSID'], $_COOKIE['Auth']) && isset($_GET['abuse']) && isset($_POST['comment'])) {
                        $abuse = $_GET['abuse'];
                        add_abuse($abuse, $_POST['comment']);
                        $ref = $_SERVER['HTTP_REFERER'];
                        header("Location: " . $ref);
                    } else {
                        if (isset($_GET['abuse'])) {
                            $abuse = $_GET['abuse'];
                            load_abuse($abuse);
Exemple #24
0
if (isset($_GET['action'])) {
    $action = $_GET['action'];
} else {
    $action = '';
}
if ($action == 'add') {
    if (!empty($_POST)) {
        // ваш секретный ключ
        $secret = "6Lf_OQ4TAAAAAODrO91tDS6tpsUk5LT2Jc0jsJ3K";
        // пустой ответ
        $response = null;
        // проверка секретного ключа
        $reCaptcha = new ReCaptcha($secret);
        if ($_POST["g-recaptcha-response"]) {
            $response = $reCaptcha->verifyResponse($_SERVER["REMOTE_ADDR"], $_POST["g-recaptcha-response"]);
        }
        if ($response != null && $response->success) {
            $article_id = (int) $_GET['id'];
            add_comment($link, $_POST['name'], $_POST['email'], $_POST['url'], $_POST['comment'], $article_id);
            header("Location: http://localhost:8080/gitrepo/article.php?id={$article_id}");
        } else {
            $article_id = (int) $_GET['id'];
            header("Location: http://localhost:8080/gitrepo/article.php?id={$article_id}");
        }
    }
    include "Views/article.html";
    $comments = comments_get($link, $article_id);
} else {
    $articles = articles_all($link);
    include "Views/articles.php";
}
Exemple #25
0
        $html = "<h1>Pas d'artiste sous ce nom là.</h1>";
    }
} else {
    global $html;
    $html = "<table><tr><th>Nom de l'artiste</th><th>Biographie</th>";
    $array_result = get_array_all_artist();
    foreach ($array_result as $value) {
        $html .= "<tr>";
        $html .= '<td><a href="artists.php?name=' . $value['nameArtist'] . '">' . $value['nameArtist'] . '</a></td>';
        $html .= "<td>" . $value['bio'] . "</td>";
        $html .= "</tr>";
    }
    $html .= "</table>";
}
if (isset($_REQUEST['AjoutCommentaire'])) {
    add_comment($_REQUEST['contenu'], $_REQUEST['id'], $_REQUEST['idUser'], 'a');
}
?>
 <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">
                   <?php 
if (!isset($_SESSION['pseudo'])) {
Exemple #26
0
function main() {

  allow_cross_domain();
    
  if (@$_GET['file']==='jskomment.js') jskomment_js();
  if (@$_GET['action']==='p') output(add_comment(get_request_data()));
  if (@$_GET['action']==='sx') {
    output(get_comments_as_json());
  }
  if (@$_GET['action']==='s') {
    output(get_single_comment_as_json());
  }
  if (@$_GET['action']==='t') {
    output(json_encode(get_request_data()));
  }

}
         if (!checkperm('allowcomment')) {
             showmessage('no_privilege_comment', '', array(), array('return' => true));
         }
         cknewuser();
         $waittime = interval_check('post');
         if ($waittime > 0) {
             showmessage('operating_too_fast', '', array('waittime' => $waittime), array('return' => true));
         }
         $message = getstr($_POST['general'], 0, 1, 1, 2);
         if (strlen($message) < 2) {
             showmessage('content_is_too_short', '', array(), array('return' => true));
         }
         include_once libfile('class/bbcode');
         $bbcode =& bbcode::instance();
         require_once libfile('function/comment');
         $cidarr = add_comment($message, $currentid, $currenttype, 0);
         if ($cidarr['cid']) {
             $magvalues['cid'] = $cidarr['cid'];
             $magvalues['id'] = $currentid;
         }
     }
     $magvalues['type'] = $commentcable[$type];
 }
 $arr['body_general'] = getstr($_POST['general'], 150, 1, 1, 1);
 $arr['body_general'] = censor($arr['body_general']);
 if (censormod($arr['body_general']) || $_G['group']['allowsharemod']) {
     $arr['status'] = 1;
 } else {
     $arr['status'] = 0;
 }
 $arr['type'] = $type;
Exemple #28
0
            if (empty($start)) {
                $start = $event->start->date;
            }
            // Je formatte la date pour que ce soit lisible
            $date = date('d/m à G:i', strtotime($start));
            $artist = $event->getSummary();
            //On récupère le nom de l'artiste qui est le nom de l'événement
            $eventCalendar = '<a href="artists.php?name=' . $artist . '">' . $artist . '</a>';
            $eventCalendar .= " le " . $date;
            $html .= "<li>" . $eventCalendar . "</li>";
        }
        return $html;
    }
}
if (isset($_REQUEST['AjoutCommentaire'])) {
    add_comment($_REQUEST['contenu'], $_SESSION['idUser'], $_REQUEST['id'], 's');
}
$artists = "";
$array_artist = get_name_artist(5);
//On récupère les 5 premier noms
foreach ($array_artist as $value) {
    $name = $value['nameArtist'];
    $artists .= '<li><a href="artists.php?name=' . $name . '" style="text-decoration:underline";>' . $name . '</a></li>';
}
?>
<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>
Exemple #29
0
if (!$action) {
    $action = post_str("action", true);
}
switch ($action) {
    case "create_scenario_form":
        create_scenario_form();
        break;
    case "create_scenario":
        create_scenario();
        break;
    case "show_scenario":
        show_scenario();
        break;
    case "simulation_form":
        simulation_form();
        break;
    case "simulation_form_short":
        simulation_form_short();
        break;
    case "simulation_action":
        simulation_action();
        break;
    case "show_simulation":
        show_simulation();
        break;
    case "add_comment":
        add_comment();
        break;
    default:
        show_scenarios();
}
<?php

include $_SERVER['DOCUMENT_ROOT'] . '/config.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/lib/db.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/lib/session.php';
sec_session_start();
global $table_prefix;
global $dbh;
switch ($_POST['option']) {
    case 1:
        add_comment($dbh, $table_prefix);
        break;
    case 2:
        add_news($dbh, $table_prefix);
        break;
    case 3:
        remove_news($dbh, $table_prefix);
        break;
    case 4:
        send_message($dbh, $table_prefix);
        break;
    case 5:
        reply_message($dbh, $table_prefix);
        break;
    case 6:
        get_massage($dbh, $table_prefix);
        break;
}
function add_comment($dbh1, $table_prefix)
{
    if ($stmt = $dbh1->prepare("INSERT INTO  " . $table_prefix . "_comments (project_id, user_id, comment) VALUES (?, ?, ?)")) {