Show
Ignore:
Timestamp:
09/26/07 08:57:31 (3 years ago)
Author:
mdodoo
Message:

Lots of things are still not working, but I think this code is better than what was currently committed ([1639]
should have been reverted, and the person who committed should have had their SVN access pulled, for example).
Created this by grabbing the trunk code and then manually inserting the MU branch's changes in. This is probably
not usable in an actual installation (no support for creating new user accounts yet, for example), but patches are
welcome.

Not sure why I write so much here - I am not sure anyone other than my fellow devs actually read them...

Location:
branches/multiuser/cls
Files:
5 modified

Legend:

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

    r1640 r1759  
    224224            ." from " . getTable('item2user') ." i2u " 
    225225            . " inner join " . getTable('channels2user') . " c2u on c2u.fkuid=" . rss_user_id() 
    226             . " inner join " . getTable('folders') ." f on c2u.parent=f.id" 
     226            . " inner join " . getTable('channels') . " c on c.id = c2u.fkcid" 
     227            . " inner join " . getTable('folders') ." f on c.parent=f.id" 
    227228            ." where i2u.flgunread =1 " 
    228229            ." and i2u.flgdeleted=0 "; 
     
    252253        _pf('FeedList->populate() ...'); 
    253254        $sql = "select " 
    254         ." c.id, c.title, c.url, c.siteurl, f.name, c2u.parent, c2u.icon, c.descr, c2u.flgdeleted,c2u.flgprivate " 
     255        ." c.id, c.title, c.url, c.siteurl, f.name, c.parent, c2u.icon, c.descr, c2u.flgdeleted,c2u.flgprivate " 
    255256        ." from ".getTable("channels")." c " 
    256257        . " inner join " . getTable("channels2user")." c2u on c2u.fkcid=c.id " 
     
    265266 
    266267        if (getConfig('rss.config.absoluteordering')) { 
    267             $sql .= " order by f.position asc, c2u.position asc"; 
     268            $sql .= " order by f.position asc, c.position asc"; 
    268269        } else { 
    269270            $sql .= " order by f.name, c.title asc"; 
  • branches/multiuser/cls/items.php

    r1639 r1759  
    6060     * ctor 
    6161     */ 
    62     function Item($id, $title, $url, $enclosure, $parent, $author, $description, $date, $isPubDate, $unread, $rating) { 
     62    function Item($id, $title, $url, $enclosure, $parent, $author, $description, $date, $isPubDate, $unread, $private, $sticky, $flagged) { 
    6363        $this->rss = &$GLOBALS['rss']; 
    6464        $this->id = $id; 
    65         $this->flags = $unread; 
    6665        if ($title) { 
    6766            $this->title = $title; 
     
    8685        $this->isPubDate = $isPubDate; 
    8786        $this -> tags=array(); 
    88         $this -> rating = $rating; 
    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; 
     87        //$this -> rating = $rating; 
     88        $this ->isUnread    = $unread; 
     89        $this ->isPrivate   = $private; 
     90        //$this ->isDeleted = $deleted; 
     91        $this ->isSticky    = $sticky; 
     92        $this ->isFlag    = $flagged; 
    9493        //$this -> key = md5(rand(0,10000)); 
    9594         
     
    193192        $this->items[] = $item; 
    194193         
    195         if ((!$this -> hasUnreadItems) && $item->flags & RSS_MODE_UNREAD_STATE) { 
     194        if ((!$this -> hasUnreadItems) && $item->isUnread) { 
    196195            $this -> hasUnreadItems = true; 
    197196        } 
     
    260259         
    261260        // Predefined alternate ordering 
    262         $this -> ORDER_BY_UNREAD_FIRST = " order by i2u.flgunread & " . RSS_MODE_UNREAD_STATE . " desc, "; 
     261        $this -> ORDER_BY_UNREAD_FIRST = " order by i2u.flgunread desc, "; 
    263262        if (getConfig('rss.config.absoluteordering')) { 
    264             $this -> ORDER_BY_UNREAD_FIRST .= " f.position asc, c2u.position asc"; 
     263            $this -> ORDER_BY_UNREAD_FIRST .= " f.position asc, c.position asc"; 
    265264        } else { 
    266             $this -> ORDER_BY_UNREAD_FIRST .= " f.name asc, c2u.title asc"; 
     265            $this -> ORDER_BY_UNREAD_FIRST .= " f.name asc, c.title asc"; 
    267266        } 
    268267        $this -> ORDER_BY_UNREAD_FIRST .= ", i.added desc, i.id asc"; 
     
    283282 
    284283      _pf('ItemList::populate()'); 
    285         $this -> _sqlActualWhat = " i.title,  c.title, c.id, i2u.flgunread, " 
    286             ."i.url, i.enclosure, i.author, i.description, c2u.icon, " 
     284        $this -> _sqlActualWhat = " i.title,  c.title, c.id," 
     285         . " i2u.flgunread, i2u.flgprivate, i2u.flgsticky, i2u.flgdeleted, i2u.flgflagged," 
     286            ." i.url, i.enclosure, i.author, i.description, c.icon, " 
    287287            ." unix_timestamp(ifnull(i.pubdate,i.added)) as ts, " 
    288288            ." i.pubdate is not null as ispubdate, i.id " 
     
    298298            . " inner join " . getTable('channels2user') ." c2u on (i.cid=c2u.fkcid)" 
    299299            . " inner join " . getTable("channels")." c on (c2u.fkcid=c.id)" 
    300             . " inner join " . getTable("folders") ." f on (c2u.parent=f.id) "; 
     300            . " inner join " . getTable("folders") ." f on (c.parent=f.id) "; 
    301301 
    302302 
     
    336336            if (!getConfig('rss.config.feedgrouping')) { 
    337337                if(getConfig("rss.config.datedesc.$skey")){ 
    338                     $this -> _sqlActualOrder = " ts desc, f.position asc, c2u.position asc "; 
     338                    $this -> _sqlActualOrder = " ts desc, f.position asc, c.position asc "; 
    339339                }else{ 
    340                     $this -> _sqlActualOrder = " ts asc, f.position asc, c2u.position asc "; 
     340                    $this -> _sqlActualOrder = " ts asc, f.position asc, c.position asc "; 
    341341                } 
    342342            } elseif (getConfig('rss.config.absoluteordering')) { 
    343                 $this -> _sqlActualOrder = " f.position asc, c2u.position asc"; 
     343                $this -> _sqlActualOrder = " f.position asc, c.position asc"; 
    344344            } else { 
    345345                $this -> _sqlActualOrder = " f.name asc, c.title asc"; 
     
    376376        $curIdx = 0; 
    377377        $f=null; 
    378         while (list ($ititle_, $ctitle_, $cid_, $iunread_, $iurl_, $ienclosure_, $iauthor_, $idescr_, $cicon_, $its_, $iispubdate_, $iid_) = $GLOBALS['rss_db']->rss_fetch_row($res)) { 
     378        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)) { 
    379379             
    380380            // Built a new Item 
    381             $i = new Item($iid_, $ititle_, $iurl_, $ienclosure_, $cid_, $iauthor_, $idescr_, $its_, $iispubdate_, $iunread_); 
     381            $i = new Item($iid_, $ititle_, $iurl_, $ienclosure_, $cid_, $iauthor_, $idescr_, $its_, $iispubdate_, $iunread_, $iprivate_, $isticky_, $iflagged_); 
    382382             
    383383            // no dupes, please 
     
    411411            // Some stats... 
    412412            $this -> itemCount++;            
    413             if ($iunread_ & RSS_MODE_UNREAD_STATE) { 
     413            if ($iunread_) { 
    414414                $this -> unreadCount++;  
    415415                $this -> unreadIids[] = $iid_; 
  • branches/multiuser/cls/update.php

    r1639 r1759  
    9999        if (!hidePrivate() || $ignorePrivate) { 
    100100            if (count($newIds) > 0 && getConfig('rss.config.markreadonupdate')) { 
    101                 rss_query("update ".getTable("item2user")." i2u set i2u.flgunread = unread & " 
    102                           .SET_MODE_READ_STATE." where unread & ".RSS_MODE_UNREAD_STATE 
    103                           ." and i2u.fkiid not in (".implode(",", $newIds).")"); 
     101                rss_query("update ".getTable("item2user")." i2u set i2u.flgunread = 0" 
     102                    . " where i2u.flgunread=1" 
     103                    ." and i2u.fkiid not in (".implode(",", $newIds).")"); 
    104104            } 
    105105        } 
  • branches/multiuser/cls/user.php

    r1524 r1759  
    2727############################################################################### 
    2828rss_require('cls/wrappers/user.php'); 
     29rss_require('themes.php'); 
     30rss_require('plugins.php'); 
    2931 
    3032define ('RSS_USER_ACTION_LOGIN',0x01); 
     
    8183            rss_redirect(''); 
    8284        } 
     85 
    8386                 
    8487        $cuname = $chash = null; 
  • branches/multiuser/cls/wrappers/user.php

    r1524 r1759  
    3838} 
    3939 
     40function rss_user_show_private() { 
     41    return $GLOBALS['rssuser'] -> getShowPrivate(); 
     42} 
     43 
    4044function rss_user_logout() { 
    4145    $GLOBALS['rssuser'] -> logout();