Changeset 1606 for branches

Show
Ignore:
Timestamp:
10/16/06 08:11:03 (2 years ago)
Author:
mdodoo
Message:

This was really annoying, and took more time than the previous commit. For some reason, "svn diff" does not work correctly on my machine.

Location:
branches/multiuser
Files:
61 added
10 removed
13 modified

Legend:

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

    r1604 r1606  
    6161 
    6262    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"; 
    6375 
    6476    // feeds 
     
    162174        .((getConfig('rss.output.showfavicons') && $icon != "")? 
    163175          "<img src=\"$icon\" class=\"favicon\" alt=\"\" width=\"16\" height=\"16\" />":"") 
    164         ."<label for=\"scb_$id\">".($dead ? "<strike>" : "").$title.($dead ? "</strike>" : "")."</label>" 
     176        ."<label for=\"scb_$id\"".($dead ? ' style="text-decoration:line-through">' : ">").$title."</label>" 
    165177        ."</td>\n" 
    166178        ."\t<td class=\"cntr\">".preg_replace('/ /','&nbsp;',$parentLabel)."</td>\n" 
  • branches/multiuser/admin/index.php

    r1604 r1606  
    270270    ); 
    271271    while (false !== ($entry = $d->read())) { 
    272         if (preg_match('#^[a-z]{2}_[A-Z]{2}$#',$entry)) { 
     272        if (preg_match('#^[a-z]{2}_?([A-Z]{2})?$#',$entry)) { 
    273273            $ret[$entry]=getLanguageInfo($entry); 
    274274        }  
  • branches/multiuser/admin/items.php

    r1604 r1606  
    5252    . "<p><label for=\"prune_include_sticky\">".__('Delete Sticky items too: ')."</label>\n" 
    5353    . "<input type=\"checkbox\" id=\"prune_include_sticky\" name=\"prune_include_sticky\" value=\"1\"/></p>\n" 
     54    . "<p><label for=\"prune_include_unread\">".__('Delete Unread items too: ')."</label>\n" 
     55    . "<input type=\"checkbox\" id=\"prune_include_unread\" name=\"prune_include_unread\" value=\"1\"/></p>\n" 
    5456    . "<p><label for=\"prune_exclude_tags\">".__('Do not delete items tagged... ')."</label>\n" 
    5557    . "<input type=\"text\" id=\"prune_exclude_tags\" name=\"prune_exclude_tags\" value=\"\"/></p>\n" 
     
    112114            if (!array_key_exists('prune_include_sticky', $_REQUEST) 
    113115                    || $_REQUEST['prune_include_sticky'] != '1') { 
    114  
    115116                $sql .= " and not(unread & " .RSS_MODE_STICKY_STATE .") "; 
    116117            } 
    117118 
    118             if (array_key_exists('prune_exclude_tags', $_REQUEST) 
    119                     && trim($_REQUEST['prune_exclude_tags'])) { 
     119 
     120            if (!array_key_exists('prune_include_unread', $_REQUEST)  
     121                    || $_REQUEST['prune_include_unread'] != '1') { 
     122                $sql .= " and not(unread & " .RSS_MODE_UNREAD_STATE .") ";  
     123            } 
     124             
     125             if (array_key_exists('prune_exclude_tags', $_REQUEST) && trim($_REQUEST['prune_exclude_tags'])) { 
    120126 
    121127                if ( trim($_REQUEST['prune_exclude_tags']) == '*') { 
  • branches/multiuser/author.php

    r1604 r1606  
    2929 
    3030$a =trim(sanitize($_REQUEST['author'], RSS_SANITIZER_WORDS)); 
     31 
    3132list ($ra) = rss_fetch_row(rss_query( 
    3233    "select distinct(author) from " .getTable('item')  
    33     ." where author like '$a'" 
     34    ." where author = '$a'" 
    3435)); 
    3536 
  • branches/multiuser/cls/db/db.mysql.php

    r1181 r1606  
    3131class MysqlDB extends DB { 
    3232 
     33    var $resource; 
     34 
    3335    function  MysqlDB() { 
    3436        parent::DB(); 
     
    4143     
    4244    function DBConnect($dbserver, $dbuname, $dbpass) { 
    43          if (!mysql_connect($dbserver, $dbuname, $dbpass)) { 
     45    $this -> resource = mysql_connect($dbserver, $dbuname, $dbpass); 
     46 
     47        if(!$this -> resource) { 
    4448              die( "<h1>Error connecting to the database!</h1>\n" 
    4549                     ."<p>Have you edited dbinit.php and correctly defined " 
     
    4953     
    5054    function DBSelectDB($dbname) { 
    51         if (!mysql_select_db($dbname)) { 
     55        if (!mysql_select_db($dbname, $this -> resource)) { 
    5256              die( "<h1>Error selecting the database!</h1>\n" 
    5357                     ."<p>Does your database exist?" 
     
    6064     
    6165    function rss_query ($query, $dieOnError=true, $preventRecursion=false) { 
    62          $ret =  mysql_query($query); 
     66         $ret =  mysql_query($query, $this -> resource); 
    6367     
    6468         if ($error = $this -> rss_sql_error()) { 
     
    101105     
    102106    function rss_sql_error() { 
    103          return mysql_errno(); 
     107         return mysql_errno($this -> resource); 
    104108    } 
    105109     
    106110    function rss_sql_error_message () { 
    107          return mysql_error(); 
     111         return mysql_error($this -> resource); 
    108112    } 
    109113     
    110114    function rss_insert_id() { 
    111         return mysql_insert_id(); 
     115        return mysql_insert_id($this -> resource); 
    112116    } 
    113117     
     
    125129        switch ($kind) { 
    126130            case RSS_SQL_ERROR_NO_ERROR: 
    127                 return (mysql_errno() == 0); 
     131                return (mysql_errno($this -> resource) == 0); 
    128132                break; 
    129133            case RSS_SQL_ERROR_DUPLICATE_ROW: 
    130                 return (mysql_errno() == 1062); 
     134                return (mysql_errno($this -> resource) == 1062); 
    131135                break; 
    132136            default: 
  • branches/multiuser/cls/l10n.php

    r1604 r1606  
    3838    function RSSl10n() { 
    3939        $this -> locale = preg_replace('#[^a-zA-Z_]#','',$this -> __detectUserLang()); 
    40          
    41         $ll=explode('_',$this -> locale); 
    42         $this->isloang=$ll[0].'-'.strtoupper($ll[1]); 
    43          
    44         if (function_exists('version_compare') && version_compare("4.3.0",PHP_VERSION, "<=") && preg_match('#([a-z]{2})_([A-Z]{2})#',$this -> locale,$m)) { 
     40        $this -> isolang=str_replace('_','-',$this -> locale); 
     41        if (function_exists('version_compare') && version_compare("4.3.0",PHP_VERSION, "<=") && preg_match('#([a-z]{2})_?([A-Z]{2})?#',$this -> locale,$m)) { 
    4542            $locales=array( 
    46                 $m[0].'UTF-8', 
    47                 $m[0].'utf-8', 
     43                $m[0].'.UTF-8', 
     44                $m[0].'.utf-8', 
    4845                $m[0], 
    49                 $m[1].'_'.strtoupper($m[1]), 
    50                 $m[1], 
    51                 $m[2] 
     46                $m[1],               
     47                $m[1].'_'.strtoupper($m[1]) 
     48                //$m[2] 
    5249            ); 
    5350            setlocale(LC_ALL, $locales);     
     
    7572    } 
    7673    function getISOLang() { 
    77         return $this ->isloang; 
     74        return $this ->isolang; 
    7875    } 
    7976    /** 
     
    8178     */ 
    8279    function __detectUserLang() { 
    83        if (isset($_REQUEST['lang']) && preg_match('#^[a-z]{2}_[A-Z]{2}$#',$_REQUEST['lang']) && file_exists(GREGARIUS_HOME .'intl/'.$_REQUEST['lang'])) { 
    84             setcookie(RSS_LOCALE_COOKIE,$_REQUEST['lang'],time()+3600*6,getPath()); 
     80       if (isset($_REQUEST['lang']) && preg_match('#^[a-z]{2}_?([A-Z]{2})?$#',$_REQUEST['lang']) && ($_REQUEST['lang'] == 'en' || file_exists(GREGARIUS_HOME .'intl/'.$_REQUEST['lang']))) { 
     81            $this -> __setLocaleCookie($_REQUEST['lang']); 
    8582            return  $_REQUEST['lang']; 
    8683        } elseif (isset($_COOKIE[RSS_LOCALE_COOKIE])) { 
     
    9996                if (preg_match('#^([a-z]{2})[\-_]?([a-z]{2})?$#i',$ll,$pm)) { 
    10097                    $ret =null; 
    101                     if (isset($pm[2])){ 
    102                         if (file_exists(GREGARIUS_HOME .'intl/'.$pm[1] ."_".strtoupper($pm[2]))) { 
    103                             // xx-yy -> xx_YY 
    104                             $ret= $pm[1] ."_".strtoupper($pm[2]); 
    105                         } elseif(file_exists(GREGARIUS_HOME .'intl/'.$pm[1] ."_".strtoupper($pm[1]))) { 
    106                             // xx-yy -> xx_XX 
    107                             $ret= $pm[1] ."_".strtoupper($pm[1]); 
    108                         } 
    109                     } elseif(file_exists(GREGARIUS_HOME .'intl/'.$pm[1] ."_".strtoupper($pm[1]))) { 
    110                         // xx  -> xx_XX 
    111                         $ret= $pm[1] ."_".strtoupper($pm[1]); 
     98                    if (isset($pm[2]) && file_exists(GREGARIUS_HOME .'intl/'.$pm[1] ."_".strtoupper($pm[2]))) { 
     99                        // xx-yy -> xx_YY 
     100                        $ret= $pm[1] ."_".strtoupper($pm[2]); 
     101                    } elseif(file_exists(GREGARIUS_HOME .'intl/'.$pm[1] )) { 
     102                        // xx  -> xx 
     103                        $ret= $pm[1]; 
    112104                    } elseif($pm[1] == 'en') { 
    113105                        // ugly: a better way would be to look up all the available locales 
     
    117109                    if ($ret) { 
    118110                        // remember the detected locale for a couple hours 
    119                         setcookie(RSS_LOCALE_COOKIE,$ret,time()+3600*6,getPath()); 
     111                        $this -> __setLocaleCookie($ret); 
    120112                        return $ret; 
    121113                    } 
     
    127119        return getConfig('rss.output.lang'); 
    128120    } 
     121 
     122    function __setLocaleCookie($value) { 
     123        setcookie(RSS_LOCALE_COOKIE,$value,time()+3600*6,getPath()); 
     124    } 
    129125} 
    130126     
  • branches/multiuser/cls/wrappers/item.php

    r1604 r1606  
    7474    return $url; 
    7575  } 
    76   return "http://" . $_SERVER['HTTP_HOST'] . rss_item_pl_url(); 
     76  return guessTransportProto() . $_SERVER['HTTP_HOST'] . getPath() . rss_item_pl_url(); 
    7777} 
    7878 
  • branches/multiuser/intl/en.php

    r1595 r1606  
    306306define ('LBL_ADDED', 'Added'); 
    307307 
    308 define('LBL_ADMIN_USERS','Users'); 
    309308?> 
  • branches/multiuser/intl/messages.pot

    r1604 r1606  
    99"Project-Id-Version: PACKAGE VERSION\n" 
    1010"Report-Msgid-Bugs-To: \n" 
    11 "POT-Creation-Date: 2006-09-13 10:59+0200\n" 
     11"POT-Creation-Date: 2006-09-19 17:00+0200\n" 
    1212"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 
    1313"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 
     
    2727msgstr "" 
    2828 
    29 #: admin/channels.php:531 update.php:59 admin/channels.php:545 
    30 #: admin/channels.php:545 update.php:59 
     29#: admin/channels.php:531 update.php:59 admin/channels.php:545 update.php:61 
     30#: admin/channels.php:545 update.php:61 
    3131msgid "Updating" 
    3232msgstr "" 
     
    8989msgstr "" 
    9090 
    91 #: cls/nav.php:63 themes/default/mobile/nav.php:5 cls/nav.php:63 
    92 #: themes/default/mobile/nav.php:5 
     91#: cls/nav.php:63 themes/default/mobile/nav.php:5 cls/nav.php:64 
     92#: cls/nav.php:64 themes/default/mobile/nav.php:5 
    9393msgid "<span>R</span>efresh" 
    9494msgstr "" 
    9595 
    96 #: cls/nav.php:64 cls/nav.php:64 
     96#: cls/nav.php:64 cls/nav.php:66 cls/nav.php:66 
    9797msgid "<span>S</span>earch" 
    9898msgstr "" 
    9999 
    100 #: cls/nav.php:65 cls/nav.php:65 
     100#: cls/nav.php:65 cls/nav.php:67 cls/nav.php:67 
    101101msgid "A<span>d</span>min" 
    102102msgstr "" 
     
    187187#: admin/config.php:160 admin/tags.php:153 ajax.php:194 ajax.php:217 
    188188#: themes/default/web/item.php:31 themes/lilina/web/item.php:55 
    189 #: themes/lilina/web/item.php:111 admin/channels.php:179 
     189#: themes/lilina/web/item.php:111 admin/tags.php:180 admin/channels.php:179 
    190190#: admin/channels.php:286 admin/channels.php:315 admin/config.php:160 
    191 #: admin/folders.php:92 admin/plugins.php:149 admin/tags.php:153 ajax.php:194 
    192 #: ajax.php:217 themes/default/web/item.php:31 themes/lilina/web/item.php:55 
    193 #: themes/lilina/web/item.php:111 
     191#: admin/folders.php:92 admin/plugins.php:149 admin/tags.php:153 
     192#: admin/tags.php:180 ajax.php:194 ajax.php:217 themes/default/web/item.php:31 
     193#: themes/lilina/web/item.php:55 themes/lilina/web/item.php:111 
    194194msgid "edit" 
    195195msgstr "" 
     
    10601060msgstr "" 
    10611061 
    1062 #: admin/channels.php:215 admin/tags.php:168 
    1063 msgid "<input type=\"hidden\" name=\"" 
    1064 msgstr "" 
    1065  
    1066 #: admin/channels.php:215 admin/tags.php:168 
    1067 msgid "\" value=\"" 
    1068 msgstr "" 
    1069  
    1070 #: admin/channels.php:215 admin/channels.php:216 admin/tags.php:167 
    1071 #: admin/tags.php:168 
    1072 msgid "\" />\n" 
    1073 msgstr "" 
    1074  
    1075 #: admin/channels.php:216 admin/tags.php:167 
    1076 msgid "<input type=\"hidden\" name=\"action\" value=\"" 
    1077 msgstr "" 
    1078  
    1079 #: admin/channels.php:217 
    1080 msgid "</p>\n" 
    1081 msgstr "" 
    1082  
    1083 #: admin/channels.php:218 admin/tags.php:169 
    1084 msgid "</fieldset>\n" 
    1085 msgstr "" 
    1086  
    1087 #: admin/channels.php:222 
    1088 msgid "" 
    1089 "</form></div>\n" 
    1090 "\n" 
    1091 "\n" 
    1092 msgstr "" 
    1093  
    1094 #: admin/folders.php:207 admin/tags.php:116 
    1095 msgid "update " 
    1096 msgstr "" 
    1097  
    1098 #: admin/folders.php:207 
    1099 msgid " set name='$new_label' where id=$fid" 
    1100 msgstr "" 
    1101  
    1102 #: admin/index.php:204 
    1103 #, c-format 
    1104 msgid "%s" 
    1105 msgstr "" 
    1106  
    1107 #: admin/index.php:207 admin/tags.php:171 
    1108 msgid "</div>\n" 
    1109 msgstr "" 
    1110  
    1111 #: admin/tags.php:116 admin/tags.php:144 admin/tags.php:175 
    1112 msgid "tag" 
    1113 msgstr "" 
    1114  
    1115 #: admin/tags.php:116 
    1116 msgid " set tag='$new_label' where id=$tid" 
    1117 msgstr "" 
    1118  
    1119 #: admin/tags.php:123 
    1120 msgid "<script type=\"text/javascript\">\n" 
    1121 msgstr "" 
    1122  
    1123 #: admin/tags.php:124 
    1124 msgid "//<!--\n" 
    1125 msgstr "" 
    1126  
    1127 #: admin/tags.php:125 
    1128 msgid "function cbtoggle() {\n" 
    1129 msgstr "" 
    1130  
    1131 #: admin/tags.php:126 
    1132 msgid "var c=document.getElementById('mastercb').checked;\n" 
    1133 msgstr "" 
    1134  
    1135 #: admin/tags.php:127 
    1136 msgid "" 
    1137 "var cs=document.getElementById('tagtable').getElementsByTagName('input');\n" 
    1138 msgstr "" 
    1139  
    1140 #: admin/tags.php:128 
    1141 msgid "for(i=0;i<cs.length;i++) {\n" 
    1142 msgstr "" 
    1143  
    1144 #: admin/tags.php:129 
    1145 msgid "if (cs[i].type == 'checkbox') cs[i].checked = c;\n" 
    1146 msgstr "" 
    1147  
    1148 #: admin/tags.php:130 admin/tags.php:131 
    1149 msgid "}\n" 
    1150 msgstr "" 
    1151  
    1152 #: admin/tags.php:132 
    1153 msgid "</script>\n" 
    1154 msgstr "" 
    1155  
    1156 #: admin/tags.php:134 
    1157 msgid "<form method=\"post\" action=\"" 
    1158 msgstr "" 
    1159  
    1160 #: admin/tags.php:134 
    1161 msgid "\">\n" 
    1162 msgstr "" 
    1163  
    1164 #: admin/tags.php:135 
    1165 msgid "<h2 class=\"trigger\">" 
    1166 msgstr "" 
    1167  
    1168 #: admin/tags.php:135 
    1169 msgid "</h2>\n" 
    1170 msgstr "" 
    1171  
    1172 #: admin/tags.php:136 
    1173 msgid "<div id=\"admin_tags\" class=\"trigger\">" 
    1174 msgstr "" 
    1175  
    1176 #: admin/tags.php:137 
    1177 msgid "<table id=\"tagtable\">\n" 
    1178 msgstr "" 
    1179  
    1180 #: admin/tags.php:138 
    1181 msgid "<tr>\n" 
    1182 msgstr "" 
    1183  
    1184 #: admin/tags.php:139 
    1185 msgid "" 
    1186 "\t<th><input type=\"checkbox\" id=\"mastercb\" onclick=\"cbtoggle();\" /></" 
    1187 "th>\n" 
    1188 msgstr "" 
    1189  
    1190 #: admin/tags.php:140 
    1191 msgid "\t<th class=\"cntr\">" 
    1192 msgstr "" 
    1193  
    1194 #: admin/tags.php:140 admin/tags.php:141 
    1195 msgid "</th>\n" 
    1196 msgstr "" 
    1197  
    1198 #: admin/tags.php:141 
    1199 msgid "\t<th>" 
    1200 msgstr "" 
    1201  
    1202 #: admin/tags.php:142 
    1203 msgid "</tr>\n" 
    1204 msgstr "" 
    1205  
    1206 #: admin/tags.php:144 
    1207 msgid "select id,tag from " 
    1208 msgstr "" 
    1209  
    1210 #: admin/tags.php:144 
    1211 msgid " order by tag asc" 
    1212 msgstr "" 
    1213  
    1214 #: admin/tags.php:170 
    1215 msgid "</form>\n" 
    1216 msgstr "" 
    1217  
    1218 #: admin/tags.php:175 
    1219 msgid "select id, tag from " 
    1220 msgstr "" 
    1221  
    1222 #: admin/tags.php:175 
    1223 msgid " where id=$tid" 
    1224 msgstr "" 
    1225  
    12261062#: admin/channels.php:379 admin/channels.php:383 admin/channels.php:617 
    12271063#: admin/channels.php:379 admin/channels.php:383 admin/channels.php:617 
     
    13161152msgid "Admin" 
    13171153msgstr "" 
     1154 
     1155#: admin/config.php:190 admin/config.php:190 
     1156msgid "Invalid config key specified." 
     1157msgstr "" 
     1158 
     1159#: admin/config.php:368 admin/config.php:368 
     1160msgid "Ooops, unknown config type: " 
     1161msgstr "" 
     1162 
     1163#: admin/tags.php:162 admin/tags.php:162 
     1164msgid "Selected" 
     1165msgstr "" 
     1166 
     1167#: update.php:32 update.php:32 
     1168msgid "Sorry, updating from the web is currently not allowed." 
     1169msgstr "" 
  • branches/multiuser/intl/pt_BR/LC_MESSAGES/messages.po

    r1604 r1606  
    55"Project-Id-Version: Gregarius 0.5.5\n" 
    66"Report-Msgid-Bugs-To: \n" 
    7 "POT-Creation-Date: 2006-09-13 10:43+0200\n" 
     7"POT-Creation-Date: 2006-09-18 09:28+0200\n" 
    88"PO-Revision-Date: \n" 
    99"Last-Translator: \n" 
     
    2020msgstr "Root" 
    2121 
    22 #: admin/channels.php:531 update.php:59 admin/channels.php:545 
     22#: admin/channels.php:531 update.php:59 admin/channels.php:545 update.php:61 
    2323msgid "Updating" 
    2424msgstr "Atualizado" 
     
    7474msgstr "<span>I</span>nicial" 
    7575 
    76 #: cls/nav.php:63 themes/default/mobile/nav.php:5 
     76#: cls/nav.php:63 themes/default/mobile/nav.php:5 cls/nav.php:64 
    7777msgid "<span>R</span>efresh" 
    7878msgstr "<span>A</span>tualizar" 
    7979 
    80 #: cls/nav.php:64 
     80#: cls/nav.php:64 cls/nav.php:66 
    8181msgid "<span>S</span>earch" 
    8282msgstr "<span>B</span>usca" 
    8383 
    84 #: cls/nav.php:65 
     84#: cls/nav.php:65 cls/nav.php:67 
    8585msgid "A<span>d</span>min" 
    8686msgstr "A<span>d</span>min" 
     
    169169#: admin/config.php:160 admin/tags.php:153 ajax.php:194 ajax.php:217 
    170170#: themes/default/web/item.php:31 themes/lilina/web/item.php:55 
    171 #: themes/lilina/web/item.php:111 
     171#: themes/lilina/web/item.php:111 admin/tags.php:180 
    172172msgid "edit" 
    173173msgstr "editar" 
     
    943943msgstr "Resultados por p&aacute;