Changeset 1470
- Timestamp:
- 05/15/06 16:53:07 (3 years ago)
- Location:
- release-branches/0.5.4/gregarius
- Files:
-
- 1 removed
- 38 modified
- 19 copied
-
INSTALL (modified) (1 diff)
-
admin/index.php (modified) (3 diffs)
-
admin/plugins.php (modified) (2 diffs)
-
admin/users.php (modified) (3 diffs)
-
ajax.php (modified) (3 diffs)
-
author.php (modified) (2 diffs)
-
cls/db/ParsingQuery.class.php (modified) (1 diff)
-
cls/items.php (modified) (6 diffs)
-
cls/search.php (modified) (1 diff)
-
cls/update.php (modified) (1 diff)
-
cls/user.php (copied) (copied from trunk/rss/cls/user.php)
-
cls/wrappers/header.php (modified) (2 diffs)
-
cls/wrappers/itemlist.php (modified) (1 diff)
-
cls/wrappers/user.php (copied) (copied from trunk/rss/cls/wrappers/user.php)
-
constants.php (modified) (1 diff)
-
extlib/MagpieTests (deleted)
-
feed.php (modified) (13 diffs)
-
index.php (modified) (1 diff)
-
init.php (modified) (2 diffs)
-
intl/cn_s.php (copied) (copied from trunk/rss/intl/cn_s.php)
-
intl/cn_t.php (copied) (copied from trunk/rss/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/rss/intl/he.php)
-
intl/it.php (modified) (1 diff)
-
intl/pt_BR.php (modified) (1 diff)
-
intl/ru.php (modified) (1 diff)
-
intl/sv.php (modified) (1 diff)
-
plugins/rssview.php (modified) (4 diffs)
-
schema.php (modified) (3 diffs)
-
state.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) (2 diffs)
-
themes/default/web/itemlist.php (modified) (1 diff)
-
themes/default/web/pagination.php (copied) (copied from trunk/rss/themes/default/web/pagination.php)
-
themes/lilina/intl (copied) (copied from trunk/rss/themes/lilina/intl)
-
themes/lilina/intl/cn_s.php (copied) (copied from trunk/rss/themes/lilina/intl/cn_s.php)
-
themes/lilina/intl/cn_t.php (copied) (copied from trunk/rss/themes/lilina/intl/cn_t.php)
-
themes/lilina/intl/de.php (copied) (copied from trunk/rss/themes/lilina/intl/de.php)
-
themes/lilina/intl/dk.php (copied) (copied from trunk/rss/themes/lilina/intl/dk.php)
-
themes/lilina/intl/en.php (copied) (copied from trunk/rss/themes/lilina/intl/en.php)
-
themes/lilina/intl/es.php (copied) (copied from trunk/rss/themes/lilina/intl/es.php)
-
themes/lilina/intl/fr.php (copied) (copied from trunk/rss/themes/lilina/intl/fr.php)
-
themes/lilina/intl/he.php (copied) (copied from trunk/rss/themes/lilina/intl/he.php)
-
themes/lilina/intl/it.php (copied) (copied from trunk/rss/themes/lilina/intl/it.php)
-
themes/lilina/intl/pt_BR.php (copied) (copied from trunk/rss/themes/lilina/intl/pt_BR.php)
-
themes/lilina/intl/ru.php (copied) (copied from trunk/rss/themes/lilina/intl/ru.php)
-
themes/lilina/intl/sv.php (copied) (copied from trunk/rss/themes/lilina/intl/sv.php)
-
themes/lilina/web/index.php (modified) (1 diff)
-
themes/lilina/web/item.php (modified) (2 diffs)
-
update.php (modified) (2 diffs)
-
util.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
release-branches/0.5.4/gregarius/INSTALL
r1290 r1470 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. -
release-branches/0.5.4/gregarius/admin/index.php
r1409 r1470 73 73 74 74 75 $auth=rss_ check_user_level(RSS_USER_LEVEL_ADMIN);75 $auth=rss_user_check_user_level(RSS_USER_LEVEL_ADMIN); 76 76 if (! $auth) { 77 77 // check whether the admin password has been set. … … 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); 88 88 } else { 89 // forget the password 90 unset($__pw__); 91 $login_uname = null; 92 $login_pass = null; 93 if (isset($_POST['username']) && isset($_POST['password'])) { 94 $login_uname = $_POST['username']; 95 $login_pass = $_POST['password']; 96 97 } 98 rss_login_form($login_uname,$login_pass); 99 exit(); 89 rss_login_form(); 90 exit(); 100 91 } 101 92 } … … 113 104 */ 114 105 function admin_main($authorised) { 115 116 106 echo "\n<div id=\"channel_admin\" class=\"frame\">"; 117 107 if ($authorised) { -
release-branches/0.5.4/gregarius/admin/plugins.php
r1275 r1470 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"; -
release-branches/0.5.4/gregarius/admin/users.php
r1409 r1470 48 48 <!-- 49 49 function on_submit_password_match() { 50 pass=document.getElementById(' admin_pass').value;51 pass2=document.getElementById(' admin_pass2').value;50 pass=document.getElementById('password').value; 51 pass2=document.getElementById('password2').value; 52 52 if(pass !== pass2){ 53 53 msg = '<?php echo LBL_ADMIN_PASS_NO_MATCH ?>'; 54 54 document.getElementById('admin_match_result').innerHTML = msg; 55 document.getElementById(' admin_pass').value = '';56 document.getElementById(' admin_pass2').value = '';55 document.getElementById('password').value = ''; 56 document.getElementById('password2').value = ''; 57 57 return false; 58 58 }else{ 59 return true; 59 document.getElementById('password2').value = ''; 60 return loginHandler(); 60 61 } 61 62 } … … 70 71 echo "<form action=\"".$_SERVER['PHP_SELF'] . "\" onsubmit=\"return on_submit_password_match();\" method=\"post\">\n" 71 72 ."<fieldset style=\"width:400px;\">" 72 ."<p><label style=\"display:block\" for=\" admin_uname\">".LBL_USERNAME.":</label>\n"73 ."<input type=\"text\" id=\" admin_uname\" name=\"admin_uname\" /></p>\n"74 ."<p><label style=\"display:block\" for=\" admin_pass\">".LBL_PASSWORD.":</label>\n"75 ."<input type=\"password\" id=\" admin_pass\" name=\"admin_pass\" /></p>\n"76 ."<p><label style=\"display:block\" for=\" admin_pass2\">".LBL_PASSWORD2.":</label>\n"77 ."<input type=\"password\" id=\" admin_pass2\" name=\"admin_pass2\" /></p>\n"73 ."<p><label style=\"display:block\" for=\"username\">".LBL_USERNAME.":</label>\n" 74 ."<input type=\"text\" id=\"username\" name=\"username\" /></p>\n" 75 ."<p><label style=\"display:block\" for=\"password\">".LBL_PASSWORD.":</label>\n" 76 ."<input type=\"password\" id=\"password\" name=\"password\" /></p>\n" 77 ."<p><label style=\"display:block\" for=\"password2\">".LBL_PASSWORD2.":</label>\n" 78 ."<input type=\"password\" id=\"password2\" name=\"password2\" /></p>\n" 78 79 ."<p><input type=\"submit\" value=\"".LBL_ADMIN_OK."\" /></p>\n" 79 80 ."<div style=\"display:inline;\" id=\"admin_match_result\"></div>\n" … … 89 90 90 91 admin_header(); 91 ?> 92 <script type="text/javascript"> 93 <!-- 92 echo "\n<div id=\"channel_admin\" class=\"frame\">"; 94 93 95 function on_submit_login_form() { 96 uname=document.getElementById('username').value; 97 pass=hex_md5(document.getElementById('password').value); 98 ajax_login(uname,pass,admin_login_hdlr); 99 return false; 100 } 101 102 103 function admin_login_hdlr(data) { 104 tokens=data.split('|'); 105 ulevel=tokens[0]; 106 uname=tokens[1]; 107 pass=tokens[2]; 108 if (ulevel > 0) { 109 if (<?php echo (getConfig('rss.config.autologout') ? "true":"false"); ?>) { 110 setRootSessionCookie('<?php echo RSS_USER_COOKIE; ?>', uname+'|'+pass); 111 } else { 112 setRootCookie('<?php echo RSS_USER_COOKIE; ?>', uname+'|'+pass); 113 } 114 } 115 msg = ''; 116 if (ulevel == <?php echo RSS_USER_LEVEL_NOLEVEL ?>) { 117 msg = '<?php echo LBL_ADMIN_LOGIN_BAD_LOGIN ?>'; 118 } else if (ulevel > <?php echo RSS_USER_LEVEL_NOLEVEL ?> && ulevel < <?php echo RSS_USER_LEVEL_ADMIN ?>) { 119 msg = '<?php echo LBL_ADMIN_LOGIN_NO_ADMIN ?>'.replace('%s',uname); 120 } else if (ulevel >= <?php echo RSS_USER_LEVEL_ADMIN ?>) { 121 document.location=document.location; 122 return 0; 123 } 124 125 if (msg != '') { 126 document.getElementById('admin_login_result').innerHTML = '<br>' + msg; 127 } 128 } 129 --> 130 </script> 131 132 <?php 133 echo "\n<div id=\"channel_admin\" class=\"frame\">"; 134 echo "<h2></h2>\n"; 135 136 echo "<form id=\"admin_login\" style=\"text-align:center\" action=\"".$_SERVER['PHP_SELF'] ."\" onsubmit=\"return on_submit_login_form();\" method=\"post\">\n" 137 // ."<p>". LBL_ADMIN_LOGIN ."</p>\n" 94 echo "<form id=\"admin_login\" onsubmit=\"return loginHandler();\" 95 style=\"text-align:center\" action=\"".$_SERVER['PHP_SELF'] ."\" method=\"post\">\n" 138 96 ."<fieldset>" 97 ."<legend>" . LBL_ADMIN_LOGIN . "</legend>\n" 139 98 ."<p><label style=\"display:block\" for=\"username\">".LBL_USERNAME.":</label>\n" 140 99 ."<input type=\"text\" id=\"username\" name=\"username\" /></p>\n" -
release-branches/0.5.4/gregarius/ajax.php
r1409 r1470 120 120 121 121 // Non standard! One usually calls sajax_export() ... 122 $sajax_export_list = array("__exp__submitTag","__exp__getSideContent","__exp__getFeedContent" ,"__exp_login");122 $sajax_export_list = array("__exp__submitTag","__exp__getSideContent","__exp__getFeedContent"); 123 123 124 124 // Plugins shall export ajax functions as well … … 160 160 /// Released under GPL 161 161 162 function ajax_login(uname,pass,cb_handler) {163 x___exp_login(uname,pass, cb_handler,cb_handler);164 }165 166 function login(cb) {167 uname=document.getElementById('username').value;168 pass=hex_md5(document.getElementById('password').value);169 ajax_login(uname,pass,cb);170 }171 172 173 function minilogin_cb_handler(data) {174 tokens=data.split('|');175 if (tokens[0] != <?php echo RSS_USER_LEVEL_NOLEVEL; ?>) {176 document.getElementById('loginfo').innerHTML = ''177 + '<?php echo LBL_LOGGED_IN_AS; ?>'.replace(/%s/gi,tokens[1])178 + ' | <a href="<?php echo getPath() . "?logout\">".LBL_LOG_OUT."</a>" ?>';179 if (<?php echo (getConfig('rss.config.autologout') ? "true":"false"); ?>) {180 setRootSessionCookie('<?php echo RSS_USER_COOKIE; ?>', tokens[1]+'|'+tokens[2]);181 } else {182 setRootCookie('<?php echo RSS_USER_COOKIE; ?>', tokens[1]+'|'+tokens[2]);183 }184 document.location = document.location.href.replace(/\?logout$/, "");185 }186 }187 188 162 function miniloginform() { 189 163 span = document.getElementById('loginformcontainer'); … … 195 169 } 196 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 } 197 180 198 181 function setTags(id,tagss) { -
release-branches/0.5.4/gregarius/author.php
r1190 r1470 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); -
release-branches/0.5.4/gregarius/cls/db/ParsingQuery.class.php
r1091 r1470 116 116 unset($defineElement[$numElement]['sup']); 117 117 } 118 for($i=($key+1) ; $i<= (count($tableElement)+1) ; $i++) { 118 # FIX wrong enum parsing 119 $nb_items=count($tableElement); 120 for($i=($key+1) ; $i<= ($nb_items+1) ; $i++) { 119 121 $tabValue[1] .= ','.$tableElement[$i]; 120 122 unset($tableElement[$i]); -
release-branches/0.5.4/gregarius/cls/items.php
r1181 r1470 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 … … 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 287 ." unix_timestamp(ifnull(i.pubdate,i.added)) as ts, " 283 ." i.pubdate is not null as ispubdate, i.id, r.rating " 284 ." from ".getTable("item") ." i "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 ? " not(c.mode & ".RSS_MODE_DELETED_STATE.") and " : "") 293 297 ." not(i.unread & ".RSS_MODE_DELETED_STATE.") and "; … … 296 300 297 301 if (hidePrivate()) { 298 $ sql.= " not(i.unread & ".RSS_MODE_PRIVATE_STATE.") and ";299 } 300 301 if ($ sqlWhere) {302 $ sql.= $sqlWhere ." and ";303 } 304 $ sql.= " 1=1 ";302 $this -> _sqlActualWhere .= " not(i.unread & ".RSS_MODE_PRIVATE_STATE.") 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 $startItem, $itemCount"; 344 347 $this -> _sqlActualLimit = " $startItem, $itemCount"; 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 ?> -
release-branches/0.5.4/gregarius/cls/search.php
r1343 r1470 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 } -
release-branches/0.5.4/gregarius/cls/update.php
