Changeset 1639 for branches/multiuser/cls
- Timestamp:
- 11/24/06 16:23:35 (2 years ago)
- Location:
- branches/multiuser/cls
- Files:
-
- 5 modified
-
items.php (modified) (8 diffs)
-
l10n.php (modified) (1 diff)
-
update.php (modified) (5 diffs)
-
wrappers/header.php (modified) (2 diffs)
-
wrappers/item.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/multiuser/cls/items.php
r1604 r1639 60 60 * ctor 61 61 */ 62 function Item($id, $title, $url, $enclosure, $parent, $author, $description, $date, $isPubDate, $unread, $private, $sticky, $flagged) {62 function Item($id, $title, $url, $enclosure, $parent, $author, $description, $date, $isPubDate, $unread, $rating) { 63 63 $this->rss = &$GLOBALS['rss']; 64 64 $this->id = $id; 65 //$this->flags = $unread;65 $this->flags = $unread; 66 66 if ($title) { 67 67 $this->title = $title; … … 87 87 $this -> tags=array(); 88 88 $this -> rating = $rating; 89 $this ->isUnread = $unread ;90 $this ->isPrivate = $ private;91 $this ->isDeleted = $ deleted;92 $this ->isSticky = $ sticky;93 $this ->isFlag = $flagged;89 $this ->isUnread = $unread & RSS_MODE_UNREAD_STATE; 90 $this ->isPrivate = $unread & RSS_MODE_PRIVATE_STATE; 91 $this ->isDeleted = $unread & RSS_MODE_DELETED_STATE; 92 $this ->isSticky = $unread & RSS_MODE_STICKY_STATE; 93 $this ->isFlag = $unread & RSS_MODE_FLAG_STATE; 94 94 //$this -> key = md5(rand(0,10000)); 95 95 … … 193 193 $this->items[] = $item; 194 194 195 if ((!$this -> hasUnreadItems) && $item-> isUnread) {195 if ((!$this -> hasUnreadItems) && $item->flags & RSS_MODE_UNREAD_STATE) { 196 196 $this -> hasUnreadItems = true; 197 197 } … … 260 260 261 261 // Predefined alternate ordering 262 $this -> ORDER_BY_UNREAD_FIRST = " order by i2u.flgunread desc, ";262 $this -> ORDER_BY_UNREAD_FIRST = " order by i2u.flgunread & " . RSS_MODE_UNREAD_STATE . " desc, "; 263 263 if (getConfig('rss.config.absoluteordering')) { 264 264 $this -> ORDER_BY_UNREAD_FIRST .= " f.position asc, c2u.position asc"; 265 265 } else { 266 $this -> ORDER_BY_UNREAD_FIRST .= " f.name asc, c .title asc";266 $this -> ORDER_BY_UNREAD_FIRST .= " f.name asc, c2u.title asc"; 267 267 } 268 268 $this -> ORDER_BY_UNREAD_FIRST .= ", i.added desc, i.id asc"; … … 271 271 272 272 /** 273 * Populates a an ItemList with items from the Database. Note that this meth do273 * Populates a an ItemList with items from the Database. Note that this method 274 274 * can be invoked several times on the same ItemList object instance: upon each 275 275 * call the new items will be aggregated to the existing ones. … … 283 283 284 284 _pf('ItemList::populate()'); 285 $this -> _sqlActualWhat = " i.title, c.title, c.id, " 286 ."i2u.flgunread, i2u.flgprivate, i2u.flgsticky, i2u.flgdeleted, " 287 ." i2u.flgflagged," 285 $this -> _sqlActualWhat = " i.title, c.title, c.id, i2u.flgunread, " 288 286 ."i.url, i.enclosure, i.author, i.description, c2u.icon, " 289 287 ." unix_timestamp(ifnull(i.pubdate,i.added)) as ts, " … … 360 358 $this -> _sqlActualLimit = " $startItem, $itemCount"; 361 359 362 $sql = " \nselect\n\t "360 $sql = "select " 363 361 .$this -> _sqlActualWhat 364 . " \nfrom\n\t"362 . " from " 365 363 .$this -> _sqlActualFrom 366 . " \nwhere\n\t"364 . " where " 367 365 . $this -> _sqlActualWhere 368 . " \norder by\n\t"366 . " order by " 369 367 . $this -> _sqlActualOrder 370 . " \nlimit "368 . " limit " 371 369 . $this -> _sqlActualLimit; 372 370 373 // die( $sql );371 //echo $sql; 374 372 $this -> iids = array(); 375 $res = rss_query($sql);373 $res = $GLOBALS['rss_db']->rss_query($sql); 376 374 $this -> rowCount = $GLOBALS['rss_db']->rss_num_rows($res); 377 375 $prevCid = -1; 378 376 $curIdx = 0; 379 377 $f=null; 380 while (list ($ititle_, $ctitle_, $cid_, $iunread_, $i private_, $isticky_, $ideleted_, $iflagged_, $iurl_, $ienclosure_, $iauthor_, $idescr_, $cicon_, $its_, $iispubdate_, $iid_) = $GLOBALS['rss_db']->rss_fetch_row($res)) {378 while (list ($ititle_, $ctitle_, $cid_, $iunread_, $iurl_, $ienclosure_, $iauthor_, $idescr_, $cicon_, $its_, $iispubdate_, $iid_) = $GLOBALS['rss_db']->rss_fetch_row($res)) { 381 379 382 380 // Built a new Item 383 $i = new Item($iid_, $ititle_, $iurl_, $ienclosure_, $cid_, $iauthor_, $idescr_, $its_, $iispubdate_, $iunread_ , $iprivate_, $isticky_, $iflagged_);381 $i = new Item($iid_, $ititle_, $iurl_, $ienclosure_, $cid_, $iauthor_, $idescr_, $its_, $iispubdate_, $iunread_); 384 382 385 383 // no dupes, please … … 413 411 // Some stats... 414 412 $this -> itemCount++; 415 if ($iunread_ ) {413 if ($iunread_ & RSS_MODE_UNREAD_STATE) { 416 414 $this -> unreadCount++; 417 415 $this -> unreadIids[] = $iid_; -
branches/multiuser/cls/l10n.php
r1628 r1639 75 75 } 76 76 /** 77 * Detect users preferred language. Losely based on http://grep.be/data/accept-to-gettext.inc 77 * Detect user's preferred language. 78 * Loosely based on http://grep.be/data/accept-to-gettext.inc 78 79 */ 79 80 function __detectUserLang() { 80 if (isset($_REQUEST['lang']) && preg_match('#^[a-z]{2}_?([A-Z]{2})?$#',$_REQUEST['lang']) && ($_REQUEST['lang'] == 'en' || file_exists(GREGARIUS_HOME .'intl/'.$_REQUEST['lang']))) { 81 // Language overridden? 82 if (defined('RSS_LANGUAGE_OVERRIDE')) { 83 return constant('RSS_LANGUAGE_OVERRIDE'); 84 // Language defined in the request (?lang=) 85 } elseif (isset($_REQUEST['lang']) && preg_match('#^[a-z]{2}_?([A-Z]{2})?$#',$_REQUEST['lang']) && ($_REQUEST['lang'] == 'en' || file_exists(GREGARIUS_HOME .'intl/'.$_REQUEST['lang']))) { 81 86 $this -> __setLocaleCookie($_REQUEST['lang']); 82 87 rss_invalidate_cache(); -
branches/multiuser/cls/update.php
r1604 r1639 99 99 if (!hidePrivate() || $ignorePrivate) { 100 100 if (count($newIds) > 0 && getConfig('rss.config.markreadonupdate')) { 101 rss_query("update ".getTable("item2user")." i2u set i2u.flgunread=0 where i2u.flgunread=1" 101 rss_query("update ".getTable("item2user")." i2u set i2u.flgunread = unread & " 102 .SET_MODE_READ_STATE." where unread & ".RSS_MODE_UNREAD_STATE 102 103 ." and i2u.fkiid not in (".implode(",", $newIds).")"); 103 104 } … … 113 114 114 115 function magpieError($error) { 115 if ( $error & MAGPIE_FEED_ORIGIN_CACHE) {116 if (is_numeric($error) && ($error & MAGPIE_FEED_ORIGIN_CACHE)) { 116 117 if ($error & MAGPIE_FEED_ORIGIN_HTTP_304) { 117 118 $label = __('OK (304 Not modified)'); … … 120 121 elseif ($error & MAGPIE_FEED_ORIGIN_HTTP_TIMEOUT) { 121 122 $label = __('HTTP Timeout (Local cache)'); 122 $cls = ERROR_ WARNING;123 $cls = ERROR_ERROR; 123 124 } 124 125 elseif ($error & MAGPIE_FEED_ORIGIN_NOT_FETCHED) { … … 129 130 $label = __('404 Not Found (Local cache)'); 130 131 $cls = ERROR_ERROR; 132 } elseif ($error & MAGPIE_FEED_ORIGIN_HTTP_403) { 133 $label = __('403 Forbidden (Local cache)'); 134 $cls = ERROR_ERROR; 131 135 } 132 136 else { … … 141 145 else { 142 146 if (is_numeric($error)) { 143 $label = __('ERROR') ;147 $label = __('ERROR') ." $error"; 144 148 $cls = ERROR_ERROR; 145 149 } else { -
branches/multiuser/cls/wrappers/header.php
r1604 r1639 135 135 } 136 136 137 function rss_header_logininfo( ) {137 function rss_header_logininfo($showLoginBox = true) { 138 138 139 139 $ret = "<div id=\"loginfo\">\n"; … … 142 142 $ret .= sprintf(__('Logged in as <strong>%s</strong>'), rss_user_name()) 143 143 ." | <a href=\"".getPath()."?logout\">".__('Logout')."</a>\n"; 144 } else {144 } else if(true == $showLoginBox) { 145 145 $ret .= __('Not logged in') 146 146 ." | <a href=\"#\" onclick=\"miniloginform(); return false;\">".__('Login')."</a>"; -
branches/multiuser/cls/wrappers/item.php
r1606 r1639 47 47 if (getConfig('rss.output.usepermalinks')) { 48 48 list ($ply, $plm, $pld) = explode(":", rss_date("Y:m:d", $GLOBALS['rss'] -> currentItem -> date, false)); 49 $ptitle = ($label."'".$GLOBALS['rss'] -> currentItem -> parent -> escapedTitle 50 ."/$ply/$plm/$pld/".$GLOBALS['rss'] -> currentItem -> escapedTitle."'"); 51 } 52 return $ptitle; 49 $ptitle = ($label."'". htmlentities($GLOBALS['rss'] -> currentItem -> title,ENT_QUOTES ,'UTF-8') ."'"); 50 } 51 return @$ptitle; 53 52 } 54 53
