示例#1
0
function twitter_spreads_page($text)
{
    $date_joined = date('jS M Y', $raw_date_joined);
    $tweets_per_day = twitter_tweets_per_day($user, 1);
    $content .= '<fieldset><legend><img src="http://si0.twimg.com/images/dev/cms/intents/bird/bird_blue/bird_16_blue.png" width="16" height="16" /> What\'s Happening?</legend><div class="ss"><div class="form"><form method="post" action="update">
  <div style="margin:0;padding:0;display:inline"><textarea id="status" name="status" cols="44" style="width:100%">I\'m using #twitUBAS. Wanna try mobile twitter with fast access & rich of features? Try #twitUBe now. http://twit.basko.ro</textarea><input name="in_reply_to_id" value="' . $in_reply_to_id . '" type="hidden" /><input type="submit" value="Tweet" class="buttons" /></form></span><span id="remaining">140</span> 
  <span id="geo" style="display: none;"><input onclick="goGeo()" type="checkbox" id="geoloc" name="location" /> <label for="geoloc" id="lblGeo"></label></span></div></div></div></fieldset>  <script type="text/javascript">
started = false;
chkbox = document.getElementById("geoloc");
if (navigator.geolocation) {
    geoStatus("Tweet my location");
    if ("' . $_COOKIE['geo'] . '"=="Y") {
        chkbox.checked = true;
        goGeo();
    }
}
function goGeo(node) {
    if (started) return;
    started = true;
    geoStatus("Locating...");
    navigator.geolocation.getCurrentPosition(geoSuccess, geoStatus);
}
function geoStatus(msg) {
    document.getElementById("geo").style.display = "inline";
    document.getElementById("lblGeo").innerHTML = msg;
}
function geoSuccess(position) {
    geoStatus("Tweet my <a href=\'http://maps.google.co.uk/m?q=" + position.coords.latitude + "," + position.coords.longitude + "\' target=\'blank\'>location</a>");
    chkbox.value = position.coords.latitude + "," + position.coords.longitude;
}
  </script>';
    theme('page', "Spreads", $content);
}
示例#2
0
文件: theme.php 项目: NaiRobley/Dabr
function theme_users_list($feed, $hide_pagination = false)
{
    if (isset($feed->users)) {
        $users = $feed->users;
    } else {
        $users = $feed;
    }
    $rows = array();
    if (count($users) == 0 || $users == '[]') {
        return '<p>No users to display.</p>';
    }
    foreach ($users as $user) {
        $content = "";
        if ($user->user) {
            $user = $user->user;
        }
        $name = theme('full_name', $user);
        $tweets_per_day = twitter_tweets_per_day($user);
        $last_tweet = strtotime($user->status->created_at);
        // $vicon = ($user->verified) ? theme('action_icon', "", '✔', 'verified') : '';
        $content = "{$name}<br />";
        //" <span class=\"actionicons\">{$vicon}</span>";
        $content .= "<span class='about'>";
        if ($user->description != "") {
            $content .= "Bio: " . twitter_parse_tags($user->description, $user->entities->description) . "<br />";
        }
        if ($user->location != "") {
            $content .= theme('action_icon', "https://maps.google.com/maps?q=" . urlencode($user->location), "<span class='icons'>⌖</span> {$user->location}", 'Location');
            $content .= "<br />";
        }
        $content .= "Info: ";
        $content .= pluralise('tweet', $user->statuses_count, true) . ", ";
        $content .= pluralise('friend', $user->friends_count, true) . ", ";
        $content .= pluralise('follower', $user->followers_count, true) . ", ";
        $content .= "~" . pluralise('tweet', $tweets_per_day, true) . " per day<br />";
        if ($user->status->created_at) {
            $content .= "Last tweet: ";
            if ($user->protected == 'true' && $last_tweet == 0) {
                $content .= "Private";
            } else {
                if ($last_tweet == 0) {
                    $content .= "Never tweeted";
                } else {
                    $content .= twitter_date('l jS F Y', $last_tweet);
                }
            }
        }
        $content .= "</span>";
        $rows[] = array('data' => array(array('data' => theme('avatar', theme_get_avatar($user)), 'class' => 'avatar'), array('data' => $content, 'class' => 'status shift')), 'class' => 'tweet');
    }
    $content = theme('table', array(), $rows, array('class' => 'followers'));
    if (!$hide_pagination) {
        #$content .= theme('pagination');
        $content .= theme('list_pagination', $feed);
    }
    return $content;
}
示例#3
0
function theme_followers($feed, $hide_pagination = false)
{
    $rows = array();
    if (count($feed) == 0 || $feed == '[]') {
        return '<p>No users to display.</p>';
    }
    foreach ($feed->users->user as $user) {
        $name = theme('full_name', $user);
        $tweets_per_day = twitter_tweets_per_day($user);
        $last_tweet = strtotime($user->status->created_at);
        $content = "{$name}<br /><span class='about'>";
        if ($user->description != "") {
            $content .= "Bio: {$user->description}<br />";
        }
        if ($user->location != "") {
            $content .= "Location: {$user->location}<br />";
        }
        $content .= "Info: ";
        $content .= pluralise('tweet', $user->statuses_count, true) . ", ";
        $content .= pluralise('friend', $user->friends_count, true) . ", ";
        $content .= pluralise('follower', $user->followers_count, true) . ", ";
        $content .= "~" . pluralise('tweet', $tweets_per_day, true) . " per day<br />";
        $content .= "Last tweet: ";
        if ($user->protected == 'true' && $last_tweet == 0) {
            $content .= "Private";
        } else {
            if ($last_tweet == 0) {
                $content .= "Never tweeted";
            } else {
                $content .= twitter_date('l jS F Y', $last_tweet);
            }
        }
        $content .= "</span>";
        $rows[] = array('data' => array(array('data' => theme('avatar', $user->profile_image_url), 'class' => 'avatar'), array('data' => $content, 'class' => 'status shift')), 'class' => 'tweet');
    }
    $content = theme('table', array(), $rows, array('class' => 'followers'));
    if (!$hide_pagination) {
        $content .= theme('list_pagination', $feed);
    }
    return $content;
}
示例#4
0
function theme_followers($feed, $hide_pagination = false)
{
    $rows = array();
    if (count($feed) == 0 || $feed == '[]') {
        return '<p>No users to display.</p>';
    }
    foreach ($feed->users->user as $user) {
        $name = theme('full_name', $user);
        $tweets_per_day = twitter_tweets_per_day($user);
        $rows[] = array(theme('avatar', $user->profile_image_url), "{$name} - {$user->location}<br />" . "<small>{$user->description}<br />" . "Info: {$user->statuses_count} tweets, {$user->friends_count} friends, {$user->followers_count} followers, ~{$tweets_per_day} tweets per day</small>");
    }
    $content = theme('table', array(), $rows, array('class' => 'followers'));
    if (!$hide_pagination) {
        $content .= theme('list_pagination', $feed);
    }
    return $content;
}
示例#5
0
function theme_retweeters($feed, $hide_pagination = false)
{
    $rows = array();
    if (count($feed) == 0 || $feed == '[]') {
        return '<p>No one has retweeted this status.</p>';
    }
    foreach ($feed->user as $user) {
        $name = theme('full_name', $user);
        $tweets_per_day = twitter_tweets_per_day($user);
        $last_tweet = strtotime($user->status->created_at);
        $content = "{$name}<br /><span class='about'>";
        if ($user->description != "") {
            $content .= "Bio: " . twitter_parse_tags($user->description) . "<br />";
        }
        if ($user->location != "") {
            $content .= "Location: {$user->location}<br />";
        }
        $content .= "Info: ";
        $content .= pluralise('tweet', $user->statuses_count, true) . ", ";
        $content .= pluralise('friend', $user->friends_count, true) . ", ";
        $content .= pluralise('follower', $user->followers_count, true) . ", ";
        $content .= "~" . pluralise('tweet', $tweets_per_day, true) . " per day<br />";
        $content .= "</span>";
        $rows[] = array('data' => array(array('data' => theme('avatar', theme_get_avatar($user)), 'class' => 'avatar'), array('data' => $content, 'class' => 'status shift')), 'class' => 'tweet');
    }
    $content = theme('table', array(), $rows, array('class' => 'followers'));
    if (!$hide_pagination) {
        $content .= theme('list_pagination', $feed);
    }
    return $content;
}
示例#6
0
文件: twitter.php 项目: xctcc/npt
function theme_followers($feed, $hide_pagination = false, $list = false)
{
    $rows = array();
    $lists = $feed->users;
    if (count($lists) == 0) {
        return '<p>' . __('No users to display.') . '</p>';
    }
    foreach ($lists as $user) {
        $name = theme('full_name', $user);
        if ($list) {
            $name .= " <a href='" . BASE_URL . "confirm/listdelete/{$list}/{$user->screen_name}'>" . __("Delete From List") . "</a>";
        }
        $tweets_per_day = twitter_tweets_per_day($user);
        $last_tweet = strtotime($user->status->created_at);
        $content = "{$name}<br /><span class='about'>";
        if ($user->description != "") {
            $content .= "<strong>" . __("Bio: ") . "</strong>{$user->description}<br />";
        }
        if ($user->location != "") {
            $content .= "<strong>" . __("Location: ") . "</strong>{$user->location}<br />";
        }
        $content .= "<strong>" . __("Info: ") . "</strong>";
        $content .= $user->statuses_count . " " . __("Tweets") . " | ";
        $content .= $user->friends_count . " " . __("Friends") . " | ";
        $content .= $user->followers_count . " " . __("Followers") . " | ";
        $content .= "~" . $tweets_per_day . " " . __("Tweets Per Day") . "<br />";
        $content .= "<strong>" . __("Last tweet: ") . "</strong>";
        if ($user->protected == 'true' && $last_tweet == 0) {
            $content .= __("Private/Protected");
        } elseif ($last_tweet == 0) {
            $content .= __("Never tweeted");
        } else {
            // $content .= twitter_date('Y-m-d H:i', $last_tweet);
            $content .= format_interval(time() - $last_tweet) . __(" ago");
        }
        $content .= "</span>";
        $rows[] = array('data' => array(array('data' => theme('avatar', img_proxy_url(theme_get_avatar($user))), 'class' => 'avatar'), array('data' => $content, 'class' => 'status shift')), 'class' => 'tweet');
    }
    $content = theme('table', array(), $rows, array('class' => 'followers'));
    if (!$hide_pagination) {
        $content .= theme('list_pagination', $feed);
    }
    return $content;
}
示例#7
0
文件: theme.php 项目: vinazol/Dabr
function theme_users_list($feed, $hide_pagination = false)
{
    if (isset($feed->users)) {
        $users = $feed->users;
    } else {
        $users = $feed;
    }
    $rows = array();
    if (count($users) == 0 || $users == '[]') {
        return '<p>' . _(NO_USERS_FOUND) . '</p>';
    }
    foreach ($users as $user) {
        $content = "";
        if ($user->user) {
            $user = $user->user;
        }
        $name = theme('full_name', $user);
        $tweets_per_day = twitter_tweets_per_day($user);
        $last_tweet = strtotime($user->status->created_at);
        $content = "{$name}<br />";
        $content .= "<span class='about'>";
        if ($user->description != "") {
            $content .= _(PROFILE_BIO) . ": " . twitter_parse_tags($user->description, $user->entities->description) . "<br />";
        }
        if ($user->location != "") {
            $content .= theme('action_icon', "https://maps.google.com/maps?q=" . urlencode($user->location), "<span class='icons'>⌖</span> {$user->location}", _(PROFILE_LOCATION));
            $content .= "<br />";
        }
        $content .= theme_user_info($user);
        if ($user->status->created_at) {
            $content .= " " . _(LAST_TWEET) . ": ";
            if ($user->protected == 'true' && $last_tweet == 0) {
                $content .= _(LAST_TWEET_PRIVATE);
            } else {
                if ($last_tweet == 0) {
                    $content .= _(LAST_TWEET_NEVER);
                } else {
                    $content .= twitter_date('l jS F Y', $last_tweet);
                }
            }
        }
        $content .= "</span>";
        $rows[] = array('data' => array(array('data' => theme('avatar', theme_get_avatar($user)), 'class' => 'avatar'), array('data' => $content, 'class' => 'status shift')), 'class' => 'tweet');
    }
    $content = theme('table', array(), $rows, array('class' => 'followers'));
    if (!$hide_pagination) {
        #$content .= theme('pagination');
        $content .= theme('list_pagination', $feed);
    }
    return $content;
}