Skip to content

Commit 4f9eaf5

Browse files
committed
Clear some trailing whitespace. Should have done this in a long time!
1 parent f651cb8 commit 4f9eaf5

15 files changed

+40
-43
lines changed

index.php

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
<?php
2-
3-
// $Id$
4-
52
define( 'PUBWICH', 1 );
63
require( dirname(__FILE__) . '/lib/Pubwich.php' );
74
Pubwich::init();

lib/Pubwich.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ static public function init() {
102102
/**
103103
* Translate a string according to the defined locale/
104104
*
105-
* @param string $string
105+
* @param string $string
106106
* @return string
107107
*/
108108
public function _( $string ) {
@@ -313,7 +313,7 @@ static private function applyTheme() {
313313
static public function getLoop() {
314314
$output = '';
315315
foreach( self::$columns as $col => $classes ) {
316-
$output .= '<div class="col'.$col.'">';
316+
$output .= '<div class="col'.$col.'">';
317317
foreach( $classes as $classe ) {
318318
$output .= $classe->renderBox();
319319
}
@@ -359,23 +359,23 @@ static public function time_since( $original ) {
359359
array( 60 * 60 , Pubwich::_('hour') ),
360360
array( 60 , Pubwich::_('minute') ),
361361
);
362-
362+
363363
$today = time();
364364
$since = $today - $original;
365365

366366
if ( $since < 0 ) {
367367
return sprintf( Pubwich::_('just moments ago'), $since );
368368
}
369-
369+
370370
if ( $since < 60 ) {
371371
return sprintf( Pubwich::_('%d seconds ago'), $since );
372372
}
373-
373+
374374
if ( $since > ( 7 * 24 * 60 * 60 ) ) {
375-
$print = strftime( Pubwich::_('%e %B at %H:%M'), $original );
375+
$print = strftime( Pubwich::_('%e %B at %H:%M'), $original );
376376
return $print;
377377
}
378-
378+
379379
for ( $i = 0, $j = count( $chunks ); $i < $j; $i++ ) {
380380
$seconds = $chunks[$i][0];
381381
$name = $chunks[$i][1];

lib/PubwichLog.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ static public function init() {
2121
mkdir( $log_dir );
2222
}
2323
$log_file = $log_dir . '/pubwich-'.date('Y-m-d').'.log';
24-
self::$file = fopen($log_file, 'a+');
24+
self::$file = fopen($log_file, 'a+');
2525
// what will happen if several sessions are started simultaneously?
2626
//self::log( 0, '----[ Log for Pubwich session ('.date('Y-m-d h:i:s').') ]-----------------------------', true );
2727
}
2828

2929
}
3030

3131
static public function log( $level, $msg, $nodate=false ) {
32-
32+
3333
if ( $level <= PUBWICH_LOGLEVEL ) {
3434
if ( !PUBWICH_LOGTOFILE ) {
3535
echo $msg . "<br />\n";

lib/PubwichTemplate.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class PubwichTemplate {
99

1010
private $template = null, $output;
11-
11+
1212
/**
1313
* @constructor
1414
*/

lib/Services/Atom.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111

1212
class Atom extends Service {
13-
13+
1414
public function __construct( $config ){
1515
$this->total = $config['total'];
1616
$this->setURL( $config['url'] );

lib/Services/Delicious.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
Pubwich::requireServiceFile( 'RSS' );
1313
class Delicious extends RSS {
14-
14+
1515
public function __construct( $config ){
1616
$config['link'] = 'http://del.icio.us/'.$config['username'].'/';
1717
$config['url'] = sprintf( 'http://feeds.delicious.com/v2/rss/%s?count=%s', $config['username'], $config['total'] );

lib/Services/Facebook.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
Pubwich::requireServiceFile( 'RSS' );
1313
class Facebook extends RSS {
14-
14+
1515
public function __construct( $config ){
1616
$config['link'] = 'http://www.facebook.com/'.$config['username'].'/';
1717
$config['url'] = sprintf( 'http://www.facebook.com/feeds/status.php?id=%d&viewer=%d&key=%s&format=rss20', $config['id'], $config['id'], $config['key'] );

lib/Services/Flickr.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function populateItemTemplate( &$item ) {
5151
* Return a Flickr photo URL
5252
* @param array $photo Photo item
5353
* @return string
54-
*/
54+
*/
5555
public function getAbsoluteUrl( $photo, $size= 's' ) {
5656
return sprintf( 'http://farm%d.static.flickr.com/%s/%s_%s_%s.jpg',
5757
$photo['farm'],

lib/Services/Lastfm.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ public function getData() {
3333
public function init() {
3434
parent::init();
3535
}
36-
36+
3737
}
3838

3939
class LastFMRecentTracks extends LastFM {
40-
40+
4141
public function __construct( $config ) {
42-
parent::setVariables( $config );
42+
parent::setVariables( $config );
4343

4444
$this->setURL( sprintf( 'http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&api_key=%s&user=%s&limit=%d', $this->key, $this->username, $this->total ) );
4545
$this->setItemTemplate('<li{%classe%}><a class="clearfix" href="{%link%}">{%artist%} — {%track%}</a></li>'."\n");

lib/Services/RSS.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111

1212
class RSS extends Service {
13-
13+
1414
public function __construct( $config ){
1515
$this->setURL( $config['url'] );
1616
$this->total = $config['total'];

lib/Services/Readernaut.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111

1212
class Readernaut extends Service {
13-
13+
1414
public $size;
1515

1616
public function buildCache() {
@@ -30,7 +30,7 @@ public function setVariables( $config ) {
3030
$this->username = $config['username'];
3131
$this->size = $config['size'];
3232
}
33-
33+
3434
}
3535

3636
class ReadernautBooks extends Readernaut {
@@ -60,10 +60,10 @@ public function getData() {
6060
public function populateItemTemplate( &$item ) {
6161
return array(
6262
'id' => $item->reader_book_id,
63-
'link' => $item->book_edition->permalink,
63+
'link' => $item->book_edition->permalink,
6464
'title' => $item->book_edition->title,
6565
'subtitle' => $item->book_edition->subtitle,
66-
'author' => $item->book_edition->authors->author,
66+
'author' => $item->book_edition->authors->author,
6767
'image' => $item->book_edition->covers->cover_small,
6868
'image_medium' => $item->book_edition->covers->cover_medium,
6969
'image_large' => $item->book_edition->covers->cover_large,
@@ -104,10 +104,10 @@ public function populateItemTemplate( &$item ) {
104104
// yep, this is actually book_edtion. Readernaut's creator Nathan Borror has been notified about this typo :)
105105
return array(
106106
'id' => $item->reader_book_id,
107-
'link' => $item->book_edtion->permalink,
107+
'link' => $item->book_edtion->permalink,
108108
'title' => $item->book_edtion->title,
109109
'subtitle' => $item->book_edtion->subtitle,
110-
'author' => $item->book_edtion->authors->author,
110+
'author' => $item->book_edtion->authors->author,
111111
'image' => $item->book_edtion->covers->cover_small,
112112
'image_medium' => $item->book_edtion->covers->cover_medium,
113113
'image_large' => $item->book_edtion->covers->cover_large,

lib/Services/Service.php

+11-11
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,30 @@
33

44
/**
55
* @classname Service
6-
*/
6+
*/
77
class Service {
88

99
public $data, $cache_id, $cache_options, $title, $description, $urlTemplate, $username, $total, $method, $callback_function, $header_link, $http_headers;
1010
private $url, $itemTemplate, $tmpTemplate, $boxTemplate, $tmpBoxTemplate;
1111

1212
/**
1313
* @constructor
14-
*/
14+
*/
1515
public function __construct( $config=null ) {
1616
PubwichLog::log( 2, sprintf( Pubwich::_("Creating an instance of %s"), get_class( $this ) ) );
1717

1818
$this->title = $config['title'];
1919
$this->description = $config['description'];
2020

21-
$id = md5( $this->getURL() );
22-
$this->cache_id = $id;
21+
$id = md5( $this->getURL() );
22+
$this->cache_id = $id;
2323

2424
if ( !$this->callback_function ) {
2525
$this->callback_function = 'simplexml_load_string';
2626
}
2727

28-
$this->cache_options = array(
29-
'cacheDir' => CACHE_LOCATION,
28+
$this->cache_options = array(
29+
'cacheDir' => CACHE_LOCATION,
3030
'lifeTime' => CACHE_LIMIT,
3131
'readControl' => true,
3232
'readControlType' => 'strlen',
@@ -73,7 +73,7 @@ public function setURL( $url ) {
7373
/**
7474
* @param string $url
7575
* @return Service
76-
*/
76+
*/
7777
public function init() {
7878
PubwichLog::log( 2, sprintf( Pubwich::_("Initializing instance of %s"), get_class( $this ) ) );
7979
$url = $this->getURL();
@@ -113,7 +113,7 @@ public function buildCache( $Cache_Lite = null ) {
113113

114114
/**
115115
* @return string
116-
*/
116+
*/
117117
public function getData() {
118118
return $this->data;
119119
}
@@ -166,7 +166,7 @@ public function getItemTemplate() {
166166
public function setBoxTemplate( $template ) {
167167
if ( !$this->boxTemplate ) {
168168
$this->tmpBoxTemplate = $template;
169-
} else {
169+
} else {
170170
$this->boxTemplate->setTemplate( $template );
171171
}
172172
}
@@ -205,7 +205,7 @@ public function renderBox( ) {
205205
} else {
206206
foreach( $classData as $item ) {
207207
$compteur++;
208-
if ($this->total && $compteur > $this->total) { break; }
208+
if ($this->total && $compteur > $this->total) { break; }
209209
$populate = $this->populateItemTemplate( $item );
210210

211211
if ( function_exists( get_class( $this ) . '_populateItemTemplate' ) ) {
@@ -219,7 +219,7 @@ public function renderBox( ) {
219219

220220
$data = array(
221221
'class' => $htmlClass,
222-
'items' => $items
222+
'items' => $items
223223
);
224224

225225
// Let the service override it

lib/Services/Text.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* @methods None
1010
*/
1111
class Text extends Service {
12-
12+
1313
public function __construct( $config ){
1414
$this->text = $config['text'];
1515
$this->setItemTemplate('{%text%}'."\n");

lib/Services/Vimeo.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111

1212
class Vimeo extends Service {
13-
13+
1414
public function __construct( $config ){
1515
$this->setURL( sprintf( 'http://vimeo.com/api/%s/clips.xml', $config['username'] ) );
1616
$this->total = $config['total'];
@@ -47,6 +47,6 @@ public function populateItemTemplate( &$item ) {
4747
'image_large' => $item->thumbnail_large,
4848
);
4949
}
50-
50+
5151
}
5252

lib/Services/Youtube.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
Pubwich::requireServiceFile( 'Atom' );
1313
class Youtube extends Atom {
14-
14+
1515
private $size;
1616

1717
public function __construct( $config ){
@@ -32,7 +32,7 @@ public function populateItemTemplate( &$item ) {
3232
$description = (string) $media->group->description;
3333
$url_attrs = $media->group->player->attributes();
3434
$url = $url_attrs['url'];
35-
35+
3636
return parent::populateItemTemplate( $item ) + array(
3737
'title' => $title,
3838
'description' => $description,

0 commit comments

Comments
 (0)