本文整理汇总了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();
}
示例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;
示例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 {