Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 13 commits
  • 22 files changed
  • 0 commit comments
  • 5 contributors
Commits on Sep 16, 2011
Shelby DeNike Pict.Mobi Support
Added Pict.mobi support
57641ad
Commits on Nov 09, 2011
@tonyduckles tonyduckles Introduce $lifestream->date_format. Replace most date() calls with da…
…te_format().
306e54a
@tonyduckles tonyduckles Eliminate $lifestream->date and $lifestream->get_date() since they no…
…w just duplicate $lifestream->timestamp
490f634
@tonyduckles tonyduckles Create wp_post lsevent entries with local timezone rather than UTC 4c9f309
Commits on Nov 02, 2012
@AaronVanGeffen AaronVanGeffen Fixed the Twitter extension, for now. Note this change will likely st…
…op working around March 2013, when Twitter completly phases out their XML-based API.
6d5735a
@dcramer Merge pull request #102 from AaronVanGeffen/master
Fixed Twitter extension
a4e78f6
Commits on Dec 29, 2012
@mousey mousey Merge pull request #82 from tonyduckles/timezone-fix
Timezone Issues fix
d851a92
@mousey mousey Merge pull request #78 from sdenike/master
Added Pict.Mobi Support
05aa7b3
Commits on Jan 04, 2013
Rob McGhee Twitter Fix
Twitter Fix Suggested By thebinarypenguin
5b89cad
Rob McGhee Tumblr Fix
Issue #74 Fix suggested by entropicamente
b38b0f3
Rob McGhee Xbox Live Fix
Issue #104 changed the plugin to use xboxapi.com instead of the old
duncanmackenzie site
aab410d
Commits on Jan 06, 2013
Rob McGhee XBox Live Fix v2
Corrected the For Each issue #104
f860bd7
Rob McGhee Google Plus Fix
Using URL provided by @netizenxero on issue #89
389df53
View
2  extensions/googleplus/extension.inc.php
@@ -22,7 +22,7 @@ function get_options()
function get_url()
{
- return "http://plusfeed.appspot.com/". $this->get_option('id');
+ return "http://highdn-plusfeed.appspot.com/". $this->get_option('id');
}
function get_public_url()
View
33 extensions/pictmobi/extension.inc.php
@@ -0,0 +1,33 @@
+<?php
+class Lifestream_PictMobiFeed extends Lifestream_PhotoFeed
+{
+ const ID = 'pictmobi';
+ const NAME = 'Pict.Mobi';
+ const URL = 'http://pict.mobi/';
+
+ function get_options()
+ {
+ return array(
+ 'username' => array($this->lifestream->__('Username:'), true, '', ''),
+ );
+ }
+
+ function get_public_url()
+ {
+ return 'http://pict.mobi/images/'.$this->get_option('username');
+ }
+
+ function get_url()
+ {
+ return 'http://pict.mobi/feed/'.$this->get_option('username');
+ }
+
+ function get_thumbnail_url($row, $item)
+ {
+ preg_match('#\/([^\/]+)$#i', $item['link'], $matches);
+ return 'http://pict.mobi/show/thumb/'.$matches[1];
+ }
+}
+$lifestream->register_feed('Lifestream_PictMobiFeed');
+?>
+
View
BIN  extensions/pictmobi/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  extensions/pictmobi/index.html
No changes.
View
163 extensions/tumblr/extension.inc.php
@@ -1,83 +1,82 @@
-<?php
-class Lifestream_TumblrFeed extends Lifestream_Feed
-{
- const ID = 'tumblr';
- const NAME = 'Tumblr';
- const URL = 'http://www.tumblr.com/';
- const HAS_EXCERPTS = true;
-
- // http://media.tumblr.com/ck3ATKEVYd6ay62wLAzqtEkX_500.jpg
- private $image_match_regexp = '/src="(http:\/\/(?:[a-z0-9\.]+\.)?media\.tumblr\.com\/[a-zA-Z0-9_-]+\.jpg)"/i';
-
- function get_options()
- {
- return array(
- 'username' => array($this->lifestream->__('Username:'), true, '', ''),
- );
- }
-
- # TODO: initialization import
- # http://twitter.com/statuses/user_timeline/zeeg.xml
- function get_url()
- {
- return 'http://'.$this->get_option('username').'.tumblr.com/rss';
- }
-
- function get_user_url($user)
- {
- return 'http://'.$this->get_option('username').'.tumblr.com/';
- }
-
- function yield($row, $url, $key)
- {
- $data = parent::yield($row, $url, $key);
- preg_match($this->image_match_regexp, $row->get_description(), $match);
- if (strip_tags($data['title']) == strip_tags($data['description']))
- {
- $data['key'] = 'note';
- }
- if ($match)
- {
- $data['thumbnail'] = $match[1];
- $data['image'] = $match[1];
- $data['key'] = 'image';
- }
- return $data;
- }
-
- function parse_users($text)
- {
- return preg_replace_callback('/([^\w]*)@([a-z0-9_-]+)\b/i', array($this, '_get_user_link'), $text);
- }
-
- function _get_user_link($match)
- {
- return $match[1].$this->get_user_link($match[2]);
- }
-
- function render_item($event, $item)
- {
- if ($event->key == 'image')
- {
- return Lifestream_PhotoFeed::render_item($event, $item);
- }
- elseif ($event->key == 'note')
- {
- return Lifestream_TwitterFeed::parse_users($this->parse_urls(htmlspecialchars($item['title']))) . ' ['.$this->lifestream->get_anchor_html($this->get_option('username'). htmlspecialchars($item['link'])).']';
- }
- else
- {
- return parent::render_item($event, $item);
- }
- }
-
- function get_label_class($key)
- {
- if ($key == 'image') $cls = Lifestream_PhotoFeed::LABEL;
- elseif ($key == 'note') $cls = Lifestream_TwitterFeed::LABEL;
- else $cls = Lifestream_BlogFeed::LABEL;
- return $cls;
- }
-}
-$lifestream->register_feed('Lifestream_TumblrFeed');
+<?php
+class Lifestream_TumblrFeed extends Lifestream_Feed
+{
+ const ID = 'tumblr';
+ const NAME = 'Tumblr';
+ const URL = 'http://www.tumblr.com/';
+ const HAS_EXCERPTS = true;
+
+ // http://media.tumblr.com/ck3ATKEVYd6ay62wLAzqtEkX_500.jpg
+ private $image_match_regexp = '/src="(http:\/\/(?:[a-z0-9\.]+\.)?media\.tumblr\.com\/[a-zA-Z0-9_-]+\.jpg)"/i';
+
+ function get_options()
+ {
+ return array(
+ 'username' => array($this->lifestream->__('Username:'), true, '', ''),
+ );
+ }
+
+ # TODO: initialization import
+ function get_url()
+ {
+ return 'http://'.$this->get_option('username').'.tumblr.com/rss';
+ }
+
+ function get_user_url($user)
+ {
+ return 'http://'.$this->get_option('username').'.tumblr.com/';
+ }
+
+ function yield($row, $url, $key)
+ {
+ $data = parent::yield($row, $url, $key);
+ preg_match($this->image_match_regexp, $row->get_description(), $match);
+ if (strip_tags($data['title']) == strip_tags($data['description']))
+ {
+ $data['key'] = 'note';
+ }
+ if ($match)
+ {
+ $data['thumbnail'] = $match[1];
+ $data['image'] = $match[1];
+ $data['key'] = 'image';
+ }
+ return $data;
+ }
+
+ function parse_users($text)
+ {
+ return preg_replace_callback('/([^\w]*)@([a-z0-9_-]+)\b/i', array($this, '_get_user_link'), $text);
+ }
+
+ function _get_user_link($match)
+ {
+ return $match[1].$this->get_user_link($match[2]);
+ }
+
+ function render_item($event, $item)
+ {
+ if ($event->key == 'image')
+ {
+ return Lifestream_PhotoFeed::render_item($event, $item);
+ }
+ elseif ($event->key == 'note')
+ {
+ return Lifestream_TumblrFeed::parse_users($this->parse_urls(htmlspecialchars($item['title']))) . ' ['.$this->lifestream->get_anchor_html($this->get_option('username'). htmlspecialchars($item['link'])).']';
+ }
+ else
+ {
+ return parent::render_item($event, $item);
+ }
+ }
+
+ function get_label_class($key)
+ {
+ if ($key == 'image') $cls = Lifestream_PhotoFeed::LABEL;
+ elseif ($key == 'note') $cls = Lifestream_TumblrFeed::LABEL;
+ else $cls = Lifestream_BlogFeed::LABEL;
+ return $cls;
+ }
+}
+$lifestream->register_feed('Lifestream_TumblrFeed');
?>
View
272 extensions/twitter/extension.inc.php
@@ -1,140 +1,134 @@
-<?php
-class Lifestream_TwitterFeed extends Lifestream_Feed
-{
- const ID = 'twitter';
- const NAME = 'Twitter';
- const URL = 'http://www.twitter.com/';
- const LABEL = 'Lifestream_MessageLabel';
- const CAN_GROUP = false;
- const DESCRIPTION = 'Specifying your password will allow Lifestream to pull in protected updates from your profile. Your password is stored in plaintext in the database, so only do this is you have no other option.';
- const AUTHOR = 'David Cramer, Kyle McNally';
-
- function __toString()
- {
- return $this->get_option('username');
- }
-
- function get_options()
- {
- return array(
- 'username' => array($this->lifestream->__('Username:'), true, '', ''),
- 'password' => array($this->lifestream->__('Password:'), false, '', ''),
- 'hide_username' => array($this->lifestream->__('Hide Username'), false, true, false),
- 'hide_replies' => array($this->lifestream->__('Hide Replies'), false, true, false),
- );
- }
-
- function _get_user_link($match)
- {
- return $match[1].$this->get_user_link($match[2]);
- }
-
- function _get_search_term_link($match)
- {
- return $match[1].$this->lifestream->get_anchor_html(htmlspecialchars($match[2]), 'https://search.twitter.com/search?q='.urlencode($match[2]), array('class'=>'searchterm'));
- }
-
- function get_user_link($user)
- {
- return $this->lifestream->get_anchor_html('@'.htmlspecialchars($user), $this->get_user_url($user), array('class'=>'user'));
- }
-
- function get_user_url($user)
- {
- return 'http://www.twitter.com/'.urlencode($user);
- }
-
- function get_public_url()
- {
- return $this->get_user_url($this->get_option('username'));
- }
-
- function parse_users($text)
- {
- return preg_replace_callback('/([^\w]*)@([a-z0-9_\-\/]+)\b/i', array($this, '_get_user_link'), $text);
- }
-
- function parse_search_term($text)
- {
- return preg_replace_callback('/([^\w]*)(#[a-z0-9_\-\/]+)\b/i', array($this, '_get_search_term_link'), $text);
- }
-
- function get_url($page=1, $count=20)
- {
- if ($this->get_option('password'))
- {
- $url_base = 'http://'.$this->get_option('username').':'.urlencode($this->get_option('password')).'@twitter.com';
- }
- else
- {
- $url_base = 'http://twitter.com';
- }
- return $url_base . '/statuses/user_timeline/'.$this->get_option('username').'.rss?page='.$page.'&count='.$count.'&source=twitterandroid';
- }
-
- function save()
- {
- $is_new = (bool)!$this->id;
- parent::save();
- if ($is_new)
- {
- // new feed -- attempt to import all statuses up to 2k
- $feed_msg = array(true, '');
- $page = 0;
- while ($feed_msg[0] !== false && $page < 10)
- {
- $page += 1;
- $feed_msg = $this->refresh($this->get_url($page, 200));
- }
- }
- }
-
- function render_item($row, $item)
- {
- $url = $this->parse_search_term($this->parse_users($this->parse_urls(htmlspecialchars($item['description']))));
- if($this->get_option('hide_username')) return $url;
- else return $url . ' ['.$this->lifestream->get_anchor_html(htmlspecialchars($this->get_option('username')), $item['link']).']';
- }
-
- function yield($row, $url, $key)
- {
- $data = parent::yield($row, $url, $key);
- $string = $this->get_option('username'). ': ';
- $description = $this->lifestream->html_entity_decode($row->get_description());
- if (lifestream_str_startswith(strtolower($description), strtolower($string)))
- {
- $description = substr($description, strlen($string));
- }
- if ($this->get_option('hide_replies') && lifestream_str_startswith($description, '@'))
- {
- return false;
- }
- $data['description'] = $description;
- return $data;
- }
-}
-
-/**
- * Displays your latest Twitter status.
- * @param {Boolean} $links Parse user links.
- */
-function lifestream_twitter_status($links=true)
-{
- global $lifestream;
-
- $event = $lifestream->get_single_event('twitter');
- if (!$event) return;
- if ($links)
- {
- // to render it with links
- echo $event->feed->render_item($event, $event->data[0]);
- }
- else
- {
- // or render just the text
- echo $event->data[0]['title'];
- }
-}
-
-$lifestream->register_feed('Lifestream_TwitterFeed');
+<?php
+class Lifestream_TwitterFeed extends Lifestream_Feed
+{
+ const ID = 'twitter';
+ const NAME = 'Twitter';
+ const URL = 'http://www.twitter.com/';
+ const LABEL = 'Lifestream_MessageLabel';
+ const CAN_GROUP = false;
+ const DESCRIPTION = 'Specifying your password will allow Lifestream to pull in protected updates from your profile. Your password is stored in plaintext in the database, so only do this is you have no other option.';
+ const AUTHOR = 'David Cramer, Kyle McNally';
+
+ function __toString()
+ {
+ return $this->get_option('username');
+ }
+
+ function get_options()
+ {
+ return array(
+ 'username' => array($this->lifestream->__('Username:'), true, '', ''),
+ 'hide_username' => array($this->lifestream->__('Hide Username'), false, true, false),
+ 'hide_replies' => array($this->lifestream->__('Hide Replies'), false, true, false),
+ );
+ }
+
+ function _get_user_link($match)
+ {
+ return $match[1].$this->get_user_link($match[2]);
+ }
+
+ function _get_search_term_link($match)
+ {
+ return $match[1].$this->lifestream->get_anchor_html(htmlspecialchars($match[2]), 'https://search.twitter.com/search?q='.urlencode($match[2]), array('class'=>'searchterm'));
+ }
+
+ function get_user_link($user)
+ {
+ return $this->lifestream->get_anchor_html('@'.htmlspecialchars($user), $this->get_user_url($user), array('class'=>'user'));
+ }
+
+ function get_user_url($user)
+ {
+ return 'http://www.twitter.com/'.urlencode($user);
+ }
+
+ function get_public_url()
+ {
+ return $this->get_user_url($this->get_option('username'));
+ }
+
+ function parse_users($text)
+ {
+ return preg_replace_callback('/([^\w]*)@([a-z0-9_\-\/]+)\b/i', array($this, '_get_user_link'), $text);
+ }
+
+ function parse_search_term($text)
+ {
+ return preg_replace_callback('/([^\w]*)(#[a-z0-9_\-\/]+)\b/i', array($this, '_get_search_term_link'), $text);
+ }
+
+ function get_url($page=1, $count=20)
+ {
+ return 'http://api.twitter.com/1/statuses/user_timeline.rss'
+ . '?screen_name='.$this->get_option('username')
+ . '&page='.$page
+ . '&count='.$count;
+ }
+
+ function save()
+ {
+ $is_new = (bool)!$this->id;
+ parent::save();
+ if ($is_new)
+ {
+ // new feed -- attempt to import all statuses up to 2k
+ $feed_msg = array(true, '');
+ $page = 0;
+ while ($feed_msg[0] !== false && $page < 10)
+ {
+ $page += 1;
+ $feed_msg = $this->refresh($this->get_url($page, 200));
+ }
+ }
+ }
+
+ function render_item($row, $item)
+ {
+ $url = $this->parse_search_term($this->parse_users($this->parse_urls(htmlspecialchars($item['description']))));
+ if($this->get_option('hide_username')) return $url;
+ else return $url . ' ['.$this->lifestream->get_anchor_html(htmlspecialchars($this->get_option('username')), $item['link']).']';
+ }
+
+ function yield($row, $url, $key)
+ {
+ $data = parent::yield($row, $url, $key);
+ $string = $this->get_option('username'). ': ';
+ $description = $this->lifestream->html_entity_decode($row->get_description());
+ if (lifestream_str_startswith(strtolower($description), strtolower($string)))
+ {
+ $description = substr($description, strlen($string));
+ }
+ if ($this->get_option('hide_replies') && lifestream_str_startswith($description, '@'))
+ {
+ return false;
+ }
+ $data['description'] = $description;
+ return $data;
+ }
+}
+
+/**
+ * Displays your latest Twitter status.
+ * @param {Boolean} $links Parse user links.
+ */
+function lifestream_twitter_status($links=true)
+{
+ global $lifestream;
+
+ $event = $lifestream->get_single_event('twitter');
+ if (!$event) return;
+ if ($links)
+ {
+ // to render it with links
+ echo $event->feed->render_item($event, $event->data[0]);
+ }
+ else
+ {
+ // or render just the text
+ echo $event->data[0]['title'];
+ }
+}
+
+$lifestream->register_feed('Lifestream_TwitterFeed');
?>
View
141 extensions/xboxlive/extension.inc.php
@@ -1,72 +1,71 @@
-<?php
-class Lifestream_XboxLiveFeed extends Lifestream_Feed
-{
- const ID = 'xboxlive';
- const NAME = 'Xbox Live';
- const URL = 'http://www.xbox.com/';
- const LABEL = 'Lifestream_PlayGameLabel';
-
- function __toString()
- {
- return $this->get_option('username');
- }
-
- function get_options()
- {
- return array(
- 'username' => array($this->lifestream->__('Xbox Live ID:'), true, '', ''),
- );
- }
-
- function get_public_url()
- {
- return 'http://live.xbox.com/member/'.urlencode($this->get_option('username'));
- }
-
- function get_url()
- {
- return 'http://duncanmackenzie.net/services/GetXboxInfo.aspx?GamerTag='.urlencode($this->get_option('username'));
- }
-
- function get_event_display(&$event, &$bit)
- {
- return $bit['title'] ? $bit['title'] : $bit['name'];
- }
-
- function yield($row)
- {
- return array(
- 'guid' => $this->lifestream->html_entity_decode($row->DetailsURL),
- 'date' => strtotime($row->LastPlayed),
- 'link' => $this->lifestream->html_entity_decode($row->DetailsURL),
- 'title' => $this->lifestream->html_entity_decode($row->Game->Name),
- );
- }
-
- function fetch()
- {
- $url = $this->get_url();
- $response = $this->lifestream->file_get_contents($url);
-
- if ($response)
- {
- $xml = new SimpleXMLElement($response);
-
- if ($xml[0] == 'Service Unavailable') return;
-
- $items = array();
- foreach ($xml->RecentGames->XboxUserGameInfo as $row)
- {
- $items[] = $this->yield($row);
- }
- return $items;
- }
- }
-
- function render_item($row, $item)
- {
- return sprintf('%s', htmlspecialchars($item['link']), htmlspecialchars($item['name']));
- }
-}
-$lifestream->register_feed('Lifestream_XboxLiveFeed');
+<?php
+class Lifestream_XboxLiveFeed extends Lifestream_Feed
+{
+ const ID = 'xboxlive';
+ const NAME = 'Xbox Live';
+ const URL = 'http://www.xbox.com/';
+ const LABEL = 'Lifestream_PlayGameLabel';
+
+ function __toString()
+ {
+ return $this->get_option('username');
+ }
+
+ function get_options()
+ {
+ return array(
+ 'username' => array($this->lifestream->__('Xbox Live ID:'), true, '', ''),
+ );
+ }
+
+ function get_public_url()
+ {
+ return 'http://live.xbox.com/member/'.urlencode($this->get_option('username'));
+ }
+
+ function get_url()
+ {
+ return 'https://xboxapi.com/xml/profile/'.urlencode($this->get_option('username'));
+ }
+
+ function get_event_display(&$event, &$bit)
+ {
+ return $bit['title'] ? $bit['title'] : $bit['name'];
+ }
+
+ function yield($row)
+ {
+ return array(
+ 'guid' => $this->lifestream->html_entity_decode($row->ID),
+ 'link' => $this->lifestream->html_entity_decode($row->MarketplaceURL),
+ 'title' => $this->lifestream->html_entity_decode($row->Name),
+ );
+ }
+
+ function fetch()
+ {
+ $url = $this->get_url();
+ $response = $this->lifestream->file_get_contents($url);
+
+ if ($response)
+ {
+ $xml = new SimpleXMLElement($response);
+
+ if ($xml[0] == 'Service Unavailable') return;
+
+ $items = array();
+ foreach ($xml->RecentGames as $row)
+ {
+ $items[] = $this->yield($row);
+ }
+ return $items;
+ }
+ }
+
+ function render_item($row, $item)
+ {
+ return sprintf('%s', htmlspecialchars($item['link']), htmlspecialchars($item['name']));
+ }
+}
+$lifestream->register_feed('Lifestream_XboxLiveFeed');
?>
View
31 inc/core.php
@@ -58,7 +58,6 @@ class Lifestream_Event
function __construct(&$lifestream, $row)
{
$this->lifestream = $lifestream;
- $this->date = $row->timestamp;
$this->data = array(unserialize($row->data));
$this->id = $row->id;
$this->timestamp = $row->timestamp;
@@ -94,11 +93,6 @@ function get_timesince()
return $this->lifestream->timesince($this->timestamp);
}
- function get_date()
- {
- return $this->date + LIFESTREAM_DATE_OFFSET;
- }
-
/**
* Returns an HTML-ready string.
*/
@@ -645,9 +639,6 @@ function init()
{
global $wpdb;
- $offset = get_option('gmt_offset') * 3600;
- define('LIFESTREAM_DATE_OFFSET', $offset);
-
load_plugin_textdomain('lifestream', false, 'lifestream/locales');
$page = (isset($_GET['page']) ? $_GET['page'] : null);
@@ -1540,7 +1531,7 @@ function timesince($timestamp, $granularity=1, $format='Y-m-d H:i:s')
}
else
{
- return date($this->get_option('day_format'), $timestamp);
+ return $this->date_format($this->get_option('day_format'), $timestamp);
}
}
@@ -1979,7 +1970,7 @@ function create_post_for_event($event)
'post_type' => 'lsevent',
// should we insert the feed types into the tags?
// 'tags_input' => ''
- 'post_date' => date('Y-m-d H:i:s', $event->timestamp),
+ 'post_date' => $this->date_format('Y-m-d H:i:s', $event->timestamp),
);
$post_id = wp_insert_post($post);
$event->post_id = $post_id;
@@ -2164,6 +2155,18 @@ function get_events($_=array())
}
return $events;
}
+
+ /**
+ * Given a UTC-based timestamp, return a formatted date based on the
+ * WP timezone setting.
+ */
+ function date_format($format, $timestamp=null) {
+ if (!$timestamp) $timestamp = time();
+ $timezone = get_option('timezone_string');
+ $date = new DateTime('@'.$timestamp, new DateTimeZone('UTC'));
+ if ($timezone) $date->setTimezone(new DateTimeZone($timezone)); // Use local timezone if set in wp-lifestream options
+ return $date->format($format);
+ }
}
$lifestream = new Lifestream();
@@ -2557,7 +2560,7 @@ function refresh($urls=null, $initial=false)
if ($this->get_option('grouped') && $this->get_constant('CAN_GROUP') && constant(sprintf('%s::%s', $label, 'CAN_GROUP')))
{
if (!array_key_exists($group_key, $grouped)) $grouped[$group_key] = array();
- $grouped[$group_key][date('m d Y', $date)] = $date;
+ $grouped[$group_key][$this->lifestream->date_format('m d Y', $date)] = $date;
}
else
{
@@ -2950,8 +2953,6 @@ function lifestream($args=array())
$_['limit'] = $_['limit'] + 1;
$options =& $_;
- // TODO: offset
- //$offset = $lifestream->get_option('lifestream_timezone');
$events = call_user_func(array(&$lifestream, 'get_events'), $_);
$has_next_page = (count($events) > $limit);
if ($has_next_page) {
@@ -2989,8 +2990,6 @@ function lifestream_sidebar_widget($_=array())
$options =& $_;
- // TODO: offset
- //$offset = $lifestream->get_option('lifestream_timezone');
$events = call_user_func(array(&$lifestream, 'get_events'), $_);
$show_metadata = empty($options['hide_metadata']);
View
6 inc/syndicate.php
@@ -16,7 +16,7 @@ function lifestream_rss_feed()
header('Content-Type: application/xml+rss; charset: UTF-8');
- $date = date('r');
+ $date = $lifestream->date_format('r');
$lines = array('<?xml version="1.0" encoding="UTF-8"?>');
$lines[] = '<rss xmlns:lifestream="http://www.davidcramer.net/a-url-which-ill-make-later" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">';
$lines[] = ' <channel>';
@@ -61,7 +61,7 @@ function lifestream_opml_feed()
*/
global $wpdb, $lifestream;
- $date = date(DATE_RFC822);
+ $date = $lifestream->date_format(DATE_RFC822);
$lines = array('<?xml version="1.0" encoding="UTF-8"?>');
$lines[] = '<!-- OPML generated by Lifestream '.LIFESTREAM_VERSION.' on '.$date.' -->';
$lines[] = '<opml version="1.1">';
@@ -113,4 +113,4 @@ function lifestream_opml_feed()
$lines[] = '</opml>';
echo implode("\n", $lines);
}
-?>
+?>
View
4 inc/template.php
@@ -202,7 +202,7 @@ function event_date($event=null)
{
if (!$event) $event = $this->event;
- echo date($this->lifestream->get_option('hour_format'), $event->timestamp);
+ echo $this->lifestream->date_format($this->lifestream->get_option('hour_format'), $event->timestamp);
}
function get_link()
@@ -347,4 +347,4 @@ function ls_prev_page($format='&laquo; %link', $link='%title')
return $ls_template->previous_stream_link();
}
-?>
+?>
View
4 pages/edit-feed.inc.php
@@ -175,7 +175,7 @@ function checkAutoIcon() {
<tr valign="top">
<td class="num"><?php echo $result->id; ?></td>
<td><strong><a class="row-title" href="<?php echo htmlspecialchars($result->get_event_link()); ?>"<?php if (!$result->visible) echo ' style="text-decoration: line-through;"'; ?>><?php echo htmlspecialchars($result->get_event_display()); ?></a></strong><br/><small><?php echo htmlspecialchars($result->feed->get_public_name()); ?> &#8211; <?php echo htmlspecialchars($result->get_event_link()); ?></small>
- <td><?php echo date($date_format, $result->date); ?></td>
+ <td><?php echo $lifestream->date_format($date_format, $result->timestamp); ?></td>
<td><?php echo $result->owner; ?></td>
</tr>
<?php } ?>
@@ -186,4 +186,4 @@ function checkAutoIcon() {
<?php } ?>
<br/>
<?php } ?>
-</div>
+</div>
View
4 pages/errors.inc.php
@@ -66,7 +66,7 @@
}
?>
</td>
- <td><?php echo date($date_format, $result->timestamp); ?></td>
+ <td><?php echo $lifestream->date_format($date_format, $result->timestamp); ?></td>
</tr>
<?php } ?>
</tbody>
@@ -80,4 +80,4 @@
</div>
<?php } else { ?>
<p><?php $lifestream->_e('There are no errors to show.'); ?></p>
-<?php } ?>
+<?php } ?>
View
4 pages/events.inc.php
@@ -42,7 +42,7 @@
<td class="num"><a href="?page=lifestream.php&amp;op=edit&amp;id=<?php echo $result->feed->id; ?>"><?php echo $result->feed->id; ?></a></td>
<td class="icon"><img src="<?php echo $result->feed->get_icon_url(); ?>" alt="icon"/></td>
<td><strong><a class="row-title" href="<?php echo htmlspecialchars($result->get_event_link()); ?>"<?php if (!$result->visible) echo ' style="text-decoration: line-through;"'; ?>><?php echo htmlspecialchars($result->get_event_display()); ?></a></strong><br/><small><?php echo htmlspecialchars($result->feed->get_public_name()); ?> &#8211; <?php echo htmlspecialchars($result->get_event_link()); ?></small></td>
- <td><?php echo date($date_format, $result->date); ?></td>
+ <td><?php echo $lifestream->date_format($date_format, $result->timestamp); ?></td>
<td><?php echo $result->owner; ?></td>
</tr>
<?php } ?>
@@ -61,4 +61,4 @@
</form>
<?php } else { ?>
<p><?php $lifestream->_e('There are no events to show.'); ?></p>
-<?php } ?>
+<?php } ?>
View
2  pages/feeds.inc.php
@@ -60,7 +60,7 @@
if (is_int($msg)) echo '<div class="success">'.$msg.' new event(s).</div>';
}
?></td>
- <td class="date"><?php echo date('F j, Y', $result->date).'<br/>'.date('g:ia', $result->date); ?></td>
+ <td class="date"><?php echo $lifestream->date_format('F j, Y', $result->date).'<br/>'.$lifestream->date_format('g:ia', $result->date); ?></td>
<td class="num"><?php echo $result->events; ?></td>
<td><?php echo $result->owner; ?></td>
</tr>
View
4 pages/maintenance.inc.php
@@ -50,7 +50,7 @@
?>
<tr>
<td><strong><?php echo htmlspecialchars($name); ?></strong><br /><small><?php echo htmlspecialchars($lifestream->get_cron_task_description($name)); ?></small></td>
- <td><?php echo date('r', $ts + LIFESTREAM_DATE_OFFSET); ?><br /><small>Every <?php echo $lifestream->duration($data[0]['interval']); ?></td>
+ <td><?php echo $lifestream->date_format('r', $ts); ?><br /><small>Every <?php echo $lifestream->duration($data[0]['interval']); ?></td>
</tr>
<?php
}
@@ -89,4 +89,4 @@
</dl>
</fieldset>
<br/>
-</form>
+</form>
View
6 pages/settings.inc.php
@@ -20,14 +20,14 @@
<tr>
<th><label for="id_day_format"><?php $lifestream->_e('Day Format:'); ?></label></th>
<td>
- <input type="text" class="text" name="lifestream_day_format" id="id_day_format" value="<?php echo htmlspecialchars($lifestream->get_option('day_format')); ?>"/> (e.g. <?php echo date($lifestream->get_option('day_format')); ?>)
+ <input type="text" class="text" name="lifestream_day_format" id="id_day_format" value="<?php echo htmlspecialchars($lifestream->get_option('day_format')); ?>"/> (e.g. <?php echo $lifestream->date_format($lifestream->get_option('day_format')); ?>)
<div class="helptext"><?php $lifestream->_e('For more information, please see PHP\'s <a href="http://www.php.net/date/">date()</a> method.'); ?></div>
</td>
</tr>
<tr>
<th><label for="id_hour_format"><?php $lifestream->_e('Hour Format:'); ?></label></th>
<td>
- <input type="text" class="text" name="lifestream_hour_format" id="id_hour_format" value="<?php echo htmlspecialchars($lifestream->get_option('hour_format')); ?>"/> (e.g. <?php echo date($lifestream->get_option('hour_format')); ?>)
+ <input type="text" class="text" name="lifestream_hour_format" id="id_hour_format" value="<?php echo htmlspecialchars($lifestream->get_option('hour_format')); ?>"/> (e.g. <?php echo $lifestream->date_format($lifestream->get_option('hour_format')); ?>)
<div class="helptext"><?php $lifestream->_e('For more information, please see PHP\'s <a href="http://www.php.net/date/">date()</a> method.'); ?></div>
</td>
</tr>
@@ -330,4 +330,4 @@ function handleDigestTimeField() {
</div>
</div>
</form>
-</div>
+</div>
View
2  templates/event.php
@@ -16,7 +16,7 @@
<div class="lifestream_label"><?php ls_event_label(); ?></div>
<div class="lifestream_meta">
- &#8212; <abbr title="<?php echo date("c", $event->timestamp); ?>" class="lifestream_hour"><?php ls_event_date(); ?></abbr> <span class="lifestream_via">via <?php ls_event_feed_label() ?></span>
+ &#8212; <abbr title="<?php echo $lifestream->date_format("c", $event->timestamp); ?>" class="lifestream_hour"><?php ls_event_date(); ?></abbr> <span class="lifestream_via">via <?php ls_event_feed_label() ?></span>
</div>
<?php ls_event_content(); ?>
View
2  templates/home.php
@@ -32,7 +32,7 @@
<div class="lifestream_label"><?php ls_event_label(); ?></div>
<div class="lifestream_meta">
- &#8212; <a href="<?php ls_event_permalink(); ?>"><abbr title="<?php echo date("c", $event->timestamp); ?>" class="lifestream_hour"><?php ls_event_date(); ?></abbr></a><?php if ($event->feed->get_constant('ID') != 'generic' || $event->feed->options['feed_label']) { ?> <span class="lifestream_via">via <?php ls_event_feed_label() ?><?php } ?> | <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></span>
+ &#8212; <a href="<?php ls_event_permalink(); ?>"><abbr title="<?php echo $lifestream->date_format("c", $event->timestamp); ?>" class="lifestream_hour"><?php ls_event_date(); ?></abbr></a><?php if ($event->feed->get_constant('ID') != 'generic' || $event->feed->options['feed_label']) { ?> <span class="lifestream_via">via <?php ls_event_feed_label() ?><?php } ?> | <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></span>
</div>
<?php ls_event_content(); ?>
View
8 themes/boxy/main.inc.php
@@ -2,8 +2,8 @@
$day = '';
if (count($events))
{
- $today = date('m d Y');
- $yesterday = date('m d Y', time()-86400);
+ $today = $lifestream->date_format('m d Y');
+ $yesterday = $lifestream->date_format('m d Y', time()-86400);
?>
<ol class="lifestream">
<?php
@@ -16,7 +16,7 @@
</span>
<span class="lifestream_label"><?php echo $event->get_label($options); ?></span>
<?php if ($show_metadata) { ?>
- <span class="lifestream_meta"><abbr title="<?php echo date("c", $event->timestamp); ?>" class="lifestream_hour"><?php echo $lifestream->timesince($event->timestamp); ?></abbr><span class="lifestream_via">via <?php echo $event->get_feed_label($options) ?></span></span>
+ <span class="lifestream_meta"><abbr title="<?php echo $lifestream->date_format("c", $event->timestamp); ?>" class="lifestream_hour"><?php echo $lifestream->timesince($event->timestamp); ?></abbr><span class="lifestream_via">via <?php echo $event->get_feed_label($options) ?></span></span>
<?php } ?>
</li>
<?php
@@ -32,4 +32,4 @@
<p class="lifestream"><?php $lifestream->_e('There are no events to show at this time.'); ?></p>
<?php
}
-?>
+?>
View
4 themes/default/digest.inc.php
@@ -10,7 +10,7 @@
<td class="lifestream_text">
<div class="lifestream_label"><?php echo $event->get_label($options); ?></div>
<?php if ($show_metadata) { ?>
- <div class="lifestream_meta">&#8212; <abbr title="<?php echo date("c", $event->timestamp); ?>" class="lifestream_hour"><?php echo date($lifestream->get_option('hour_format'), $event->timestamp); ?></abbr> <span class="lifestream_via">via <?php echo $event->get_feed_label($options) ?></span></div>
+ <div class="lifestream_meta">&#8212; <abbr title="<?php echo $lifestream->date_format("c", $event->timestamp); ?>" class="lifestream_hour"><?php echo $lifestream->date_format($lifestream->get_option('hour_format'), $event->timestamp); ?></abbr> <span class="lifestream_via">via <?php echo $event->get_feed_label($options) ?></span></div>
<?php } ?>
<?php echo $event->render($options); ?>
</td>
@@ -18,4 +18,4 @@
<?php
}
?>
-</table>
+</table>
View
18 themes/default/main.inc.php
@@ -4,8 +4,8 @@
$newline = "\n\t\t\t\t\t\t";
if (count($events))
{
- $today = date('m d Y');
- $yesterday = date('m d Y', time()-86400);
+ $today = $lifestream->date_format('m d Y');
+ $yesterday = $lifestream->date_format('m d Y', time()-86400);
if ($has_paging)
{
@@ -17,14 +17,14 @@
echo $newline . '<ol id="lifestream">';
foreach ($events as $event)
{
- $timestamp = $event->get_date();
- if ($today == date('m d Y', $timestamp)) $this_day = $lifestream->__('Today');
- else if ($yesterday == date('m d Y', $timestamp)) $this_day = $lifestream->__('Yesterday');
- else $this_day = $lifestream->__(ucfirst(htmlentities(date($lifestream->get_option('day_format'), $timestamp))));
+ $timestamp = $event->timestamp;
+ if ($today == $lifestream->date_format('m d Y', $timestamp)) $this_day = $lifestream->__('Today');
+ else if ($yesterday == $lifestream->date_format('m d Y', $timestamp)) $this_day = $lifestream->__('Yesterday');
+ else $this_day = $lifestream->__(ucfirst(htmlentities($lifestream->date_format($lifestream->get_option('day_format'), $timestamp))));
if ($day != $this_day)
{
if ($counter) echo $newline . '</ol>';
- echo $newline . "\t" . '<li class="' . date('j F Y', $timestamp) . '">';
+ echo $newline . "\t" . '<li class="' . $lifestream->date_format('j F Y', $timestamp) . '">';
echo $newline . "\t" . '<h2>' . $this_day . '</h2>';
echo $newline . "\t" . '<ol>';
$day = $this_day;
@@ -36,7 +36,7 @@
echo '<p class="lifestream-meta">';
echo '<img class="lifestream-icon" src="' . $event->feed->get_icon_url() . '" /> ';
echo '<span class="lifestream-hour">';
- echo ($today == date('m d Y', $timestamp)) ? $lifestream->timesince($event->timestamp) : date($lifestream->get_option('hour_format'), $event->timestamp);
+ echo ($today == $lifestream->date_format('m d Y', $timestamp)) ? $lifestream->timesince($event->timestamp) : $lifestream->date_format($lifestream->get_option('hour_format'), $event->timestamp);
echo '</span> ';
echo '<span class="lifestream-via">via ' . $event->get_feed_label($options) . '</span>';
echo '</p>'; // .lifestream-meta
@@ -57,4 +57,4 @@
<p id="lifestream"><?php $lifestream->_e('There are no events to show at this time.'); ?></p>
<?php
}
-?>
+?>
View
4 themes/default/sidebar.inc.php
@@ -13,7 +13,7 @@
<div class="lifestream_text">
<div class="lifestream_label"><?php echo $event->get_label($options); ?></div>
<?php if ($show_metadata) { ?>
- <div class="lifestream_meta">&#8212; <abbr title="<?php echo date("c", $event->timestamp); ?>" class="lifestream_hour"><?php echo $lifestream->timesince($event->timestamp); ?></abbr> <span class="lifestream_via">via <?php echo $event->get_feed_label($options) ?></span></div>
+ <div class="lifestream_meta">&#8212; <abbr title="<?php echo $lifestream->date_format("c", $event->timestamp); ?>" class="lifestream_hour"><?php echo $lifestream->timesince($event->timestamp); ?></abbr> <span class="lifestream_via">via <?php echo $event->get_feed_label($options) ?></span></div>
<?php } ?>
<?php echo $event->render($options); ?>
</div>
@@ -29,4 +29,4 @@
<p class="lifestream"><?php $lifestream->_e('There are no events to show at this time.'); ?></p>
<?php
}
-?>
+?>

No commit comments for this range

Something went wrong with that request. Please try again.