Changeset 854

Show
Ignore:
Timestamp:
09/05/05 09:54:25 (3 years ago)
Author:
mbonetti
Message:

ok, should be fine. This fixes #136 and #107 (I think?)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/rss/feed.php

    r853 r854  
    272272        case  'LBL_MARK_CHANNEL_READ': 
    273273          
    274             $first_unread_id=$next_unread_id=''; 
     274        /** mark channel as read **/ 
     275        $sql = "update " .getTable("item") 
     276            ." set unread = unread & ".SET_MODE_READ_STATE." where cid=$cid"; 
     277        if (hidePrivate()) { 
     278            $sql .= " and not(unread & " . FEED_MODE_PRIVATE_STATE . ")"; 
     279        } 
     280        if (count($IdsToMarkAsRead)) { 
     281            $sql .= " and id in (" . implode(',',$IdsToMarkAsRead) .")"; 
     282        } 
     283        rss_query($sql); 
     284 
     285 
     286        /** see where we should redirect **/ 
     287        $first_unread_id=$next_unread_id=''; 
    275288          
    276289         // redirect to the next unread, if any. 
     
    295308         $next_ok=false; 
    296309         while(list ($unread_id) = rss_fetch_row($res)) { 
    297             if ($first_unread_id == '' && $unread_id != $cid) { 
     310            if ($first_unread_id == '') { 
    298311                $first_unread_id = $unread_id; 
    299312            } 
     
    305318             
    306319            if ($unread_id == $cid) { 
    307                 $next_ok=true; 
     320                $next_unread_id=$unread_id; 
     321                break; 
    308322            } 
    309323         } 
     
    312326         } 
    313327          
    314          $sql = "update " .getTable("item") ." set unread = unread & ".SET_MODE_READ_STATE." where cid=$cid"; 
    315           
    316           
    317         if (hidePrivate()) { 
    318             $sql .= " and not(unread & " . FEED_MODE_PRIVATE_STATE . ")"; 
    319         } 
    320         if (count($IdsToMarkAsRead)) { 
    321             $sql .= " and id in (" . implode(',',$IdsToMarkAsRead) .")"; 
    322         } 
    323           
    324          rss_query($sql); 
     328 
    325329          
    326330         //redirect