Changeset 1603

Show
Ignore:
Timestamp:
10/15/06 22:13:45 (2 years ago)
Author:
spetersen
Message:

Finally got a little time to bring the PostgreSQL inline with trunk SVN change 1602.

Location:
branches/postgresql
Files:
1 added
1 removed
75 modified
69 copied

Legend:

Unmodified
Added
Removed
  • branches/postgresql/.htaccess

    r1262 r1603  
    3636  #tag view 
    3737  RewriteRule   ^tags?\/?$          tags.php?alltags [L,QSA] 
    38   RewriteRule   ^tag\/([a-zA-Z0-9_\.\+]+)$      tags.php?tag=$1 [L,QSA] 
    39   RewriteRule   ^tag\/([a-zA-Z0-9_\.\+]+)\/rss\/?$  tags.php?tag=$1&rss [L,QSA] 
     38  RewriteRule   ^tag\/(.+)$     tags.php?tag=$1 [L,QSA] 
     39  RewriteRule   ^tag\/(.+)\/rss\/?$  tags.php?tag=$1&rss [L,QSA] 
    4040   
    4141  #state view 
  • branches/postgresql/INSTALL

    r1484 r1603  
    3434            cd rss 
    3535  
    36    5.   Create a configuration file, based on the sample: 
     36   5.   Choose your installation type: 
     37 
     38        1.  For a graphical installation, point your browser at the root 
     39            directory of your installation. Enter the necessary information 
     40            about your database structure and continue. 
     41 
     42        2.  For a manual installation, create a configuration file, based on the 
     43            sample: 
    3744          
    38         1.  Copy the sample database configuration file: 
     45            Copy the sample database configuration file: 
    3946 
    4047                cp dbinit.php.sample dbinit.php 
    41          
    42         2.  Edit the dbinit.php file to match your database configuration.  
     48 
     49            Edit the dbinit.php file to match your database configuration.  
    4350            Make sure that the database exists and has the right permissions 
    4451            and the database user you define owns privileges to create/modify 
    45             tables. 
     52            tables. Point your browser at the root directory of your  
     53            installation. You should read a message informing you that the  
     54            database schema has been generated. 
    4655    
    47    6.   Point your browser to the root directory of your installation. 
    48     You should read a message informing you that the database schema 
    49     has been generated. 
    50  
    51     If at this point, the browser returns a 500 internal server 
     56   6.   If at this point, the browser returns a 500 internal server 
    5257    error, then remove (or disable) the .htaccess file in this 
    5358    directory and try again. 
  • branches/postgresql/admin/channels.php

    r1432 r1603  
    3737 
    3838function channels() { 
    39     echo "<h2>". LBL_ADMIN_CHANNELS ."</h2>\n"; 
     39    echo "<h2>". __('Feeds:') ."</h2>\n"; 
    4040    echo "<div id=\"admin_channels\">\n"; 
    4141    echo "<form method=\"post\" action=\"" .$_SERVER['PHP_SELF'] ."\">\n"; 
    4242    echo "<p><input type=\"hidden\" name=\"". CST_ADMIN_DOMAIN."\" value=\"".CST_ADMIN_DOMAIN_CHANNEL."\" />\n"; 
    43     echo "<label for=\"new_channel\">". LBL_ADMIN_CHANNELS_ADD ."</label>\n"; 
     43    echo "<label for=\"new_channel\">". __('Add a feed:') ."</label>\n"; 
    4444    echo "<input type=\"text\" name=\"new_channel\" id=\"new_channel\" value=\"http://\" onmouseover=\"clearOnHover(this);\" onfocus=\"this.select()\" />\n"; 
    4545 
    46     echo "<label for=\"add_channel_to_folder\">". LBL_ADMIN_IN_FOLDER . "</label>\n"; 
    47     folder_combo('add_channel_to_folder'); 
    48     echo "<input type=\"hidden\" name=\"". CST_ADMIN_METAACTION ."\" value=\"LBL_ADMIN_ADD\" />\n"; 
    49     echo "<input type=\"submit\" name=\"action\" value=\"". LBL_ADMIN_ADD ."\" /></p>\n"; 
    50     echo "<p style=\"font-size:small\">".LBL_ADMIN_ADD_CHANNEL_EXPL."</p>"; 
     46    echo "<label for=\"add_channel_to_folder\">". __('to folder:') . "</label>\n"; 
     47    echo rss_toolkit_folders_combo('add_channel_to_folder'); 
     48    echo "<label for=\"channel_tags\">" . __('Categories') . ":</label>\n"; 
     49    echo "<input type=\"text\" name=\"channel_tags\" id=\"channel_tags\" />\n"; 
     50    echo "<input type=\"hidden\" name=\"". CST_ADMIN_METAACTION ."\" value=\"ACT_ADMIN_ADD\" />\n"; 
     51    echo "<input type=\"submit\" name=\"action\" value=\"". __('Add') ."\" /></p>\n"; 
     52    echo "<p style=\"font-size:small\">".__('(Enter either the URL of an RSS feed or of a Website whose feed you wish to subscribe to)')."</p>"; 
    5153    echo "</form>\n\n"; 
    5254 
     
    5860                   ."('$b_url'.concat(escape(document.location).replace(/\s/,'%2520'))))"; 
    5961 
    60     echo "<p style=\"font-size:small\">" . LBL_ADMIN_BOOKMARKET_LABEL . " <a class=\"bookmarklet\" href=\"$bookmarklet\">".LBL_ADMIN_BOOKMARKLET_TITLE."</a></p>\n"; 
     62    echo "<p style=\"font-size:small\">" . __('Subscription bookmarklet [<a href="http://www.squarefree.com/bookmarklets/">?</a>]:') . " <a class=\"bookmarklet\" href=\"$bookmarklet\">".__('Subscribe in Gregarius!')."</a></p>\n"; 
     63    // feed handler - similar to bookmarklet, but with %s 
     64    $feedhandler_url = "javascript:navigator.registerContentHandler(\'application/vnd.mozilla.maybe.feed\',\'$b_url%s\',\'Gregarius\');"; 
     65    echo "<script type=\"text/javascript\">\n" 
     66    ."//<!--\n" 
     67    ."if (navigator && typeof(navigator.registerContentHandler) == 'function'){\n" 
     68    ."\tdocument.write('<p style=\"font-size:small\">"  
     69    . __('Register as Feed Handler [<a href="http://www.bengoodger.com/software/mb/feeds/feed-handling.html">?</a>]:')  
     70    . " <a class=\"bookmarklet\" href=\"$feedhandler_url\">" 
     71    .__('Register Gregarius!')."</a></p>');\n" 
     72    ."}\n" 
     73    ."// -->\n" 
     74    ."</script>\n"; 
    6175 
    6276    // feeds 
     
    8195    ."<tr>\n" 
    8296    ."\t<th><input type=\"checkbox\" id=\"mastercb\" onclick=\"cbtoggle();\" /></th>\n" 
    83     ."\t<th>". LBL_ADMIN_CHANNELS_HEADING_TITLE ."</th>\n" 
    84     ."\t<th class=\"cntr\">". LBL_ADMIN_CHANNELS_HEADING_FOLDER ."</th>\n" 
    85     ."\t<th>". LBL_ADMIN_CHANNELS_HEADING_DESCR ."</th>\n" 
    86     ."\t<th>". LBL_TAG_FOLDERS."</th>\n" 
    87     ."\t<th>". LBL_ADMIN_CHANNELS_HEADING_FLAGS."</th>\n"; 
     97    ."\t<th>". __('Title') ."</th>\n" 
     98    ."\t<th class=\"cntr\">". __('Folder') ."</th>\n" 
     99    ."\t<th>". __('Description') ."</th>\n" 
     100    ."\t<th>". __('Categories')."</th>\n" 
     101    ."\t<th>". __('Flags')."</th>\n"; 
    88102 
    89103    if (getConfig('rss.config.absoluteordering')) { 
    90         echo "\t<th>".LBL_ADMIN_CHANNELS_HEADING_MOVE."</th>\n"; 
    91     } 
    92  
    93     echo "\t<th class=\"cntr\">". LBL_ADMIN_CHANNELS_HEADING_ACTION ."</th>\n" 
     104        echo "\t<th>".__('Move')."</th>\n"; 
     105    } 
     106 
     107    echo "\t<th class=\"cntr\">". __('Action') ."</th>\n" 
    94108    ."</tr>\n"; 
    95109 
    96110    $sql = "select " 
    97            ." c.id, c.title, c.url, c.siteurl, d.name, c.descr, c.parent, c.icon, c.mode " 
    98            ." from " .getTable("channels") ." c, " . getTable("folders") ." d " 
    99            ." where d.id = c.parent "; 
     111           ." c.id, c.title, c.url, c.siteurl, d.name, c.descr, c.parent, c.icon, c.mode, c.daterefreshed " 
     112           ." from " .getTable("channels") ." c " 
     113           ." inner join " . getTable("folders") ." d " 
     114           ."   on d.id = c.parent "; 
    100115 
    101116    if (getConfig('rss.config.absoluteordering')) { 
     
    107122    $res = rss_query($sql); 
    108123    $cntr = 0; 
    109     while (list($id, $title, $url, $siteurl, $parent, $descr, $pid, $icon,$mode) = rss_fetch_row($res)) { 
     124    while (list($id, $title, $url, $siteurl, $parent, $descr, $pid, $icon, $mode, $daterefreshed) = rss_fetch_row($res)) { 
    110125 
    111126        if (getConfig('rss.output.usemodrewrite')) { 
     
    115130        } 
    116131 
    117         $parentLabel = $parent == ''? LBL_HOME_FOLDER:$parent; 
     132        $parentLabel = $parent == ''? __('Root'):$parent; 
    118133 
    119134        $class_ = (($cntr++ % 2 == 0)?"even":"odd"); 
     
    121136        // get feed's tags 
    122137        $tags = ""; 
    123         $sql2 = "select t.id, t.tag from " . getTable('tag') . " t, " 
    124                 . getTable('metatag') . " m where t.id = m.tid " 
    125                 . "and m.ttype = 'channel' and m.fid = $id"; 
     138        $sql2 = "select t.id, t.tag from " . getTable('tag') . " t " 
     139                . "inner join " . getTable('metatag') . " m " 
     140                . "  on m.tid = t.id " 
     141                . "where m.ttype = 'channel' and m.fid = $id"; 
    126142        $res2 = rss_query($sql2); 
    127143 
     
    133149            } 
    134150        } 
     151         
     152                if(NULL == $daterefreshed) { 
     153                    $dead = true; 
     154                } else { 
     155                    $dead = (time() - strtotime($daterefreshed) > getConfig('rss.config.deadthreshhold')*60*60 ? true : false); 
     156                } 
    135157 
    136158        $fmode = array(); 
     
    140162        if ($mode & RSS_MODE_DELETED_STATE) { 
    141163            $fmode[] = "D"; 
    142         } 
     164                        $dead = false; 
     165        } 
     166 
    143167        $slabel = count($fmode)?implode(", ",$fmode):"&nbsp;"; 
    144168        if ($icon && substr($icon,0,5) == 'blob:') { 
     
    150174        .((getConfig('rss.output.showfavicons') && $icon != "")? 
    151175          "<img src=\"$icon\" class=\"favicon\" alt=\"\" width=\"16\" height=\"16\" />":"") 
    152         ."<label for=\"scb_$id\">$title</label>" 
     176        ."<label for=\"scb_$id\"".($dead ? ' style="text-decoration:line-through">' : ">").$title."</label>" 
    153177        ."</td>\n" 
    154178        ."\t<td class=\"cntr\">".preg_replace('/ /','&nbsp;',$parentLabel)."</td>\n" 
     
    159183        if (getConfig('rss.config.absoluteordering')) { 
    160184            echo "\t<td class=\"cntr\"><a href=\"".$_SERVER['PHP_SELF']. "?".CST_ADMIN_DOMAIN."=". CST_ADMIN_DOMAIN_CHANNEL 
    161             ."&amp;action=". CST_ADMIN_MOVE_UP_ACTION. "&amp;cid=$id\">". LBL_ADMIN_MOVE_UP 
     185            ."&amp;action=". CST_ADMIN_MOVE_UP_ACTION. "&amp;cid=$id\">". __('&uarr;') 
    162186            ."</a>&nbsp;-&nbsp;<a href=\"".$_SERVER['PHP_SELF']. "?".CST_ADMIN_DOMAIN."=". CST_ADMIN_DOMAIN_CHANNEL 
    163             ."&amp;action=". CST_ADMIN_MOVE_DOWN_ACTION ."&amp;cid=$id\">".LBL_ADMIN_MOVE_DOWN ."</a></td>\n"; 
     187            ."&amp;action=". CST_ADMIN_MOVE_DOWN_ACTION ."&amp;cid=$id\">".__('&darr;') ."</a></td>\n"; 
    164188        } 
    165189        echo "\t<td class=\"cntr\"><a href=\"".$_SERVER['PHP_SELF']. "?".CST_ADMIN_DOMAIN."=". CST_ADMIN_DOMAIN_CHANNEL 
    166190        ."&amp;".CST_ADMIN_VIEW."=". CST_ADMIN_DOMAIN_CHANNEL 
    167         ."&amp;action=". CST_ADMIN_EDIT_ACTION. "&amp;cid=$id\">" . LBL_ADMIN_EDIT 
     191        ."&amp;action=". CST_ADMIN_EDIT_ACTION. "&amp;cid=$id\">" . __('edit') 
    168192        ."</a>|<a href=\"".$_SERVER['PHP_SELF']. "?".CST_ADMIN_DOMAIN."=". CST_ADMIN_DOMAIN_CHANNEL 
    169193        ."&amp;".CST_ADMIN_VIEW."=". CST_ADMIN_DOMAIN_CHANNEL 
    170         ."&amp;action=". CST_ADMIN_DELETE_ACTION ."&amp;cid=$id\">" . LBL_ADMIN_DELETE ."</a></td>\n" 
     194        ."&amp;action=". CST_ADMIN_DELETE_ACTION ."&amp;cid=$id\">" . __('delete') ."</a></td>\n" 
    171195        ."</tr>\n"; 
    172196    } 
     
    177201    ."<legend>Selected...</legend>\n" 
    178202    ."<p>\n" 
    179     ."<label for=\"me_folder\">".LBL_ADMIN_CHANNEL_FOLDER."</label>\n"; 
    180     folder_combo('me_folder',null); 
     203    ."<label for=\"me_folder\">".__('In folder:')."</label>\n" 
     204    .rss_toolkit_folders_combo('me_folder',null); 
    181205 
    182206    echo 
    183     "<input type=\"submit\" id=\"me_move_to_folder\" name=\"me_move_to_folder\" value=\"".LBL_ADMIN_CHANNELS_HEADING_MOVE."\" />\n" 
     207    "<input type=\"submit\" id=\"me_move_to_folder\" name=\"me_move_to_folder\" value=\"".__('Move')."\" />\n" 
    184208 
    185209    ."<span class=\"vr\">&nbsp;</span>" 
    186210 
    187     ."<label>".LBL_ADMIN_STATE."</label>\n" 
     211    ."<label>".__('State:')."</label>\n" 
    188212    ."<input type=\"checkbox\" name=\"me_deprecated\" id=\"me_deprecated\" value=\"".RSS_MODE_DELETED_STATE."\" />\n" 
    189     ."<label for=\"me_deprecated\">".LBL_DEPRECATED."</label>\n" 
     213    ."<label for=\"me_deprecated\">".__('Deprecated')."</label>\n" 
    190214 
    191215    ."<input type=\"checkbox\" name=\"me_private\" id=\"me_private\" value=\"".RSS_MODE_PRIVATE_STATE."\" />\n" 
    192     ."<label for=\"me_private\">".LBL_PRIVATE."</label>\n" 
    193  
    194     ."<input type=\"submit\" id=\"me_state\" name=\"me_state\" value=\"".LBL_ADMIN_STATE_SET."\" />\n" 
     216    ."<label for=\"me_private\">".__('Private')."</label>\n" 
     217 
     218    ."<input type=\"submit\" id=\"me_state\" name=\"me_state\" value=\"".__('Set')."\" />\n" 
    195219 
    196220    ."<span class=\"vr\">&nbsp;</span>" 
    197221 
    198     ."<input type=\"submit\" id=\"me_delete\" name=\"me_delete\" value=\"".LBL_ADMIN_DELETE2."\" />\n" 
     222    ."<input type=\"submit\" id=\"me_delete\" name=\"me_delete\" value=\"".__('Delete')."\" />\n" 
    199223    ."<input type=\"checkbox\" name=\"me_do_delete\" id=\"me_do_delete\" value=\"1\" />\n" 
    200     ."<label for=\"me_do_delete\">".LBL_ADMIN_IM_SURE."</label>\n" 
     224    ."<label for=\"me_do_delete\">".__("I'm sure!")."</label>\n" 
    201225 
    202226 
     
    237261    switch ($__action__) { 
    238262 
    239     case LBL_ADMIN_ADD: 
    240     case 'LBL_ADMIN_ADD': 
     263    case __('Add'): 
     264    case 'ACT_ADMIN_ADD': 
    241265    case 'Add': 
    242266 
     
    257281 
    258282        if ($label != 'http://' &&  substr($label, 0,4) == "http") { 
    259             $ret = add_channel($label,$fid); 
     283            $tags = $_REQUEST['channel_tags']; 
     284            $ret = add_channel($label,$fid,null,null,$tags); 
    260285            //var_dump($ret); 
    261286            if (is_array($ret) && $ret[0] > -1) { 
     
    266291                $newCid = $ret[0]; 
    267292                rss_error(sprintf( 
    268                               LBL_ADMIN_OPML_IMPORT_FEED_INFO, 
     293                              __('Adding %s to %s... '), 
    269294                              htmlentities($label),"/$flabel") 
    270                           . LBL_ADMIN_OK 
     295                          . __('OK') 
    271296                          . "&nbsp;[<a href=\"".getPath()."admin/index.php?domain=".CST_ADMIN_DOMAIN_CHANNEL 
    272297                          ."&amp;action=edit&amp;cid=$newCid\">" 
    273                           . LBL_ADMIN_EDIT 
     298                          . __('edit') 
    274299                          ."</a>]", 
    275300      &nbs