Beispiel #1
0
function twitter_confirmation_page($query)
{
    // the URL /confirm can be passed parameters like so /confirm/param1/param2/param3 etc.
    $action = $query[1];
    $target = $query[2];
    //The name of the user we are doing this action on
    $target_id = $query[3];
    //The targets's ID.  Needed to check if they are being blocked.
    switch ($action) {
        case 'block':
            if (twitter_block_exists($target_id)) {
                $action = 'unblock';
                $content = "<p>Are you really sure you want to <strong>Unblock {$target}</strong>?</p>";
                $content .= '<ul><li>They will see your updates on their home page if they follow you again.</li><li>You <em>can</em> block them again if you want.</li></ul>';
            } else {
                $content = "<p>Are you really sure you want to <strong>{$action} {$target}</strong>?</p>";
                $content .= "<ul>\n\t\t\t\t                <li>You won't show up in their list of friends</li>\n\t\t\t\t                <li>They won't see your updates on their home page</li>\n\t\t\t\t                <li>They won't be able to follow you</li>\n\t\t\t\t                <li>You <em>can</em> unblock them but you will need to follow them again afterwards</li>\n\t\t\t\t            </ul>";
            }
            break;
        case 'delete':
            $cb = get_codebird();
            $api_options = array("id" => $target);
            $status = $cb->statuses_show_ID($api_options);
            @twitter_api_status($status);
            $content = '<p>Are you really sure you want to delete your tweet?</p>';
            $content .= "<ul>\n\t\t\t                 <li>Tweet: {$status->text}</li>\n\t\t\t                 <li>There is <strong>no way to undo this action</strong>.</li>\n\t\t\t            </ul>";
            break;
        case 'deleteDM':
            $cb = get_codebird();
            $api_options = array("id" => $target);
            $status = $cb->directMessages_show($api_options);
            @twitter_api_status($status);
            $content = '<p>Are you really sure you want to delete that DM?</p>';
            $content .= "<ul>\n\t\t\t                <li>Message: {$status->text}</li>\n\t\t\t                <li>There is <strong>no way to undo this action</strong>.</li>\n\t\t\t                <li>The DM will be deleted from both the sender's outbox <em>and</em> receiver's inbox.</li>\n\t\t\t            </ul>";
            break;
        case 'spam':
            $content = "<p>Are you really sure you want to report <strong>{$target}</strong> as a spammer?</p>";
            $content .= "<p>They will also be blocked from following you.</p>";
            break;
        case 'hideretweets':
            $content = "<p>Are you really sure you want to hide the Retweets from <strong>{$target}</strong>?</p>";
            $content .= "<ul><li>The tweets that {$target} shares will no longer appear in your timeline.</li>\n\t\t\t                 <li>However you will still see them when looking at {$target}'s timeline.</li></ul>";
            break;
        case 'showretweets':
            $content = "<p>Are you really sure you want to show the Retweets from <strong>{$target}</strong>?</p>";
            $content .= "<ul><li>The tweets that {$target} shares will appear in your timeline.</li>\n\t\t\t                 <li>You can turn these off at any time.</li></ul>";
            break;
        case '':
            theme('error', "<h2>Error!</h2><p>Nothing to confirm.</p>");
            break;
    }
    $content .= "<form action='{$action}/{$target}' method='post'>\n\t\t\t\t\t\t<input type='submit' value='Yes please' />\n\t\t\t\t\t</form>";
    theme('Page', 'Confirm', $content);
}
Beispiel #2
0
function twitter_confirmation_page($query)
{
    // the URL /confirm can be passed parameters like so /confirm/param1/param2/param3 etc.
    $action = $query[1];
    $target = $query[2];
    //The name of the user we are doing this action on
    $target_id = $query[3];
    //The targets's ID.  Needed to check if they are being blocked.
    switch ($action) {
        case 'block':
            if (twitter_block_exists($target_id)) {
                $action = 'unblock';
                $content = "<p>Are you really sure you want to <strong>Unblock {$target}</strong>?</p>";
                $content .= '<ul><li>They will see your updates on their home page if they follow you again.</li><li>You <em>can</em> block them again if you want.</li></ul>';
            } else {
                $content = "<p>Are you really sure you want to <strong>{$action} {$target}</strong>?</p>";
                $content .= "<ul><li>You won't show up in their list of friends</li><li>They won't see your updates on their home page</li><li>They won't be able to follow you</li><li>You <em>can</em> unblock them but you will need to follow them again afterwards</li></ul>";
            }
            break;
        case 'delete':
            $content = '<p>Are you really sure you want to delete your tweet?</p>';
            $content .= "<ul><li>Tweet ID: <strong>{$target}</strong></li><li>There is no way to undo this action.</li></ul>";
            break;
        case 'spam':
            $content = "<p>Are you really sure you want to report <strong>{$target}</strong> as a spammer?</p>";
            $content .= "<p>They will also be blocked from following you.</p>";
            break;
    }
    $content .= "<form action='{$action}/{$target}' method='post'>\n\t\t\t\t\t\t<input type='submit' value='Yes please' />\n\t\t\t\t\t</form>";
    theme('Page', 'Confirm', $content);
}
Beispiel #3
0
function twitter_confirmation_page($query)
{
    $action = $query[1];
    $target = $query[2];
    $target_id = $query[3];
    $realurl = "{$action}/{$target}";
    switch ($action) {
        case 'block':
            if (twitter_block_exists($target_id)) {
                $action = 'unblock';
                $content = "<p>" . __("Are you really sure you want to") . " <strong>" . __("Unblock") . " {$target}</strong>?</p>";
                $content .= "<ul><li>" . __("They will see your updates on their home page if they follow you again.") . "</li><li>" . __("You <em>can</em> block them again if you want.") . "</li></ul>";
            } else {
                $content = "<p>" . __("Are you really sure you want to") . " <strong>{$action} {$target}</strong>?</p>";
                $content .= "<ul><li>" . __("You won't show up in their list of friends") . "</li><li>" . __("They won't see your updates on their home page") . "</li><li>" . __("They won't be able to follow you") . "</li><li>" . __("You <em>can</em> unblock them but you will need to follow them again afterwards") . "</li></ul>";
            }
            break;
        case 'delete':
            $request = API_ROOT . "statuses/show.json?id={$target}";
            $status = twitter_process($request);
            $parsed = $status->text;
            $content = "<p>" . __("Are you really sure you want to") . " " . __("delete your tweet?") . "</p>";
            $content .= "<ul><li>" . __("Tweet: ") . "{$parsed}</li><li>" . __("Note: ") . __("There is no way to undo this action.") . "</li></ul>";
            break;
        case 'listdelete':
            $listname = $target;
            $membername = $target_id;
            $content = "<p>" . __("Are you really sure you want to") . $membername . __(" removed from your ") . $listname . __(" list?") . "</p>";
            $realurl = "lists/" . user_current_username() . "/{$listname}/delete/{$membername}";
            break;
        case 'spam':
            $content = "<p>" . __("Are you really sure you want to") . " " . __("report") . " <strong>{$target}</strong> " . __("as a spammer?") . "</p>";
            $content .= "<p>" . __("They won't be able to follow you.") . "</p>";
            break;
    }
    $content .= "<form action='" . BASE_URL . $realurl . "' method='post'><input type='submit' value='" . __("Yes") . "' /></form>";
    theme('Page', __("Confirm"), $content);
}