本文整理匯總了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 {