Ticket #263: 263.patch
| File 263.patch, 9.1 kB (added by kdz13, 3 years ago) |
|---|
-
dbstruct.sql
119 119 insert into config (key_,value_,default_,type_,desc_,export_) values ("rss.config.ajaxparallelsize",'3','3','num','Sets the number of feeds to update in parallel. Remember to set rss.config.serverpush to false.',NULL); 120 120 insert into config (key_,value_,default_,type_,desc_,export_) values ("rss.config.ajaxbatchsize",'3','3','num','Sets the number of feeds in a batch when using the ajax updater. Remember to set rss.config.serverpush to false.',NULL); 121 121 insert into config (key_,value_,default_,type_,desc_,export_) values ("rss.config.defaultdashboard", '1', '1','boolean','If the first page seen when entering the admin section should be the dashboard',NULL); 122 insert into config (key_,value_,default_,type_,desc_,export_) values ("rss.output.nav.unread", 'false', 'false','boolean','If the navigation hints on the feeds page should go to the next feed with unread items. If false, it simply goes to the next feed.',NULL); 122 123 123 124 DROP TABLE IF EXISTS `tag`; 124 125 CREATE TABLE `tag` ( -
schema.php
383 383 "rss.output.title" => array('Gregarius','Gregarius','string','Sets the title of this feedreader.',NULL), 384 384 "rss.config.ajaxparallelsize" => array('3','3','num','Sets the number of feeds to update in parallel. Remember to set rss.config.serverpush to false.',NULL), 385 385 "rss.config.ajaxbatchsize" => array('3','3','num','Sets the number of feeds in a batch when using the ajax updater. Remember to set rss.config.serverpush to false.',NULL), 386 "rss.config.defaultdashboard" => array('true','true','boolean','If the first page seen when entering the admin section should be the dashboard',NULL) 386 "rss.config.defaultdashboard" => array('true','true','boolean','If the first page seen when entering the admin section should be the dashboard',NULL), 387 "rss.output.nav.unread" => array('false','false','boolean','If the navigation hints on the feeds page should go to the next feed with unread items. If false, it simply goes to the next feed.',NULL) 387 388 ); 388 389 389 390 -
feed.php
840 840 } elseif (strlen($lbl) > 40) { 841 841 $lbl = substr($lbl,0,37) . "..."; 842 842 } 843 $readMoreNav .= "<a href=\"".$prev['url']."\" class=\"fl\">".LBL_NAV_PREV_PREFIX ."$lbl</a>\n"; 843 $readMoreNav .= "<a href=\"".$prev['url']."\" class=\"fl\">".LBL_NAV_PREV_PREFIX . $lbl; 844 if( array_key_exists( 'unread', $prev ) && $prev['unread'] ) { 845 $readMoreNav .= " (" . $prev['unread'] . " " . LBL_UNREAD . ")"; 846 } 847 $readMoreNav .= "</a>\n"; 844 848 } 845 849 846 850 if($succ != null) { … … 850 854 } elseif (strlen($lbl) > 40) { 851 855 $lbl = substr($lbl,0,37) . "..."; 852 856 } 853 $readMoreNav .= "<a href=\"".$succ['url']."\" class=\"fr\">$lbl".LBL_NAV_SUCC_POSTFIX."</a>\n"; 857 $readMoreNav .= "<a href=\"".$succ['url']."\" class=\"fr\">$lbl"; 858 if( array_key_exists( 'unread', $succ ) && $succ['unread'] ) { 859 $readMoreNav .= " (" . $succ['unread'] . " " . LBL_UNREAD . ")"; 860 } 861 $readMoreNav .= LBL_NAV_SUCC_POSTFIX."</a>\n"; 854 862 } 855 863 856 864 if ($readMoreNav != "") { … … 1144 1152 case 'feed': 1145 1153 1146 1154 $sql = "select " 1147 ." c.id, c.title " 1148 ." from " 1149 .getTable("channels") ." c, " 1150 . getTable("folders") ." d " 1151 ." where d.id = c.parent "; 1155 ." c.id, c.title"; 1156 if (getConfig('rss.output.nav.unread') ) { 1157 $sql .= ", count(i.id) as unreadCount "; 1158 } else { 1159 $sql .= ", 0"; 1160 } 1161 $sql .= " from " 1162 .getTable("folders") ." d, " 1163 .getTable("channels") ." c "; 1164 if (getConfig('rss.output.nav.unread') ) { 1165 $sql .= " left outer join " . getTable('item') . " i on i.cid=c.id "; 1166 } 1167 $sqlwhere = " where d.id = c.parent"; 1152 1168 1153 1154 1169 if (hidePrivate()) { 1155 $sql .=" and not(c.mode & " . RSS_MODE_PRIVATE_STATE .") "; 1170 $sqlwhere .=" and not(c.mode & " . RSS_MODE_PRIVATE_STATE .") "; 1171 if (getConfig('rss.output.nav.unread') ) { 1172 $sql .= " and not (i.unread & " . RSS_MODE_PRIVATE_STATE . ") "; 1173 } 1156 1174 } 1157 $sql .= " and not(c.mode & " . RSS_MODE_DELETED_STATE .") "; 1175 $sqlwhere .= " and not(c.mode & " . RSS_MODE_DELETED_STATE .") "; 1176 if (getConfig('rss.output.nav.unread') ) { 1177 $sql .= " and (i.unread & ".RSS_MODE_UNREAD_STATE . ") and not (i.unread & " .RSS_MODE_DELETED_STATE . ") "; 1178 } 1179 if (getConfig('rss.output.nav.unread') ) { 1180 $sqlwhere .= " group by i.cid"; 1181 } 1158 1182 1159 1183 if (getConfig('rss.config.absoluteordering')) { 1160 $sql .=" order by d.position asc, c.position asc";1184 $sqlwhere .=" order by d.position asc, c.position asc"; 1161 1185 } else { 1162 $sql .=" order by d.name asc, c.title asc";1186 $sqlwhere .=" order by d.name asc, c.title asc"; 1163 1187 } 1164 1188 1165 1166 $res = rss_query($sql); 1189 $res = rss_query($sql.$sqlwhere); 1167 1190 $pcid = $ptitile = null; 1168 $cid name=array();1191 $ciddata=array(); 1169 1192 $cids=array(); 1170 while (list ($cid_,$title_ )=rss_fetch_row($res)) {1193 while (list ($cid_,$title_,$unread_)=rss_fetch_row($res)) { 1171 1194 $cids[]=$cid_; 1172 $cid name[]=array($cid_,$title_);1195 $ciddata[]=array($cid_,$title_,$unread_); 1173 1196 } 1174 1197 $key = array_search($cid,$cids); 1175 1198 if ($key !== NULL && $key !== FALSE) { 1176 //echo "$key " .count($cidname); 1177 if ($key+1 < count($cidname)) { 1178 list($cid_,$title_) = $cidname[$key+1]; 1199 //echo "$key " .count($ciddata); 1200 $succkey = $key + 1; 1201 $prevkey = $key - 1; 1202 while ($succkey < count($ciddata)) { 1203 list($cid_,$title_,$unread_) = $ciddata[$succkey]; 1204 if (getConfig('rss.output.nav.unread') ) { 1205 if( !$unread_ ) { 1206 if( $succkey + 1 < count($ciddata) ) { 1207 $succkey++; 1208 continue; 1209 } 1210 else { 1211 $succkey = $key + 1; //no more feeds, we'll just use the regular "next" one 1212 } 1213 } 1214 } 1215 1179 1216 $succ = array( 1180 1217 'url' => getPath(). 1181 1218 ( getConfig('rss.output.usemodrewrite') ? 1182 1219 preg_replace("/[^A-Za-z0-9\.]/","_",$title_) ."/" 1183 1220 :"feed.php?channel=$cid_") , 1184 'lbl' => htmlentities( $title_,ENT_COMPAT,"UTF-8" ) 1221 'lbl' => htmlentities( $title_,ENT_COMPAT,"UTF-8" ) , 1222 'unread' => $unread_ 1185 1223 ); 1224 break; 1186 1225 } 1187 if ($key > 0) { 1188 list($cid_,$title_) = $cidname[$key-1]; 1226 while ($prevkey >= 0) { 1227 list($cid_,$title_,$unread_) = $ciddata[$prevkey]; 1228 if (getConfig('rss.output.nav.unread') ) { 1229 if( !$unread_ ) { 1230 if( $prevkey > 0 ) { 1231 $prevkey--; 1232 continue; 1233 } 1234 else { 1235 $prevkey = $key - 1; //no more feeds, we'll just use the regular "previous" one 1236 } 1237 } 1238 } 1239 1189 1240 $prev = array( 1190 1241 'url' => getPath(). 1191 1242 ( getConfig('rss.output.usemodrewrite') ? 1192 1243 preg_replace("/[^A-Za-z0-9\.]/","_",$title_) ."/" 1193 1244 :"feed.php?channel=$cid_") , 1194 'lbl' => htmlentities( $title_,ENT_COMPAT,"UTF-8" ) 1245 'lbl' => htmlentities( $title_,ENT_COMPAT,"UTF-8" ) , 1246 'unread' => $unread_ 1195 1247 ); 1248 break; 1196 1249 } 1197 1250 1198 1251 }
