Changeset 580
- Timestamp:
- 09/19/06 11:56:24 (2 years ago)
- Files:
-
- devel/htaccess-dist (modified) (2 diffs)
- devel/units/weblogs/weblogs_view.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
devel/htaccess-dist
r551 r580 52 52 RewriteRule ^([A-Za-z0-9]+)\/weblog\/?$ _weblog/index.php?weblog_name=$1 53 53 ReWriteRule ^([A-Za-z0-9]+)\/weblog\/skip=([0-9]+)$ _weblog/index.php?weblog_name=$1&weblog_offset=$2 54 RewriteRule ^([A-Za-z0-9]+)\/weblog\/([^\/]+)\/?$ _weblog/index.php?weblog_name=$1&filter=$2 55 ReWriteRule ^([A-Za-z0-9]+)\/weblog\/([^\/]+)\/skip=([0-9]+)$ _weblog/index.php?weblog_name=$1&filter=$2&weblog_offset=$3 54 56 RewriteRule ^([A-Za-z0-9]+)\/weblog\/archive\/?$ _weblog/archive.php?weblog_name=$1 55 57 RewriteRule ^([A-Za-z0-9]+)\/weblog\/archive\/([0-9]+)\/([0-9]+)\/?$ _weblog/archive_month.php?weblog_name=$1&year=$2&month=$3 … … 81 83 RewriteRule ^([A-Za-z0-9]+)\/icons\/([-0-9]+)\/([A-Za-z])\/([0-9]+)\/([A-Za-z])\/([0-9]+)\/?$ _icons/icon.php?id=$2&constraint1=$3&size1=$4&constraint2=$5&size2=$6 82 84 83 RewriteRule ^([A-Za-z0-9]+)\/calendar\/rss\/?$ _calendar/rss.php?username=$184 RewriteRule ^([A-Za-z0-9]+)\/calendar\/rss\/(.+)\/?$ _calendar/rss.php?tag=$285 RewriteRule ^([A-Za-z0-9]+)\/calendar\/([0-9]+)\.html$ _calendar/view_events.php?event_id=$286 RewriteRule ^([A-Za-z0-9]+)\/calendar\/import\/?$ _calendar/ical_import.php87 RewriteRule ^([A-Za-z0-9]+)\/calendar\/archive\/?$ _calendar/archive.php?username=$188 RewriteRule ^([A-Za-z0-9]+)\/calendar\/archive\/([0-9]+)\/([0-9]+)\/?$ _calendar/archive_month.php?username=$1&year=$2&month=$389 90 RewriteRule ^([A-Za-z0-9]+)\/calendar\/?$ _calendar/index.php?context=private91 RewriteRule ^([A-Za-z0-9]+)\/calendar\/friends\/?$ _calendar/index.php?context=friends92 RewriteRule ^([A-Za-z0-9]+)\/calendar\/communities\/?$ _calendar/index.php?context=communities93 94 85 # Some blogging clients probe Wordpress or MoveableType endpoints, 95 86 # redirect them to the Elgg xml-rpc endpoint devel/units/weblogs/weblogs_view.php
r454 r580 5 5 // Get the current profile ID 6 6 7 global $profile_id; 8 global $CFG; 7 global $profile_id, $CFG, $db; 9 8 10 9 // If the weblog offset hasn't been set, it's 0 11 10 $weblog_offset = optional_param('weblog_offset',0,PARAM_INT); 11 $filter = optional_param('filter'); 12 12 13 13 // Get all posts in the system that we can see 14 14 15 15 $where = run("users:access_level_sql_where",$_SESSION['userid']); 16 $posts = get_records_select('weblog_posts','('.$where.') AND weblog = '.$profile_id,null,'posted DESC','*',$weblog_offset,'25'); 17 $numberofposts = count_records_select('weblog_posts','('.$where.') AND weblog = '.$profile_id); 16 if (empty($filter)) { 17 $posts = get_records_select('weblog_posts','('.$where.') AND weblog = '.$profile_id,null,'posted DESC','*',$weblog_offset,'25'); 18 $numberofposts = count_records_select('weblog_posts','('.$where.') AND weblog = '.$profile_id); 19 } else { 20 $where = str_replace("access","wp.access",$where); 21 $where = str_replace("owner","wp.owner",$where); 22 $posts = get_records_sql("select * from ".$CFG->prefix."tags t join ".$CFG->prefix."weblog_posts wp on wp.ident = t.ref where ($where) AND t.tagtype = 'weblog' AND wp.weblog = $profile_id AND t.tag = " . $db->qstr($filter) . " order by posted desc limit $weblog_offset,25"); 23 $numberofposts = get_record_sql("select count(wp.ident) as numberofposts from ".$CFG->prefix."tags t join ".$CFG->prefix."weblog_posts wp on wp.ident = t.ref where ($where) AND t.tagtype = 'weblog' AND wp.weblog = $profile_id AND t.tag = " . $db->qstr($filter)); 24 $numberofposts = $numberofposts->numberofposts; 25 } 18 26 19 27 if (!empty($posts)) {
