Skip to content

Commit

Permalink
[fix] reorganize error reporting and fix pass-by-reference problem
Browse files Browse the repository at this point in the history
  • Loading branch information
haschek committed Nov 26, 2011
1 parent d504cbc commit 66916e7
Show file tree
Hide file tree
Showing 4 changed files with 164 additions and 145 deletions.
303 changes: 160 additions & 143 deletions cfg/config.sample.php
@@ -1,15 +1,16 @@
<?php
defined('PUBWICH') or die('No direct access allowed.');

// Rename this file to config.php
//! Rename this file to config.php

error_reporting(E_ALL ^ E_NOTICE); // uncomment this line in development environment
//! Production environment
// ini_set('display_errors', 0); // uncomment this line in production environment (prevent errors from showing up)
// error_reporting(0); // uncomment this line in production environment (prevent errors from showing up)

// Localisation
date_default_timezone_set( 'America/Montreal' );
date_default_timezone_set( 'Europe/Berlin' );
define('PUBWICH_LANG', ''); // leave to '' to keep Pubwich in english
setlocale( LC_ALL, 'en_CA.UTF8' ); // for date methods
setlocale( LC_ALL, 'en_EN.UTF8' ); // for date methods

// General site informations
define('PUBWICH_URL', 'http://localhost/pubwich/');
Expand All @@ -27,153 +28,169 @@
define( 'FETCHDATA_TIMEOUT', 5); // 5 seconds

// Pubwich services configuration
// first, we have some examples to configure single services
// below, we use the service configs to group them

//*
$infobox = array(
'Text', 'intro', array(
'title' => 'About PubwichFork',
'text' => '
<p>PubwichFork is an open-source PHP Web application that
allows you to aggregate your published data from multiple
Websites and services into a single HTML page.</p>
<p>PubwichFork is an improved version of the original
Pubwich application, since Pubwich is not really maintained
anymore by the original author. PubwichFork fixes several
bugs and integrates pre-output filtering of the data
streams.</p>',
)
); //*/

/*
$flickr = array(
'Flickr', 'photos', array(
'method' => 'FlickrUser',
'key' => 'FLICKR_KEY_HERE',
'userid' => 'FLICKER_USERID_HERE', // use http://www.idgettr.com to find it
'username' => 'FLICKR_USERNAME_HERE',
'total' => 12,
'title' => 'Flick<em>r</em>',
'description' => 'latest photos',
'row' => 4,
)
); //*/

/*
$vimeo = array(
'Vimeo', 'videos', array(
'username' => 'VIMEO_USERNAME_HERE',
'total' => 4,
'title' => 'Vimeo',
'description' => 'latest videos'
)
); //*/

/*
$youtube = array(
'Youtube', 'youtube', array(
'method' => 'YoutubeVideos',
'username' => 'YOUTUBE_USERNAME_HERE',
'total' => 4,
'size' => 120,
'title' => 'Youtube',
'description' => 'latest videos'
)
); //*/

/*
$twitter = array(
'Twitter', 'etats', array(
'method' => 'TwitterUser',
'username' => 'TWITTER_USERNAME_HERE',
'oauth' => array(
// You have to create a new application at http://dev.twitter.com/apps to get these keys
// See the tutorial at http://pubwich.org/wiki/Using_Twitter_with_Pubwich
'app_consumer_key' => '',
'app_consumer_secret' => '',
'user_access_token' => '',
'user_access_token_secret' => ''
),
'total' => 10,
'title' => 'Twitter',
'description' => 'latest statuses'
)
); //*/

/*
$delicious = array(
'Delicious', 'liens', array(
'username' => 'DELICIOUS_USERNAME_HERE',
'total' => 5,
'title' => 'del.icio.us',
'description' => 'latest bookmarks',
)
); //*/

/*
$facebook = array(
'Facebook', 'status', array(
'id' => 'FACEBOOK_USERID_HERE',
'key' => 'FACEBOOK_KEY_HERE',
'username' => 'FACEBOOK_USERNAME_HERE',
'total' => 5,
'title' => 'Facebook',
'description' => 'latest statuses',
)
); //*/

/*
$rss_news = array(
'RSS', 'ixmedia', array(
'url' => 'http://feeds2.feedburner.com/ixmediablogue',
'link' => 'http://blogue.ixmedia.com/',
'total' => 5,
'title' => 'Blogue iXmédia',
'description' => 'latest atom blog entries'
)
); //*/

/*
$atom_news = array(
'Atom', 'effair', array(
'url' => 'http://remiprevost.com/atom/',
'link' => 'http://remiprevost.com/',
'total' => 5,
'title' => 'Effair',
'description' => 'latest rss blog entries'
)
); //*/

/*
$readernaut = array(
'Readernaut', 'livres', array(
'method' => 'ReadernautBooks',
'username' => 'READERNAUT_USERNAME_HERE',
'total' => 9,
'size' => 50,
'title' => 'Readernaut',
'description' => 'latest books'
)
); //*/

/*
* setServices syntax to use
*
* Pubwich::setServices(
* array(
*
* // column 1
* array(
* array('Flickr', 'photos', array(
* 'method' => 'FlickrUser',
* 'title' => 'Flickr',
* 'description' => 'My pictures',
* 'key' => '',
* ...
* )
* ),
*
* // column 2
* array(
* ...
* ),
*
* // column 3
* array(
* ...
* )
* )
* );
*
*/
$lastfm = array(
'Lastfm', 'albums', array(
'method' => 'LastFMWeeklyAlbums',
'key' => 'LASTFM_KEY_HERE',
'username' => 'LASTFM_USERNAME_HERE',
'total' => 5,
'size' => 64,
'title' => 'Last.fm',
'description' => 'weekly top albums',
)
); //*/


Pubwich::setServices(
array(
// column 1
array(

array( 'Text', 'intro', array(
'title' => 'Introduction',
'text' => 'This is a short introduction text. To hide the "Introduction" title, all you have to is not specify a "title" item for the <strong>Text</strong> box.',
)
),

array( 'Flickr', 'photos', array(
'method' => 'FlickrUser',
'key' => 'FLICKR_KEY_HERE',
'userid' => 'FLICKER_USERID_HERE', // use http://www.idgettr.com to find it
'username' => 'FLICKR_USERNAME_HERE',
'total' => 12,
'title' => 'Flick<em>r</em>',
'description' => 'latest photos',
'row' => 4,
)
),

array( 'Vimeo', 'videos', array(
'username' => 'VIMEO_USERNAME_HERE',
'total' => 4,
'title' => 'Vimeo',
'description' => 'latest videos'
)
),

array( 'Youtube', 'youtube', array(
'method' => 'YoutubeVideos',
'username' => 'YOUTUBE_USERNAME_HERE',
'total' => 4,
'size' => 120,
'title' => 'Youtube',
'description' => 'latest videos'
)
),

$infobox,
// $youtube,
// $vimeo,
// $flickr,
),
array(
array( 'Twitter', 'etats', array(
'method' => 'TwitterUser',
'username' => 'TWITTER_USERNAME_HERE',
'oauth' => array(
// You have to create a new application at http://dev.twitter.com/apps to get these keys
// See the tutorial at http://pubwich.org/wiki/Using_Twitter_with_Pubwich
'app_consumer_key' => '',
'app_consumer_secret' => '',
'user_access_token' => '',
'user_access_token_secret' => ''
),
'total' => 10,
'title' => 'Twitter',
'description' => 'latest statuses'
)
),

array( 'Delicious', 'liens', array(
'username' => 'DELICIOUS_USERNAME_HERE',
'total' => 5,
'title' => 'del.icio.us',
'description' => 'latest bookmarks',
)
),

array( 'Facebook', 'status', array(
'id' => 'FACEBOOK_USERID_HERE',
'key' => 'FACEBOOK_KEY_HERE',
'username' => 'FACEBOOK_USERNAME_HERE',
'total' => 5,
'title' => 'Facebook',
'description' => 'latest statuses',
)
),

array( 'RSS', 'ixmedia', array(
'url' => 'http://feeds2.feedburner.com/ixmediablogue',
'link' => 'http://blogue.ixmedia.com/',
'total' => 5,
'title' => 'Blogue iXmédia',
'description' => 'latest atom blog entries'
)
),
// $twitter,
// $delicious,
// $facebook,
// $rss_news,
),
array(

array( 'Atom', 'effair', array(
'url' => 'http://remiprevost.com/atom/',
'link' => 'http://remiprevost.com/',
'total' => 5,
'title' => 'Effair',
'description' => 'latest rss blog entries'
)
),

array( 'Readernaut', 'livres', array(
'method' => 'ReadernautBooks',
'username' => 'READERNAUT_USERNAME_HERE',
'total' => 9,
'size' => 50,
'title' => 'Readernaut',
'description' => 'latest books'
)
),

array( 'Lastfm', 'albums', array(
'method' => 'LastFMWeeklyAlbums',
'key' => 'LASTFM_KEY_HERE',
'username' => 'LASTFM_USERNAME_HERE',
'total' => 5,
'size' => 64,
'title' => 'Last.fm',
'description' => 'weekly top albums',
)
),
// $atom_news,
// $readernaut,
// $lastfm,
),

)
Expand Down
2 changes: 2 additions & 0 deletions index.php
@@ -1,4 +1,6 @@
<?php
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 1);
define( 'PUBWICH', 1 );
require( dirname(__FILE__) . '/lib/Pubwich.php' );
Pubwich::init();
Expand Down
2 changes: 1 addition & 1 deletion lib/Pubwich.php
Expand Up @@ -478,7 +478,7 @@ static public function processFilters() {

if ( function_exists( $item_filter ) && isset($service->data_processed) && is_array($service->data_processed)) {
foreach ($service->data_processed as $i => $v) {
$item_filter(&$service->data_processed[$i]);
$item_filter($service->data_processed[$i]);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion themes/default/filters.php
Expand Up @@ -35,7 +35,7 @@ function Service_filterItem($item)
}
*/

function Feed_filterItem($item)
function Feed_filterItem(&$item)
{
$item['title'] = shortenString(
$item['title'],
Expand Down

0 comments on commit 66916e7

Please sign in to comment.