<?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
0
<?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
0
    $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 {