Changeset 24
- Timestamp:
- 02/26/07 00:20:14 (23 months ago)
- Location:
- veekun
- Files:
-
- 1 removed
- 6 modified
-
lib/Vee/Controller/Forum.pm (modified) (3 diffs)
-
lib/Vee/Controller/Forum/Create.pm (modified) (1 diff)
-
templates/forum/common.tt (modified) (1 diff)
-
templates/forum/index.tt (modified) (2 diffs)
-
templates/forum/view.tt (modified) (2 diffs)
-
templates/index.tt (modified) (1 diff)
-
templates/index.tt.old (deleted)
Legend:
- Unmodified
- Added
- Removed
-
veekun/lib/Vee/Controller/Forum.pm
r23 r24 52 52 $s->{extra_css} = 'forum'; 53 53 54 $s->{announcements } = $c->model('DBIC::Threads')->search_announcements;55 $s->{forums } = $c->model('DBIC::Forums')->search(undef, { prefetch => { lastpost => 'user' } });54 $s->{announcements_rs} = $c->model('DBIC::Threads')->search_announcements; 55 $s->{forums_rs} = $c->model('DBIC::Forums')->search(undef, { prefetch => { lastpost => 'user' } }); 56 56 57 57 $s->{template} = 'forum/index.tt'; … … 80 80 $s->{crumbs} = [ '<a href="/forum">Forum Index</a>', '<a href="/forum/'.$forum->id.'">'.$forum->name.'</a>' ]; 81 81 82 $s->{announcements } = $c->model('DBIC::Threads')->search_announcements;83 $s->{forum} = $forum;84 $s->{threads } = $forum->search_related('threads', undef, {82 $s->{announcements_rs} = $c->model('DBIC::Threads')->search_announcements; 83 $s->{forum} = $forum; 84 $s->{threads_rs} = $forum->search_related('threads', undef, { 85 85 order_by => 'FIND_IN_SET("sticky", me.flags) > 0 DESC, lastpost.time DESC', 86 86 prefetch => { firstpost => 'user', lastpost => 'user' }, … … 89 89 } ); 90 90 # TODO: ugly but for now I don't know the best way to clean it up 91 $s->{threads } = $s->{threads}->search(\ 'NOT FIND_IN_SET("deleted", me.flags)') unless $c->can_i(override_thread_deleted => $forum->id);91 $s->{threads_rs} = $s->{threads_rs}->search(\ 'NOT FIND_IN_SET("deleted", me.flags)') unless $c->can_i(override_thread_deleted => $forum->id); 92 92 93 93 $s->{template} = 'forum/view.tt'; -
veekun/lib/Vee/Controller/Forum/Create.pm
r23 r24 105 105 $thread->lastpostid( $last_post->id ); 106 106 $thread->lasttime( time ); 107 $thread->update 107 $thread->update; 108 108 109 109 return $last_post; -
veekun/templates/forum/common.tt
r23 r24 59 59 <!-- show_announcements: print out the announcement list at the top of a forum page --> 60 60 61 [% BLOCK show_announcements %][%# announcements %] 62 [% RETURN UNLESS announcements %] 61 [% BLOCK show_announcements %][%# announcements_rs %] 62 [% RETURN UNLESS announcements_rs.first %] 63 [% CALL announcements_rs.reset %] 63 64 <h2>Announcements</h2> 64 65 [% INCLUDE threads_start -%] 65 [% WHILE (t = announcements .next) %]66 [% WHILE (t = announcements_rs.next) %] 66 67 [% INCLUDE threads_each thread=t show_forum=1 %] 67 68 [% END %] 68 69 [% INCLUDE threads_end %] 69 <h r/>70 <h2>Threads</h2> 70 71 [%+ END %] 71 72 -
veekun/templates/forum/index.tt
r17 r24 1 1 [% PROCESS 'forum/common.tt' %] 2 2 3 [% INCLUDE show_announcements %]3 [% INCLUDE show_announcements announcements_rs=announcements_rs %] 4 4 [% forum_flags = BLOCK %] 5 5 [% FOREACH flag IN forum.flags.split(',') %] … … 10 10 [% forum_flags %] 11 11 [% INCLUDE forums_start %] 12 [% WHILE (f = forums.next) %] 13 [% NEXT IF f.accessibility == 'hidden' AND NOT c.can_i('override_forum_hidden', f.id) %] 14 [% IF f.flags.match('header') %] 15 [% prev_header = f %] 16 [% ELSE %] 17 [% INCLUDE forums_header title=prev_header.name blurb=prev_header.blurb IF prev_header %] 18 [% INCLUDE forums_each forum=f %] 12 [% IF NOT forums_rs.first %] 13 [% INCLUDE forums_message message='Either no forums exist, or all existing forums are blocked from your view.' %] 14 [% ELSE %] 15 [% CALL forums_rs.reset %] 16 [% WHILE (f = forums_rs.next) %] 17 [% NEXT IF f.accessibility == 'hidden' AND NOT c.can_i('override_forum_hidden', f.id) %] 18 [% IF f.flags.match('header') %] 19 [% prev_header = f %] 20 [% ELSE %] 21 [% INCLUDE forums_header title=prev_header.name blurb=prev_header.blurb IF prev_header %] 22 [% INCLUDE forums_each forum=f %] 23 [% END %] 19 24 [% END %] 20 25 [% END %] 21 [% INCLUDE forums_message message='Either no forums exist, or all existing forums are blocked from your view.' UNLESS forums.size %]22 26 [% INCLUDE forums_end %] 23 27 [% forum_flags %] -
veekun/templates/forum/view.tt
r14 r24 4 4 [% IF forum.blurb %]<div class="forum-blurb">[% forum.blurb %]</div>[% END %] 5 5 [% this_pagelist = pagelist(skip, c.site_opts.page_sizes.threads, forum.threadct, c.uri('Forum', 'forum', forum.id), c.req.params); this_pagelist %] 6 [% INCLUDE show_announcements announcements =announcements %]6 [% INCLUDE show_announcements announcements_rs=announcements_rs %] 7 7 [% forum_flags = BLOCK %] 8 8 [% FOREACH flag IN forum.flags.split(',') %] … … 13 13 [% forum_flags %] 14 14 [% INCLUDE threads_start %] 15 [% WHILE (t = threads.next) %] 16 [% INCLUDE threads_each thread=t %] 15 [% IF NOT threads_rs.first %] 16 [% INCLUDE threads_message message='Either no threads exist, or all existing threads are blocked from your view.' %] 17 [% ELSE %] 18 [% CALL threads_rs.reset %] 19 [% WHILE (t = threads_rs.next) %] 20 [% INCLUDE threads_each thread=t %] 21 [% END %] 17 22 [% END %] 18 [% INCLUDE threads_message message='Either no threads exist, or all existing threads are blocked from your view.' UNLESS threads.size %]19 23 [% INCLUDE threads_end %] 20 24 [% forum_flags %] -
veekun/templates/index.tt
r21 r24 50 50 <p> Recent users: 51 51 [% now = time %] 52 [% last_user = 0 %] 52 53 [% WHILE (u = recent_users.next) %] 53 54 [%# IF NOT done_user_sep AND last_user AND last_user.lastactive < now - 600; done_user_set = 1 %] | [%# END %]
