Esempio n. 1
0
function twitter_directs_page($query)
{
    $perPage = setting_fetch('perPage', 20);
    $action = strtolower(trim($query[1]));
    switch ($action) {
        case 'create':
            $to = $query[2];
            $content = theme('directs_form', $to);
            theme('page', 'Create DM', $content);
        case 'send':
            twitter_ensure_post_action();
            $to = trim(stripslashes($_POST['to']));
            $message = trim(stripslashes($_POST['message']));
            $request = API_URL . 'direct_messages/new.json';
            twitter_process($request, array('user' => $to, 'text' => $message));
            twitter_refresh('directs/sent');
        case 'sent':
            $request = API_URL . 'direct_messages/sent.json?page=' . intval($_GET['page']) . '&include_entities=true&count=' . $perPage;
            $tl = twitter_standard_timeline(twitter_process($request), 'directs_sent');
            $content = theme_directs_menu();
            $content .= theme('timeline', $tl);
            theme('page', 'DM Sent', $content);
        case 'inbox':
        default:
            $request = API_URL . 'direct_messages.json?page=' . intval($_GET['page']) . '&include_entities=true&count=' . $perPage;
            $tl = twitter_standard_timeline(twitter_process($request), 'directs_inbox');
            $content = theme_directs_menu();
            $content .= theme('timeline', $tl);
            theme('page', 'DM Inbox', $content);
    }
}
Esempio n. 2
0
function twitter_directs_page($query)
{
    $action = strtolower(trim($query[1]));
    switch ($action) {
        case 'delete':
            $id = $query[2];
            if (!is_numeric($id)) {
                return;
            }
            $request = API_URL . "direct_messages/destroy/{$id}.json";
            twitter_process($request, true);
            twitter_refresh();
        case 'create':
            $to = $query[2];
            $content = theme('directs_form', $to);
            theme('page', 'Create DM', $content);
        case 'send':
            twitter_ensure_post_action();
            $to = trim(stripslashes($_POST['to']));
            $message = trim(stripslashes($_POST['message']));
            $request = API_URL . 'direct_messages/new.json';
            twitter_process($request, array('user' => $to, 'text' => $message));
            twitter_refresh('directs/sent');
        case 'sent':
            $request = API_URL . 'direct_messages/sent.json?page=' . intval($_GET['page']);
            $tl = twitter_standard_timeline(twitter_process($request), 'directs_sent');
            $content = theme_directs_menu();
            $content .= theme('timeline', $tl);
            theme('page', 'DM Sent', $content);
        case 'inbox':
        default:
            $request = API_URL . 'direct_messages.json?page=' . intval($_GET['page']) . '&include_entities=true';
            $tl = twitter_standard_timeline(twitter_process($request), 'directs_inbox');
            $content = theme_directs_menu();
            $content .= theme('timeline', $tl);
            theme('page', 'DM Inbox', $content);
    }
}
Esempio n. 3
0
function twitter_directs_page($query)
{
    $cb = get_codebird();
    $api_options = array("count" => setting_fetch('perPage', 20));
    $action = strtolower(trim($query[1]));
    switch ($action) {
        case 'create':
            $to = $query[2];
            $content = theme('directs_form', $to);
            theme('page', 'Create DM', $content);
        case 'send':
            twitter_ensure_post_action();
            $to = trim(stripslashes(str_replace('@', '', $_POST['to'])));
            $message = trim(stripslashes($_POST['message']));
            $api_options = array('screen_name' => $to, 'text' => $message);
            @twitter_api_status($cb->directMessages_new($api_options));
            twitter_refresh('messages/sent');
        case 'sent':
            if ($_GET['max_id']) {
                $api_options["max_id"] = $_GET['max_id'];
            }
            $tl = $cb->directMessages_sent($api_options);
            twitter_api_status($tl);
            $tl = twitter_standard_timeline($tl, 'directs_sent');
            $content = theme_directs_menu();
            $content .= theme('timeline', $tl);
            theme('page', 'DM Sent', $content);
        case 'inbox':
        default:
            if ($_GET['max_id']) {
                $api_options["max_id"] = $_GET['max_id'];
            }
            $tl = $cb->directMessages($api_options);
            twitter_api_status($tl);
            $tl = twitter_standard_timeline($tl, 'directs_inbox');
            $content = theme_directs_menu();
            $content .= theme('timeline', $tl);
            theme('page', 'DM Inbox', $content);
    }
}
Esempio n. 4
0
File: lists.php Progetto: xctcc/npt
function lists_list_delete_member($user, $list, $member)
{
    twitter_ensure_post_action();
    $post_data = array("owner_screen_name" => $user, "slug" => $list, "screen_name" => $member);
    $request = API_ROOT . "lists/members/destroy.json";
    twitter_process($request, $post_data);
    header('Location: ' . BASE_URL . "lists/{$user}/{$list}/members");
}
Esempio n. 5
0
function twitter_directs_page($query)
{
    $action = strtolower(trim($query[1]));
    switch ($action) {
        case 'delete':
            $id = $query[2];
            if (!is_numeric($id)) {
                return;
            }
            $post_data = array("id" => $id);
            $request = API_ROOT . "direct_messages/destroy.json";
            twitter_process($request, $post_data);
            twitter_refresh();
        case 'create':
            $to = $query[2];
            $content = theme('directs_form', $to);
            theme('page', __("Create DM") . " {$to}", $content);
        case 'send':
            twitter_ensure_post_action();
            $to = trim(stripslashes($_POST['to']));
            $message = trim(stripslashes($_POST['message']));
            $request = API_ROOT . 'direct_messages/new.json';
            twitter_process($request, array('screen_name' => $to, 'text' => $message));
            twitter_refresh('directs/sent');
        case 'sent':
            $count = setting_fetch('tpp', 20);
            $request = API_ROOT . "direct_messages/sent.json?include_entities=true&count={$count}";
            if ($_GET['max_id']) {
                $request .= "&max_id=" . $_GET['max_id'];
            }
            if ($_GET['since_id']) {
                $request .= "&since_id=" . $_GET['since_id'];
            }
            $tl = twitter_standard_timeline(twitter_process($request), 'directs_sent');
            $content = theme_directs_menu();
            $content .= theme('timeline', $tl);
            theme('page', __("DM Sent"), $content);
        case 'inbox':
        default:
            $count = setting_fetch('tpp', 20);
            $request = API_ROOT . "direct_messages.json?include_entities=true&count={$count}";
            if ($_GET['max_id']) {
                $request .= "&max_id=" . $_GET['max_id'];
            }
            if ($_GET['since_id']) {
                $request .= "&since_id=" . $_GET['since_id'];
            }
            $tl = twitter_standard_timeline(twitter_process($request), 'directs_inbox');
            $content = theme_directs_menu();
            $content .= theme('timeline', $tl);
            theme('page', __("DM Inbox"), $content);
    }
}
Esempio n. 6
0
function twitter_directs_page($query)
{
    $api_options = array("count" => setting_fetch('dabr_perPage', 20), "full_text" => true);
    $action = strtolower(trim($query[1]));
    switch ($action) {
        case 'create':
            $to = $query[2];
            $content = theme('directs_form', $to);
            theme('page', _(CREATE_DM_TITLE), $content);
        case 'send':
            twitter_ensure_post_action();
            $to = trim(stripslashes(str_replace('@', '', $_POST['to'])));
            $message = trim(stripslashes($_POST['message']));
            $api_options["screen_name"] = $to;
            $api_options["text"] = $message;
            execute_codebird("directMessages_new", $api_options);
            twitter_refresh('messages/sent');
        case 'sent':
            if ($_GET['max_id']) {
                $api_options["max_id"] = $_GET['max_id'];
            }
            $tl = execute_codebird("directMessages_sent", $api_options);
            $tl = twitter_standard_timeline($tl, 'directs_sent');
            $content = theme_directs_menu();
            $content .= theme('timeline', $tl);
            theme('page', _(DM_SENT_TITLE), $content);
        case 'inbox':
        default:
            if ($_GET['max_id']) {
                $api_options["max_id"] = $_GET['max_id'];
            }
            $tl = execute_codebird("directMessages", $api_options);
            $tl = twitter_standard_timeline($tl, 'directs_inbox');
            $content = theme_directs_menu();
            $content .= theme('timeline', $tl);
            theme('page', _(DM_INBOX_TITLE), $content);
    }
}
Esempio n. 7
0
function twitter_directs_page($query)
{
    $per_page = setting_fetch('perPage', 20);
    $action = strtolower(trim($query[1]));
    switch ($action) {
        case 'create':
            $to = $query[2];
            $content = theme('directs_form', $to);
            theme('page', 'Create DM', $content);
        case 'send':
            twitter_ensure_post_action();
            $to = trim(stripslashes(str_replace('@', '', $_POST['to'])));
            $message = trim(stripslashes($_POST['message']));
            $request = API_NEW . 'direct_messages/new.json';
            twitter_process($request, array('screen_name' => $to, 'text' => $message));
            twitter_refresh('directs/sent');
        case 'sent':
            $request = API_NEW . "direct_messages/sent.json?count={$per_page}";
            if ($_GET['max_id']) {
                $request .= '&max_id=' . $_GET['max_id'];
            }
            $tl = twitter_process($request);
            $tl = twitter_standard_timeline($tl, 'directs_sent');
            $content = theme_directs_menu();
            $content .= theme('timeline', $tl);
            theme('page', 'DM Sent', $content);
        case 'inbox':
        default:
            $request = API_NEW . "direct_messages.json?count={$per_page}";
            if ($_GET['max_id']) {
                $request .= '&max_id=' . $_GET['max_id'];
            }
            $tl = twitter_process($request);
            $tl = twitter_standard_timeline($tl, 'directs_inbox');
            $content = theme_directs_menu();
            $content .= theme('timeline', $tl);
            theme('page', 'DM Inbox', $content);
    }
}