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


PHP post::delete_this_post方法代码示例

本文整理汇总了PHP中post::delete_this_post方法的典型用法代码示例。如果您正苦于以下问题:PHP post::delete_this_post方法的具体用法?PHP post::delete_this_post怎么用?PHP post::delete_this_post使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在post的用法示例。


在下文中一共展示了post::delete_this_post方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: time

<?php

$date = time() - 62 * 24 * 60 * 60;
$faved = array();
$r = $db2->query('SELECT DISTINCT post_id FROM post_favs WHERE post_type="public" ');
while ($tmp = $db2->fetch_object($r)) {
    $faved[] = intval($tmp->post_id);
}
$posts = array();
$r = $db2->query('SELECT * FROM posts WHERE api_id=2 AND date<"' . $date . '" AND date_lastcomment<="' . $date . '" ');
while ($tmp = $db2->fetch_object($r)) {
    $tmp->id = intval($tmp->id);
    if (in_array($tmp->id, $faved)) {
        continue;
    }
    $posts[] = $tmp;
}
$user = (object) array('is_logged' => TRUE, 'id' => 0, 'info' => (object) array('is_network_admin' => 1));
foreach ($posts as $obj) {
    $p = new post('public', FALSE, $obj);
    $p->delete_this_post();
}
开发者ID:essa,项目名称:sharetronix_ja,代码行数:22,代码来源:4-clean_old_feed_posts.php

示例2: post

<?php

if (!$this->network->id) {
    echo 'ERROR';
    return;
}
if (!$this->user->is_logged) {
    echo 'ERROR';
    return;
}
if (isset($_POST['postid']) && preg_match('/^(public|private)_([0-9]+)$/', $_POST['postid'], $m)) {
    $p = new post($m[1], $m[2]);
    if ($p->error) {
        echo 'ERROR';
        return;
    }
    if ($p->delete_this_post()) {
        echo 'OK';
        return;
    }
}
echo 'ERROR';
return;
开发者ID:chaobj001,项目名称:tt,代码行数:23,代码来源:ajax_delpost.php

示例3: htmlspecialchars

    $answer .= $twitter_data->data_field('sender_id', $private_post->post_user->id);
    $answer .= $twitter_data->data_field('text', htmlspecialchars($private_post->post_message));
    $answer .= $twitter_data->data_field('recipient_id', $private_post->post_to_user->id);
    $answer .= $twitter_data->data_field('created_at', gmdate('D M d H:i:s \\+0000 Y', $private_post->post_date));
    $answer .= $twitter_data->data_field('sender_screen_name', 'none');
    $answer .= $twitter_data->data_field('recipient_screen_name', 'none');
    $answer .= $twitter_data->data_section('sender', TRUE);
    $answer .= $twitter_data->print_user($private_post->post_user->id);
    $answer .= $twitter_data->data_section('sender', FALSE, TRUE);
    $answer .= $api_session->format == 'json' ? ',' : '';
    $answer .= $twitter_data->data_section('recipient', TRUE);
    $answer .= $twitter_data->print_user($private_post->post_to_user->id);
    $answer .= $twitter_data->data_section('recipient', FALSE, TRUE);
    $answer .= $twitter_data->data_section('direct_message', FALSE, TRUE);
    $answer .= $twitter_data->data_bottom();
    if ($private_post->delete_this_post()) {
        echo $answer;
        exit;
    } else {
        if (!isset($_REQUEST['suppress_response_codes'])) {
            header('HTTP/1.1 500 Internal Server Error');
        } else {
            echo generate_error($api_session->format, 'Server error (Stage 4).', $_SERVER['REQUEST_URI'], $api_session->callback);
        }
        exit;
    }
} else {
    if ($_SERVER['REQUEST_METHOD'] != 'GET') {
        if (!isset($_REQUEST['suppress_response_codes'])) {
            header('HTTP/1.1 400 Bad Request');
        } else {
开发者ID:chaobj001,项目名称:tt,代码行数:31,代码来源:direct_messages.php


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