本文整理汇总了PHP中deletePost函数的典型用法代码示例。如果您正苦于以下问题:PHP deletePost函数的具体用法?PHP deletePost怎么用?PHP deletePost使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了deletePost函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postCon
function postCon($id, $action)
{
switch ($action) {
case '1':
deletePost($id);
break;
case '2':
cancleInformPost($id);
default:
break;
}
}
示例2: error
}
}
if ($err) {
error($err);
}
}
extract($_POST);
extract($_GET);
$iniv = array('action', 'res', 'no', 'pwd', 'page');
foreach ($iniv as $iniva) {
if (!isset(${$iniva})) {
${$iniva} = "";
}
}
init();
switch ($action) {
case 'post':
addPost();
break;
case 'delete':
deletePost($no, $pwd);
default:
if ($res) {
// 回應模式輸出
$page = isset($_GET['page']) ? $_GET['page'] : 'RE_PAGE_MAX';
if (!($page == 'all' || $page == 'RE_PAGE_MAX')) {
$page = intval($_GET['page']);
}
}
showPost($res, $page);
}
示例3: getTextData
<?php
// table.php
require_once "functions.php";
require_once "header.php";
$text_list = getTextData();
//var_dump($car_list);
$emailtable = getEmailData();
//kas kasutaja tahab kustutada
// kas aadressireal on ?delete=??!??!?!
if (isset($_GET["delete"])) {
// saadan kaasa id, mida kustutada
deletePost($_GET["delete"]);
}
?>
<table border=1 align="center" >
<tr>
<th>ID</th>
<th>user_id</th>
<th>text</th>
</tr>
<?php
// iga massiivis olema elemendi kohta
// count($car_list) - massiivi pikkus
for ($i = 0; $i < count($text_list); $i++) {
// $i = $i +1; sama mis $i += 1; sama mis $i++;
// tavaline rida
echo "<tr>";
echo "<td>" . $text_list[$i]->post_kd . "</td>";
示例4: updatePost
$form_valid = false;
}
// action taken if form filled in correctly...
if ($form_valid == true) {
updatePost($_GET['id'], $_SESSION['userId'], $_POST['title'], $_POST['editor1'], $_POST['category']);
// variables set to createPost function for insertion into db...
header('Location: ?page=cmsUpdated&goto=cmsPostsTable');
}
}
$id = $_GET['id'];
$post = getPostById($id);
include VIEWS . 'contentCMSUpdate.php';
break;
case 'delete':
$id = $_GET['id'];
if (!empty($_POST)) {
if ($_POST['deleteConf'] == 'Yes') {
deletePost($id);
header('Location: ?page=cmsUpdated&goto=cmsPostsTable');
} elseif ($_POST['deleteConf'] == 'No') {
header('Location: ?page=cmsPostsTable');
}
}
$post = getPostById($id);
include VIEWS . 'contentCMSDelete.php';
break;
}
} else {
$posts = getAllPostsCMS();
include VIEWS . 'contentCMSPostsTable.php';
}
示例5: session_start
<?php
session_start();
!$_SESSION['login'] ? header('location:index.php') : '';
include 'koneksi.php';
include 'fungsi_delete.php';
$id_post = $_GET['id'];
deletePost($con, $id_post);
示例6: buildIndex
buildIndex();
// trigger themes
rebuildThemes('post');
openBoard($boardName);
if ($shadow) {
// lock thread
$query = prepare(sprintf("UPDATE `posts_%s` SET `locked` = 1 WHERE `id` = :id", $board['uri']));
$query->bindValue(':id', $postID, PDO::PARAM_INT);
$query->execute() or error(db_error($query));
$post = array('mod' => true, 'subject' => '', 'email' => '', 'name' => $config['mod']['shadow_name'], 'capcode' => $config['mod']['shadow_capcode'], 'trip' => '', 'body' => sprintf($config['mod']['shadow_mesage'], '>>>/' . $targetBoard . '/' . $newID), 'password' => '', 'has_file' => false, 'thread' => $postID, 'op' => false);
markup($post['body']);
$botID = post($post);
buildThread($postID);
header('Location: ?/' . sprintf($config['board_path'], $boardName) . $config['dir']['res'] . sprintf($config['file_page'], $postID) . '#' . $botID, true, $config['redirect_http']);
} else {
deletePost($postID);
buildIndex();
openBoard($targetBoard);
header('Location: ?/' . sprintf($config['board_path'], $board['uri']) . $config['dir']['res'] . sprintf($config['file_page'], $newID), true, $config['redirect_http']);
}
} else {
$body = '<fieldset><legend>Move thread</legend>' . '<form action="?/' . $boardName . '/move/' . $postID . '" method="post">' . '<table>';
$boards = listBoards();
if (count($boards) <= 1) {
error(_('No board to move to; there is only one.'));
}
$__boards = '';
foreach ($boards as &$_board) {
if ($_board['uri'] == $board['uri']) {
continue;
}
示例7: post
// Commit the post to the database.
$post['id'] = $id = post($post);
if (!$tor) {
insertFloodPost($post);
}
// Update statistics for this board.
updateStatisticsForPost($post);
// Handle cyclical threads
if (!$post['op'] && isset($thread['cycle']) && $thread['cycle']) {
// Query is a bit weird due to "This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'" (MariaDB Ver 15.1 Distrib 10.0.17-MariaDB, for Linux (x86_64))
$query = prepare(sprintf('SELECT `id` FROM ``posts_%s`` WHERE `thread` = :thread AND `id` NOT IN (SELECT `id` FROM (SELECT `id` FROM ``posts_%s`` WHERE `thread` = :thread ORDER BY `id` DESC LIMIT :limit) i)', $board['uri'], $board['uri']));
$query->bindValue(':thread', $post['thread']);
$query->bindValue(':limit', $config['cycle_limit'], PDO::PARAM_INT);
$query->execute() or error(db_error($query));
while ($dpost = $query->fetch()) {
deletePost($dpost['id'], false, false);
}
}
if (isset($post['antispam_hash'])) {
incrementSpamHash($post['antispam_hash']);
}
if (isset($post['tracked_cites']) && !empty($post['tracked_cites'])) {
$insert_rows = array();
foreach ($post['tracked_cites'] as $cite) {
$insert_rows[] = '(' . $pdo->quote($board['uri']) . ', ' . (int) $id . ', ' . $pdo->quote($cite[0]) . ', ' . (int) $cite[1] . ')';
}
query('INSERT INTO ``cites`` VALUES ' . implode(', ', $insert_rows)) or error(db_error());
}
if (!$post['op'] && !isset($_POST['no-bump']) && strtolower($post['email']) != 'sage' && !$thread['sage'] && ($thread['cycle'] || $config['reply_limit'] == 0 || $numposts['replies'] + 1 < $config['reply_limit'])) {
bumpThread($post['thread']);
}
示例8: deletePost
<?php
require_once '../phpInclude/dbconn.php';
require_once '../phpInclude/AdminClass.php';
$share_id = $_REQUEST['share_id'];
if (!empty($share_id)) {
deletePost($share_id);
$success = "1";
$msg = "post deleted!";
} else {
$success = "0";
$msg = "Incomplete Parameters!";
}
echo json_encode(array("success" => $success, "msg" => $msg));
示例9: signup
<?php
require_once 'include.php';
$act = $_REQUEST['act'];
if ($act === 'signup') {
$msg = signup();
} elseif ($act === 'login') {
$msg = login();
} elseif ($act === 'logout') {
$msg = logout();
} elseif ($act === 'post') {
$msg = post();
} elseif ($act === 'deletePost') {
$msg = deletePost();
} elseif ($act === 'likePost') {
$msg = likePost();
} elseif ($act === 'commentPost') {
$msg = commentPost();
} elseif ($act === 'deleteComment') {
$msg = deleteComment();
} elseif ($act === 'changeInfo') {
$msg = changeInfo();
} elseif ($act === 'readNotify') {
$msg = readNotify();
} elseif ($act === 'markAllRead') {
$msg = markAllRead();
}
?>
<!DOCTYPE HTML>
<html>
<head>
示例10: session_start
<?php
session_start();
function deletePost($dataTodelete, $prevData)
{
return str_replace($dataTodelete, "", $prevData);
}
$blogId = $_SESSION['blogId'];
$filePath = '../@' . $blogId . '/index.php';
$prevData = file_get_contents($filePath);
$nextData = deletePost($_POST["d"], $prevData);
if (file_put_contents($filePath, $nextData)) {
die("deleted");
} else {
die("error");
}
//die(htmlentities($newPostContent));
?>
示例11:
<?php
require MODELES . 'membres/checkAdmin.php';
if (checkAdmin()) {
require MODELES . '/faq/getPosts.php';
if (isset($_GET['id']) && ($post = getPosts($_GET['id']))) {
// si on a posté le formulaire :
require MODELES . 'backoffice/deletePost.php';
if (deletePost($_GET['id'])) {
$message = 'Suppression réussie !';
} else {
$message = 'Oups ! Une erreur s\'est produite...';
}
} else {
echo 'Invalid parameter';
exit;
}
require VUES . 'backoffice/deletefaq.php';
}
示例12: deletePost
<?php
require 'functions.php';
$url = 'profile.php';
$postId = $_POST['postIdName'];
deletePost($postId);
header('Location: ' . $url);
示例13: session_start
<?php
require_once 'lib/common.php';
require_once 'lib/list-posts.php';
session_start();
// Don't let non-auth users access this screen
if (!isLoggedin()) {
redirectAndExit('index.php');
}
if ($_POST) {
$deleteResponse = $_POST['delete-post'];
if ($deleteResponse) {
$keys = array_keys($deleteResponse);
$deletePostId = $keys[0];
if ($deletePostId) {
deletePost(getPDO(), $deletePostId);
redirectAndExit('list-posts.php');
}
}
}
// Connect to the database, run a query
$pdo = getPDO();
$posts = getAllPosts($pdo);
?>
<!DOCTYPE html>
<html>
<head>
<title> A blog application | Blog posts</title>
示例14: writePost
// print_r($_SESSION);
// echo "</pre>";
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (isset($_POST['postText'])) {
$postText = $_POST['postText'];
writePost($db, $user_id, $postText);
// 2重投稿防止のためにリロードする処理
header('Location: index.php');
exit;
}
}
if (isset($_GET['delete_post_id'])) {
$post = getPost($db, $_GET['delete_post_id']);
if ($user_id == $post[0]['user_id']) {
$delete_post_id = $_GET['delete_post_id'];
deletePost($db, $delete_post_id);
header('Location: ' . $_SERVER['SCRIPT_NAME']);
exit;
} else {
http_response_code(403);
print "unauthorized access";
exit;
}
}
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>index - Ditter</title>
示例15: deletePost
<?php
require "session.php";
require "init.php";
require "header.php";
require 'function.php';
deletePost($_GET["id"]);
header('Location: connect.php');
exit;