Просмотр исходного кода

git diff Attention git diff À partir de ce commit, les contenus des articles sont compressés dans la base de données - pas compatible avec les anciennes versions, pour cela il faut mettre à jour la BDD

Marien Fressinaud 13 лет назад
Родитель
Сommit
adc704c3d7
3 измененных файлов с 30 добавлено и 44 удалено
  1. 10 2
      app/models/Entry.php
  2. 10 13
      app/views/index/index.phtml
  3. 10 29
      public/theme/base.css

+ 10 - 2
app/models/Entry.php

@@ -103,7 +103,7 @@ class EntryDAO extends Model_pdo {
 			$valuesTmp['guid'],
 			$valuesTmp['title'],
 			$valuesTmp['author'],
-			$valuesTmp['content'],
+			base64_encode (gzdeflate (serialize ($valuesTmp['content']))),
 			$valuesTmp['link'],
 			$valuesTmp['date'],
 			$valuesTmp['is_read'],
@@ -119,6 +119,10 @@ class EntryDAO extends Model_pdo {
 	}
 	
 	public function updateEntry ($id, $valuesTmp) {
+		if (isset ($valuesTmp['content'])) {
+			$valuesTmp['content'] = base64_encode (gzdeflate (serialize ($valuesTmp['content'])));
+		}
+	
 		$set = '';
 		foreach ($valuesTmp as $key => $v) {
 			$set .= $key . '=?, ';
@@ -141,6 +145,10 @@ class EntryDAO extends Model_pdo {
 	}
 	
 	public function updateEntries ($valuesTmp) {
+		if (isset ($valuesTmp['content'])) {
+			$valuesTmp['content'] = base64_encode (gzdeflate (serialize ($valuesTmp['content'])));
+		}
+		
 		$set = '';
 		foreach ($valuesTmp as $key => $v) {
 			$set .= $key . '=?, ';
@@ -300,7 +308,7 @@ class HelperEntry {
 					$dao['guid'],
 					$dao['title'],
 					$dao['author'],
-					$dao['content'],
+					unserialize (gzinflate (base64_decode ($dao['content']))),
 					$dao['link'],
 					$dao['date'],
 					$dao['is_read'],

+ 10 - 13
app/views/index/index.phtml

@@ -18,32 +18,29 @@
 		<h1 class="title"><a target="_blank" href="<?php echo $item->link (); ?>"> <?php echo $item->title (); ?></a></h1>
 		
 		<div class="before">
-		</div>
-		
-		<div class="content"><?php echo $item->content (); ?></div>
-		
-		<div class="after">
 			<?php $author = $item->author (); ?>
 			<?php $feed = $item->feed (true); ?>
 			Le <?php echo $item->date (); ?>
 			<?php echo $author != '' ? ' par ' . $author : ''; ?>
 			sur <a target="_blank" href="<?php echo $feed->website (); ?>"><?php echo $feed->name (); ?> <img src="http://www.google.com/s2/favicons?domain=<?php echo get_domain ($feed->website ()); ?>" alt="" /></a>,
-			
-			<div class="options">
+		</div>
+		
+		<div class="content"><?php echo $item->content (); ?></div>
+		
+		<div class="after">
 			<?php if (!login_is_conf ($this->conf) || is_logged ()) { ?>
 			<?php if (!$item->isRead ()) { ?>
-			<a class="read" href="<?php echo Url::display (array ('c' => 'entry', 'a' => 'read', 'params' => array ('id' => $item->id (), 'is_read' => 1))); ?>">J'ai fini de lire l'article</a><!--
+			<a class="read" href="<?php echo Url::display (array ('c' => 'entry', 'a' => 'read', 'params' => array ('id' => $item->id (), 'is_read' => 1))); ?>">J'ai fini de lire l'article</a>
 			<?php } else { ?>
-			<a class="read" href="<?php echo Url::display (array ('c' => 'entry', 'a' => 'read', 'params' => array ('id' => $item->id (), 'is_read' => 0))); ?>">Marquer comme non lu</a><!--
+			<a class="read" href="<?php echo Url::display (array ('c' => 'entry', 'a' => 'read', 'params' => array ('id' => $item->id (), 'is_read' => 0))); ?>">Marquer comme non lu</a>
 			<?php } ?>
-			
+			-
 			<?php if (!$item->isFavorite ()) { ?>
-			--><a class="bookmark" href="<?php echo Url::display (array ('c' => 'entry', 'a' => 'bookmark', 'params' => array ('id' => $item->id (), 'is_favorite' => 1))); ?>">Ajouter l'article à mes favoris</a>
+			<a class="bookmark" href="<?php echo Url::display (array ('c' => 'entry', 'a' => 'bookmark', 'params' => array ('id' => $item->id (), 'is_favorite' => 1))); ?>">Ajouter l'article à mes favoris</a>
 			<?php } else { ?>
-			--><a class="bookmark" href="<?php echo Url::display (array ('c' => 'entry', 'a' => 'bookmark', 'params' => array ('id' => $item->id (), 'is_favorite' => 0))); ?>">Retirer l'article de mes favoris</a>
+			<a class="bookmark" href="<?php echo Url::display (array ('c' => 'entry', 'a' => 'bookmark', 'params' => array ('id' => $item->id (), 'is_favorite' => 0))); ?>">Retirer l'article de mes favoris</a>
 			<?php } ?>
 			<?php } ?>
-			</div>
 		</div>
 	</div>
 	<?php } ?>

+ 10 - 29
public/theme/base.css

@@ -244,39 +244,20 @@ form {
 		.post.flux:hover {
 			background: #fff;
 		}
-		.post.flux .after {
-			padding: 10px 20px;
+		.post.flux .after, .post.flux .before {
+			padding: 0 20px;
 			color: #aaa;
 			font-size: 80%;
 			font-style: italic;
 		}
-			.post.flux .after a {
+			.post.flux .before a {
 				color: #96BDE2;
 			}
-			.post.flux .after .options {
-				float: right;
-			}
-				.post.flux .after .options a {
-					padding: 0 20px;
-				}
-		/*.post.flux .after {
-			margin: 20px 0 0;
-			background: #fff;
-			font-size: 80%;
-			text-align: center;
-			border-top: 1px solid #aaa;
-			border-bottom: 1px solid #aaa;
-		}
 			.post.flux .after a {
 				display: inline-block;
-				height: 50px;
-				line-height: 50px;
-				width: 50%;
+				height: 40px;
+				line-height: 40px;
 			}
-				.post.flux .after a:hover {
-					background: #f6f6f6;
-					text-decoration: none;
-				}*/
 		.post.flux > h1 {
 			min-height: 0;
 			padding: 10px 20px;
@@ -284,7 +265,7 @@ form {
 			line-height: 150%;
 		}
 		.post.flux .content {
-			padding: 10px 100px;
+			padding: 5px 100px;
 		}
 			.post.flux .content h1, .post.flux .content h2, .post.flux .content h3 {
 				margin: 20px 0;
@@ -314,6 +295,10 @@ form {
 				border-left: 4px solid #ccc;
 				color: #666;
 			}
+		.post.flux.active {
+			border-left: 10px solid #0062BE;
+			background: #fff;
+		}
 		.post.flux.not_read {
 			border-left: 10px solid #FF5300;
 			background: #FFF3ED;
@@ -322,10 +307,6 @@ form {
 			border-left: 10px solid #FFC300;
 			background: #FFF6DA;
 		}
-		.post.flux.active {
-			border-left: 10px solid #0062BE;
-			background: #fff;
-		}
 
 /*** PAGINATION ***/
 .pagination {