Quellcode durchsuchen

Grosse màj : ajout de la configuration + ajouts divers fonctionnalités

Marien Fressinaud vor 13 Jahren
Ursprung
Commit
0426541acb

+ 1 - 0
app/App_FrontController.php

@@ -23,6 +23,7 @@ class App_FrontController extends FrontController {
 	
 	private function loadModels () {
 		include (APP_PATH . '/models/RSSConfiguration.php');
+		include (APP_PATH . '/models/Category.php');
 		include (APP_PATH . '/models/Feed.php');
 		include (APP_PATH . '/models/Entry.php');
 	}

+ 61 - 3
app/controllers/configureController.php

@@ -2,11 +2,66 @@
 
 class configureController extends ActionController {
 	public function categorizeAction () {
-	
+		$catDAO = new CategoryDAO ();
+		
+		if (Request::isPost ()) {
+			$cats = Request::param ('categories', array ());
+			$ids = Request::param ('ids', array ());
+			$newCat = Request::param ('new_category');
+			
+			foreach ($cats as $key => $name) {
+				if (strlen ($name) > 0) {
+					$cat = new Category ($name);
+					$values = array (
+						'name' => $cat->name (),
+						'color' => $cat->color ()
+					);
+					$catDAO->updateCategory ($ids[$key], $values);
+				} else {
+					$catDAO->deleteCategory ($ids[$key]);
+				}
+			}
+			
+			if ($newCat != false) {
+				$cat = new Category ($newCat);
+				$values = array (
+					'id' => $cat->id (),
+					'name' => $cat->name (),
+					'color' => $cat->color ()
+				);
+				$catDAO->addCategory ($values);
+			}
+			
+			$catDAO->save ();
+			
+		}
+		
+		$this->view->categories = $catDAO->listCategories ();
 	}
 	
 	public function fluxAction () {
-	
+		$feedDAO = new FeedDAO ();
+		$this->view->feeds = $feedDAO->listFeeds ();
+		
+		$id = Request::param ('id');
+		
+		$this->view->flux = false;
+		if ($id != false) {
+			$this->view->flux = $feedDAO->searchById ($id);
+			
+			$catDAO = new CategoryDAO ();
+			$this->view->categories = $catDAO->listCategories ();
+			
+			if (Request::isPost () && $this->view->flux) {
+				$cat = Request::param ('category');
+				$values = array (
+					'category' => $cat
+				);
+				$feedDAO->updateFeed ($id, $values);
+				
+				$this->view->flux->_category ($cat);
+			}
+		}
 	}
 	
 	public function displayAction () {
@@ -14,15 +69,18 @@ class configureController extends ActionController {
 			$nb = Request::param ('posts_per_page', 10);
 			$view = Request::param ('default_view', 'all');
 			$display = Request::param ('display_posts', 'no');
+			$sort = Request::param ('sort_order', 'low_to_high');
 		
 			$this->view->conf->_postsPerPage (intval ($nb));
 			$this->view->conf->_defaultView ($view);
 			$this->view->conf->_displayPosts ($display);
+			$this->view->conf->_sortOrder ($sort);
 		
 			$values = array (
 				'posts_per_page' => $this->view->conf->postsPerPage (),
 				'default_view' => $this->view->conf->defaultView (),
-				'display_posts' => $this->view->conf->displayPosts ()
+				'display_posts' => $this->view->conf->displayPosts (),
+				'sort_order' => $this->view->conf->sortOrder ()
 			);
 		
 			$confDAO = new RSSConfigurationDAO ();

+ 26 - 17
app/controllers/feedController.php

@@ -7,7 +7,8 @@ class feedController extends ActionController {
 			
 			try {
 				$feed = new Feed ($url);
-				$entries = $feed->loadEntries ();
+				$feed->load ();
+				$entries = $feed->entries (false);
 				$feed_entries = array ();
 				
 				if ($entries !== false) {
@@ -24,6 +25,7 @@ class feedController extends ActionController {
 							'date' => $entry->date (true),
 							'is_read' => $entry->isRead (),
 							'is_favorite' => $entry->isFavorite (),
+							'feed' => $feed->id ()
 						);
 						$entryDAO->addEntry ($values);
 						
@@ -35,8 +37,11 @@ class feedController extends ActionController {
 				$values = array (
 					'id' => $feed->id (),
 					'url' => $feed->url (),
-					'categories' => $feed->categories (),
-					'entries' => $feed_entries
+					'category' => $feed->category (),
+					'entries' => $feed_entries,
+					'name' => $feed->name (),
+					'website' => $feed->website (),
+					'description' => $feed->description (),
 				);
 				$feedDAO->addFeed ($values);
 			} catch (Exception $e) {
@@ -54,27 +59,31 @@ class feedController extends ActionController {
 		$feeds = $feedDAO->listFeeds ();
 		
 		foreach ($feeds as $feed) {
-			$entries = $feed->loadEntries ();
+			$feed->load ();
+			$entries = $feed->entries (false);
 			$feed_entries = $feed->entries ();
 				
 			if ($entries !== false) {
 				foreach ($entries as $entry) {
-					$values = array (
-						'id' => $entry->id (),
-						'guid' => $entry->guid (),
-						'title' => $entry->title (),
-						'author' => $entry->author (),
-						'content' => $entry->content (),
-						'link' => $entry->link (),
-						'date' => $entry->date (true),
-						'is_read' => $entry->isRead (),
-						'is_favorite' => $entry->isFavorite (),
-					);
-					$entryDAO->addEntry ($values);
-					
 					if (!in_array ($entry->id (), $feed_entries)) {
+						$values = array (
+							'id' => $entry->id (),
+							'guid' => $entry->guid (),
+							'title' => $entry->title (),
+							'author' => $entry->author (),
+							'content' => $entry->content (),
+							'link' => $entry->link (),
+							'date' => $entry->date (true),
+							'is_read' => $entry->isRead (),
+							'is_favorite' => $entry->isFavorite (),
+							'feed' => $feed->id ()
+						);
+						$entryDAO->addEntry ($values);
+					
 						$feed_entries[] = $entry->id ();
 					}
+					
+					// TODO gérer suppression des articles trop vieux (à paramétrer)
 				}
 			}
 			

+ 5 - 1
app/controllers/indexController.php

@@ -11,7 +11,11 @@ class indexController extends ActionController {
 			$entries = $entryDAO->listEntries ();
 		}
 		
-		usort ($entries, 'sortEntriesByDate');
+		if ($this->view->conf->sortOrder () == 'high_to_low') {
+			usort ($entries, 'sortReverseEntriesByDate');
+		} else {
+			usort ($entries, 'sortEntriesByDate');
+		}
 		
 		//gestion pagination
 		$page = Request::param ('page', 1);

+ 4 - 4
app/layout/aside.phtml

@@ -9,7 +9,7 @@
 			<a href="<?php echo Url::display (array ()); ?>">Flux RSS</a>
 		</li>
 		<li <?php echo Request::controllerName () == 'configure' ? 'class="active"' : ''; ?>>
-			<a href="<?php echo Url::display (array ('c' => 'configure', 'a' => 'categorize')); ?>">Configurer</a>
+			<a href="<?php echo Url::display (array ('c' => 'configure', 'a' => 'flux')); ?>">Configurer</a>
 		</li>
 		<li>
 			<a href="<?php echo Url::display (array ('c' => 'feed', 'a' => 'actualize')); ?>">Mettre les flux à jour</a>
@@ -21,12 +21,12 @@
 <div class="aside">
 	<ul id="menu">
 		<li><h2>Configuration</h2></li>
-		<li <?php echo Request::actionName () == 'categorize' ? 'class="active"' : ''; ?>>
-			<a href="<?php echo Url::display (array ('c' => 'configure', 'a' => 'categorize')); ?>">Catégories</a>
-		</li>
 		<li <?php echo Request::actionName () == 'flux' ? 'class="active"' : ''; ?>>
 			<a href="<?php echo Url::display (array ('c' => 'configure', 'a' => 'flux')); ?>">Flux RSS</a>
 		</li>
+		<li <?php echo Request::actionName () == 'categorize' ? 'class="active"' : ''; ?>>
+			<a href="<?php echo Url::display (array ('c' => 'configure', 'a' => 'categorize')); ?>">Catégories</a>
+		</li>
 		<li <?php echo Request::actionName () == 'display' ? 'class="active"' : ''; ?>>
 			<a href="<?php echo Url::display (array ('c' => 'configure', 'a' => 'display')); ?>">Affichage</a>
 		</li>

+ 113 - 0
app/models/Category.php

@@ -0,0 +1,113 @@
+<?php
+
+class Category extends Model {
+	private $id;
+	private $name;
+	private $color;
+	
+	public function __construct ($name = '', $color = '#0062BE') {
+		$this->_name ($name);
+		$this->_color ($color);
+	}
+	
+	public function id () {
+		return small_hash ($this->name . Configuration::selApplication ());
+	}
+	public function name () {
+		return $this->name;
+	}
+	public function color () {
+		return $this->color;
+	}
+	
+	public function _name ($value) {
+		$this->name = $value;
+	}
+	public function _color ($value) {
+		if (preg_match ('/^#([0-9a-f]{3}|[0-9a-f]{6})$/i', $value)) {
+			$this->color = $value;
+		} else {
+			$this->color = '#0062BE';
+		}
+	}
+}
+
+class CategoryDAO extends Model_array {
+	public function __construct () {
+		parent::__construct (PUBLIC_PATH . '/data/db/Categories.array.php');
+	}
+	
+	public function addCategory ($values) {
+		$id = $values['id'];
+		unset ($values['id']);
+	
+		if (!isset ($this->array[$id])) {
+			$this->array[$id] = array ();
+		
+			foreach ($values as $key => $value) {
+				$this->array[$id][$key] = $value;
+			}
+		} else {
+			return false;
+		}
+	}
+	
+	public function updateCategory ($id, $values) {
+		foreach ($values as $key => $value) {
+			$this->array[$id][$key] = $value;
+		}
+	}
+	
+	public function deleteCategory ($id) {
+		if (isset ($this->array[$id])) {
+			unset ($this->array[$id]);
+		}
+	}
+	
+	public function searchById ($id) {
+		$list = HelperCategory::daoToCategory ($this->array);
+		
+		if (isset ($list[$id])) {
+			return $list[$id];
+		} else {
+			return false;
+		}
+	}
+	
+	public function listCategories () {
+		$list = $this->array;
+		
+		if (!is_array ($list)) {
+			$list = array ();
+		}
+		
+		return HelperCategory::daoToCategory ($list);
+	}
+	
+	public function count () {
+		return count ($this->array);
+	}
+	
+	public function save () {
+		$this->writeFile ($this->array);
+	}
+}
+
+class HelperCategory {
+	public static function daoToCategory ($listDAO) {
+		$list = array ();
+
+		if (!is_array ($listDAO)) {
+			$listDAO = array ($listDAO);
+		}
+
+		foreach ($listDAO as $key => $dao) {
+			$list[$key] = new Category (
+				$dao['name'],
+				$dao['color']
+			);
+		}
+
+		return $list;
+	}
+}

+ 15 - 1
app/models/Entry.php

@@ -9,8 +9,9 @@ class Entry extends Model {
 	private $date;
 	private $is_read;
 	private $is_favorite;
+	private $feed;
 	
-	public function __construct ($guid = '', $title = '', $author = '', $content = '',
+	public function __construct ($feed = '', $guid = '', $title = '', $author = '', $content = '',
 	                             $link = '', $pubdate = 0, $is_read = false, $is_favorite = false) {
 		$this->_guid ($guid);
 		$this->_title ($title);
@@ -20,6 +21,7 @@ class Entry extends Model {
 		$this->_date ($pubdate);
 		$this->_isRead ($is_read);
 		$this->_isFavorite ($is_favorite);
+		$this->_feed ($feed);
 	}
 	
 	public function id () {
@@ -53,6 +55,14 @@ class Entry extends Model {
 	public function isFavorite () {
 		return $this->is_favorite;
 	}
+	public function feed ($object = false) {
+		if ($object) {
+			$feedDAO = new FeedDAO ();
+			return $feedDAO->searchById ($this->feed);
+		} else {
+			return $this->feed;
+		}
+	}
 	
 	public function _guid ($value) {
 		$this->guid = $value;
@@ -78,6 +88,9 @@ class Entry extends Model {
 	public function _isFavorite ($value) {
 		$this->is_favorite = $value;
 	}
+	public function _feed ($value) {
+		$this->feed = $value;
+	}
 }
 
 class EntryDAO extends Model_array {
@@ -162,6 +175,7 @@ class HelperEntry {
 
 		foreach ($listDAO as $key => $dao) {
 			$list[$key] = new Entry (
+				$dao['feed'],
 				$dao['guid'],
 				$dao['title'],
 				$dao['author'],

+ 82 - 44
app/models/Feed.php

@@ -2,13 +2,15 @@
 
 class Feed extends Model {
 	private $url;
-	private $categories;
-	private $entries_list;
+	private $category = '';
+	private $entries_list = array ();
+	private $entries = null;
+	private $name = '';
+	private $website = '';
+	private $description = '';
 	
-	public function __construct ($url = null) {
+	public function __construct ($url) {
 		$this->_url ($url);
-		$this->_categories (array ());
-		$this->_entries (array ());
 	}
 	
 	public function id () {
@@ -17,11 +19,26 @@ class Feed extends Model {
 	public function url () {
 		return $this->url;
 	}
-	public function categories () {
-		return $this->categories;
+	public function category () {
+		return $this->category;
 	}
-	public function entries () {
-		return $this->entries_list;
+	public function entries ($list = true) {
+		if ($list) {
+			return $this->entries_list;
+		} elseif (!is_null ($this->entries)) {
+			return $this->entries;
+		} else {
+			return false;
+		}
+	}
+	public function name () {
+		return $this->name;
+	}
+	public function website () {
+		return $this->website;
+	}
+	public function description () {
+		return $this->description;
 	}
 	
 	public function _url ($value) {
@@ -31,12 +48,8 @@ class Feed extends Model {
 			throw new Exception ();
 		}
 	}
-	public function _categories ($value) {
-		if (!is_array ($value)) {
-			$value = array ($value);
-		}
-		
-		$this->categories = $value;
+	public function _category ($value) {
+		$this->category = $value;
 	}
 	public function _entries ($value) {
 		if (!is_array ($value)) {
@@ -45,42 +58,54 @@ class Feed extends Model {
 		
 		$this->entries_list = $value;
 	}
+	public function _name ($value) {
+		$this->name = $value;
+	}
+	public function _website ($value) {
+		$this->website = $value;
+	}
+	public function _description ($value) {
+		$this->description = $value;
+	}
 	
-	public function loadEntries () {
+	public function load () {
 		if (!is_null ($this->url)) {
 			$feed = new SimplePie ();
 			$feed->set_feed_url ($this->url);
 			$feed->set_cache_location (CACHE_PATH);
 			$feed->init ();
 			
-			$entries = array ();
-    			if ($feed->data) {
-    				foreach ($feed->get_items () as $item) {
-    					$title = $item->get_title ();
-    					$author = $item->get_author ();
-    					$content = $item->get_content ();
-    					$link = $item->get_permalink ();
-    					$date = strtotime ($item->get_date ());
-    				
-    					$entry = new Entry (
-    						$item->get_id (),
-    						!is_null ($title) ? $title : '',
-    						!is_null ($author) ? $author->name : '',
-    						!is_null ($content) ? $content : '',
-    						!is_null ($link) ? $link : '',
-    						$date ? $date : time ()
-    					);
-    					
-    					$entries[$entry->id ()] = $entry;
-        			}
-				
-				return $entries;
-			} else {
-				return false;
-			}
-		} else {
-			return false;
+			$title = $feed->get_title ();
+			$this->loadEntries ($feed);
+			$this->_name (!is_null ($title) ? $title : $this->url);
+			$this->_website ($feed->get_link ());
+			$this->_description ($feed->get_description ());
+		}
+	}
+	private function loadEntries ($feed) {
+		$entries = array ();
+			
+		foreach ($feed->get_items () as $item) {
+			$title = $item->get_title ();
+			$author = $item->get_author ();
+			$content = $item->get_content ();
+			$link = $item->get_permalink ();
+			$date = strtotime ($item->get_date ());
+	
+			$entry = new Entry (
+				$this->id (),
+				$item->get_id (),
+				!is_null ($title) ? $title : '',
+				!is_null ($author) ? $author->name : '',
+				!is_null ($content) ? $content : '',
+				!is_null ($link) ? $link : '',
+				$date ? $date : time ()
+			);
+		
+			$entries[$entry->id ()] = $entry;
 		}
+	
+		$this->entries = $entries;
 	}
 }
 
@@ -114,6 +139,16 @@ class FeedDAO extends Model_array {
 		$this->writeFile($this->array);
 	}
 	
+	public function searchById ($id) {
+		$list = HelperFeed::daoToFeed ($this->array);
+		
+		if (isset ($list[$id])) {
+			return $list[$id];
+		} else {
+			return false;
+		}
+	}
+	
 	public function listFeeds () {
 		$list = $this->array;
 		
@@ -139,8 +174,11 @@ class HelperFeed {
 
 		foreach ($listDAO as $key => $dao) {
 			$list[$key] = new Feed ($dao['url']);
-			$list[$key]->_categories ($dao['categories']);
+			$list[$key]->_category ($dao['category']);
 			$list[$key]->_entries ($dao['entries']);
+			$list[$key]->_name ($dao['name']);
+			$list[$key]->_website ($dao['website']);
+			$list[$key]->_description ($dao['description']);
 		}
 
 		return $list;

+ 16 - 0
app/models/RSSConfiguration.php

@@ -4,12 +4,14 @@ class RSSConfiguration extends Model {
 	private $posts_per_page;
 	private $default_view;
 	private $display_posts;
+	private $sort_order;
 	
 	public function __construct () {
 		$confDAO = new RSSConfigurationDAO ();
 		$this->_postsPerPage ($confDAO->posts_per_page);
 		$this->_defaultView ($confDAO->default_view);
 		$this->_displayPosts ($confDAO->display_posts);
+		$this->_sortOrder ($confDAO->sort_order);
 	}
 	
 	public function postsPerPage () {
@@ -21,6 +23,9 @@ class RSSConfiguration extends Model {
 	public function displayPosts () {
 		return $this->display_posts;
 	}
+	public function sortOrder () {
+		return $this->sort_order;
+	}
 	
 	public function _postsPerPage ($value) {
 		if (is_int ($value)) {
@@ -43,12 +48,20 @@ class RSSConfiguration extends Model {
 			$this->display_posts = 'no';
 		}
 	}
+	public function _sortOrder ($value) {
+		if ($value == 'high_to_low') {
+			$this->sort_order = 'high_to_low';
+		} else {
+			$this->sort_order = 'low_to_high';
+		}
+	}
 }
 
 class RSSConfigurationDAO extends Model_array {
 	public $posts_per_page = 10;
 	public $default_view = 'all';
 	public $display_posts = 'no';
+	public $sort_order = 'low_to_high';
 
 	public function __construct () {
 		parent::__construct (PUBLIC_PATH . '/data/db/Configuration.array.php');
@@ -62,6 +75,9 @@ class RSSConfigurationDAO extends Model_array {
 		if (isset ($this->array['display_posts'])) {
 			$this->display_posts = $this->array['display_posts'];
 		}
+		if (isset ($this->array['sort_order'])) {
+			$this->sort_order = $this->array['sort_order'];
+		}
 	}
 	
 	public function save ($values) {

+ 14 - 3
app/views/configure/categorize.phtml

@@ -1,3 +1,14 @@
-<div class="post">
-	Fonctionnalité non implémentée (pour le moment)
-</div>
+<form method="post" action="">
+	<h1>Gérer les catégories</h1>
+	
+	<?php $i = 0; foreach ($this->categories as $cat) { $i++; ?>
+	<label for="cat_<?php echo $cat->id (); ?>">Catégorie n°<?php echo $i; ?></label>
+	<input type="text" id="cat_<?php echo $cat->id (); ?>" name="categories[]" value="<?php echo $cat->name (); ?>" />
+	<input type="hidden" name="ids[]" value="<?php echo $cat->id (); ?>" />
+	<?php } ?>
+	
+	<label for="new_category">Ajouter une catégorie</label>
+	<input type="text" id="new_category" name="new_category" placeholder="Nouvelle catégorie" />
+	
+	<input type="submit" value="Valider" />
+</form>

+ 6 - 0
app/views/configure/display.phtml

@@ -14,6 +14,12 @@
 			<label for="radio_not_read">Afficher les non lus</label>
 		</div>
 		
+		<label for="sort_order">Ordre de tri</label>
+		<select name="sort_order" id="sort_order">
+			<option value="low_to_high"<?php echo $this->conf->sortOrder () == 'low_to_high' ? ' selected="selected"' : ''; ?>>Du plus récent au plus ancien</option>
+			<option value="high_to_low"<?php echo $this->conf->sortOrder () == 'high_to_low' ? ' selected="selected"' : ''; ?>>Du plus ancien au plus récent</option>
+		</select>
+		
 		<label>Afficher les articles dépliés par défaut</label>
 		<div class="radio_group">
 			<input type="radio" name="display_posts" id="radio_yes" value="yes"<?php echo $this->conf->displayPosts () ? ' checked="checked"' : ''; ?> />

+ 43 - 2
app/views/configure/flux.phtml

@@ -1,3 +1,44 @@
-<div class="post">
-	Fonctionnalité non implémentée (pour le moment)
+<div class="table">
+	<div class="aside">
+		<ul>
+			<li><h2>Vox flux RSS</h2></li>
+			<?php if (!empty ($this->feeds)) { ?>
+			<?php foreach ($this->feeds as $feed) { ?>
+			<li <?php echo ($this->flux && $this->flux->id () == $feed->id ()) ? 'class="active"' : ''; ?>>
+				<a href="<?php echo Url::display (array ('c' => 'configure', 'a' => 'flux', 'params' => array ('id' => $feed->id ()))); ?>"><?php echo $feed->name (); ?></a>
+			</li>
+			<?php } ?>
+			<?php } else { ?>
+			<li class="disable"><span>Aucun flux</span></li>
+			<?php } ?>
+		</ul>
+	</div>
+	
+	<?php if ($this->flux) { ?>
+	<form method="post" action="">
+		<h1><?php echo $this->flux->name (); ?></h1>
+		<?php echo $this->flux->description (); ?>
+		
+		<label>URL du site</label>
+		<span><a target="_blank" href="<?php echo $this->flux->website (); ?>"><?php echo $this->flux->website (); ?></a></span>
+		
+		<label>Nombre d'articles</label>
+		<span><?php echo count ($this->flux->entries ()); ?></span>
+		
+		<?php if (!empty ($this->categories)) { ?>
+		<label>Ranger dans une catégorie</label>
+		<div class="radio_group">
+			<?php foreach ($this->categories as $cat) { ?>
+			<input type="radio" name="category" id="cat_<?php echo $cat->id (); ?>" value="<?php echo $cat->id (); ?>"<?php echo $cat->id () == $this->flux->category () ? ' checked="checked"' : ''; ?> />
+			<label for="cat_<?php echo $cat->id (); ?>"><?php echo $cat->name (); ?></label>
+			<br />
+			<?php } ?>
+		</div>
+		
+		<input type="submit" value="Valider" />
+		<?php } ?>
+	</form>
+	<?php } else { ?>
+	<div class="nothing">Aucun flux sélectionné</div>
+	<?php } ?>
 </div>

+ 7 - 1
app/views/index/index.phtml

@@ -14,7 +14,13 @@
 	
 	<?php foreach ($items as $item) { ?>
 	<div class="post flux<?php echo !$item->isRead () ? ' not_read' : ''; ?><?php echo $item->isFavorite () ? ' favorite' : ''; ?>">
-		<div class="before"><?php echo $item->author (); ?> a écrit le <?php echo $item->date (); ?>,</div>
+		<?php $author = $item->author (); ?>
+		<div class="before">
+			<?php echo $author != '' ? $author . ' a écrit' : ''; ?>
+			le <?php echo $item->date (); ?>
+			<?php $feed = $item->feed (true); ?>
+			sur <a target="_blank" href="<?php echo $feed->website (); ?>"><?php echo $feed->name (); ?></a>,
+		</div>
 		
 		<h1><a target="_blank" href="<?php echo $item->link (); ?>"> <?php echo $item->title (); ?></a></h1>
 		<div class="content"><?php echo $item->content (); ?></div>

+ 3 - 3
lib/Url.php

@@ -58,19 +58,19 @@ class Url {
 		if (isset ($url['c'])
 		 && $url['c'] != Request::defaultControllerName ()) {
 			$uri .= $separator . 'c=' . $url['c'];
-			$separator = '&';
+			$separator = '&amp;';
 		}
 		
 		if (isset ($url['a'])
 		 && $url['a'] != Request::defaultActionName ()) {
 			$uri .= $separator . 'a=' . $url['a'];
-			$separator = '&';
+			$separator = '&amp;';
 		}
 		
 		if (isset ($url['params'])) {
 			foreach ($url['params'] as $key => $param) {
 				$uri .= $separator . $key . '=' . $param;
-				$separator = '&';
+				$separator = '&amp;';
 			}
 		}
 		

+ 12 - 9
lib/lib_rss.php

@@ -16,31 +16,31 @@ function timestamptodate ($t, $hour = true) {
 	$annee = date ('Y', $t);
 	
 	switch ($mois) {
-	case 01:
+	case 1:
 		$mois = 'janvier';
 		break;
-	case 02:
+	case 2:
 		$mois = 'février';
 		break;
-	case 03:
+	case 3:
 		$mois = 'mars';
 		break;
-	case 04:
+	case 4:
 		$mois = 'avril';
 		break;
-	case 05:
+	case 5:
 		$mois = 'mai';
 		break;
-	case 06:
+	case 6:
 		$mois = 'juin';
 		break;
-	case 07:
+	case 7:
 		$mois = 'juillet';
 		break;
-	case 08:
+	case 8:
 		$mois = 'août';
 		break;
-	case 09:
+	case 9:
 		$mois = 'septembre';
 		break;
 	case 10:
@@ -65,3 +65,6 @@ function timestamptodate ($t, $hour = true) {
 function sortEntriesByDate ($entry1, $entry2) {
 	return $entry2->date (true) - $entry1->date (true);
 }
+function sortReverseEntriesByDate ($entry1, $entry2) {
+	return $entry1->date (true) - $entry2->date (true);
+}

+ 35 - 6
public/theme/base.css

@@ -64,6 +64,7 @@ form {
 }
 	label {
 		display: block;
+		margin: 20px 0 0;
 		padding: 0 20px 0 0;
 		font-weight: bold;
 	}
@@ -93,11 +94,19 @@ form {
 		margin: 5px 0 5px;
 		padding: 5px 0;
 	}
-	.radio_group label {
-		display: inline-block;
-		padding: 0 0 0 5px;
-		font-weight: normal;
+	select {
+		width: 100%;
+		padding: 5px;
 	}
+	.radio_group {
+		line-height: 35px;
+	}
+		.radio_group label {
+			display: inline-block;
+			margin: 0;
+			padding: 0 0 0 5px;
+			font-weight: normal;
+		}
 
 /* STRUCTURE */
 #global {
@@ -111,27 +120,34 @@ form {
 		width: 250px;
 		vertical-align: top;
 		border-right: 1px solid #aaa;
+		background: #fff;
 	}
 		.aside ul {
 			margin: 0;
 			list-style: none;
 		}
 			.aside li {
+				width: 100%;
 				height: 50px;
+				overflow: hidden;
 				line-height: 50px;
 			}
 				.aside li.active a {
 					background: #0062BE !important;
 					color: #fff;
 				}
-				.aside li a {
+				.aside li a, .aside li span {
 					display: block;
+					width: 230px;
 					padding: 0 10px;
 				}
-					.aside li a:hover {
+					.aside li a:hover, .aside li span:hover {
 						text-decoration: none;
 						background: #fafafa;
 					}
+					.aside li.disable span {
+						background: #fff;
+					}
 				.aside li h2 {
 					height: 50px;
 					padding: 0;
@@ -139,6 +155,7 @@ form {
 					background: #eee;
 					line-height: 50px;
 				}
+				
 		.aside form {
 			display: table;
 			width: 250px;
@@ -197,6 +214,18 @@ form {
 		#stream {
 			padding: 20px 0;
 		}
+		#main .table {
+			display: table;
+			width: 100%;
+			height: 100%;
+		}
+		#main .nothing {
+			display: table-cell;
+			width: 100%;
+			height: 100%;
+			vertical-align: middle;
+			text-align: center;
+		}
 
 .post {
 	width: 80%;