Commit 5d977951 authored by 神楽坂玲奈's avatar 神楽坂玲奈

parent 0903c20a
......@@ -58,8 +58,13 @@ class TopicsController < ApplicationController
# GET /forum/id/new
# GET /forum/id/new.xml
def new
@topic = Topic.new
#@topic = Topic.new
if params[:board_id].blank? || (@board = Board.find params[:board_id]).nil?
return render( :text => :board_not_exist )
end
#p @board
#p '---------------------------------------------'
@actions = [:new_topic]
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @topic }
......@@ -74,6 +79,7 @@ class TopicsController < ApplicationController
# POST /board/id
# POST /board/id.xml
def create
#TODO: 验证category_id有效性
@topic = Topic.new(params[:topic])
#@topic.category_id = Board.find(params[:topic][:category_id])
@topic.user = @correct_user
......
module ApplicationHelper
=begin
@@addon_stylesheet = []
@@addon_javascript = []
@@addon_top = []
@@addon_header =[]
@@addon_footer =[]
def self.addon_stylesheet
return @@addon_stylesheet
end
def self.addon_stylesheet=(val)
@@addon_stylesheet = val
end
def self.addon_javascript
return @@addon_javascript
end
def self.addon_javascript=(val)
@@addon_javascript = val
end
def self.addon_top
return @@addon_top
end
def self.addon_top=(val)
@@addon_top = val
end
def self.addon_header
return @@addon_header
end
def self.addon_header=(val)
@@addon_header = val
end
def self.addon_footer
return @@addon_footer
end
def self.addon_footer=(val)
@@addon_footer = val
end
=end
end
\ No newline at end of file
<div id="wrapper">
<div id="wrap" class="wrap s_clear">
<div class="itemtitle s_clear">
<p class="right boardcount">
......@@ -57,5 +56,4 @@
- <%=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
#encoding: UTF-8
<div id="wrapper">
<div id="wrap" class="wrap s_clear">
<div class="main">
<div class="content">
......@@ -22,7 +21,7 @@
<%= render 'layouts/pages', :count => @board.topics.count %>
<span id="visitedboards" onmouseover="$('visitedboards').id = 'visitedboardstmp';this.id = 'visitedboards';showMenu({'ctrlid':this.id})" class="pageback"><a href="index.php">返回首页</a></span>
<span class="postbtn" id="newspecial" prompt="post_newthread" onmouseover="$('newspecial').id = 'newspecialtmp';this.id = 'newspecial';showMenu({'ctrlid':this.id})"><a href="post.php?action=newthread&amp;fid=68" onclick="showWindow('newthread', this.href);return false;">发帖</a></span>
<span class="postbtn" id="newspecial" prompt="post_newthread"><%= link_to t('topic.new'), new_topic_path %></span>
</div>
......@@ -98,24 +97,24 @@
</form>
</div>
<div class="pages_btns s_clear">
<div class="pages"><strong>1</strong><a href="boarddisplay.php?fid=68&amp;page=2">2</a><a href="boarddisplay.php?fid=68&amp;page=3">3</a><a href="boarddisplay.php?fid=68&amp;page=4">4</a><a href="boarddisplay.php?fid=68&amp;page=2" class="next">下一页</a></div><span id="visitedboards" onmouseover="$('visitedboards').id = 'visitedboardstmp';this.id = 'visitedboards';showMenu({'ctrlid':this.id})" class="pageback"><a href="index.php">返回首页</a></span>
<span class="postbtn" id="newspecialtmp" onmouseover="$('newspecial').id = 'newspecialtmp';this.id = 'newspecial';showMenu({'ctrlid':this.id})"><a href="post.php?action=newthread&amp;fid=68" onclick="showWindow('newthread', this.href);return false;">发帖</a></span>
<%= render 'layouts/pages', :count => @board.topics.count %>
<span id="visitedboards" onmouseover="$('visitedboards').id = 'visitedboardstmp';this.id = 'visitedboards';showMenu({'ctrlid':this.id})" class="pageback"><a href="index.php">返回首页</a></span>
<span class="postbtn" id="newspecialtmp" ><%= link_to t('topic.new'), new_topic_path %></span>
</div>
<p id="notice"><%= notice %></p>
<%= link_to 'New Topic', new_topic_path %>
<%# fast newthread %>
<%# fast newtopic %>
<%= form_tag :controller => :topics do %>
<p>
Title: <%= text_field_tag "topic[name]" %>
<%=t 'topic.title' %><%= text_field_tag "topic[name]" %>
</p>
<p>
Content: <%= text_area_tag "post[content]" %>
<%= text_area_tag "post[content]" %>
</p>
<%= hidden_field_tag "topic[category_id]", @board.id%>
<%= hidden_field_tag "topic[category_type]", :board%>
<%= submit_tag "newthread" %>
<%= submit_tag t("topic.submit") %>
<% end %>
<dl id="onlinelist">
<dt>
......@@ -141,5 +140,4 @@
<script>$('umenu').innerHTML = '<span id="myrepeats" onmouseover="showMenu(this.id)">[切换]</span>' + $('umenu').innerHTML;</script><ul id="myrepeats_menu" class="popupmenu_popup" style="display:none;"><li class="wide" style="clear:both"><a href="plugin.php?id=myrepeats:memcp">设置马甲</a></li></ul></div>
</div><ul class="popupmenu_popup headermenu_popup" id="plugin_menu" style="display: none"> <li><a id="mn_plugin_family_family" href="plugin.php?id=family:family">家族门派</a></li>
</ul>
<ul class="popupmenu_popup headermenu_popup" id="1nNcin_menu" style="display: none"><li><a href="plugin.php?id=moodwall" hidefocus="true" >心情墙壁</a></li><li><a href="plugin.php?id=dps_medalcenter" hidefocus="true" >勋章中心</a></li><li><a href="magic.php" hidefocus="true" >道具中心</a></li><li><a href="plugin.php?id=rs_sign:sign" hidefocus="true" >每日签到</a></li><li><a href="pet.php" hidefocus="true" >口袋东方</a></li><li><a href="plugin.php?id=promotion:promotion" hidefocus="true" >宣传中心</a></li><li><a href="bank.php" hidefocus="true" >社区银行</a></li><li><a href="plugin.php?id=family:family" hidefocus="true" >家族领地</a></li></ul>
</div>
\ No newline at end of file
<ul class="popupmenu_popup headermenu_popup" id="1nNcin_menu" style="display: none"><li><a href="plugin.php?id=moodwall" hidefocus="true" >心情墙壁</a></li><li><a href="plugin.php?id=dps_medalcenter" hidefocus="true" >勋章中心</a></li><li><a href="magic.php" hidefocus="true" >道具中心</a></li><li><a href="plugin.php?id=rs_sign:sign" hidefocus="true" >每日签到</a></li><li><a href="pet.php" hidefocus="true" >口袋东方</a></li><li><a href="plugin.php?id=promotion:promotion" hidefocus="true" >宣传中心</a></li><li><a href="bank.php" hidefocus="true" >社区银行</a></li><li><a href="plugin.php?id=family:family" hidefocus="true" >家族领地</a></li></ul>
\ No newline at end of file
<%#
# To change this template, choose Tools | Templates
# and open the template in the editor.
%>
<%#
function multi($count, $perpage, $curpage, $mpurl, $maxpages = 0, $page = 10, $autogoto = TRUE, $simple = FALSE) {
global $maxpage;
$ajaxtarget = !empty($_GET['ajaxtarget']) ? " ajaxtarget=\"".dhtmlspecialchars($_GET['ajaxtarget'])."\" " : '';
$multipage = '';
$mpurl .= strpos($mpurl, '?') ? '&amp;' : '?';
$realpages = 1;
if($count > $perpage) {
$offset = 2;
$realpages = @ceil($count / $perpage);
$pages = $maxpages && $maxpages < $realpages ? $maxpages : $realpages;
if($page > $pages) {
$from = 1;
$to = $pages;
} else {
$from = $curpage - $offset;
$to = $from + $page - 1;
if($from < 1) {
$to = $curpage + 1 - $from;
$from = 1;
if($to - $from < $page) {
$to = $page;
}
} elseif($to > $pages) {
$from = $pages - $page + 1;
$to = $pages;
}
}
$multipage = ($curpage - $offset > 1 && $pages > $page ? '<a href="'.$mpurl.'page=1" class="first"'.$ajaxtarget.'>1 ...</a>' : '').
($curpage > 1 && !$simple ? '<a href="'.$mpurl.'page='.($curpage - 1).'" class="prev"'.$ajaxtarget.'>'.$lang['prev'].'</a>' : '');
for($i = $from; $i <= $to; $i++) {
$multipage .= $i == $curpage ? '<strong>'.$i.'</strong>' :
'<a href="'.$mpurl.'page='.$i.($ajaxtarget && $i == $pages && $autogoto ? '#' : '').'"'.$ajaxtarget.'>'.$i.'</a>';
}
$multipage .= ($to < $pages ? '<a href="'.$mpurl.'page='.$pages.'" class="last"'.$ajaxtarget.'>... '.$realpages.'</a>' : '').
($curpage < $pages && !$simple ? '<a href="'.$mpurl.'page='.($curpage + 1).'" class="next"'.$ajaxtarget.'>'.$lang['next'].'</a>' : '').
($showkbd && !$simple && $pages > $page && !$ajaxtarget ? '<kbd><input type="text" name="custompage" size="3" onkeydown="if(event.keyCode==13) {window.location=\''.$mpurl.'page=\'+this.value; return false;}" /></kbd>' : '');
$multipage = $multipage ? '<div class="pages">'.($showcount && !$simple ? '<em>&nbsp;'.$count.'&nbsp;</em>' : '').$multipage.'</div>' : '';
}
$maxpage = $realpages;
return $multipage;
}
%>
<% perpage = 3
curpage ||= (params[:page] || 1).to_i
if count > perpage
offset = 2;
pages = count / perpage
if 10 > pages
from = 1;
to = pages;
else
from = curpage - offset
to = from + page - 1;
if(from < 1)
to = curpage + 1 - from;
<%
perpage = 20
curpage ||= (params[:page] || 1).to_i
if count > perpage
offset = 2;
pages = (count-1) / perpage + 1
if 10 > pages
from = 1;
if(to - from < 10)
to = 10;
to = pages;
else
from = curpage - offset
to = from + page - 1;
if(from < 1)
to = curpage + 1 - from;
from = 1;
if(to - from < 10)
to = 10;
end
elsif(to > pages)
from = pages - page + 1;
to = pages
end
elsif(to > pages)
from = pages - page + 1;
to = pages
end
end
%>
<div class="pages">
<%= link_to_if curpage - offset > 1 && pages > 10, curpage, :page => 1, :class => :first %>
<%= link_to_if curpage > 1, t('forum.prev'), :page => curpage-1, :class => :prev %>
<%= link_to curpage, :page => 1, :class => :first if curpage - offset > 1 && pages > 10 %>
<%= link_to t('forum.prev'), :page => curpage-1, :class => :prev if curpage > 1 %>
<% from.upto to do |i| %>
<%= link_to_if(i != curpage, i, :page => i){"<strong>#{i}</strong>".html_safe} %>
<% end %>
<%# p to, to < pages %><%#= to %><%#= (to<pages).inspect %>
<%= link_to_if(false, "...#{pages}", :page => pages, :class => :last) %>
<%= link_to_if(false, t('forum.next'), :page => curpage+1, :class => :next) %>
<%= link_to "...#{pages}", :page => pages, :class => :last if to < pages %>
<%= link_to t('forum.next'), :page => curpage+1, :class => :next if curpage < pages %>
<!--
($showkbd && !$simple && $pages > $page && !$ajaxtarget ? '<kbd><input type="text" name="custompage" size="3" onkeydown="if(event.keyCode==13) {window.location=\''.$mpurl.'page=\'+this.value; return false;}" /></kbd>' : '');
......
......@@ -14,7 +14,9 @@
<%# ApplicationHelper::addon_top.each { |s| %>
<%#= render 'layouts/'+s %>
<%# } %>
<div id="wrapper">
<%= yield %>
</div>
<%= render 'layouts/footer' %>
<%# ApplicationHelper::addon_footer.each { |s| %>
<%#= render 'layouts/'+s %>
......
function multi($num, $perpage, $curpage, $mpurl, $maxpages = 0, $page = 10, $autogoto = TRUE, $simple = FALSE) {
global $maxpage;
$ajaxtarget = !empty($_GET['ajaxtarget']) ? " ajaxtarget=\"".dhtmlspecialchars($_GET['ajaxtarget'])."\" " : '';
if(defined('IN_ADMINCP')) {
$shownum = $showkbd = TRUE;
$lang['prev'] = '&lsaquo;&lsaquo;';
$lang['next'] = '&rsaquo;&rsaquo;';
} else {
$shownum = $showkbd = FALSE;
$lang['prev'] = '&nbsp';
$lang['next'] = $GLOBALS['dlang']['nextpage'];
}
$multipage = '';
$mpurl .= strpos($mpurl, '?') ? '&amp;' : '?';
$realpages = 1;
if($num > $perpage) {
$offset = 2;
$realpages = @ceil($num / $perpage);
$pages = $maxpages && $maxpages < $realpages ? $maxpages : $realpages;
if($page > $pages) {
$from = 1;
$to = $pages;
} else {
$from = $curpage - $offset;
$to = $from + $page - 1;
if($from < 1) {
$to = $curpage + 1 - $from;
$from = 1;
if($to - $from < $page) {
$to = $page;
}
} elseif($to > $pages) {
$from = $pages - $page + 1;
$to = $pages;
}
}
$multipage = ($curpage - $offset > 1 && $pages > $page ? '<a href="'.$mpurl.'page=1" class="first"'.$ajaxtarget.'>1 ...</a>' : '').
($curpage > 1 && !$simple ? '<a href="'.$mpurl.'page='.($curpage - 1).'" class="prev"'.$ajaxtarget.'>'.$lang['prev'].'</a>' : '');
for($i = $from; $i <= $to; $i++) {
$multipage .= $i == $curpage ? '<strong>'.$i.'</strong>' :
'<a href="'.$mpurl.'page='.$i.($ajaxtarget && $i == $pages && $autogoto ? '#' : '').'"'.$ajaxtarget.'>'.$i.'</a>';
}
$multipage .= ($to < $pages ? '<a href="'.$mpurl.'page='.$pages.'" class="last"'.$ajaxtarget.'>... '.$realpages.'</a>' : '').
($curpage < $pages && !$simple ? '<a href="'.$mpurl.'page='.($curpage + 1).'" class="next"'.$ajaxtarget.'>'.$lang['next'].'</a>' : '').
($showkbd && !$simple && $pages > $page && !$ajaxtarget ? '<kbd><input type="text" name="custompage" size="3" onkeydown="if(event.keyCode==13) {window.location=\''.$mpurl.'page=\'+this.value; return false;}" /></kbd>' : '');
$multipage = $multipage ? '<div class="pages">'.($shownum && !$simple ? '<em>&nbsp;'.$num.'&nbsp;</em>' : '').$multipage.'</div>' : '';
}
$maxpage = $realpages;
return $multipage;
}
<h1>New topic</h1>
<%= render 'form' %>
<%= link_to 'Back', topics_path %>
<%= form_tag :controller => :topics do %>
<p>
<%= @board.id %>
<%=t 'topic.title' %><%= text_field_tag "topic[name]" %>
</p>
<p>
<%= text_area_tag "post[content]" %>
</p>
<%= hidden_field_tag "topic[category_id]", @board.id %>
<%= hidden_field_tag "topic[category_type]", :board %>
<%= submit_tag t("topic.submit") %>
<% end %>
\ No newline at end of file
<div id="wrapper">
<ul class="popupmenu_popup headermenu_popup inlinelist" id="modopt_menu" style="width: 180px; display: none"><li class="wide"><a href="javascript:;" onclick="modthreads(3, 'delete')">删除主题</a></li><li class="wide"><a href="javascript:;" onclick="modthreads(3, 'down')">提升下沉</a></li><li class="wide"><a href="javascript:;" onclick="modthreads(1, 'stick')">主题置顶</a></li><li class="wide"><a href="javascript:;" onclick="modthreads(1, 'highlight')">高亮显示</a></li><li class="wide"><a href="javascript:;" onclick="modthreads(1, 'digest')">设置精华</a></li><li class="wide"><a href="javascript:;" onclick="modaction('stamp')">主题鉴定</a></li><li class="wide"><a href="javascript:;" onclick="modthreads(4)">关闭打开</a></li><li class="wide"><a href="javascript:;" onclick="modthreads(2, 'move')">移动主题</a></li><li class="wide"><a href="javascript:;" onclick="modthreads(2, 'type')">主题分类</a></li><li class="wide"><a href="javascript:;" onclick="modaction('copy')">复制主题</a></li><li class="wide"><a href="javascript:;" onclick="modaction('merge')">合并主题</a></li><li class="wide"><a href="javascript:;" onclick="modaction('split')">分割主题</a></li><li class="wide"><a href="javascript:;" onclick="modaction('repair')">修复主题</a></li><li class="wide"><a href="plugin.php?id=dps_postawards:postawards&amp;tid=29727" onclick="showWindow('paward', this.href);return false;">楼层奖惩</a></li></ul>
<div id="modlayer" style="display:none;position:position;width:165px;">
<span>选中</span><strong id="modcount"></strong><span>篇: </span>
......@@ -234,5 +233,4 @@
</div>
<div id="ad_footerbanner1"></div><div id="ad_footerbanner2"></div><div id="ad_footerbanner3"></div>
<script>$('umenu').innerHTML = '<span id="myrepeats" onmouseover="showMenu(this.id)">[切换]</span>' + $('umenu').innerHTML;</script><ul id="myrepeats_menu" class="popupmenu_popup" style="display:none;"><li class="wide"><a href="plugin.php?id=myrepeats:switch&amp;username=%B2%A4%C2%DC%B0%FC">菠萝包</a></li><li class="wide" style="clear:both"><a href="plugin.php?id=myrepeats:memcp">设置马甲</a></li></ul></div>
</div>
\ No newline at end of file
<script>$('umenu').innerHTML = '<span id="myrepeats" onmouseover="showMenu(this.id)">[切换]</span>' + $('umenu').innerHTML;</script><ul id="myrepeats_menu" class="popupmenu_popup" style="display:none;"><li class="wide"><a href="plugin.php?id=myrepeats:switch&amp;username=%B2%A4%C2%DC%B0%FC">菠萝包</a></li><li class="wide" style="clear:both"><a href="plugin.php?id=myrepeats:memcp">设置马甲</a></li></ul></div>
\ No newline at end of file
......@@ -13,12 +13,15 @@ zh-CN:
navi:
forum: "论坛"
topic:
new: "发帖"
title: "标题"
submit: "提交"
order: "排序"
displayorder: "置顶"
digest: "精华"
user_name: "作者"
view_num: "查看"
reply_num: "回复"
view_num: "查看"
reply_num: "回复"
post_last: "最后回复"
created_at: "发表时间"
updated_at: "回复时间"
......
This diff is collapsed.
1100
\ No newline at end of file
1136
\ 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