function save() { $params = array(); $params['comment'] = $_POST['comment']; $params['create_date'] = date('Y-m-d H:i:s'); $params['discussion_id'] = $_GET['id']; include 'model/user.php'; $arrUser = user_get(array('email' => $_SESSION['username'])); $params['user_id'] = $arrUser[0]['user_id']; comment_post($params); $url = $_SERVER['REQUEST_URI']; header("Location: " . $url); exit; }
function intelligent_comment($post_id, $post_message, $access_token) { $message = 'Thank you'; if (stripos($post_message, 'ra') !== FALSE) { $message = 'Thanks ra'; } else { if (stripos($post_message, 'Sir') !== FALSE) { $message = 'Thanks'; } else { if (stripos($post_message, 'da') !== FALSE) { $message = 'Thanks da'; } } } if (strpos($post_message, ':D') !== FALSE || strpos($post_message, ':-D') !== FALSE || strpos($post_message, ':)') !== FALSE || strpos($post_message, ':-)') !== FALSE) { $message .= ' :)'; } return comment_post($post_id, $message, $access_token) === TRUE ? $message : FALSE; }
get_markers(); break; case 'get_markers_by_category': get_markers_by_category($_REQUEST['id_categoria']); break; case 'add_post': add_post($_REQUEST['id_user'], $_REQUEST['post_title'], $_REQUEST['post_content']); break; case 'get_post': get_post($_REQUEST['id_post']); break; case 'get_comments': get_comments($_REQUEST['id_post']); break; case 'comment_post': comment_post($_REQUEST['id_post'], $_REQUEST['username'], $_REQUEST['id_user'], $_REQUEST['comment']); break; case 'qualify': qualify($_REQUEST['id_usuario'], $_REQUEST['qualification']); break; case 'get_average': get_average(); break; case 'upload_image': upload_image($_FILES, $_REQUEST['id_user'], $_REQUEST['id_post']); break; case 'get_image': get_image($_REQUEST['filename']); break; } } else {
$story = db_fetch_object(db_query("SELECT s.*, u.userid FROM stories s LEFT JOIN users u ON s.author = u.id WHERE s.id = '{$id}'")); if (story_visible($story)) { $theme->story($story, "[ <A HREF=\"story.php?op=reply&id={$id}&pid=0\">" . t("reply to this story") . "</A> ]"); comment_render($id, $cid); } else { $theme->box(t("Warning message"), t("The story you requested is not available or does not exist.")); } } switch ($op) { case t("Preview comment"): $theme->header(); comment_preview(check_input($pid), check_input($id), $subject ? check_output($subject) : "", $comment ? check_output($comment) : ""); $theme->footer(); break; case t("Post comment"): comment_post(check_input($pid), check_input($id), check_input($subject), check_input($comment)); $theme->header(); story_render(check_input($id), check_input($cid)); $theme->footer(); break; case "reply": $theme->header(); comment_reply(check_input($pid), check_input($id)); $theme->footer(); break; case t("Update settings"): comment_settings(check_input($mode), check_input($order), check_input($threshold)); $theme->header(); story_render(check_input($id), check_input($cid)); $theme->footer(); break;