当前位置: 首页>>代码示例>>PHP>>正文


PHP deletePost函数代码示例

本文整理汇总了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;
    }
}
开发者ID:dalinhuang,项目名称:HCI-forum,代码行数:12,代码来源:informResult.php

示例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);
}
开发者ID:h16o2u9u,项目名称:rtoss,代码行数:31,代码来源:ptboard.php

示例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>";
开发者ID:Max1mov,项目名称:3.kodutoo-II-ruhm,代码行数:31,代码来源:table_post.php

示例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';
}
开发者ID:jagfiend,项目名称:college_php_portfolio,代码行数:31,代码来源:cmsPostsTable.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);
开发者ID:adhy57,项目名称:antaCMS,代码行数:8,代码来源:deletePost.php

示例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;
         }
开发者ID:niksfish,项目名称:Tinyboard,代码行数:31,代码来源:mod.php

示例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']);
 }
开发者ID:fugeris,项目名称:8chan,代码行数:31,代码来源:post.php

示例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));
开发者ID:Gameonn,项目名称:curler-class,代码行数:14,代码来源:delete_post.php

示例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>
开发者ID:hardihuang,项目名称:zihuaxiang,代码行数:31,代码来源:doAction.php

示例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));
?>

开发者ID:vyaspranjal,项目名称:WebLogMe,代码行数:18,代码来源:deletepost.php

示例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';
}
开发者ID:aurelienshz,项目名称:g1a,代码行数:19,代码来源:deletefaq.php

示例12: deletePost

<?php

require 'functions.php';
$url = 'profile.php';
$postId = $_POST['postIdName'];
deletePost($postId);
header('Location: ' . $url);
开发者ID:nicklasdean,项目名称:scwes2,代码行数:7,代码来源:deletePost.php

示例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>
开发者ID:D-L-C,项目名称:php-Development-project,代码行数:31,代码来源:list-posts.php

示例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>
开发者ID:g-hyoga,项目名称:textbook,代码行数:31,代码来源:index.php

示例15: deletePost

<?php

require "session.php";
require "init.php";
require "header.php";
require 'function.php';
deletePost($_GET["id"]);
header('Location: connect.php');
exit;
开发者ID:Rouksana,项目名称:ecvd-php,代码行数:9,代码来源:removePost.php


注:本文中的deletePost函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。