Changeset 1468

Show
Ignore:
Timestamp:
05/11/06 17:43:17 (2 years ago)
Author:
mbonetti
Message:

Mobile update

Location:
trunk/rss
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/rss/cls/update.php

    r1405 r1468  
    293293 
    294294        } 
    295  
    296295        parent::cleanUp($newIds, $ignorePrivate = true); 
    297  
    298     } 
    299  
    300 } 
    301  
     296    } 
     297} 
     298 
     299class MobileUpdate extends Update { 
     300    function MobileUpdate() { 
     301        parent::Update($doPopulate = true); 
     302    } 
     303    function render() { 
     304        $newIds = array(); 
     305    foreach ($this->chans as $chan) { 
     306            list ($cid, $url, $title) = $chan; 
     307            echo "$title ...\t"; 
     308            flush(); 
     309            $ret = update($cid); 
     310 
     311            if (is_array($ret)) { 
     312                    list ($error, $unreadIds) = $ret; 
     313                    $newIds = array_merge($newIds, $unreadIds); 
     314            } else { 
     315                    $error = 0; 
     316                    $unreadIds = array (); 
     317            } 
     318            $unread = count($unreadIds); 
     319            list($label,$cls) = parent::magpieError($error); 
     320            echo "\n$label, $unread " . LBL_UPDATE_UNREAD . "<br />"; 
     321            flush(); 
     322    } 
     323    } 
     324} 
     325 
     326     
    302327/** 
    303328 * CommandLineUpdateNews updates the feeds and displays only feeds with 
  • trunk/rss/feed.php

    r1467 r1468  
    8585            $sql .=" and not(c.mode & " . RSS_MODE_PRIVATE_STATE .") "; 
    8686        } 
    87         $sql .= " and not(c.mode & " .  RSS_MODE_DELETED_STATE .") "; 
     87        //$sql .= " and not(c.mode & " .  RSS_MODE_DELETED_STATE .") "; 
    8888 
    8989        $res = rss_query( $sql ); 
     
    104104                $sql .=" and not(c.mode & " . RSS_MODE_PRIVATE_STATE .") "; 
    105105            } 
    106             $sql .= " and not(c.mode & " .  RSS_MODE_DELETED_STATE .") "; 
     106            //$sql .= " and not(c.mode & " .  RSS_MODE_DELETED_STATE .") "; 
    107107 
    108108            $res = rss_query( $sql ); 
     
    157157        } 
    158158 
    159         $sql .=" and not(i.unread & " . RSS_MODE_DELETED_STATE  .") "; 
     159        //$sql .=" and not(i.unread & " . RSS_MODE_DELETED_STATE  .") "; 
    160160        $sql .=" order by i.added desc, i.id asc"; 
    161161 
  • trunk/rss/themes/default/mobile/nav.php

    r1309 r1468  
    33$GLOBALS['rss']->nav->appendNavItem(getPath()."?feeds",LBL_H2_CHANNELS); 
    44$GLOBALS['rss']->nav->appendNavItem(getPath()."?cats",LBL_TAG_FOLDERS); 
     5$GLOBALS['rss']->nav->appendNavItem(getPath()."update.php?mobile", LBL_NAV_UPDATE); 
    56 
    67foreach ($GLOBALS['rss']->nav->items as $item) { 
    7     if( !eregi( 'update.php', $item -> href ) && !eregi( 'admin', $item -> href ) ) { 
    8     $item -> render(); 
     8    if( !eregi( 'update.php$', $item -> href ) && !eregi( 'admin', $item -> href ) ) { 
     9            $item -> render(); 
    910    } 
    1011} 
  • trunk/rss/update.php

    r1405 r1468  
    5454$silent = array_key_exists('silent', $_GET) || ($cline && in_array('--silent',$argv)); 
    5555$newsonly = array_key_exists('newsonly', $_GET) || ($cline && in_array('--newsonly', $argv)); 
     56$mobile = array_key_exists('mobile',$_GET); 
    5657 
    5758$GLOBALS['rss'] -> header = new Header( 
     
    7879} elseif(!$silent && $browser->supportsAJAX()) { 
    7980    $update = new AJAXUpdate();  
     81 
     82} elseif($mobile) { 
     83    $update = new MobileUpdate(); 
    8084     
    8185} else {