diff options
author | Alessandro Cosentino <cosenal@gmail.com> | 2012-10-28 19:26:59 -0400 |
---|---|---|
committer | Alessandro Cosentino <cosenal@gmail.com> | 2012-10-28 19:26:59 -0400 |
commit | 4299b35e82480271edf39b4f2a0831b7e0a68970 (patch) | |
tree | 6ce62d64e01150edda9141b4c1c050a5ef5ebf1f | |
parent | a7f7f04052ded38c94e15a4e94645f6ab2b39941 (diff) |
[News] fix bugs in feedById
-rw-r--r-- | css/news.css | 5 | ||||
-rw-r--r-- | lib/itemmapper.php | 20 | ||||
-rw-r--r-- | templates/part.feeds.php | 7 |
3 files changed, 23 insertions, 9 deletions
diff --git a/css/news.css b/css/news.css index 748904a66..7083cdcd8 100644 --- a/css/news.css +++ b/css/news.css @@ -663,13 +663,14 @@ div.add_parentfolder { } .feed_item:hover .secondary_item_utils { - display: inline-block; + display: block; } + /* .feed_item a.share { background:url('%webroot%/core/img/actions/share.svg') no-repeat center; } - + */ .feed_item:hover .secondary_item_utils li.keep_unread { cursor: pointer; } diff --git a/lib/itemmapper.php b/lib/itemmapper.php index ba9be41a7..9b6c613ff 100644 --- a/lib/itemmapper.php +++ b/lib/itemmapper.php @@ -36,6 +36,7 @@ class ItemMapper { * @returns an object of the class OC_News_Item */ public function fromRow($row) { + $url = $row['url']; $title = $row['title']; $guid = $row['guid']; @@ -171,8 +172,10 @@ class ItemMapper { $status, $itemid ); - $stmt->execute($params); + + $result = $stmt->execute($params); + return true; } @@ -239,11 +242,18 @@ class ItemMapper { * @param id The id of the item in the database table. */ public function findById($id) { - $stmt = \OCP\DB::prepare('SELECT * FROM ' . self::tableName . ' JOIN ' . FeedMapper::tableName . - ' ON ' . self::tableName . '.feed_id = ' . FeedMapper::tableName . '.id WHERE ' - . self::tableName .'.id = ? AND ' . FeedMapper::tableName . '.user_id = ? '); - $result = $stmt->execute(array($id, $this->userid)); + $stmt = \OCP\DB::prepare('SELECT ' . self::tableName . '.id AS id, ' . self::tableName . + '.url AS url, ' . self::tableName . '.title AS title, guid, body, status, author, feed_id, pub_date' . + ' FROM ' . self::tableName . ' JOIN ' . FeedMapper::tableName . + ' ON ' . self::tableName . '.feed_id = ' . FeedMapper::tableName . '.id WHERE (' . self::tableName . + '.id = ? AND ' . FeedMapper::tableName . '.user_id = ? )'); + $result = $stmt->execute(array($id, $this->userid)); + + /* + $stmt = \OCP\DB::prepare('SELECT * FROM ' . self::tableName . ' WHERE id = ?'); + $result = $stmt->execute(array($id)); + */ $row = $result->fetchRow(); $item = $this->fromRow($row); diff --git a/templates/part.feeds.php b/templates/part.feeds.php index 5e9895870..c2b129ee8 100644 --- a/templates/part.feeds.php +++ b/templates/part.feeds.php @@ -40,7 +40,7 @@ $allfeeds = isset($_['allfeeds']) ? $_['allfeeds'] : ''; $lastViewedFeedId = $_['lastViewedFeedId']; $lastViewedFeedType = $_['lastViewedFeedType']; $starredCount = $_['starredCount']; -$sharedCount = $_['sharedCount']; +//$sharedCount = $_['sharedCount']; ?> @@ -55,11 +55,14 @@ $sharedCount = $_['sharedCount']; <span class="unread_items_counter"><?php echo $starredCount ?></span> </li> +<?php +/* <li class="shared <?php if($lastViewedFeedType == OCA\News\FeedType::SHARED) { echo "active"; }; ?>"> <a class="title" href="#" ><?php echo $l->t('Shared'); ?></a> <span class="unread_items_counter"><?php echo $sharedCount ?></span> </li> - +*/ +?> <?php print_collection_list($allfeeds, $lastViewedFeedId, $lastViewedFeedType); |