function outputComment($output) { $arr = createComment('Ram', 'Awesome Program!', '6:30'); echo 'Name : ' . $arr[0] . '<br>'; echo 'Comment : ' . $arr[1] . '<br>'; echo 'Time : ' . $arr[2] . '<br>'; }
function postCommentVote($self) { if (!$self) { // stuff } $vote = postVote($self); $comment = createComment($vote->id); // Make a comment vote $comment_vote = factory(App\CommentVote::class)->make(['comment_id' => $comment->id, 'vote_id' => $vote->id])->toArray(); $comment_vote = $self->call('POST', '/api/comment_vote?token=' . $self->token, $comment_vote); $self->assertResponseOk(); return $comment_vote->getOriginalContent(); }
$pid = $data["pid"]; $channelname = $data["channelname"]; $channelowner = $data["channelowner"]; if (isBanned($conn, $user, $channelname, $channelowner)) { $error = true; $error_message = "You are banned from posting in this channel"; } else { if (strlen($comment) == 0) { $error = true; $error_message = "Your comment cannot be empty"; } else { if (strlen($comment) > 256) { $error = true; $error_message = "Your comment cannot be longer than 256 characters"; } else { createComment($conn, $user, $comment, $pid, $channelname, $channelowner); $time = getCommentTime($conn, $user, $pid, $channelname, $channelowner); } } } $conn->close(); $response = array('error' => $error, 'error_message' => $error_message, 'channelname' => $channelname, 'channelowner' => $channelowner, 'pid' => $pid, 'comment' => $comment, 'time' => $time); echo json_encode($response); function createComment($conn, $user, $comment, $pid, $channelname, $channelowner) { global $error, $error_message; $stmt = $conn->prepare("INSERT INTO post_comments (pc_username, pc_comment, pc_time, pc_chname, pc_chowner, pc_number) \n \t\t\tVALUES (?, ?, UTC_TIMESTAMP(), ?, ?, ?)"); $stmt->bind_param("ssssi", $user, $comment, $channelname, $channelowner, $pid); if (!$stmt->execute()) { $error = true; $error_message = "Either the comment has already been posted, or the post no longer exists";
<?php require 'queries/commentQueries.php'; $PAGE->id = 'commentCreate'; $fields = array('blogid', 'name', 'html'); $inputs = array(); //check POST object for variables from front end foreach ($fields as $postKey) { if (isset($_POST[$postKey]) && !empty($_POST[$postKey])) { $inputs[$postKey] = $_POST[$postKey]; } else { return errorHandler("missing {$postKey}", 503); } } //print debug statement if ($SERVERDEBUG) { echo "\r\n inputs:"; echo json_encode($inputs); } //setup for query $stmt = createComment($DB, $inputs['blogid'], $inputs['name'], $inputs['html']); if (!$stmt) { return; } // createNewList already send error. if (!$stmt->execute()) { return errorHandler("failed to create this user {$stmt->errno}: {$stmt->error}"); } echo '{"id":"' . $stmt->insert_id . '"}';
<?php session_start(); include_once 'database/events.php'; $event = $_POST['id']; $author = $_POST['author']; $text = $_POST['text']; createComment($event, $author, $text); header('Location: ' . './show_event.php?id=' . $event);
<!-- END: SECTION#2 --> <div class="section"> <div class="container"> <h2>SECTION 2 - INTERACTION WITH COMMUNITY THROUGH WEARABLE </h2> <div class="info center">Please provide some more information about your experience while interacting with the community using the prototype (here referred to as ‘the wearable’ - t-shirt plus technology (set of hardware and software connected to the clothes) plus shirt): </div> <?php createLikert5("1. I felt more connected to the community by sharing where I am.", 2, 1); createLikert5("2. I felt more connected to the community by sharing what I see.", 2, 2); createLikert5("3. I felt like I am sharing personal things with the community.", 2, 3); createLikert5("4. I felt safe knowing the community knows where I am.", 2, 4); createLikert5("5. I felt comfortable knowing the community sees where I am.", 2, 5); createLikert5("6. I felt useful by sharing information with the community.", 2, 6); createComment("7. Please use the space below for additional comments on the use of the wearable to interact with the community.", 2, 7); ?> </div> </div> <!-- END: SECTION#2 --> <div class="section center"> <button class="btn btn-primary btn-lg" type="submit">Submit</button> </div> <input type="hidden" id="participant_id" name="function" value="save"> </form> <script src="components/jquery/1.11.1/jquery.min.js"></script> <script src="components/bootstrap-3.3.2-dist/js/bootstrap.min.js"></script>
createLikert5("13. I felt the wearable thermal comfort adequate. ", "1", "13"); createLikert5("14. I felt the different functionalities worked well together. ", "1", "14"); createLikert5("15. I felt the different parts were well attached.", "1", "15"); createLikert5("16. I felt like I need to pay minimal attention to the wearable. ", "1", "16"); createLikert5("17. I felt the interactions with the wearable were simple.", "1", "17"); createLikert5("18. I thought the wearable was attentive to changes in the environment around me. ", "1", "18"); createLikert5("19. I felt easy moving my body while using the wearable.", "1", "19"); createLikert5("20. I felt like all the parts were integrated into the clothing.", "1", "20"); createLikert5("21. I always knew what each part did.", "1", "21"); createLikert5("22. I thought the wearable communicated well what was happening.", "1", "22"); createLikert5("23. I felt I could easily access all the parts necessary.", "1", "23"); createLikert5("24. I did bump into things. ", "1", "24"); createSAM("25. Independently of my interactions with others, this is how I felt about using the GPS feature of the wearable: ", "1", "25"); createSAM("26. Independently of my interactions with others, this is how I felt about using the camera feature of the wearable: ", "1", "26"); createSAM("27. Independently of my interactions with others, this is how I felt about the notification feature of the wearable: ", "1", "27"); createComment("28. Please use the space below for additional comments on using the wearable:", "1", "28"); ?> </div> </div> <div class="section center"> <button class="btn btn-primary btn-lg" type="submit">Submit</button> </div> <input type="hidden" id="participant_id" name="function" value="save"> </form> <script src="components/jquery/1.11.1/jquery.min.js"></script> <script src="components/bootstrap-3.3.2-dist/js/bootstrap.min.js"></script>
$argv[] = '--conf'; $argv[] = '/usr/wikia/docroot/wiki.factory/LocalSettings.php'; $wikia_base = dirname(dirname(__FILE__)); $bootstrap_file = $wikia_base . '/commandLine.inc'; if (is_file($bootstrap_file)) { require_once $bootstrap_file; } else { error_log("Can't find command line include file '{$bootstrap_file}'"); } print "done\n"; $article_id = $argv[0]; $title = Title::newFromID($article_id); if (!$title instanceof Title) { die("Could not make new comment from article ID '{$article_id}'"); } createComment($title, $argv[1], $argv[2]); /** * clear comments cache for this article */ $title->invalidateCache(); $title->purgeSquid(); $listing = BlogArticle::getOwnerTitle($title); if ($listing) { $listing->invalidateCache(); $listing->purgeSquid(); } $key = $title->getPrefixedDBkey(); $wgMemc->delete(wfMemcKey("blog", "listing", $key, 0)); $clist = BlogCommentList::newFromTitle($title); $clist->getCommentPages(true); function createComment($title = null, $commenter = null, $text = null)
<div class="section"> <div class="container"> <h2>SECTION 2 - INTERACTION WITH WEARABLE THROUGH DISPLAY </h2> <div class="info center">Please provide some more information about your experience while interacting with the wearer: </div> <?php createLikert5("1. I felt connected to the wearer by seeing where s/he is.", 2, 1); createLikert5("2. I felt connected to the wearer by seeing his/her photos.", 2, 2); createLikert5("3. I liked to interact with the wearer.", 2, 3); createLikert5("4. I felt ease to see where the wearer was.", 2, 4); createLikert5("5. I felt ease to see photos the wearer took.", 2, 5); createLikert5("6. I felt ease when requesting photos from the wearer.", 2, 6); createLikert5("7. I felt like I was interacting with the wearer.", 2, 7); createLikert5("8. I felt like the wearer was interacting with me.", 2, 8); createComment("9. Please use the space below for additional comments on the use of the display to interact with the wearer:", 2, 9); ?> </div> </div> <!-- END: SECTION#2 --> <div class="section center"> <button class="btn btn-primary btn-lg" type="submit">Submit</button> </div> <input type="hidden" id="participant_id" name="function" value="save"> </form> <script src="components/jquery/1.11.1/jquery.min.js"></script> <script src="components/bootstrap-3.3.2-dist/js/bootstrap.min.js"></script> <script> $(function () {
<?php include 'exe4.php'; displayHeader('Heading h1', 'Sub Heading h2'); $comment = array([0], [1], [2], [3]); $comment[0] = createComment('Ramasubbaiya', 'Awesome Program!', strtotime('30-07-2014 06:30:55 AM')); $comment[1] = createComment('Ramasubbaiya', 'Awesome Program!', strtotime('04-03-2014 06:30:55 PM')); $comment[2] = createComment('Ramasubbaiya', 'Awesome Program!', strtotime('23-12-2014 06:30:55 AM')); $comment[3] = createComment('Ramasubbaiya', 'Awesome Program!', strtotime('07-04-2010 06:30:55 PM')); foreach ($comment as $k => $v) { outputComment($v) . '<br>'; }
<?php // controller for individual post display page... include DATA . 'posts.php'; include DATA . 'comments.php'; // set error array key value pairs so that correct error messages displayed... $error = array('editor1' => ''); $postId = $_GET['id']; $post = getPostById($postId); $comments = getAllPostComments($postId); if (!empty($_POST)) { $form_valid = true; // sanitization... $_POST['editor1'] = trim($_POST['editor1']); //validation if ($_POST['editor1'] == '') { $error['editor1'] = 'You have not entered any content! Try again yeh...?'; $form_valid = false; } // action taken if form filled in correctly... if ($form_valid == true) { createComment($post['userId'], $_GET['id'], $_POST['editor1']); // variables sent to createComment function for insertion into db... header('Location: ?page=postDisplay&id=' . $_GET['id']); // reloads the page with new comment... } } include VIEWS . 'header.php'; include VIEWS . 'contentPostDisplay.php'; include VIEWS . 'footer.php';
// page logic for different views... if (isset($_GET['action'])) { switch ($_GET['action']) { case 'create': if (!empty($_POST)) { $form_valid = true; // sanitization... $_POST['editor1'] = trim($_POST['editor1']); //validation... if ($_POST['editor1'] == '') { $error['editor1'] = 'You have not entered any content! Try again yeh...?'; $form_valid = false; } // action taken if form filled in correctly... if ($form_valid == true) { createComment($_SESSION['userId'], $_POST['postId'], $_POST['editor1']); // variables set to createPost function for insertion into db... header('Location: ?page=cmsUpdated&goto=cmsCommentsTable'); } } $postIds = getAllPostIds(); include VIEWS . 'contentCMSCreate.php'; break; case 'update': if (!empty($_POST)) { $form_valid = true; // sanitization... $_POST['editor1'] = trim($_POST['editor1']); //validation... if ($_POST['editor1'] == '') { $error['editor1'] = 'You have not entered any content! Try again yeh...?';