diff options
| author | 2012-12-07 21:44:39 +0100 | |
|---|---|---|
| committer | 2012-12-07 21:44:39 +0100 | |
| commit | adc704c3d75518fd7ed7a32b9ed21d9b7eb71c99 (patch) | |
| tree | c7e768c89f1d9a37220d95a9add921d8f228692b | |
| parent | b039a6a0e35b3b9d9eef90474df8199289f61a43 (diff) | |
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
| -rwxr-xr-x | app/models/Entry.php | 12 | ||||
| -rw-r--r-- | app/views/index/index.phtml | 23 | ||||
| -rw-r--r-- | public/theme/base.css | 39 |
3 files changed, 30 insertions, 44 deletions
diff --git a/app/models/Entry.php b/app/models/Entry.php index 654286bd7..fb7399fec 100755 --- a/app/models/Entry.php +++ b/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'], diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml index 86352f6ad..0ddf4efdd 100644 --- a/app/views/index/index.phtml +++ b/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 } ?> diff --git a/public/theme/base.css b/public/theme/base.css index 3de9094d7..bf19ef0ae 100644 --- a/public/theme/base.css +++ b/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 { |
