- Timestamp:
- 06/05/06 17:36:00 (2 years ago)
- Location:
- branches/postgresql
- Files:
-
- 42 modified
- 22 copied
-
INSTALL (modified) (1 diff)
-
admin/index.php (modified) (1 diff)
-
admin/plugins.php (modified) (2 diffs)
-
admin/users.php (modified) (3 diffs)
-
ajax.php (modified) (1 diff)
-
author.php (modified) (2 diffs)
-
cls/items.php (modified) (6 diffs)
-
cls/l10n.php (copied) (copied from trunk/gregarius/cls/l10n.php)
-
cls/search.php (modified) (1 diff)
-
cls/update.php (modified) (1 diff)
-
cls/user.php (modified) (1 diff)
-
cls/wrappers/header.php (modified) (1 diff)
-
cls/wrappers/itemlist.php (modified) (1 diff)
-
cls/wrappers/user.php (modified) (1 diff)
-
constants.php (modified) (1 diff)
-
db.php (modified) (1 diff)
-
dbstruct.pgsql.sql (modified) (1 diff)
-
extlib/Snoopy.class.inc (modified) (1 diff)
-
extlib/l10n (copied) (copied from trunk/gregarius/extlib/l10n)
-
extlib/l10n/gettext.php (copied) (copied from trunk/gregarius/extlib/l10n/gettext.php)
-
extlib/l10n/streams.php (copied) (copied from trunk/gregarius/extlib/l10n/streams.php)
-
feed.php (modified) (6 diffs)
-
init.php (modified) (3 diffs)
-
intl/cn_s.php (copied) (copied from trunk/gregarius/intl/cn_s.php)
-
intl/cn_t.php (copied) (copied from trunk/gregarius/intl/cn_t.php)
-
intl/de.php (modified) (1 diff)
-
intl/dk.php (modified) (1 diff)
-
intl/en.php (modified) (1 diff)
-
intl/es.php (modified) (1 diff)
-
intl/fr.php (modified) (1 diff)
-
intl/he.php (copied) (copied from trunk/gregarius/intl/he.php)
-
intl/it.php (modified) (1 diff)
-
intl/pt_BR.php (modified) (1 diff)
-
intl/pt_PT.php (copied) (copied from trunk/gregarius/intl/pt_PT.php)
-
intl/ru.php (modified) (1 diff)
-
intl/sv.php (modified) (1 diff)
-
plugins/rssview.php (modified) (4 diffs)
-
schema.php (modified) (1 diff)
-
state.php (modified) (1 diff)
-
tags.php (modified) (1 diff)
-
themes.php (modified) (1 diff)
-
themes/default/mobile/feedsfeed.php (modified) (1 diff)
-
themes/default/mobile/nav.php (modified) (1 diff)
-
themes/default/mobile/plugins.php (modified) (3 diffs)
-
themes/default/web/css/look.css (modified) (1 diff)
-
themes/default/web/itemlist.php (modified) (1 diff)
-
themes/default/web/pagination.php (copied) (copied from trunk/gregarius/themes/default/web/pagination.php)
-
themes/lilina/intl (copied) (copied from trunk/gregarius/themes/lilina/intl)
-
themes/lilina/intl/cn_s.php (copied) (copied from trunk/gregarius/themes/lilina/intl/cn_s.php)
-
themes/lilina/intl/cn_t.php (copied) (copied from trunk/gregarius/themes/lilina/intl/cn_t.php)
-
themes/lilina/intl/de.php (copied) (copied from trunk/gregarius/themes/lilina/intl/de.php)
-
themes/lilina/intl/dk.php (copied) (copied from trunk/gregarius/themes/lilina/intl/dk.php)
-
themes/lilina/intl/en.php (copied) (copied from trunk/gregarius/themes/lilina/intl/en.php)
-
themes/lilina/intl/es.php (copied) (copied from trunk/gregarius/themes/lilina/intl/es.php)
-
themes/lilina/intl/fr.php (copied) (copied from trunk/gregarius/themes/lilina/intl/fr.php)
-
themes/lilina/intl/he.php (copied) (copied from trunk/gregarius/themes/lilina/intl/he.php)
-
themes/lilina/intl/it.php (copied) (copied from trunk/gregarius/themes/lilina/intl/it.php)
-
themes/lilina/intl/pt_BR.php (copied) (copied from trunk/gregarius/themes/lilina/intl/pt_BR.php)
-
themes/lilina/intl/ru.php (copied) (copied from trunk/gregarius/themes/lilina/intl/ru.php)
-
themes/lilina/intl/sv.php (copied) (copied from trunk/gregarius/themes/lilina/intl/sv.php)
-
themes/lilina/web/index.php (modified) (1 diff)
-
themes/lilina/web/item.php (modified) (1 diff)
-
update.php (modified) (2 diffs)
-
util.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/postgresql/INSTALL
r1393 r1484 41 41 42 42 2. Edit the dbinit.php file to match your database configuration. 43 Make sure that the database user you define owns privileges to 44 create tables. 43 Make sure that the database exists and has the right permissions 44 and the database user you define owns privileges to create/modify 45 tables. 45 46 46 47 6. Point your browser to the root directory of your installation. -
branches/postgresql/admin/index.php
r1432 r1484 81 81 $admin_uname = null; 82 82 $admin_pass = null; 83 if (isset($_POST[' admin_uname']) && isset($_POST['admin_pass'])) {84 $admin_uname = $_POST[' admin_uname'];85 $admin_pass = $_POST[' admin_pass'];83 if (isset($_POST['username']) && isset($_POST['password'])) { 84 $admin_uname = $_POST['username']; 85 $admin_pass = $_POST['password']; 86 86 } 87 87 set_admin_pass($admin_uname,$admin_pass); -
branches/postgresql/admin/plugins.php
r1284 r1484 132 132 ."</td>\n"; 133 133 echo "<td><label 134 for=\"_gregarius_plugin_$entry\">".(array_key_exists('name',$info)?$info['name']:"  ").134 for=\"_gregarius_plugin_$entry\">".(array_key_exists('name',$info)?$info['name']:" "). 135 135 "</label></td>\n"; 136 136 echo "<td class=\"cntr\">" 137 .(array_key_exists('version',$info)?$info['version']:"  "). "</td>\n";138 echo "<td>" .(array_key_exists('author',$info)?$info['author']:"  "). "</td>\n";139 echo "<td>" .(array_key_exists('description',$info)?$info['description']:"  "). "</td>\n";137 .(array_key_exists('version',$info)?$info['version']:" "). "</td>\n"; 138 echo "<td>" .(array_key_exists('author',$info)?$info['author']:" "). "</td>\n"; 139 echo "<td>" .(array_key_exists('description',$info)?$info['description']:" "). "</td>\n"; 140 140 141 141 // output the column to call a plugin's config page. … … 150 150 ."</a>"; 151 151 } else { 152 echo "  ";152 echo " "; 153 153 } 154 154 echo "</td>\n"; -
branches/postgresql/admin/users.php
r1432 r1484 49 49 <!-- 50 50 function on_submit_password_match() { 51 pass=document.getElementById(' admin_pass').value;52 pass2=document.getElementById(' admin_pass2').value;51 pass=document.getElementById('password').value; 52 pass2=document.getElementById('password2').value; 53 53 if(pass !== pass2){ 54 54 msg = '<?php echo LBL_ADMIN_PASS_NO_MATCH ?>'; 55 55 document.getElementById('admin_match_result').innerHTML = msg; 56 document.getElementById(' admin_pass').value = '';57 document.getElementById(' admin_pass2').value = '';56 document.getElementById('password').value = ''; 57 document.getElementById('password2').value = ''; 58 58 return false; 59 59 }else{ 60 return true; 60 document.getElementById('password2').value = ''; 61 return loginHandler(); 61 62 } 62 63 } … … 71 72 echo "<form action=\"".$_SERVER['PHP_SELF'] . "\" onsubmit=\"return on_submit_password_match();\" method=\"post\">\n" 72 73 ."<fieldset style=\"width:400px;\">" 73 ."<p><label style=\"display:block\" for=\" admin_uname\">".LBL_USERNAME.":</label>\n"74 ."<input type=\"text\" id=\" admin_uname\" name=\"admin_uname\" /></p>\n"75 ."<p><label style=\"display:block\" for=\" admin_pass\">".LBL_PASSWORD.":</label>\n"76 ."<input type=\"password\" id=\" admin_pass\" name=\"admin_pass\" /></p>\n"77 ."<p><label style=\"display:block\" for=\" admin_pass2\">".LBL_PASSWORD2.":</label>\n"78 ."<input type=\"password\" id=\" admin_pass2\" name=\"admin_pass2\" /></p>\n"74 ."<p><label style=\"display:block\" for=\"username\">".LBL_USERNAME.":</label>\n" 75 ."<input type=\"text\" id=\"username\" name=\"username\" /></p>\n" 76 ."<p><label style=\"display:block\" for=\"password\">".LBL_PASSWORD.":</label>\n" 77 ."<input type=\"password\" id=\"password\" name=\"password\" /></p>\n" 78 ."<p><label style=\"display:block\" for=\"password2\">".LBL_PASSWORD2.":</label>\n" 79 ."<input type=\"password\" id=\"password2\" name=\"password2\" /></p>\n" 79 80 ."<p><input type=\"submit\" value=\"".LBL_ADMIN_OK."\" /></p>\n" 80 81 ."<div style=\"display:inline;\" id=\"admin_match_result\"></div>\n" … … 92 93 echo "\n<div id=\"channel_admin\" class=\"frame\">"; 93 94 94 echo "<form id=\"admin_login\" style=\"text-align:center\" action=\"".$_SERVER['PHP_SELF'] ."\" method=\"post\">\n" 95 echo "<form id=\"admin_login\" onsubmit=\"return loginHandler();\" 96 style=\"text-align:center\" action=\"".$_SERVER['PHP_SELF'] ."\" method=\"post\">\n" 95 97 ."<fieldset>" 96 98 ."<legend>" . LBL_ADMIN_LOGIN . "</legend>\n" -
branches/postgresql/ajax.php
r1432 r1484 169 169 } 170 170 171 function loginHandler() { 172 pw = document.getElementById('password'); 173 username = document.getElementById('username'); 174 var re = /[0-9a-f]{32}/ ; 175 if (! re.test(pw.value)) { 176 pw.value = hex_md5(pw.value + username.value); 177 } 178 return true; 179 } 171 180 172 181 function setTags(id,tagss) { -
branches/postgresql/author.php
r1190 r1484 28 28 require_once ('init.php'); 29 29 30 $a = preg_replace("/[^A-Za-z0-9\.]/","%",rss_real_escape_string($_REQUEST['author'])); 31 30 $a =trim(sanitize($_REQUEST['author'], RSS_SANITIZER_WORDS)); 32 31 list ($ra) = rss_fetch_row(rss_query( 33 32 "select distinct(author) from " .getTable('item') 34 ." where author like ' %$a%'"33 ." where author like '$a'" 35 34 )); 36 35 37 36 if (!$ra) { 38 rss_redirect(); 37 rss_404(); 38 exit; 39 39 } 40 40 … … 43 43 $GLOBALS['rss']->feedList = new FeedList(false); 44 44 $authorItems = new ItemList(); 45 $sqlWhere = " i.author like '%$a%' "; 46 $authorItems->populate($sqlWhere); 45 $sqlWhere = " i.author like '$a' "; 46 $numItems = getConfig('rss.output.frontpage.numitems'); 47 $authorItems->populate($sqlWhere, "", 0, $numItems); 47 48 $authorItems->setTitle($t); 48 49 $authorItems->setRenderOptions(IL_NO_COLLAPSE|IL_TITLE_NO_ESCAPE); -
branches/postgresql/cls/items.php
r1255 r1484 244 244 var $unreadIids = array(); 245 245 var $rss; 246 247 246 var $_template; 247 248 var $_sqlActualWhat = ""; 249 var $_sqlActualFrom = ""; 250 var $_sqlActualWhere= ""; 251 var $_sqlActualOrder= ""; 252 var $_sqlActualLimit= ""; 248 253 249 254 function ItemList() { 250 255 $this -> _template = 'itemlist.php'; 251 256 $this -> rss = &$GLOBALS['rss']; 252 257 … … 273 278 * @param sqlOrder (optional) specifies a different item ordering 274 279 * @param sqlLimit (optional) specifies how many items should be fetched 275 * @param includeDeprecated (optional) specifies if deprecated feeds should be fetched280 * @param includeDeprecated (optional) specifies if deprecated feeds should be fetched 276 281 */ 277 282 function populate($sqlWhere, $sqlOrder="", $startItem = 0, $itemCount = -1, $hint = ITEM_SORT_HINT_MIXED, $includeDeprecated = false) { 278 283 279 _pf('ItemList::populate()');280 $ sql = "selecti.title, c.title, c.id, i.unread, "284 _pf('ItemList::populate()'); 285 $this -> _sqlActualWhat = " i.title, c.title, c.id, i.unread, " 281 286 ."i.url, i.enclosure, i.author, i.description, c.icon, " 282 ." case when i.pubdate is null then unix_timestamp(i.added) else unix_timestamp(i.pubdate) endas ts, "283 ." case when i.pubdate is not null then true else false end as ispubdate, i.id, r.rating " 284 ." from ".getTable("item") ." i "287 ." unix_timestamp(coalesce(i.pubdate,i.added)) as ts, " 288 ." i.pubdate is not null as ispubdate, i.id, r.rating "; 289 $this -> _sqlActualFrom = getTable("item") ." i " 285 290 ." left join " 286 291 . getTable("rating") ." r on (i.id = r.iid), " 287 292 .getTable("channels")." c, " 288 .getTable("folders") ." f " 289 290 ." where " 291 ." i.cid = c.id and " 293 .getTable("folders") ." f "; 294 295 $this -> _sqlActualWhere = " i.cid = c.id and " 292 296 ." f.id=c.parent and ". (false == $includeDeprecated ? " (c.mode & ".RSS_MODE_DELETED_STATE.")=0 and " : "") 293 297 ." (i.unread & ".RSS_MODE_DELETED_STATE.")=0 and "; … … 296 300 297 301 if (hidePrivate()) { 298 $ sql.= " (i.unread & ".RSS_MODE_PRIVATE_STATE.")=0 and ";299 } 300 301 if ($ sqlWhere) {302 $ sql.= $sqlWhere ." and ";303 } 304 $ sql.= " 1=1 ";302 $this -> _sqlActualWhere .= " (i.unread & ".RSS_MODE_PRIVATE_STATE.")=0 and "; 303 } 304 305 if ($this -> _sqlActualWhere) { 306 $this -> _sqlActualWhere .= $sqlWhere ." and "; 307 } 308 $this -> _sqlActualWhere .= " 1=1 "; 305 309 306 310 /// Order by … … 318 322 break; 319 323 } 320 $sql .= " order by "; 324 321 325 if (!getConfig('rss.config.feedgrouping')) { 322 326 if(getConfig("rss.config.datedesc.$skey")){ 323 $ sql .= " ts desc, f.position asc, c.position asc ";327 $this -> _sqlActualOrder = " ts desc, f.position asc, c.position asc "; 324 328 }else{ 325 $ sql .= " ts asc, f.position asc, c.position asc ";329 $this -> _sqlActualOrder = " ts asc, f.position asc, c.position asc "; 326 330 } 327 331 } elseif (getConfig('rss.config.absoluteordering')) { 328 $ sql .= " f.position asc, c.position asc";332 $this -> _sqlActualOrder = " f.position asc, c.position asc"; 329 333 } else { 330 $ sql .= " f.name asc, c.title asc";334 $this -> _sqlActualOrder = " f.name asc, c.title asc"; 331 335 } 332 336 if(getConfig("rss.config.datedesc.$skey")){ 333 $ sql.= ", ts desc, i.id asc";337 $this -> _sqlActualOrder .= ", ts desc, i.id asc"; 334 338 }else{ 335 $ sql.= ", ts asc, i.id asc";339 $this -> _sqlActualOrder .= ", ts asc, i.id asc"; 336 340 } 337 341 } else { 338 $ sql .= " $sqlOrder ";342 $this -> _sqlActualOrder = " $sqlOrder "; 339 343 } 340 344 if (($itemCount < 0) || ($itemCount > RSS_DB_MAX_QUERY_RESULTS)) { 341 345 $itemCount = RSS_DB_MAX_QUERY_RESULTS; 342 346 } 343 $sql .= " limit $itemCount OFFSET $startItem"; 344 347 $this -> _sqlActualLimit = " $itemCount OFFSET $startItem"; 348 349 $sql = "select " 350 .$this -> _sqlActualWhat 351 . " from " 352 .$this -> _sqlActualFrom 353 . " where " 354 . $this -> _sqlActualWhere 355 . " order by " 356 . $this -> _sqlActualOrder 357 . " limit " 358 . $this -> _sqlActualLimit; 359 345 360 //echo $sql; 346 361 $this -> iids = array(); … … 461 476 rss_plugin_hook('rss.plugins.items.beforeitems', null); 462 477 463 eval($this-> rss ->getCachedTemplateFile( "itemlist.php"));478 eval($this-> rss ->getCachedTemplateFile($this -> _template)); 464 479 465 480 _pf("done: ItemList -> render()"); … … 470 485 } 471 486 472 487 class ItemListNavigation { 488 var $_parent; 489 var $pages; 490 function ItemListNavigation($il) { 491 $this -> _parent = $il; 492 $this -> pages = array(); 493 $base = $_SERVER["REQUEST_URI"]; 494 if (!preg_match('#page=[0-9]+$#',$base)) { 495 $base .= "?page=0"; 496 } 497 $last = ceil( $this -> _parent -> numItems / $this -> _parent -> itemsPerPage); 498 $lastin = 0; 499 for ($i = 0; $i < $last; $i++) { 500 if ($i == 0 || $i == $last-1 || abs($i - $this -> _parent -> page) < 3) { 501 $url = preg_replace('#^(.+)page=[0-9]+$#','${1}page='.$i, $base); 502 $this -> pages[$i] = array($url, $i == $this -> _parent -> page, false); 503 $lastin = $i; 504 } elseif ($i - 1 == $lastin) { 505 $this -> pages[$i] = array(null,false,true); 506 } 507 } 508 } 509 function render() { 510 eval($this-> _parent -> rss ->getCachedTemplateFile('pagination.php')); 511 } 512 } 513 514 class PaginatedItemList extends ItemList { 515 var $page; 516 var $navigation; 517 var $itemsPerPage = 0; 518 var $numItems = 0; 519 function PaginatedItemList() { 520 parent::ItemList(); 521 if (isset($_REQUEST['page'])) { 522 $this -> page = sanitize($_REQUEST['page'], RSS_SANITIZER_NUMERIC); 523 } else { 524 $this -> page = 0; 525 } 526 527 $this -> itemsPerPage = getConfig('rss.output.frontpage.numitems'); 528 } 529 function populate($sqlWhere, $sqlOrder="", $startItem = 0, $itemCount = -1, $hint = ITEM_SORT_HINT_MIXED, $includeDeprecated = false) { 530 531 $si = $this -> page * $this -> itemsPerPage; 532 parent::populate($sqlWhere, $sqlOrder, $si, $this -> itemsPerPage, $hint, $includeDeprecated); 533 534 $sql = "select count(*) as cnt " 535 . " from " 536 . $this -> _sqlActualFrom 537 . " where " 538 . $this -> _sqlActualWhere; 539 list($this -> numItems) = rss_fetch_row(rss_query($sql)); 540 $this -> navigation = new ItemListNavigation(& $this); 541 } 542 } 473 543 ?> -
branches/postgresql/cls/search.php
r1393 r1484 186 186 187 187 if ($this->orderBy == QUERY_ORDER_BY_DATE) { 188 $qOrder = " order byts desc";188 $qOrder = " ts desc"; 189 189 } else { 190 190 if (getConfig('rss.config.absoluteordering')) { 191 $qOrder = " order byf.position asc, c.position asc";191 $qOrder = " f.position asc, c.position asc"; 192 192 } else { 193 $qOrder = " order byf.name asc, c.title asc";193 $qOrder = " f.name asc, c.title asc"; 194 194 } 195 195 } -
branches/postgresql/cls/update.php
r1432 r1484 293 293 294 294 } 295 296 295 parent::cleanUp($newIds, $ignorePrivate = true); 297 298 } 299 300 } 301 296 } 297 } 298 299 class 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 302 327 /** 303 328 * CommandLineUpdateNews updates the feeds and displays only feeds with -
branches/postgresql/cls/user.php
r1432 r1484 28 28 rss_require('cls/wrappers/user.php'); 29 29 30 /** 30 define ('RSS_USER_ACTION_LOGIN',0x01); 31 define ('RSS_USER_ACTION_COOKIE',0x02); 32 define ('RSS_USER_ACTION_SESSION',0x04); 33 define ('RSS_USER_ACTION_LOGOUT',0x08); 34 35 /** 31 36 * The RSSUser class holds all the business logic to handle Gregarius users 32 37 */ 33 38 class RSSUser { 34 /** Userid */ 35 var $_uid; 36 /** Userlevel */ 37 var $_level; 38 /** Username */ 39 var $_uname; 40 /** md5 hash of the user password */ 41 var $_hash; 42 /** List of valid IP subnets this user is allowed to log in via a cookie */ 43 var $_validIPs; 44 45 /** 46 * RSSUser constructor: 47 * Handles: 48 * -logout 49 * -cookie login (with validation) 50 * -login 51 */ 52 function RSSUser() { 53 $this -> _uid = 0; 54 $this -> _validIPs = array(); 55 $this -> _level = RSS_USER_LEVEL_NOLEVEL; 56 $this -> _uname = ''; 57 $this -> _realName = ''; 58 $this -> _hash = null; 39 /** Userid */ 40 var $_uid; 41 /** Userlevel */ 42 var $_level; 43 /** Username */ 44 var $_uname; 45 /** md5 hash of the user password */ 46 var $_hash; 47 /** List of valid IP subnets this user is allowed to log in via a cookie */ 48 var $_validIPs; 49 /** Mobile session */ 50 var $_mobileSession; 51 /** Action */ 52 var $_action; 53 54 /** 55 * RSSUser constructor: 56 * Handles: 57 * -logout 58 * -cookie login (with validation) 59 * -login 60 */ 61 function RSSUser() { 62 63 $this -> _uid = 0; 64 $this -> _validIPs = array(); 65 $this -> _level = RSS_USER_LEVEL_NOLEVEL; 66 $this -> _uname = ''; 67 $this -> _realName = ''; 68 $this -> _hash = null; 69 70 71 $this -> _mobileSession = 72 isset($_POST['media']) && 'mobile' == $_POST['media']; 73 74 if ('mobile' == getThemeMedia()) { 75 ini_set('session.use_trans_sid',true); 76 session_start(); 77 } 59 78 60 if (array_key_exists('logout',$_GET)) { 61 $this -> logout(); 62 rss_redirect(''); 79 if (array_key_exists('logout',$_GET)) { 80 $this -> logout(); 81 rss_redirect(''); 82 } 83 84  
