Show
Ignore:
Timestamp:
11/24/06 16:23:35 (2 years ago)
Author:
mdodoo
Message:

Attempted sync with trunk through "diff -r." Ignored the internationalized langugage files because i was afraid of messing something up.

It is 10:30 am. I should get some sleep.

Location:
branches/multiuser/cls
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • branches/multiuser/cls/items.php

    r1604 r1639  
    6060     * ctor 
    6161     */ 
    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) { 
    6363        $this->rss = &$GLOBALS['rss']; 
    6464        $this->id = $id; 
    65         //$this->flags = $unread; 
     65        $this->flags = $unread; 
    6666        if ($title) { 
    6767            $this->title = $title; 
     
    8787        $this -> tags=array(); 
    8888        $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; 
    9494        //$this -> key = md5(rand(0,10000)); 
    9595         
     
    193193        $this->items[] = $item; 
    194194         
    195         if ((!$this -> hasUnreadItems) && $item->isUnread) { 
     195        if ((!$this -> hasUnreadItems) && $item->flags & RSS_MODE_UNREAD_STATE) { 
    196196            $this -> hasUnreadItems = true; 
    197197        } 
     
    260260         
    261261        // 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, "; 
    263263        if (getConfig('rss.config.absoluteordering')) { 
    264264            $this -> ORDER_BY_UNREAD_FIRST .= " f.position asc, c2u.position asc"; 
    265265        } 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"; 
    267267        } 
    268268        $this -> ORDER_BY_UNREAD_FIRST .= ", i.added desc, i.id asc"; 
     
    271271 
    272272    /** 
    273      * Populates a an ItemList with items from the Database. Note that this methdo 
     273     * Populates a an ItemList with items from the Database. Note that this method 
    274274     * can be invoked several times on the same ItemList object instance: upon each 
    275275     * call the new items will be aggregated to the existing ones. 
     
    283283 
    284284      _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, " 
    288286            ."i.url, i.enclosure, i.author, i.description, c2u.icon, " 
    289287            ." unix_timestamp(ifnull(i.pubdate,i.added)) as ts, " 
     
    360358        $this -> _sqlActualLimit = " $startItem, $itemCount"; 
    361359 
    362         $sql = "\nselect\n\t " 
     360        $sql = "select " 
    363361            .$this -> _sqlActualWhat 
    364             . " \nfrom\n\t " 
     362            . " from " 
    365363            .$this -> _sqlActualFrom 
    366             . " \nwhere\n\t " 
     364            . " where " 
    367365            . $this -> _sqlActualWhere 
    368             . " \norder by\n\t " 
     366            . " order by " 
    369367            . $this -> _sqlActualOrder 
    370             . " \nlimit " 
     368            . " limit " 
    371369            . $this -> _sqlActualLimit; 
    372370             
    373         //die( $sql ); 
     371        //echo $sql; 
    374372        $this -> iids = array(); 
    375         $res = rss_query($sql); 
     373        $res = $GLOBALS['rss_db']->rss_query($sql); 
    376374        $this -> rowCount = $GLOBALS['rss_db']->rss_num_rows($res); 
    377375        $prevCid = -1; 
    378376        $curIdx = 0; 
    379377        $f=null; 
    380         while (list ($ititle_, $ctitle_, $cid_, $iunread_, $iprivate_, $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)) { 
    381379             
    382380            // 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_); 
    384382             
    385383            // no dupes, please 
     
    413411            // Some stats... 
    414412            $this -> itemCount++;            
    415             if ($iunread_) { 
     413            if ($iunread_ & RSS_MODE_UNREAD_STATE) { 
    416414                $this -> unreadCount++;  
    417415                $this -> unreadIids[] = $iid_; 
  • branches/multiuser/cls/l10n.php

    r1628 r1639  
    7575    } 
    7676    /** 
    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 
    7879     */ 
    7980    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']))) { 
    8186            $this -> __setLocaleCookie($_REQUEST['lang']); 
    8287            rss_invalidate_cache(); 
  • branches/multiuser/cls/update.php

    r1604 r1639  
    9999        if (!hidePrivate() || $ignorePrivate) { 
    100100            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 
    102103                          ." and i2u.fkiid not in (".implode(",", $newIds).")"); 
    103104            } 
     
    113114 
    114115    function magpieError($error) { 
    115         if ($error & MAGPIE_FEED_ORIGIN_CACHE) { 
     116        if (is_numeric($error) && ($error & MAGPIE_FEED_ORIGIN_CACHE)) { 
    116117            if ($error & MAGPIE_FEED_ORIGIN_HTTP_304) { 
    117118                $label = __('OK (304 Not modified)'); 
     
    120121            elseif ($error & MAGPIE_FEED_ORIGIN_HTTP_TIMEOUT) { 
    121122                $label = __('HTTP Timeout (Local cache)'); 
    122                 $cls = ERROR_WARNING; 
     123                $cls = ERROR_ERROR; 
    123124            } 
    124125            elseif ($error & MAGPIE_FEED_ORIGIN_NOT_FETCHED) { 
     
    129130                $label = __('404 Not Found (Local cache)'); 
    130131                $cls = ERROR_ERROR; 
     132            } elseif ($error & MAGPIE_FEED_ORIGIN_HTTP_403) { 
     133                $label = __('403 Forbidden (Local cache)'); 
     134                $cls = ERROR_ERROR; 
    131135            } 
    132136            else { 
     
    141145        else { 
    142146            if (is_numeric($error)) { 
    143                 $label = __('ERROR'); 
     147                $label = __('ERROR') ." $error"; 
    144148                $cls = ERROR_ERROR; 
    145149            } else { 
  • branches/multiuser/cls/wrappers/header.php

    r1604 r1639  
    135135} 
    136136 
    137 function rss_header_logininfo() { 
     137function rss_header_logininfo($showLoginBox = true) { 
    138138 
    139139    $ret = "<div id=\"loginfo\">\n"; 
     
    142142        $ret .= sprintf(__('Logged in as <strong>%s</strong>'), rss_user_name()) 
    143143                ."&nbsp;|&nbsp;<a href=\"".getPath()."?logout\">".__('Logout')."</a>\n"; 
    144     } else { 
     144    } else if(true == $showLoginBox) { 
    145145        $ret .= __('Not logged in') 
    146146                ."&nbsp;|&nbsp;<a href=\"#\" onclick=\"miniloginform(); return false;\">".__('Login')."</a>"; 
  • branches/multiuser/cls/wrappers/item.php

    r1606 r1639  
    4747    if (getConfig('rss.output.usepermalinks')) { 
    4848        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; 
    5352} 
    5453