Commit cdc04ecf authored by 神楽坂玲奈's avatar 神楽坂玲奈

帖子内容页 初步

git-svn-id: http://glupx.googlecode.com/svn/trunk/Reliz@37 189f022a-1064-8ae2-3e6f-c4a67275c50b
parent 4885581b
......@@ -6,7 +6,7 @@ class BoardsController < ApplicationController
# GET /boards.xml
def index
@boards = Board.all#[Board.find(1)]#_all_by_id 1
@actions = [:forum]
@actions = []
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @boards }
......@@ -18,7 +18,7 @@ class BoardsController < ApplicationController
def show
@page = params[:page] && !params[:page].empty? ? params[:page].to_i : 1
@board = Board.find(params[:id])
@actions = [:board, @board]
@actions = [@board]
@topics = @board.topics.all(:offset => 20*@page-20, :limit => 20, :order => [:displayorder, :id])
respond_to do |format|
format.html # show.html.erb
......
......@@ -43,11 +43,13 @@ class PostsController < ApplicationController
# POST /posts
# POST /posts.xml
def create
@post = Post.new(params[:post])
@post.topic = Topic.find params[:post][:topic_id]
if !@topic or @topic.locked
respond_to do |format|
format.html{ redirect_to(@post.topic, :notice => 'Can\'t Reply.') }
format.xml{ render :xml => @post, :status => :unprocessable_entity}
end
return
end
......@@ -71,7 +73,7 @@ class PostsController < ApplicationController
respond_to do |format|
if @post.update_attributes(params[:post])
format.html { redirect_to(@post, :notice => 'Post was successfully updated.') }
format.html { redirect_to(@post.topic, :notice => 'Post was successfully updated.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
......
......@@ -2,4 +2,20 @@ class Post < ActiveRecord::Base
belongs_to :topic
belongs_to :user
has_many :comments
def self.today
#now = Time.now
# today = Time.mktime(now.year)
Post.where(['created_at > ?', Date.today ])
end
def self.yesterday
Post.where(['created_at > ? & created_at <? ', Date.today-1, Date.today ])
#Posts.find(:all, :conditions => ["DATE(created_at) = ?", Date.today-1]
end
#Today
#Posts.find(:all, :conditions => ["DATE(created_at) = ?", ]
#Yesterday
#end
end
<div id="wrapper">
<div id="wrap" class="wrap s_clear">
<div class="itemtitle s_clear">
<p class="right boardcount">
today: <em>395</em>, yesterday: <em>1990</em>, user: <em>12050</em>
<%=t 'datetime.today' %>: <em><%= Post.today.count %> </em>,
<%=t 'datetime.yesterday' %>: <em><%= Post.yesterday.count %></em>
</p>
<ul>
<li class="current"><a href="index.php?op=classics"><span>board</span></a></li>
<li><a href="index.php?op=feeds"><span>dt</span></a></li>
</ul></div><div class="mainbox list">
</div><div class="mainbox list">
<span class="headactions">
<img id="category_3_img" src="images/default/collapsed_no.gif" title="sq/zk" alt="sq/zk" onclick="toggle_collapse('category_3');" />
</span>
......@@ -30,7 +30,7 @@ today: <em>395</em>, yesterday: <em>1990</em>, user: <em>12050</em>
<td class="boardlast">
<% if board.topics.last %>
<p><%= board.topics.last %></p>
<cite><%= board.posts.last.user %> - <span title="<%= board.posts.last.updated_at %>"><%= board.posts.last.updated_at %></span></cite>
<cite><%= board.posts.last.user %> - <span title="<%= board.posts.last.updated_at %>"><%=l board.posts.last.updated_at, :format => :short %></span></cite>
<% else %>
none
<% end %>
......@@ -53,8 +53,9 @@ today: <em>395</em>, yesterday: <em>1990</em>, user: <em>12050</em>
<span class="headactions"><a href="index.php?showoldetails=yes#online" class="nobdr"><img src="images/default/collapsed_yes.gif" alt="" /></a></span>
<h3>
<strong><a href="member.php?action=online">onlineuser</a></strong>
- total <em>236</em>
- high <em>527</em> at <em>2010-11-21</em>.
<strong><%=t 'stat.onlineuser' %></strong>
- <%=t 'stat.total' %> <em>0</em>
- <%=t 'stat.max' %> <em>0</em> <%=t 'stat.at' %> <em><%=l Time.now, :format => :long %> </em>.
</h3>
</div>
</div>
\ No newline at end of file
<div id="footer">
<div class="footerc">
<div style="margin: 0 auto; width: 160px; padding-top: 5px; text-align: center;">
<a href="javascript:;" onclick="scrollTo(0,0);">TOP</a>
......@@ -8,13 +9,11 @@
<li style="width: 100px;"><a href="http://www.touhou.cc/bbs" target="_blank">东方幻想乡</a></li>
<li style="width: 130px;">( <a href="http://www.miibeian.gov.cn/" target="_blank">渝ICP备09028990号</a>)</li><li><a href="mailto:175779871@qq.com">联系我们</a></li>
<li><a href="stats.php">论坛统计</a></li><li><a href="archiver/" target="_blank">Archiver</a></li><li><a href="wap/" target="_blank">WAP</a></li><li></li>
</ul>
<div style="height: 16px; clear: both;">Copyright &copy; 2008-2009 <a href="http://www.touhou.cc/bbs" target="_blank">东方幻想乡</a></strong>. All Rights Reserved. Themes <a href="http://bbs.7dps.com/forum-29-1.html" target="_blank">Goodnight</a> For discuz! 7.2<br />CSS Modify By <a href="http://www.touhou.cc/bbs/?fromuid=6" target="_blank">菠萝包</a><span id="debuginfo">Processed in 0.025061 second(s), 6 queries</span>.</div>
<div style="height: 16px; clear: both;">Copyright © 2008-2009 <a href="http://www.touhou.cc/bbs" target="_blank">东方幻想乡</a>. All Rights Reserved. Themes <a href="http://bbs.7dps.com/forum-29-1.html" target="_blank">Goodnight</a> For discuz! 7.2<br>CSS Modify By <a href="http://www.touhou.cc/bbs/?fromuid=6" target="_blank">菠萝包</a><span id="debuginfo">Processed in 0.046812 second(s), 11 queries</span>.</div>
</div>
<div class="bhoge">Powered by:</div>
<div class="bw3c">Validated by:</div>
<div class="bexa">CSS Modify By:</div></div>
......
<meta name="keywords" content="东方幻想乡,动漫,东方,东方project,同人,音乐,游戏,漫画,汉化,THDOTS,THBOSS,东方轮舞" />
<meta name="description" content=" 东方幻想乡 这减速到死怎么打……求破 - Discuz! Board" />
<meta name="generator" content="Discuz! 7.2" />
<meta name="author" content="Discuz! Team and Comsenz UI Team" />
<meta name="copyright" content="2001-2009 Comsenz Inc." />
<meta name="MSSmartTagsPreventParsing" content="True" />
<meta http-equiv="MSThemeCompatible" content="Yes" />
<meta http-equiv="x-ua-compatible" content="ie=7" />
<link rel="archives" title="东方幻想乡" href="http://www.touhou.cc/bbs/archiver/" />
<link rel="alternate" type="application/rss+xml" title="东方幻想乡 - 同人企画专题" href="http://www.touhou.cc/bbs/rss.php?fid=68&amp;auth=80baas4p%2BS%2FNnT%2BlQanrr%2Blzuk13j9xswULkRK6FhUrlnnrhZxiBsSc%2FwKk" />
<link rel="stylesheet" type="text/css" href="forumdata/cache/style_57_common.css?kNu" /><link rel="stylesheet" type="text/css" href="forumdata/cache/scriptstyle_57_forumdisplay.css?kNu" />
<link rel="stylesheet" type="text/css" href="forumdata/cache/scriptstyle_60_viewthread.css?FT7" />
<script type="text/javascript">var STYLEID = '57', IMGDIR = 'images/default', VERHASH = 'kNu', charset = 'gbk', discuz_uid = 359, cookiedomain = '', cookiepath = '/', attackevasive = '0', disallowfloat = 'login|register', creditnotice = '1|点数|,2|威望|,3|经验|,4|推广|,5|贡献|,6|人气|,7|人品|', gid = parseInt('3'), fid = parseInt('68'), tid = parseInt('0')</script>
<script src="forumdata/cache/common.js?kNu" type="text/javascript"></script>
<script src="LinkTalk-Application/app-host.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="forumdata/cache/style_57_common.css?qfY" /><link rel="stylesheet" type="text/css" href="forumdata/cache/scriptstyle_57_viewthread.css?qfY" />
<link href="forumdata/cache/style_57_moderator.css?1Yf" rel="stylesheet" type="text/css" />
<script type="text/javascript">var STYLEID = '57', IMGDIR = 'images/default', VERHASH = 'qfY', charset = 'gbk', discuz_uid = 359, cookiedomain = '', cookiepath = '/', attackevasive = '0', disallowfloat = 'login|register', creditnotice = '1|点数|,2|威望|,3|经验|,4|推广|,5|贡献|,6|人气|,7|人品|', gid = parseInt('1'), fid = parseInt('2'), tid = parseInt('29727')</script>
<script src="forumdata/cache/common.js?qfY" type="text/javascript"></script>
<script src="LinkTalk-Application/app-host.js" type="text/javascript"></script>
\ No newline at end of file
......@@ -42,7 +42,11 @@
<div class="bg-dmenu" style="position: relative;">
<div id="menu">
<ul>
<li class="menu_1"><a href="index.php" hidefocus="true" id="mn_index">forum</a></li><li class="menu_7"><a href="../blog" hidefocus="true" id="mn_blog">a</a></li><li class="menu_2"><a href="search.php" hidefocus="true" id="mn_search">b</a></li><li class="menu_5"><a href="misc.php?action=nav" hidefocus="true" onclick="showWindow('nav', this.href);return false;">c</a></li><li class="menu_8" id="LQBpFL" onmouseover="showMenu({'ctrlid':this.id})"><a href="#" hidefocus="true" class="dropmenu">d</a></li><li class="menu_25"><a href="plugin.php?id=family:family" hidefocus="true" id="mn_plugin_1">e</a></li><li class="menu_11"><a href="music.html" hidefocus="true" id="mn_music">f</a></li></ul>
<li class="menu_1"><%=link_to t('navi.forum'), :root, :hidefocus => true, :id => :mn_index %></li>
</ul>
<script type="text/javascript">
var currentMenu = $('mn_index') ? $('mn_index') : $('mn_index');
currentMenu.parentNode.className = 'current';
......@@ -69,7 +73,7 @@ location.href = 'index.php?' + str;
</div>
<div id="wrapper"><div id="nav">
<div id="nav">
<%= @site %>
<% @actions.each do |action| %>
&raquo; <%= action %>
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title> <%= @site.name %> - <%= @actions.last.respond_to?(:name) ? @actions.last.name : @actions.last %> </title>
<title> <%= @site.name %><% if !@actions.empty? %> - <%= @actions.last.respond_to?(:name) ? @actions.last.name : @actions.last %> <% end %> </title>
<%= render 'layouts/header' %>
<%# ApplicationHelper::addon_header.each { |s| %>
......
This diff is collapsed.
......@@ -2,6 +2,13 @@
# by tsechingho (http://github.com/tsechingho)
zh-CN:
stat:
onlineuser: "在线人数"
total: "总计"
max: "最高"
at: "于"
navi:
forum: "论坛"
topic:
order: "排序"
displayorder: "置顶"
......@@ -18,7 +25,8 @@ zh-CN:
digest: "精华"
lock: "锁定"
highlight: "高亮"
post:
edit: "编辑"
date:
formats:
......@@ -43,6 +51,10 @@ zh-CN:
pm: "下午"
datetime:
today: "今日"
yesterday: "昨日"
distance_in_words:
half_a_minute: "半分钟"
less_than_x_seconds:
......
This diff is collapsed.
4864
\ No newline at end of file
6376
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment