Show
Ignore:
Timestamp:
06/25/06 12:47:05 (2 years ago)
Author:
mbonetti
Message:

Import categories from OPML.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/gregarius/admin/channels.php

    r1496 r1512  
    512512                    $descr_ = isset($opml[$folder][$i]['DESCRIPTION'])? 
    513513                              trim($opml[$folder][$i]['DESCRIPTION']):null; 
    514                                
     514                    $cats_  = isset($opml[$folder][$i]['CATEGORY'])? 
     515                              trim($opml[$folder][$i]['CATEGORY']):""; 
    515516                    $t__ = strip_tags($title_); 
    516517                    $d__ = strip_tags($descr_); 
    517518                    $f__ = strip_tags($prev_folder); 
    518519                    $u__ = sanitize($url_,RSS_SANITIZER_URL); 
    519  
     520                    $c__ = preg_replace(ALLOWED_TAGS_REGEXP,' ',$cats_); 
    520521                    if ($u__) { 
    521522 
     
    523524                        flush(); 
    524525                        list($retcde, $retmsg) = add_channel($u__, $fid, $t__, $d__); 
     526                        if ($retcde && count($c__)) { 
     527                            __exp__submitTag($retcde,$c__,"'channel'"); 
     528                        } 
    525529                        echo ($retcde<0 ?$retmsg:" OK")."</p></li>\n"; 
    526530                        flush();