- Timestamp:
- 11/15/06 04:21:38 (2 years ago)
- Location:
- branches/postgresql
- Files:
-
- 14 removed
- 48 modified
- 22 copied
-
api.php (modified) (2 diffs)
-
cls/categories.php (modified) (1 diff)
-
cls/l10n.php (modified) (1 diff)
-
cls/search.php (modified) (5 diffs)
-
cls/update.php (modified) (11 diffs)
-
cls/wrappers/header.php (modified) (2 diffs)
-
cls/wrappers/item.php (modified) (1 diff)
-
dist/l10n.sh (modified) (1 diff)
-
extlib/JSON.php (copied) (copied from trunk/gregarius/extlib/JSON.php)
-
extlib/l10n/gettext.php (modified) (1 diff)
-
extlib/rss_fetch.inc (modified) (2 diffs)
-
intl/cn_s.php (deleted)
-
intl/cn_t.php (deleted)
-
intl/da/LC_MESSAGES/messages.mo (modified) (previous)
-
intl/da/LC_MESSAGES/messages.po (modified) (40 diffs)
-
intl/de.php (deleted)
-
intl/de/LC_MESSAGES/messages.mo (modified) (previous)
-
intl/de/LC_MESSAGES/messages.po (modified) (45 diffs)
-
intl/dk.php (deleted)
-
intl/en.php (deleted)
-
intl/es.php (deleted)
-
intl/es/LC_MESSAGES/messages.mo (modified) (previous)
-
intl/es/LC_MESSAGES/messages.po (modified) (40 diffs)
-
intl/fr.php (deleted)
-
intl/fr/LC_MESSAGES/messages.mo (modified) (previous)
-
intl/fr/LC_MESSAGES/messages.po (modified) (43 diffs)
-
intl/he.php (deleted)
-
intl/he/LC_MESSAGES/messages.mo (modified) (previous)
-
intl/he/LC_MESSAGES/messages.po (modified) (40 diffs)
-
intl/hu (copied) (copied from trunk/gregarius/intl/hu)
-
intl/hu/LC_MESSAGES (copied) (copied from trunk/gregarius/intl/hu/LC_MESSAGES)
-
intl/hu/LC_MESSAGES/messages.mo (copied) (copied from trunk/gregarius/intl/hu/LC_MESSAGES/messages.mo)
-
intl/hu/LC_MESSAGES/messages.po (copied) (copied from trunk/gregarius/intl/hu/LC_MESSAGES/messages.po)
-
intl/hu/langinfo.txt (copied) (copied from trunk/gregarius/intl/hu/langinfo.txt)
-
intl/id/LC_MESSAGES/messages.mo (modified) (previous)
-
intl/id/LC_MESSAGES/messages.po (modified) (49 diffs)
-
intl/it.php (deleted)
-
intl/it/LC_MESSAGES/messages.mo (modified) (previous)
-
intl/it/LC_MESSAGES/messages.po (modified) (41 diffs)
-
intl/ja.php (deleted)
-
intl/ja/LC_MESSAGES/messages.mo (modified) (previous)
-
intl/ja/LC_MESSAGES/messages.po (modified) (43 diffs)
-
intl/messages.pot (modified) (41 diffs)
-
intl/nl (copied) (copied from trunk/gregarius/intl/nl)
-
intl/nl/LC_MESSAGES (copied) (copied from trunk/gregarius/intl/nl/LC_MESSAGES)
-
intl/nl/LC_MESSAGES/messages.mo (copied) (copied from trunk/gregarius/intl/nl/LC_MESSAGES/messages.mo)
-
intl/nl/LC_MESSAGES/messages.po (copied) (copied from trunk/gregarius/intl/nl/LC_MESSAGES/messages.po)
-
intl/nl/langinfo.txt (copied) (copied from trunk/gregarius/intl/nl/langinfo.txt)
-
intl/pt/LC_MESSAGES/messages.mo (modified) (previous)
-
intl/pt/LC_MESSAGES/messages.po (modified) (41 diffs)
-
intl/pt_BR.php (deleted)
-
intl/pt_BR/LC_MESSAGES/messages.mo (modified) (previous)
-
intl/pt_BR/LC_MESSAGES/messages.po (modified) (51 diffs)
-
intl/pt_PT.php (deleted)
-
intl/ru.php (deleted)
-
intl/ru/LC_MESSAGES/messages.mo (modified) (previous)
-
intl/ru/LC_MESSAGES/messages.po (modified) (40 diffs)
-
intl/sv.php (deleted)
-
intl/sv/LC_MESSAGES/messages.mo (modified) (previous)
-
intl/sv/LC_MESSAGES/messages.po (modified) (42 diffs)
-
intl/uk (copied) (copied from trunk/gregarius/intl/uk)
-
intl/uk/LC_MESSAGES (copied) (copied from trunk/gregarius/intl/uk/LC_MESSAGES)
-
intl/uk/LC_MESSAGES/messages.mo (copied) (copied from trunk/gregarius/intl/uk/LC_MESSAGES/messages.mo)
-
intl/uk/LC_MESSAGES/messages.po (copied) (copied from trunk/gregarius/intl/uk/LC_MESSAGES/messages.po)
-
intl/uk/langinfo.txt (copied) (copied from trunk/gregarius/intl/uk/langinfo.txt)
-
intl/vi (copied) (copied from trunk/gregarius/intl/vi)
-
intl/vi/LC_MESSAGES (copied) (copied from trunk/gregarius/intl/vi/LC_MESSAGES)
-
intl/vi/LC_MESSAGES/messages.mo (copied) (copied from trunk/gregarius/intl/vi/LC_MESSAGES/messages.mo)
-
intl/vi/LC_MESSAGES/messages.po (copied) (copied from trunk/gregarius/intl/vi/LC_MESSAGES/messages.po)
-
intl/vi/langinfo.txt (copied) (copied from trunk/gregarius/intl/vi/langinfo.txt)
-
intl/zh_CN/LC_MESSAGES/messages.mo (modified) (previous)
-
intl/zh_CN/LC_MESSAGES/messages.po (modified) (42 diffs)
-
themes/default/mobile/feed.php (modified) (1 diff)
-
themes/default/mobile/feedsfolder.php (copied) (copied from trunk/gregarius/themes/default/mobile/feedsfolder.php)
-
themes/default/mobile/footer.php (modified) (1 diff)
-
themes/default/mobile/header.php (modified) (1 diff)
-
themes/default/mobile/index.php (modified) (2 diffs)
-
themes/default/mobile/item.php (modified) (2 diffs)
-
themes/default/mobile/itemlist.php (modified) (1 diff)
-
themes/default/mobile/nav.php (modified) (2 diffs)
-
themes/default/mobile/navitem.php (modified) (1 diff)
-
themes/default/mobile/plugins.php (modified) (3 diffs)
-
themes/default/mobile/style.css (modified) (1 diff)
-
themes/default/web/item.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/postgresql/api.php
r1603 r1634 49 49 blGetItems($cid,$date,$markread); 50 50 break; 51 } 51 case 'search': 52 rss_require('extlib/JSON.php'); 53 $json = new Services_JSON(); 54 $query = preg_replace('#[^a-z0-9\s]#','',@$_REQUEST['q']); 55 if ($query) { 56 $res = osSearch($query); 57 } else { 58 $res = array($query,array(),array(),array()); 59 } 60 header('Content-Type: text/plain'); 61 die ($json->encode($res)); 62 break; 63 } 64 52 65 } 53 66 … … 195 208 196 209 } 210 211 function osSearch($q) { 212 rss_require('cls/search.php'); 213 $sil = new SearchItemList($q,5); 214 $results = array(); 215 foreach($sil -> feeds as $feed) { 216 foreach($feed -> items as $item) { 217 $results[] = $item -> title; 218 } 219 } 220 return array($q,$results,array(),array()); 221 } 197 222 ?> -
branches/postgresql/cls/categories.php
r1603 r1634 119 119 } 120 120 $sql .= " and (c.mode & " . RSS_MODE_DELETED_STATE.")=0 "; 121 ." group by m.tid, t.tag";121 $sql .= " group by m.tid, t.tag"; 122 122 _pf('query'); 123 123 $res = rss_query($sql); -
branches/postgresql/cls/l10n.php
r1603 r1634 80 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 81 $this -> __setLocaleCookie($_REQUEST['lang']); 82 rss_invalidate_cache(); 82 83 return $_REQUEST['lang']; 83 84 } elseif (isset($_COOKIE[RSS_LOCALE_COOKIE])) { -
branches/postgresql/cls/search.php
r1603 r1634 43 43 define ('QUERY_MATCH_EXACT','exact'); 44 44 45 // This is needed for some constants 46 rss_require('cls/wrappers/toolkit.php'); 45 47 46 48 class SearchItemList extends ItemList { … … 51 53 52 54 var $currentPage; 53 var $resultsPerPage ;55 var $resultsPerPage = 0; 54 56 var $startItem; 55 57 var $endItem; … … 58 60 var $logicSep; 59 61 60 function SearchItemList( ) {62 function SearchItemList($query=null,$results=0) { 61 63 parent::ItemList(); 64 if ($query) { 65 $this -> query=$query; 66 } elseif(isset($_REQUEST[QUERY_PRM])) { 67 $this->query = $_REQUEST[QUERY_PRM]; 68 }else{ 69 $this -> query = null; 70 } 71 72 73 // Sanitize the query parameters: 74 // fixme: this probably breaks on queries with weird characters, depending 75 // on the locale. 76 // see: http://php.benscom.com/manual/en/reference.pcre.pattern.syntax.php 77 if ($this -> query) { 78 $this -> query = trim(preg_replace('#[^\w\s\x80-\xff]#','',$this -> query)); 79 } 80 81 $this->resultsPerPage = (int) $results; 82 62 83 $this -> populate(); 63 84 … … 101 122 102 123 function populate() { 103 if (!isset($_REQUEST[QUERY_PRM])) {104 return;105 }106 107 // fixme: this probably breaks on queries with weird characters, depending108 // on the locale.109 // see: http://php.benscom.com/manual/en/reference.pcre.pattern.syntax.php110 $this->query = trim(preg_replace('#[^\w\s\x80-\xff]#','',$_REQUEST[QUERY_PRM]));111 124 112 125 if (!$this->query) { … … 122 135 RSS_SANITIZER_NUMERIC); 123 136 124 $this->resultsPerPage = sanitize( 125 ((array_key_exists(QUERY_RESULTS, $_REQUEST)) ? $_REQUEST[QUERY_RESULTS] : INFINE_RESULTS), 126 RSS_SANITIZER_NUMERIC); 127 137 if (!$this->resultsPerPage) { 138 $this->resultsPerPage = sanitize( 139 ((array_key_exists(QUERY_RESULTS, $_REQUEST)) ? $_REQUEST[QUERY_RESULTS] : INFINE_RESULTS), 140 RSS_SANITIZER_NUMERIC); 141 } 142 128 143 $this->currentPage = sanitize( 129 144 (array_key_exists(QUERY_CURRENT_PAGE, $_REQUEST) ? $_REQUEST[QUERY_CURRENT_PAGE] : 0), -
branches/postgresql/cls/update.php
r1603 r1634 65 65 66 66 function Update($doPopulate = true, $updatePrivateAlso = false) { 67 rss_plugin_hook('rss.plugins.updates.before', null);67 rss_plugin_hook('rss.plugins.updates.before', null); 68 68 if($doPopulate) { 69 69 $this->populate($updatePrivateAlso); … … 77 77 function populate($updatePrivateAlso = false) { 78 78 $sql = "select c.id, c.url, c.title from ".getTable("channels") . " c " 79 . " inner join " . getTable('folders') . " f on f.id = c.parent "80 . " where (c.mode & ".RSS_MODE_DELETED_STATE.")=0 ";79 . " inner join " . getTable('folders') . " f on f.id = c.parent " 80 . " where (c.mode & ".RSS_MODE_DELETED_STATE.")=0 "; 81 81 82 82 if (hidePrivate() && !$updatePrivateAlso) { … … 104 104 } 105 105 } 106 106 107 107 setProperty('__meta__','meta.lastupdate','misc',time()); 108 108 109 109 if (count($newIds) > 0) { 110 110 rss_invalidate_cache(); 111 111 } 112 rss_plugin_hook('rss.plugins.updates.after', null);112 rss_plugin_hook('rss.plugins.updates.after', null); 113 113 } 114 114 115 115 function magpieError($error) { 116 if ( $error & MAGPIE_FEED_ORIGIN_CACHE) {116 if (is_numeric($error) && ($error & MAGPIE_FEED_ORIGIN_CACHE)) { 117 117 if ($error & MAGPIE_FEED_ORIGIN_HTTP_304) { 118 118 $label = __('OK (304 Not modified)'); … … 121 121 elseif ($error & MAGPIE_FEED_ORIGIN_HTTP_TIMEOUT) { 122 122 $label = __('HTTP Timeout (Local cache)'); 123 $cls = ERROR_ WARNING;123 $cls = ERROR_ERROR; 124 124 } 125 125 elseif ($error & MAGPIE_FEED_ORIGIN_NOT_FETCHED) { … … 131 131 $cls = ERROR_ERROR; 132 132 } 133 elseif ($error & MAGPIE_FEED_ORIGIN_HTTP_403) { 134 $label = __('403 Forbidden (Local cache)'); 135 $cls = ERROR_ERROR; 136 } 133 137 else { 134 138 $label = $error; … … 142 146 else { 143 147 if (is_numeric($error)) { 144 $label = __('ERROR') ;148 $label = __('ERROR') ." $error"; 145 149 $cls = ERROR_ERROR; 146 150 } else { … … 169 173 rss_set_hook('rss.plugins.bodystart', "pushHeaderCallBack"); 170 174 rss_set_hook('rss.plugins.bodyend', "pushFooterCallBack"); 171 175 172 176 ob_implicit_flush(); 173 177 } … … 260 264 echo "</table>\n"; 261 265 echo "<script type=\"text/javascript\">\n"; 262 echo "function runAjaxUpdate() { \n";266 echo "function runAjaxUpdate() { \n"; 263 267 echo " for (k =0; k < " . AJAX_PARALLEL_SIZE . "; k++){\n"; 264 echo " doUpdate();\n";265 echo " }\n";266 echo "}\n";267 // Fix for IE's stupid "Operation Aborted" Error268 echo " if (window.addEventListener) window.addEventListener(\"load\",runAjaxUpdate,false); else if (window.attachEvent) window.attachEvent(\"onload\",runAjaxUpdate);\n";269 echo "</script>\n";268 echo " doUpdate();\n"; 269 echo " }\n"; 270 echo "}\n"; 271 // Fix for IE's stupid "Operation Aborted" Error 272 echo " if (window.addEventListener) window.addEventListener(\"load\",runAjaxUpdate,false); else if (window.attachEvent) window.attachEvent(\"onload\",runAjaxUpdate);\n"; 273 echo "</script>\n"; 270 274 } 271 275 } … … 305 309 306 310 class MobileUpdate extends Update { 307 function MobileUpdate() {308 parent::Update($doPopulate = true);309 }310 function render() {311 $newIds = array();312 foreach ($this->chans as $chan) {313 list ($cid, $url, $title) = $chan;314 echo "$title ...\t";315 flush();316 $ret = update($cid);317 318 if (is_array($ret)) {319 list ($error, $unreadIds) = $ret;320 $newIds = array_merge($newIds, $unreadIds);321 } else {322 $error = 0;323 $unreadIds = array ();324 }325 $unread = count($unreadIds);326 list($label,$cls) = parent::magpieError($error);327 echo "\n$label, $unread " . __('New Items') . "<br />";328 flush();329 }330 }331 } 332 333 311 function MobileUpdate() { 312 parent::Update($doPopulate = true); 313 } 314 function render() { 315 $newIds = array(); 316 foreach ($this->chans as $chan) { 317 list ($cid, $url, $title) = $chan; 318 echo "$title ...\t"; 319 flush(); 320 $ret = update($cid); 321 322 if (is_array($ret)) { 323 list ($error, $unreadIds) = $ret; 324 $newIds = array_merge($newIds, $unreadIds); 325 } else { 326 $error = 0; 327 $unreadIds = array (); 328 } 329 $unread = count($unreadIds); 330 list($label,$cls) = parent::magpieError($error); 331 echo "\n$label, $unread " . __('New Items') . "<br />"; 332 flush(); 333 } 334 } 335 } 336 337 334 338 /** 335 339 * CommandLineUpdateNews updates the feeds and displays only feeds with … … 337 341 */ 338 342 class CommandLineUpdateNews extends CommandLineUpdate { 339 function render() {340 $newIds = array();341 foreach ($this->chans as $chan) {342 list ($cid, $url, $title) = $chan;343 $ret = update($cid);344 345 if (is_array($ret)) {346 list ($error, $unreadIds) = $ret;347 $newIds = array_merge($newIds, $unreadIds);348 } else {349 $error = 0;350 $unreadIds = array();351 }352 $unread = count($unreadIds);353 354 list($label, $cls) = parent::magpieError($error);355 356 if (($cls != ERROR_NOERROR) || ($unread > 0)) {357 echo "$title ...\t";358 flush();359 echo "\n$label, $unread " . __('New Items') . "\n\n";360 flush();361 }362 }363 364 if (!hidePrivate()) {365 parent::cleanUp($newIds);366 }367 }343 function render() { 344 $newIds = array(); 345 foreach ($this->chans as $chan) { 346 list ($cid, $url, $title) = $chan; 347 $ret = update($cid); 348 349 if (is_array($ret)) { 350 list ($error, $unreadIds) = $ret; 351 $newIds = array_merge($newIds, $unreadIds); 352 } else { 353 $error = 0; 354 $unreadIds = array(); 355 } 356 $unread = count($unreadIds); 357 358 list($label, $cls) = parent::magpieError($error); 359 360 if (($cls != ERROR_NOERROR) || ($unread > 0)) { 361 echo "$title ...\t"; 362 flush(); 363 echo "\n$label, $unread " . __('New Items') . "\n\n"; 364 flush(); 365 } 366 } 367 368 if (!hidePrivate()) { 369 parent::cleanUp($newIds); 370 } 371 } 368 372 } 369 373 … … 417 421 echo "\n".PUSH_BOUNDARY."\n"; 418 422 echo "WARNING: YOUR BROWSER DOESN'T SUPPORT THIS SERVER-PUSH TECHNOLOGY.\n"; 419 423 420 424 flush(); 421 425 } -
branches/postgresql/cls/wrappers/header.php
r1603 r1634 135 135 } 136 136 137 function rss_header_logininfo( ) {137 function rss_header_logininfo($showLoginBox = true) { 138 138 139 139 $ret = "<div id=\"loginfo\">\n"; … … 142 142 $ret .= sprintf(__('Logged in as <strong>%s</strong>'), rss_user_name()) 143 143 ." | <a href=\"".getPath()."?logout\">".__('Logout')."</a>\n"; 144 } else {144 } else if(true == $showLoginBox) { 145 145 $ret .= __('Not logged in') 146 146 ." | <a href=\"#\" onclick=\"miniloginform(); return false;\">".__('Login')."</a>"; -
branches/postgresql/cls/wrappers/item.php
r1603 r1634 46 46 } 47 47 if (getConfig('rss.output.usepermalinks')) { 48 list ($ply, $plm, $pld) = explode(":", rss_date("Y:m:d", $GLOBALS['rss'] -> currentItem -> date, false)); 49 $ptitle = ($label."'".$GLOBALS['rss'] -> currentItem -> parent -> escapedTitle 50 ."/$ply/$plm/$pld/".$GLOBALS['rss'] -> currentItem -> escapedTitle."'"); 51 } 52 return $ptitle; 48 //list ($ply, $plm, $pld) = explode(":", rss_date("Y:m:d", $GLOBALS['rss'] -> currentItem -> date, false)); 49 $ptitle = ($label."'". htmlentities($GLOBALS['rss'] -> currentItem -> title,ENT_QUOTES ,'UTF-8') ."'"); 50 } 51 return @$ptitle; 53 52 } 54 53 -
branches/postgresql/dist/l10n.sh
r1603 r1634 18 18 echo "Updating $PO/$POFILE" 19 19 touch $PO/$POFILE 20 msgmerge - v --update $PO/$POFILE $POT20 msgmerge -N -v --update $PO/$POFILE $POT 21 21 echo "Building $PO/$MOFILE" 22 22 msgfmt -o $PO/$MOFILE $PO/$POFILE -
branches/postgresql/extlib/l10n/gettext.php
r1484 r1634 103 103 $this->enable_cache = $enable_cache; 104 104 105 // $MAGIC1= (int)0x950412de; //bug in PHP 5105 $MAGIC1_alt = (int)0x950412de; //bug in PHP 5 106 106 $MAGIC1 = (int) - 1794895138; 107 // $MAGIC2= (int)0xde120495; //bug107 $MAGIC2_alt = (int)0xde120495; //bug 108 108 $MAGIC2 = (int) - 569244523; 109 109 110 110 $this->STREAM = $Reader; 111 111 $magic = $this->readint(); 112 if ($magic == $MAGIC1 ) {112 if ($magic == $MAGIC1 || $magic == $MAGIC1_alt) { 113 113 $this->BYTEORDER = 0; 114 } elseif ($magic == $MAGIC2 ) {114 } elseif ($magic == $MAGIC2 || $magic == $MAGIC2_alt) { 115 115 $this->BYTEORDER = 1; 116 116 } else { -
branches/postgresql/extlib/rss_fetch.inc
r1164 r1634 50 50 // Not fetched because age < MAGPIE_CACHE_AGE 51 51 define ('MAGPIE_FEED_ORIGIN_NOT_FETCHED', 64); 52 // 403 Forbidden 53 define ('MAGPIE_FEED_ORIGIN_HTTP_403', 128); 52 54 53 55 /* … … 239 241 $rss -> rss_origin |= MAGPIE_FEED_ORIGIN_HTTP_404; 240 242 break; 243 case '403': 244 $rss -> rss_origin |= MAGPIE_FEED_ORIGIN_HTTP_403; 245 break; 241 246 default: 242 247 $rss -> rss_origin |= MAGPIE_FEED_ORIGIN_HTTP_TIMEOUT; -
branches/postgresql/intl/da/LC_MESSAGES/messages.po
