Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 7
- Log:
Initial import of RForum 0.2 sources from a downloaded Tarball.
RForum is a Ruby On Rails based forum and mail gateway service.
- Author:
- adh
- Date:
- Sat Jul 22 18:43:13 +0100 2006
- Size:
- 1131 Bytes
1 | require 'application' |
2 | |
3 | class FeedController < ApplicationController |
4 | layout nil |
5 | |
6 | # Atom feeds |
7 | def global |
8 | limit = (@params['limit'] || 20).to_i |
9 | @posts = Post.find_latest(limit) |
10 | @with_text = (@params['with_text'].to_i == 1) |
11 | |
12 | render_feed |
13 | end |
14 | |
15 | def forum |
16 | limit = (@params['limit'] || 20).to_i |
17 | @forum = Forum.find(@params['id']) |
18 | @with_text = (@params['with_text'].to_i == 1) |
19 | |
20 | @posts = Post.find_by_sql(" |
21 | SELECT posts.* |
22 | FROM posts |
23 | LEFT JOIN topics ON posts.topic_id = topics.id |
24 | WHERE topics.forum_id = #{@forum.id.to_i} |
25 | AND posts.deleted = 0 |
26 | ORDER BY posts.created_at DESC LIMIT #{limit.to_i} |
27 | ") |
28 | |
29 | render_feed |
30 | end |
31 | |
32 | def topic |
33 | limit = (@params['limit'] || 20).to_i |
34 | @topic = Topic.find_on_conditions(@params['id'], "deleted = 0") |
35 | @posts = @topic.find_all_in_posts("deleted = 0", 'created_at DESC', limit) |
36 | |
37 | render_feed |
38 | end |
39 | |
40 | private |
41 | def render_feed |
42 | render_action 'feed' |
43 | @response.headers['Content-Type'] = 'application/atom+xml' |
44 | @modified = (@posts.sort_by {|p| p.updated_at }).reverse.first.updated_at |
45 | end |
46 | |
47 | end |