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

喵的初代

git-svn-id: http://glupx.googlecode.com/svn/trunk/Reliz@29 189f022a-1064-8ae2-3e6f-c4a67275c50b
parent 79ba866f
source 'http://rubygems.org'
gem 'rails', '3.0.3'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
# gem 'ruby-debug'
# gem 'ruby-debug19'
# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'
# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
# group :development, :test do
# gem 'webrat'
# end
GEM
remote: http://rubygems.org/
specs:
abstract (1.0.0)
actionmailer (3.0.3)
actionpack (= 3.0.3)
mail (~> 2.2.9)
actionpack (3.0.3)
activemodel (= 3.0.3)
activesupport (= 3.0.3)
builder (~> 2.1.2)
erubis (~> 2.6.6)
i18n (~> 0.4)
rack (~> 1.2.1)
rack-mount (~> 0.6.13)
rack-test (~> 0.5.6)
tzinfo (~> 0.3.23)
activemodel (3.0.3)
activesupport (= 3.0.3)
builder (~> 2.1.2)
i18n (~> 0.4)
activerecord (3.0.3)
activemodel (= 3.0.3)
activesupport (= 3.0.3)
arel (~> 2.0.2)
tzinfo (~> 0.3.23)
activeresource (3.0.3)
activemodel (= 3.0.3)
activesupport (= 3.0.3)
activesupport (3.0.3)
arel (2.0.6)
builder (2.1.2)
erubis (2.6.6)
abstract (>= 1.0.0)
i18n (0.5.0)
mail (2.2.12)
activesupport (>= 2.3.6)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.16)
mysql (2.8.1-x86-mingw32)
mysql (2.8.1-x86-mswin32)
polyglot (0.3.1)
rack (1.2.1)
rack-mount (0.6.13)
rack (>= 1.0.0)
rack-test (0.5.6)
rack (>= 1.0)
rails (3.0.3)
actionmailer (= 3.0.3)
actionpack (= 3.0.3)
activerecord (= 3.0.3)
activeresource (= 3.0.3)
activesupport (= 3.0.3)
bundler (~> 1.0)
railties (= 3.0.3)
railties (3.0.3)
actionpack (= 3.0.3)
activesupport (= 3.0.3)
rake (>= 0.8.7)
thor (~> 0.14.4)
rake (0.8.7)
thor (0.14.6)
treetop (1.4.9)
polyglot (>= 0.3.1)
tzinfo (0.3.23)
PLATFORMS
x86-mingw32
x86-mswin32
DEPENDENCIES
mysql
rails (= 3.0.3)
== Welcome to Rails
Rails is a web-application framework that includes everything needed to create
database-backed web applications according to the Model-View-Control pattern.
This pattern splits the view (also called the presentation) into "dumb"
templates that are primarily responsible for inserting pre-built data in between
HTML tags. The model contains the "smart" domain objects (such as Account,
Product, Person, Post) that holds all the business logic and knows how to
persist themselves to a database. The controller handles the incoming requests
(such as Save New Account, Update Product, Show Post) by manipulating the model
and directing data to the view.
In Rails, the model is handled by what's called an object-relational mapping
layer entitled Active Record. This layer allows you to present the data from
database rows as objects and embellish these data objects with business logic
methods. You can read more about Active Record in
link:files/vendor/rails/activerecord/README.html.
The controller and view are handled by the Action Pack, which handles both
layers by its two parts: Action View and Action Controller. These two layers
are bundled in a single package due to their heavy interdependence. This is
unlike the relationship between the Active Record and Action Pack that is much
more separate. Each of these packages can be used independently outside of
Rails. You can read more about Action Pack in
link:files/vendor/rails/actionpack/README.html.
== Getting Started
1. At the command prompt, create a new Rails application:
<tt>rails new myapp</tt> (where <tt>myapp</tt> is the application name)
2. Change directory to <tt>myapp</tt> and start the web server:
<tt>cd myapp; rails server</tt> (run with --help for options)
3. Go to http://localhost:3000/ and you'll see:
"Welcome aboard: You're riding Ruby on Rails!"
4. Follow the guidelines to start developing your application. You can find
the following resources handy:
* The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html
* Ruby on Rails Tutorial Book: http://www.railstutorial.org/
== Debugging Rails
Sometimes your application goes wrong. Fortunately there are a lot of tools that
will help you debug it and get it back on the rails.
First area to check is the application log files. Have "tail -f" commands
running on the server.log and development.log. Rails will automatically display
debugging and runtime information to these files. Debugging info will also be
shown in the browser on requests from 127.0.0.1.
You can also log your own messages directly into the log file from your code
using the Ruby logger class from inside your controllers. Example:
class WeblogController < ActionController::Base
def destroy
@weblog = Weblog.find(params[:id])
@weblog.destroy
logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
end
end
The result will be a message in your log file along the lines of:
Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1!
More information on how to use the logger is at http://www.ruby-doc.org/core/
Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are
several books available online as well:
* Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe)
* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
These two books will bring you up to speed on the Ruby language and also on
programming in general.
== Debugger
Debugger support is available through the debugger command when you start your
Mongrel or WEBrick server with --debugger. This means that you can break out of
execution at any point in the code, investigate and change the model, and then,
resume execution! You need to install ruby-debug to run the server in debugging
mode. With gems, use <tt>sudo gem install ruby-debug</tt>. Example:
class WeblogController < ActionController::Base
def index
@posts = Post.find(:all)
debugger
end
end
So the controller will accept the action, run the first line, then present you
with a IRB prompt in the server window. Here you can do things like:
>> @posts.inspect
=> "[#<Post:0x14a6be8
@attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>,
#<Post:0x14a6620
@attributes={"title"=>"Rails", "body"=>"Only ten..", "id"=>"2"}>]"
>> @posts.first.title = "hello from a debugger"
=> "hello from a debugger"
...and even better, you can examine how your runtime objects actually work:
>> f = @posts.first
=> #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
>> f.
Display all 152 possibilities? (y or n)
Finally, when you're ready to resume execution, you can enter "cont".
== Console
The console is a Ruby shell, which allows you to interact with your
application's domain model. Here you'll have all parts of the application
configured, just like it is when the application is running. You can inspect
domain models, change values, and save to the database. Starting the script
without arguments will launch it in the development environment.
To start the console, run <tt>rails console</tt> from the application
directory.
Options:
* Passing the <tt>-s, --sandbox</tt> argument will rollback any modifications
made to the database.
* Passing an environment name as an argument will load the corresponding
environment. Example: <tt>rails console production</tt>.
To reload your controllers and models after launching the console run
<tt>reload!</tt>
More information about irb can be found at:
link:http://www.rubycentral.com/pickaxe/irb.html
== dbconsole
You can go to the command line of your database directly through <tt>rails
dbconsole</tt>. You would be connected to the database with the credentials
defined in database.yml. Starting the script without arguments will connect you
to the development database. Passing an argument will connect you to a different
database, like <tt>rails dbconsole production</tt>. Currently works for MySQL,
PostgreSQL and SQLite 3.
== Description of Contents
The default directory structure of a generated Ruby on Rails application:
|-- app
| |-- controllers
| |-- helpers
| |-- mailers
| |-- models
| `-- views
| `-- layouts
|-- config
| |-- environments
| |-- initializers
| `-- locales
|-- db
|-- doc
|-- lib
| `-- tasks
|-- log
|-- public
| |-- images
| |-- javascripts
| `-- stylesheets
|-- script
|-- test
| |-- fixtures
| |-- functional
| |-- integration
| |-- performance
| `-- unit
|-- tmp
| |-- cache
| |-- pids
| |-- sessions
| `-- sockets
`-- vendor
`-- plugins
app
Holds all the code that's specific to this particular application.
app/controllers
Holds controllers that should be named like weblogs_controller.rb for
automated URL mapping. All controllers should descend from
ApplicationController which itself descends from ActionController::Base.
app/models
Holds models that should be named like post.rb. Models descend from
ActiveRecord::Base by default.
app/views
Holds the template files for the view that should be named like
weblogs/index.html.erb for the WeblogsController#index action. All views use
eRuby syntax by default.
app/views/layouts
Holds the template files for layouts to be used with views. This models the
common header/footer method of wrapping views. In your views, define a layout
using the <tt>layout :default</tt> and create a file named default.html.erb.
Inside default.html.erb, call <% yield %> to render the view using this
layout.
app/helpers
Holds view helpers that should be named like weblogs_helper.rb. These are
generated for you automatically when using generators for controllers.
Helpers can be used to wrap functionality for your views into methods.
config
Configuration files for the Rails environment, the routing map, the database,
and other dependencies.
db
Contains the database schema in schema.rb. db/migrate contains all the
sequence of Migrations for your schema.
doc
This directory is where your application documentation will be stored when
generated using <tt>rake doc:app</tt>
lib
Application specific libraries. Basically, any kind of custom code that
doesn't belong under controllers, models, or helpers. This directory is in
the load path.
public
The directory available for the web server. Contains subdirectories for
images, stylesheets, and javascripts. Also contains the dispatchers and the
default HTML files. This should be set as the DOCUMENT_ROOT of your web
server.
script
Helper scripts for automation and generation.
test
Unit and functional tests along with fixtures. When using the rails generate
command, template test files will be generated for you and placed in this
directory.
vendor
External libraries that the application depends on. Also includes the plugins
subdirectory. If the app has frozen rails, those gems also go here, under
vendor/rails/. This directory is in the load path.
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
require 'rake'
Reliz::Application.load_tasks
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :check_user
before_filter :check_actions
before_filter :set_language
before_filter :load_settings
def check_actions
@actions = ["warning: no actions here"] unless @actions
end
def check_user
@correct_user = User.find_by_name "admin"
end
def set_language
request_language = request.env['HTTP_ACCEPT_LANGUAGE']
request_language = request_language.nil? ? nil : request_language[/[^,;]+/]
I18n.locale = request_language if request_language && File.exist?("#{RAILS_ROOT}/config/locales/#{request_language}.yml")
end
def load_settings
@site = {
:name => "Reliz"
}
def @site.method_missing(method, *args)
self[method] || super
end
def @site.to_s
"<a href=\"/\">#{name}</a>".html_safe
end
end
def redirect_to_thc
redirect_to("http://www.touhou.cc/bbs/"+params[:anything]+"?"+env['QUERY_STRING'])
end
end
\ No newline at end of file
class BoardsController < ApplicationController
ApplicationHelper::addon_header.push "zh_header"
ApplicationHelper::addon_top.push "zh_top"
ApplicationHelper::addon_footer.push "zh_footer"
# GET /boards
# GET /boards.xml
def index
@boards = Board.all#[Board.find(1)]#_all_by_id 1
@actions = [:forum]
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @boards }
end
end
# GET /boards/1
# GET /boards/1.xml
def show
@page = params[:page] && !params[:page].empty? ? params[:page].to_i : 1
@board = Board.find(params[:id])
@actions = [:board, @board]
@topics = @board.topics.all(:offset => 20*@page-20, :limit => 20, :order => [:displayorder, :id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => params[:page] && !params[:page].empty? ? @topics : @board}
end
end
# GET /boards/new
# GET /boards/new.xml
def new
@board = Board.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @board }
end
end
# GET /boards/1/edit
def edit
@board = Board.find(params[:id])
end
# POST /boards
# POST /boards.xml
def create
@board = Board.new(params[:board])
respond_to do |format|
if @board.save
format.html { redirect_to(@board, :notice => 'Board was successfully created.') }
format.xml { render :xml => @board, :status => :created, :location => @board }
else
format.html { render :action => "new" }
format.xml { render :xml => @board.errors, :status => :unprocessable_entity }
end
end
end
# PUT /boards/1
# PUT /boards/1.xml
def update
@board = Board.find(params[:id])
respond_to do |format|
if @board.update_attributes(params[:board])
format.html { redirect_to(@board, :notice => 'Board was successfully updated.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @board.errors, :status => :unprocessable_entity }
end
end
end
# DELETE /boards/1
# DELETE /boards/1.xml
def destroy
@board = Board.find(params[:id])
@board.destroy
respond_to do |format|
format.html { redirect_to(boards_url) }
format.xml { head :ok }
end
end
end
class CommentsController < ApplicationController
# GET /comments
# GET /comments.xml
def index
@comments = Comment.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @comments }
end
end
# GET /comments/1
# GET /comments/1.xml
def show
@comment = Comment.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @comment }
end
end
# GET /comments/new
# GET /comments/new.xml
def new
@comment = Comment.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @comment }
end
end
# GET /comments/1/edit
def edit
@comment = Comment.find(params[:id])
end
# POST /comments
# POST /comments.xml
def create
@comment = Comment.new(params[:comment])
respond_to do |format|
if @comment.save
format.html { redirect_to(@comment, :notice => 'Comment was successfully created.') }
format.xml { render :xml => @comment, :status => :created, :location => @comment }
else
format.html { render :action => "new" }
format.xml { render :xml => @comment.errors, :status => :unprocessable_entity }
end
end
end
# PUT /comments/1
# PUT /comments/1.xml
def update
@comment = Comment.find(params[:id])
respond_to do |format|
if @comment.update_attributes(params[:comment])
format.html { redirect_to(@comment, :notice => 'Comment was successfully updated.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @comment.errors, :status => :unprocessable_entity }
end
end
end
# DELETE /comments/1
# DELETE /comments/1.xml
def destroy
@comment = Comment.find(params[:id])
@comment.destroy
respond_to do |format|
format.html { redirect_to(comments_url) }
format.xml { head :ok }
end
end
end
class NoticesController < ApplicationController
# GET /notices
# GET /notices.xml
def index
@notices = Notice.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @notices }
end
end
# GET /notices/1
# GET /notices/1.xml
def show
@notice = Notice.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @notice }
end
end
# GET /notices/new
# GET /notices/new.xml
def new
@notice = Notice.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @notice }
end
end
# GET /notices/1/edit
def edit
@notice = Notice.find(params[:id])
end
# POST /notices
# POST /notices.xml
def create
@notice = Notice.new(params[:notice])
respond_to do |format|
if @notice.save
format.html { redirect_to(@notice, :notice => 'Notice was successfully created.') }
format.xml { render :xml => @notice, :status => :created, :location => @notice }
else
format.html { render :action => "new" }
format.xml { render :xml => @notice.errors, :status => :unprocessable_entity }
end
end
end
# PUT /notices/1
# PUT /notices/1.xml
def update
@notice = Notice.find(params[:id])
respond_to do |format|
if @notice.update_attributes(params[:notice])
format.html { redirect_to(@notice, :notice => 'Notice was successfully updated.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @notice.errors, :status => :unprocessable_entity }
end
end
end
# DELETE /notices/1
# DELETE /notices/1.xml
def destroy
@notice = Notice.find(params[:id])
@notice.destroy
respond_to do |format|
format.html { redirect_to(notices_url) }
format.xml { head :ok }
end
end
end
class PmsController < ApplicationController
# GET /pms
# GET /pms.xml
def index
@pms = Pm.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @pms }
end
end
# GET /pms/1
# GET /pms/1.xml
def show
@pm = Pm.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @pm }
end
end
# GET /pms/new
# GET /pms/new.xml
def new
@pm = Pm.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @pm }
end
end
# GET /pms/1/edit
def edit
@pm = Pm.find(params[:id])
end
# POST /pms
# POST /pms.xml
def create
@pm = Pm.new(params[:pm])
respond_to do |format|
if @pm.save
format.html { redirect_to(@pm, :notice => 'Pm was successfully created.') }
format.xml { render :xml => @pm, :status => :created, :location => @pm }
else
format.html { render :action => "new" }
format.xml { render :xml => @pm.errors, :status => :unprocessable_entity }
end
end
end
# PUT /pms/1
# PUT /pms/1.xml
def update
@pm = Pm.find(params[:id])
respond_to do |format|
if @pm.update_attributes(params[:pm])
format.html { redirect_to(@pm, :notice => 'Pm was successfully updated.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @pm.errors, :status => :unprocessable_entity }
end
end
end
# DELETE /pms/1
# DELETE /pms/1.xml
def destroy
@pm = Pm.find(params[:id])
@pm.destroy
respond_to do |format|
format.html { redirect_to(pms_url) }
format.xml { head :ok }
end
end
end
class PostsController < ApplicationController
ApplicationHelper::addon_header.push "zh_header"
ApplicationHelper::addon_top.push "zh_top"
ApplicationHelper::addon_footer.push "zh_footer"
# GET /posts
# GET /posts.xml
def index
@posts = Post.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @posts }
end
end
# GET /posts/1
# GET /posts/1.xml
def show
@post = Post.find(params[:id])
respond_to do |format|
format.html { redirect_to(@post.topic) }
format.xml { render :xml => @post }
end
end
# GET /posts/new
# GET /posts/new.xml
def new
@post = Post.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @post }
end
end
# GET /posts/1/edit
def edit
@post = Post.find(params[:id])
end
# POST /posts
# POST /posts.xml
def create
@post = Post.new(params[:post])
@post.topic = Topic.find params[:post][:topic_id]
@post.user = @correct_user
@post.displayorder = @post.topic.floor
respond_to do |format|
if @post.save
format.html { redirect_to(@post.topic, :notice => 'Post was successfully created.') }
format.xml { render :xml => @post, :status => :created, :location => @post.topic }
else
format.html { render :action => "new" }
format.xml { render :xml => @post.errors, :status => :unprocessable_entity }
end
end
end
# PUT /posts/1
# PUT /posts/1.xml
def update
@post = Post.find(params[:id])
respond_to do |format|
if @post.update_attributes(params[:post])
format.html { redirect_to(@post, :notice => 'Post was successfully updated.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @post.errors, :status => :unprocessable_entity }
end
end
end
# DELETE /posts/1
# DELETE /posts/1.xml
def destroy
@post = Post.find(params[:id])
@post.destroy
respond_to do |format|
format.html { redirect_to(posts_url) }
format.xml { head :ok }
end
end
end
class TopicsController < ApplicationController
ApplicationHelper::addon_header.push "zh_header"
ApplicationHelper::addon_top.push "zh_top"
ApplicationHelper::addon_footer.push "zh_footer"
# GET /topics
# GET /topics.xml
def index
@topics = Topic.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @topics }
end
end
# GET /topics/1
# GET /topics/1.xml
def show
@page = params[:page] && !params[:page].empty? ? params[:page].to_i : 1
@topic = Topic.find(params[:id])
@actions = [@topic.category, @topic]
@posts = Post.find_all_by_topic_id(params[:id], :offset => 10*@page-10, :limit => 10, :order => :displayorder)
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => params[:page] && !params[:page].empty? ? @posts : @topic }
end
end
# GET /forum/id/new
# GET /forum/id/new.xml
def new
@topic = Topic.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @topic }
end
end
# GET /topics/1/edit
def edit
@topic = Topic.find(params[:id])
end
# POST /board/id
# POST /board/id.xml
def create
@topic = Topic.new(params[:topic])
#@topic.category_id = Board.find(params[:topic][:category_id])
@topic.user = @correct_user
@topic.displayorder = 0
@post = Post.new(params[:post])
@post.displayorder = 1
@post.topic = @topic
@post.user = @correct_user
respond_to do |format|
if @topic.save && @post.save
format.html { redirect_to(@topic, :notice => 'Topic was successfully created.') }
format.xml { render :xml => @topic, :status => :created, :location => @topic }
else
format.html { render :action => "new" }
format.xml { render :xml => @topic.errors, :status => :unprocessable_entity }
end
end
end
# PUT /topics/1
# PUT /topics/1.xml
def update
@topic = Topic.find(params[:id])
respond_to do |format|
if @topic.update_attributes(params[:topic])
format.html { redirect_to(@topic, :notice => 'Topic was successfully updated.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @topic.errors, :status => :unprocessable_entity }
end
end
end
# DELETE /topics/1
# DELETE /topics/1.xml
def destroy
@topic = Topic.find(params[:id])
@topic.destroy
respond_to do |format|
format.html { redirect_to(topics_url) }
format.xml { head :ok }
end
end
end
class UsersController < ApplicationController
ApplicationHelper::addon_header.push "zh_header"
ApplicationHelper::addon_top.push "zh_top"
ApplicationHelper::addon_footer.push "zh_footer"
# GET /users
# GET /users.xml
def index
@users = User.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @users }
end
end
# GET /users/1
# GET /users/1.xml
def show
@user = User.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @user }
end
end
# GET /users/new
# GET /users/new.xml
def new
@user = User.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @user }
end
end
# GET /users/1/edit
def edit
@user = User.find(params[:id])
end
# POST /users
# POST /users.xml
def create
@user = User.new(params[:user])
respond_to do |format|
if @user.save
format.html { redirect_to(@user, :notice => 'User was successfully created.') }
format.xml { render :xml => @user, :status => :created, :location => @user }
else
format.html { render :action => "new" }
format.xml { render :xml => @user.errors, :status => :unprocessable_entity }
end
end
end
# PUT /users/1
# PUT /users/1.xml
def update
@user = User.find(params[:id])
respond_to do |format|
if @user.update_attributes(params[:user])
format.html { redirect_to(@user, :notice => 'User was successfully updated.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @user.errors, :status => :unprocessable_entity }
end
end
end
# DELETE /users/1
# DELETE /users/1.xml
def destroy
@user = User.find(params[:id])
@user.destroy
respond_to do |format|
format.html { redirect_to(users_url) }
format.xml { head :ok }
end
end
end
module ApplicationHelper
@@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
module BoardsHelper
end
module CommentsHelper
end
module NoticesHelper
end
module PmsHelper
end
module PostsHelper
end
module TopicsHelper
end
module UsersHelper
end
class Board < ActiveRecord::Base
belongs_to :superboard, :foreign_key => :super_id, :class_name => "::Board"
has_many :subboards, :foreign_key => :super_id, :class_name => "::Board"#, :as => :boards
#why it doesn't work?
has_many :topics, :foreign_key => :category_id
has_many :posts, :through =>:topics
def to_s
"<a href=\"/forum/#{id}\">#{name}</a>".html_safe
end
#def superboard
# board
#end
#def subboards
# p "-------------------------"
# p boards
# boards
#
#end
end
class Comment < ActiveRecord::Base
belongs_to :post
belongs_to :user
end
class Notice < ActiveRecord::Base
belongs_to :user
#belongs_to :assocaion
#belongs_to :from_user, :as => :user, :foreign_key => :from_user_id
end
class Pm < ActiveRecord::Base
belongs_to :user
#belongs_to :from_user, :as => :user, :foreign_key => :from_user_id
end
class Post < ActiveRecord::Base
belongs_to :topic
belongs_to :user
has_many :comments
end
class Topic < ActiveRecord::Base
belongs_to :user
#belongs_to :type
belongs_to :board, :foreign_key => :category_id
has_many :posts
alias category board
def to_s
"<a href=\"/topic/#{id}\">#{name}</a>".html_safe
end
def floor
self.posts.order('displayorder DESC').first.displayorder + 1
end
end
class User < ActiveRecord::Base
#belongs_to :usergroup
#belongs_to :admingroup
def to_s
"<a href=\"/space/#{id}\">#{name}</a>".html_safe
end
end
<%= form_for(@board) do |f| %>
<% if @board.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@board.errors.count, "error") %> prohibited this board from being saved:</h2>
<ul>
<% @board.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :name %><br />
<%= f.text_field :name %>
</div>
<div class="field">
<%= f.label :introduction %><br />
<%= f.text_area :introduction %>
</div>
<div class="field">
<%= f.label :notice %><br />
<%= f.text_area :notice %>
</div>
<div class="field">
<%= f.label :logo %><br />
<%= f.text_field :logo %>
</div>
<div class="field">
<%= f.label :banner %><br />
<%= f.text_field :banner %>
</div>
<div class="field">
<%= f.label :readperm %><br />
<%= f.text_field :readperm %>
</div>
<div class="field">
<%= f.label :topicperm %><br />
<%= f.text_field :topicperm %>
</div>
<div class="field">
<%= f.label :postperm %><br />
<%= f.text_field :postperm %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>
<h1>Editing board</h1>
<%= render 'form' %>
<%= link_to 'Show', @board %> |
<%= link_to 'Back', boards_path %>
<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>
</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">
<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>
<%# @boards.each do |area| %>
<%# next if area.subboards.empty? %>
<h3><a href="index.php?gid=3" style="">测试版块</a></h3>
<table id="category_3" summary="category3" cellspacing="0" cellpadding="0" style="">
<% @boards.each do |board| %>
<tbody id="board<%= board.id %>">
<tr>
<th>
<%= link_to image_tag(board.logo), board %>
<div class="left">
<h2><%= board %></h2>
<p><%= board.introduction %></p></div>
</th>
<td class="boardnums">
<em><%= board.topics.size %></em> / <%= board.posts.size %></td>
<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>
<% else %>
none
<% end %>
</td>
</tr>
</tbody>
<% end %>
</table>
</div>
<%# end %>
<div id="ad_intercat_16"></div>
<div class="mainbox list">
<span class="headactions"><img id="boardlinks_img" src="images/default/collapsed_no.gif" alt="" onclick="toggle_collapse('boardlinks');" /></span>
<h3>link</h3>
<div id="boardlinks" style="">
</div>
</div>
<div class="mainbox list" id="online">
<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>.
</h3>
</div>
<h1>New board</h1>
<%= render 'form' %>
<%= link_to 'Back', boards_path %>
#encoding: UTF-8
<div id="wrap" class="wrap s_clear">
<div class="main">
<div class="content">
<div id="boardheader" class="s_clear">
<h1 style=""><% @board.name %></h1>
<p class="boardstats">[ <strong><%= @board.topics.size %></strong> 主题 / <%= @board.posts.size %> 帖子]</p>
<div class="boardaction">
<div class="right">
<a href="my.php?item=attention&amp;type=board&amp;action=add&amp;fid=68" id="ajax_attention" class="attention" onclick="ajaxmenu(this);doane(event);">关注</a>
<a href="my.php?item=favorites&amp;fid=68" id="ajax_favorite" onclick="ajaxmenu(this);doane(event);">收藏</a>
<a href="rss.php?fid=68&amp;auth=80baas4p%2BS%2FNnT%2BlQanrr%2Blzuk13j9xswULkRK6FhUrlnnrhZxiBsSc%2FwKk" target="_blank" class="feed">RSS</a></div>
</div>
<p class="channelinfo"><%= @board.notice %></p><p id="modedby">
版主: *空缺中*</p>
</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="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>
</div>
<div id="threadlist" class="threadlist datalist" style="position: relative;">
<form method="post" name="moderate" id="moderate" action="topicadmin.php?action=moderate&amp;fid=68&amp;infloat=yes&amp;nopost=yes">
<input type="hidden" name="formhash" value="eed723b8" />
<input type="hidden" name="listextra" value="page%3D1" />
<table summary="board_68" cellspacing="0" cellpadding="0" class="datatable">
<thead class="colplural">
<tr>
<td colspan="2">&nbsp;<a href="javascript:;" id="filtertype" class="dropmenu" onclick="showMenu({'ctrlid':this.id});">类型</a></td>
<th>
<ul class="itemfilter s_clear">
<li><%= t 'topic' %>:</li>
<li class="current"><a href="boarddisplay.php?fid=68"><span>全部</span></a></li>
<li><a class="filter" href="boarddisplay.php?fid=68&amp;filter=digest"><span>精华</span></a></li>
<li class="pipe">|</li>
<li>时间:</li>
<li><a href="boarddisplay.php?fid=68&amp;orderby=lastpost&amp;filter=86400"><span>一天</span></a></li>
<li><a href="boarddisplay.php?fid=68&amp;orderby=lastpost&amp;filter=172800"><span>两天</span></a></li>
<li><a href="boarddisplay.php?fid=68&amp;orderby=lastpost&amp;filter=604800"><span></span></a></li>
<li><a href="boarddisplay.php?fid=68&amp;orderby=lastpost&amp;filter=2592000"><span></span></a></li>
<li><a href="boarddisplay.php?fid=68&amp;orderby=lastpost&amp;filter=7948800"><span></span></a></li>
<li class="pipe">|</li>
<li><a class="order " href="boarddisplay.php?fid=68&amp;filter=&amp;orderby=heats">热门</a></li>
</ul>
</th>
<td class="author"><a href="boarddisplay.php?fid=68&amp;filter=&amp;orderby=dateline" class="order ">作者/时间</a></td>
<td class="nums"><a href="boarddisplay.php?fid=68&amp;filter=&amp;orderby=replies" class="order ">回复</a>&nbsp;<a href="boarddisplay.php?fid=68&amp;filter=&amp;orderby=views" class="order ">查看</a></td>
<td class="lastpost"><cite><a href="boarddisplay.php?fid=68&amp;filter=&amp;orderby=lastpost" class="order order_active">最后发表</a></cite></td>
</tr>
</thead>
<% @topics.each do |topic| %>
<tbody id="normalthread_<%= topic.id %>">
<tr>
<td class="folder">
<%= link_to image_tag("default/folder_common.gif"), topic, :target => :_blank %>
</td>
<td class="icon">
&nbsp;</td>
<th class="subject common">
<label>&nbsp;</label>
<span id="thread_<%= topic.id %>"><%= topic %></span>
</th>
<td class="author">
<cite>
<%= topic.user %>
</cite>
<em><%= topic.created_at %></em>
</td>
<td class="nums"><strong><%= topic.posts.size - 1 %></strong></td>
<td class="lastpost">
<cite><%= topic.posts.last.user %></cite>
<em><span title="<%= topic.posts.last.updated_at %>"><%= link_to topic.posts.last.updated_at, topic.posts.last %></span></a></em>
</td>
</tr>
</tbody>
<% end %></table>
</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>
</div>
<p id="notice"><%= notice %></p>
<%= link_to 'New Topic', new_topic_path %>
<%# fast newthread %>
<% form_tag :controller => :topics do %>
<p>
Title: <%= text_field_tag "topic[name]" %>
</p>
<p>
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" %>
<% end %>
<dl id="onlinelist">
<dt>
<span class="headactions"><a href="boarddisplay.php?fid=68&amp;page=1&amp;showoldetails=yes#online" class="nobdr"><img src="images/default/collapsed_yes.gif" alt="" /></a></span>
<h3>正在浏览此版块的会员</h3>
</dt>
</dl>
</div>
</div>
<ul class="popupmenu_popup postmenu" id="newspecial_menu" style="display: none">
<li><a href="post.php?action=newthread&amp;fid=68" onclick="showWindow('newthread', this.href);doane(event)">发新话题</a></li><li class="poll"><a href="post.php?action=newthread&amp;fid=68&amp;special=1">发布投票</a></li><li class="reward"><a href="post.php?action=newthread&amp;fid=68&amp;special=3">发布悬赏</a></li><li class="debate"><a href="post.php?action=newthread&amp;fid=68&amp;special=5">发布辩论</a></li><li class="activity"><a href="post.php?action=newthread&amp;fid=68&amp;special=4">发布活动</a></li><li class="trade"><a href="post.php?action=newthread&amp;fid=68&amp;special=2">发布商品</a></li></ul>
<ul class="popupmenu_popup headermenu_popup filter_popup" id="filtertype_menu" style="display: none;">
<li><a href="boarddisplay.php?fid=68">全部</a></li>
<li ><a href="boarddisplay.php?fid=68&amp;filter=poll">投票</a></li><li ><a href="boarddisplay.php?fid=68&amp;filter=trade">商品</a></li><li ><a href="boarddisplay.php?fid=68&amp;filter=reward">悬赏</a></li><li ><a href="boarddisplay.php?fid=68&amp;filter=activity">活动</a></li><li ><a href="boarddisplay.php?fid=68&amp;filter=debate">辩论</a></li></ul>
<ul class="popupmenu_popup" id="visitedboards_menu" style="display: none">
<li><a href="boarddisplay.php?fid=2&amp;sid=6e1Kys">综合讨论</a></li><li><a href="boarddisplay.php?fid=23&amp;sid=6e1Kys">版主申请</a></li><li><a href="boarddisplay.php?fid=48&amp;sid=6e1Kys">文文最速新闻</a></li><li><a href="boarddisplay.php?fid=76&amp;sid=6e1Kys">幻想乡大温泉</a></li></ul>
<script type="text/javascript">document.onkeyup = function(e){keyPageScroll(e, 0, 1, 'boarddisplay.php?fid=68', 1);}</script>
<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" 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 id="footer">
<%= form_for(@comment) do |f| %>
<% if @comment.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@comment.errors.count, "error") %> prohibited this comment from being saved:</h2>
<ul>
<% @comment.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :post %><br />
<%= f.text_field :post %>
</div>
<div class="field">
<%= f.label :user %><br />
<%= f.text_field :user %>
</div>
<div class="field">
<%= f.label :content %><br />
<%= f.text_area :content %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>
<h1>Editing comment</h1>
<%= render 'form' %>
<%= link_to 'Show', @comment %> |
<%= link_to 'Back', comments_path %>
<h1>Listing comments</h1>
<table>
<tr>
<th>Post</th>
<th>User</th>
<th>Content</th>
<th></th>
<th></th>
<th></th>
</tr>
<% @comments.each do |comment| %>
<tr>
<td><%= comment.post %></td>
<td><%= comment.user %></td>
<td><%= comment.content %></td>
<td><%= link_to 'Show', comment %></td>
<td><%= link_to 'Edit', edit_comment_path(comment) %></td>
<td><%= link_to 'Destroy', comment, :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New Comment', new_comment_path %>
<h1>New comment</h1>
<%= render 'form' %>
<%= link_to 'Back', comments_path %>
<p id="notice"><%= notice %></p>
<p>
<b>Post:</b>
<%= @comment.post %>
</p>
<p>
<b>User:</b>
<%= @comment.user %>
</p>
<p>
<b>Content:</b>
<%= @comment.content %>
</p>
<%= link_to 'Edit', edit_comment_path(@comment) %> |
<%= link_to 'Back', comments_path %>
<%= stylesheet_link_tag :all %>
<% ApplicationHelper::addon_stylesheet.each { |s| %>
<%= stylesheet_link_tag 'fucking/'+s %>
<% } %>
<%= javascript_include_tag :defaults %>
<% ApplicationHelper::addon_javascript.each { |s| %>
<%= javascript_link_tag 'fucking/'+s %>
<% } %>
<%= csrf_meta_tag %>
<!--<h1>Glupx</h1>
<h2><%#= @actions.shift %>
<% @actions.each do |action| %>
- <%= action %>
<% end %></h2>-->
<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>
</div>
<div id="footlink">
<div style="width: 500px; height: 58px; float: left;">
<ul class="fmenu">
<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>
<div class="bhoge">Powered by:</div>
<div class="bw3c">Validated by:</div>
<div class="bexa">CSS Modify By:</div></div>
</div>
</div>
\ No newline at end of file
<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>
<body id="index" onkeydown="if(event.keyCode==27) return false;">
<div id="append_parent"></div><div id="ajaxwaitid"></div>
<div id="topbar" name="TOP">
<div class="topanel">
<div id="memberp">
<cite><a href="space.php?uid=359" class="noborder">zh99998</a></cite>
<span class="pipe">|</span>
<a href="my.php?item=threads">my</a>
<a href="http://www.touhou.cc/blog/space.php?uid=359" target="_blank">space</a>
<a id="myprompt" href="notice.php" >notice</a>
<span id="myprompt_check"></span>
<a href="pm.php" id="pm_ntc" target="_blank">pm</a>
<span class="pipe">|</span>
<a href="memcp.php">memcp</a>
<a href="logging.php?action=logout&amp;formhash=eed723b8">logout</a>
</div>
<form method="post" id="searchform" action="search.php">
<div style="width:190px;float:left;">
<input type="hidden" name="formhash" value="eed723b8" />
<input type="text" id="srchtxt" name="srchtxt" onfocus="this.value=''" value="thc search">
<button class="searchsub" type="submit" name="searchsubmit" value="true" tabindex="100">search</button>
</div>
</form>
</div>
</div>
<div id="headerbg">
<div class="header">
<embed src="templates/goodnight/images/mnsv.swf" quality="high" wmode="transparent" style=" float:left; " pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="898" height="116"></embed>
<div id="ad_headerbanner"></div>
</div>
<div id="dmenu">
<div class="bg-dmenuleft"></div>
<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>
<script type="text/javascript">
var currentMenu = $('mn_index') ? $('mn_index') : $('mn_index');
currentMenu.parentNode.className = 'current';
</script>
</div>
<script type="text/javascript">
function setstyle(styleid) {
str = unescape('fromuid%3D8507%26styleid%3D57');
str = str.replace(/(^|&)styleid=\d+/ig, '');
str = (str != '' ? str + '&' : '') + 'styleid=' + styleid;
location.href = 'index.php?' + str;
}
</script>
</div>
</div>
<div id="myprompt_menu" style="display:none" class="promptmenu">
<div class="promptcontent">
<ul class="s_clear"><li style="display:none"><a id="prompt_pm" href="pm.php?filter=newpm" target="_blank">private (0)</a></li><li style="display:none"><a id="prompt_announcepm" href="pm.php?filter=announcepm" target="_blank">public (0)</a></li><li style="display:none"><a id="prompt_systempm" href="notice.php?filter=systempm" target="_blank">system (0)</a></li><li style="display:none"><a id="prompt_friend" href="notice.php?filter=friend" target="_blank">friend (0)</a></li><li style="display:none"><a id="prompt_threads" href="notice.php?filter=threads" target="_blank">post (0)</a></li></ul>
</div>
</div>
</div>
<div id="wrapper"><div id="nav">
<%= @site %>
<% @actions.each do |action| %>
&raquo; <%= action %>
<% end %></div>
<div id="ad_text"></div>
\ No newline at end of file
<!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>
<%= render 'layouts/header' %>
<% ApplicationHelper::addon_header.each { |s| %>
<%= render 'layouts/'+s %>
<% } %>
</head>
<body>
<%= render 'layouts/top' %>
<% ApplicationHelper::addon_top.each { |s| %>
<%= render 'layouts/'+s %>
<% } %>
<%= yield %>
<%= render 'layouts/footer' %>
<% ApplicationHelper::addon_footer.each { |s| %>
<%= render 'layouts/'+s %>
<% } %>
</body>
</html>
<%= form_for(@notice) do |f| %>
<% if @notice.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@notice.errors.count, "error") %> prohibited this notice from being saved:</h2>
<ul>
<% @notice.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :user %><br />
<%= f.text_field :user %>
</div>
<div class="field">
<%= f.label :type %><br />
<%= f.text_field :type %>
</div>
<div class="field">
<%= f.label :assocaion %><br />
<%= f.text_field :assocaion %>
</div>
<div class="field">
<%= f.label :user %><br />
<%= f.text_field :user %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>
<h1>Editing notice</h1>
<%= render 'form' %>
<%= link_to 'Show', @notice %> |
<%= link_to 'Back', notices_path %>
<h1>Listing notices</h1>
<table>
<tr>
<th>User</th>
<th>Type</th>
<th>Assocaion</th>
<th>User</th>
<th></th>
<th></th>
<th></th>
</tr>
<% @notices.each do |notice| %>
<tr>
<td><%= notice.user %></td>
<td><%= notice.type %></td>
<td><%= notice.assocaion %></td>
<td><%= notice.user %></td>
<td><%= link_to 'Show', notice %></td>
<td><%= link_to 'Edit', edit_notice_path(notice) %></td>
<td><%= link_to 'Destroy', notice, :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New Notice', new_notice_path %>
<h1>New notice</h1>
<%= render 'form' %>
<%= link_to 'Back', notices_path %>
<p id="notice"><%= notice %></p>
<p>
<b>User:</b>
<%= @notice.user %>
</p>
<p>
<b>Type:</b>
<%= @notice.type %>
</p>
<p>
<b>Assocaion:</b>
<%= @notice.assocaion %>
</p>
<p>
<b>User:</b>
<%= @notice.user %>
</p>
<%= link_to 'Edit', edit_notice_path(@notice) %> |
<%= link_to 'Back', notices_path %>
<%= form_for(@pm) do |f| %>
<% if @pm.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@pm.errors.count, "error") %> prohibited this pm from being saved:</h2>
<ul>
<% @pm.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :user %><br />
<%= f.text_field :user %>
</div>
<div class="field">
<%= f.label :user %><br />
<%= f.text_field :user %>
</div>
<div class="field">
<%= f.label :content %><br />
<%= f.text_area :content %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>
<h1>Editing pm</h1>
<%= render 'form' %>
<%= link_to 'Show', @pm %> |
<%= link_to 'Back', pms_path %>
<h1>Listing pms</h1>
<table>
<tr>
<th>User</th>
<th>User</th>
<th>Content</th>
<th></th>
<th></th>
<th></th>
</tr>
<% @pms.each do |pm| %>
<tr>
<td><%= pm.user %></td>
<td><%= pm.user %></td>
<td><%= pm.content %></td>
<td><%= link_to 'Show', pm %></td>
<td><%= link_to 'Edit', edit_pm_path(pm) %></td>
<td><%= link_to 'Destroy', pm, :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New Pm', new_pm_path %>
<h1>New pm</h1>
<%= render 'form' %>
<%= link_to 'Back', pms_path %>
<p id="notice"><%= notice %></p>
<p>
<b>User:</b>
<%= @pm.user %>
</p>
<p>
<b>User:</b>
<%= @pm.user %>
</p>
<p>
<b>Content:</b>
<%= @pm.content %>
</p>
<%= link_to 'Edit', edit_pm_path(@pm) %> |
<%= link_to 'Back', pms_path %>
<%= form_for(@post) do |f| %>
<% if @post.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:</h2>
<ul>
<% @post.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :topic %><br />
<%= f.text_field :topic %>
</div>
<div class="field">
<%= f.label :user %><br />
<%= f.text_field :user %>
</div>
<div class="field">
<%= f.label :content %><br />
<%= f.text_area :content %>
</div>
<div class="field">
<%= f.label :displayorder %><br />
<%= f.text_field :displayorder %>
</div>
<div class="field">
<%= f.label :readperm %><br />
<%= f.text_field :readperm %>
</div>
<div class="field">
<%= f.label :private %><br />
<%= f.check_box :private %>
</div>
<div class="field">
<%= f.label :anonymous %><br />
<%= f.check_box :anonymous %>
</div>
<div class="field">
<%= f.label :ubb %><br />
<%= f.check_box :ubb %>
</div>
<div class="field">
<%= f.label :html %><br />
<%= f.check_box :html %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>
<h1>Editing post</h1>
<%= render 'form' %>
<%= link_to 'Show', @post %> |
<%= link_to 'Back', posts_path %>
<h1>Listing posts</h1>
<table>
<tr>
<th>Topic</th>
<th>User</th>
<th>Content</th>
<th>Displayorder</th>
<th>Readperm</th>
<th>Private</th>
<th>Anonymous</th>
<th>Ubb</th>
<th>Html</th>
<th></th>
<th></th>
<th></th>
</tr>
<% @posts.each do |post| %>
<tr>
<td><%= post.topic %></td>
<td><%= post.user %></td>
<td><%= post.content %></td>
<td><%= post.displayorder %></td>
<td><%= post.readperm %></td>
<td><%= post.private %></td>
<td><%= post.anonymous %></td>
<td><%= post.ubb %></td>
<td><%= post.html %></td>
<td><%= link_to 'Show', post %></td>
<td><%= link_to 'Edit', edit_post_path(post) %></td>
<td><%= link_to 'Destroy', post, :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New Post', new_post_path %>
<h1>New post</h1>
<%= render 'form' %>
<%= link_to 'Back', posts_path %>
<p id="notice"><%= notice %></p>
<p>
<b>Topic:</b>
<%= @post.topic %>
</p>
<p>
<b>User:</b>
<%= @post.user %>
</p>
<p>
<b>Content:</b>
<%= @post.content %>
</p>
<p>
<b>Displayorder:</b>
<%= @post.displayorder %>
</p>
<p>
<b>Readperm:</b>
<%= @post.readperm %>
</p>
<p>
<b>Private:</b>
<%= @post.private %>
</p>
<p>
<b>Anonymous:</b>
<%= @post.anonymous %>
</p>
<p>
<b>Ubb:</b>
<%= @post.ubb %>
</p>
<p>
<b>Html:</b>
<%= @post.html %>
</p>
<%= link_to 'Edit', edit_post_path(@post) %> |
<%= link_to 'Back', posts_path %>
<%= form_for(@topic) do |f| %>
<% if @topic.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@topic.errors.count, "error") %> prohibited this topic from being saved:</h2>
<ul>
<% @topic.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :user %><br />
<%= f.text_field :user %>
</div>
<div class="field">
<%= f.label :type %><br />
<%= f.text_field :type %>
</div>
<div class="field">
<%= f.label :board %><br />
<%= f.text_field :board %>
</div>
<div class="field">
<%= f.label :name %><br />
<%= f.text_field :name %>
</div>
<div class="field">
<%= f.label :displayorder %><br />
<%= f.text_field :displayorder %>
</div>
<div class="field">
<%= f.label :views %><br />
<%= f.text_field :views %>
</div>
<div class="field">
<%= f.label :readperm %><br />
<%= f.text_field :readperm %>
</div>
<div class="field">
<%= f.label :notice %><br />
<%= f.check_box :notice %>
</div>
<div class="field">
<%= f.label :reverse %><br />
<%= f.check_box :reverse %>
</div>
<div class="field">
<%= f.label :private %><br />
<%= f.check_box :private %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>
<h1>Editing topic</h1>
<%= render 'form' %>
<%= link_to 'Show', @topic %> |
<%= link_to 'Back', topics_path %>
<h1>Listing topics</h1>
<table>
<tr>
<th>User</th>
<th>Type</th>
<th>Board</th>
<th>Name</th>
<th>Displayorder</th>
<th>Views</th>
<th>Readperm</th>
<th>Notice</th>
<th>Reverse</th>
<th>Private</th>
<th></th>
<th></th>
<th></th>
</tr>
<% @topics.each do |topic| %>
<tr>
<td><%= topic.user %></td>
<td><%= topic.type %></td>
<td><%= topic.board %></td>
<td><%= topic.name %></td>
<td><%= topic.displayorder %></td>
<td><%= topic.views %></td>
<td><%= topic.readperm %></td>
<td><%= topic.notice %></td>
<td><%= topic.reverse %></td>
<td><%= topic.private %></td>
<td><%= link_to 'Show', topic %></td>
<td><%= link_to 'Edit', edit_topic_path(topic) %></td>
<td><%= link_to 'Destroy', topic, :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New Topic', new_topic_path %>
<h1>New topic</h1>
<%= render 'form' %>
<%= link_to 'Back', topics_path %>
<div id="wrap" class="wrap s_clear threadfix">
<div class="boardcontrol">
<table cellspacing="0" cellpadding="0">
<tr>
<td class="modaction">
</td>
<td>
<span class="pageback" id="visitedboards" onmouseover="$('visitedboards').id = 'visitedboardstmp';this.id = 'visitedboards';showMenu({'ctrlid':this.id})"><a href="boarddisplay.php?fid=68&amp;page=1">返回列表</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>
</td>
</tr>
</table>
</div>
<div id="postlist" class="mainbox viewthread"><% @posts.each do |post| %>
<div id="post_<%= post.id %>"><table id="pid<%= post.id %>" summary="pid<%= post.id %>" cellspacing="0" cellpadding="0">
<tr>
<td class="postauthor" rowspan="2">
<div class="postinfo">
<%= link_to post.user.name, post.user, :style=> "margin-left: 20px; font-weight: 800"%>
</div>
<div class="popupmenu_popup userinfopanel" id="userinfo<%= post.id %>" style="display: none; position: absolute;margin-top: -11px;">
<div class="popavatar">
<div id="userinfo<%= post.id %>_ma"></div>
<ul class="profile_side">
<li class="pm"><a href="pm.php?action=new&amp;uid=<%= post.user_id %>" onclick="hideMenu('userinfo<%= post.id %>');showWindow('sendpm', this.href);return false;" title="发短消息">发短消息</a></li>
<li class="buddy"><a href="my.php?item=buddylist&amp;newbuddyid=<%= post.user_id %>&amp;buddysubmit=yes" target="_blank" id="ajax_buddy_1" title="加为好友" onclick="ajaxmenu(this, 3000);doane(event);">加为好友</a></li>
</ul>
</div>
<div class="popuserinfo">
<p>
<%= post.user %>
<em>(博丽有情破颜拳)</em><em>当前离线
</em>
</p>
<p class="customstatus">下下签</p>
<dl class="s_clear"><dt>UID</dt><dd><%= post.user_id %>&nbsp;</dd><dt>帖子</dt><dd>203&nbsp;</dd><dt>主题</dt><dd>29&nbsp;</dd><dt>精华</dt><dd>0&nbsp;</dd><dt>积分</dt><dd>203&nbsp;</dd><dt>点数</dt><dd>192 &nbsp;</dd><dt>威望</dt><dd>1 &nbsp;</dd><dt>贡献</dt><dd>0 &nbsp;</dd><dt>人气</dt><dd>0 &nbsp;</dd><dt>人品</dt><dd>-10 &nbsp;</dd><dt>阅读权限</dt><dd>20&nbsp;</dd><dt>在线时间</dt><dd>88 小时&nbsp;</dd><dt>注册时间</dt><dd>2010-6-24&nbsp;</dd><dt>最后登录</dt><dd>2010-12-23&nbsp;</dd></dl>
<div class="imicons">
<a href="http://www.touhou.cc/blog/space.php?uid=<%= post.user_id %>" target="_blank" title="个人空间"><img src="images/default/home.gif" alt="个人空间" /></a>
<a href="space.php?uid=<%= post.user_id %>" target="_blank" title="查看详细资料"><img src="images/default/userinfo.gif" alt="查看详细资料" /></a>
</div>
<div id="avatarfeed"><span id="threadsortswait"></span></div>
</div>
</div>
<div>
<div class="avatar" onmouseover="showauthor(this, 'userinfo<%= post.id %>')"><a href="space.php?uid=<%= post.user_id %>" target="_blank"><img src="http://www.touhou.cc/ucenter/avatar.php?uid=<%= post.user_id %>&size=middle" /></a></div>
<p><a href="memcp.php" target="_blank">博丽有情破颜拳</a></p>
</div>
<p><img src="images/default/star_level2.gif" alt="Rank: 2" /></p>
<dl class="profile s_clear"><dt>帖子</dt><dd>203&nbsp;</dd><dt>精华</dt><dd>0&nbsp;</dd><dt>积分</dt><dd>203&nbsp;</dd><dt>点数</dt><dd>192 &nbsp;</dd><dt>威望</dt><dd>1 &nbsp;</dd><dt>贡献</dt><dd>0 &nbsp;</dd><dt>人气</dt><dd>0 &nbsp;</dd><dt>人品</dt><dd>-10 &nbsp;</dd></dl></td>
<td class="postcontent">
<div class="postinfo">
<strong><a title="复制本帖链接" id="postnum<%= post.id %>" href="javascript:;" onclick="setCopy('http://www.touhou.cc/bbs/redirect.php?goto=findpost&amp;ptid=23884&amp;pid=<%= post.id %>', '帖子地址已经复制到剪贴板')"><em><%= post.displayorder %></em><sup>#</sup></a>
</strong>
<div class="posterinfo">
<div class="pagecontrol">
</div>
<div class="authorinfo">
<img class="authicon" id="authicon<%= post.id %>" src="images/common/online_member.gif" onclick="showauthor(this, 'userinfo<%= post.id %>');" />
<em id="authorposton<%= post.id %>">发表于 <span title="2010-12-23 12:37">前天&nbsp;12:37</span></em>
| <a href="viewthread.php?tid=23884&amp;page=1&amp;authorid=<%= post.user_id %>" rel="nofollow">只看该作者</a>
</div>
</div>
</div>
<div class="defaultpost">
<div id="ad_thread2_1"></div><div id="ad_thread3_1"></div><div id="ad_thread4_1"></div>
<div class="postmessage ">
<div class="t_msgfontfix">
<table cellspacing="0" cellpadding="0"><tr><td class="t_msgfont" id="postmessage_<%= post.id %>"><%= post.content %></td></tr></table>
</div>
<div id="post_rate_div_<%= post.id %>"></div>
</div>
</div>
</td></tr>
<tr><td class="postcontent postbottom">
<div class="signatures" style="max-height:300px;maxHeightIE:300px;"><img src="http://p1.tuzhan.com/200911/upn1/2010-09-12/17/rsagayanlong.tuzhan.com_ca33e924a0844d79aa817cde6440af5f_m.jpg" onload="thumbImg(this)" alt="" /></div>
<div id="ad_thread1_1"></div></td>
</tr>
<tr>
<td class="postauthor"></td>
<td class="postcontent">
<div class="postactions">
<div class="postact s_clear">
<em>
</em>
<p>
<a href="javascript:;" onclick="scrollTo(0,0);">TOP</a>
</p>
</div>
</div>
</td>
</tr>
<tr class="threadad">
<td class="postauthor"></td>
<td class="adcontent">
</td>
</tr>
</table>
</div>
<% end %></div>
<div id="postlistreply" class="mainbox viewthread"><div id="post_new" class="viewthread_table" style="display: none"></div></div>
<form method="post" name="modactions" id="modactions">
<input type="hidden" name="formhash" value="ff1bce37" />
<input type="hidden" name="optgroup" />
<input type="hidden" name="operation" />
<input type="hidden" name="listextra" value="page%3D1" />
</form>
<script type="text/javascript">var tagarray = ['东方','漫画','DOTS','新人','幻想','THD','论坛','沙包','游戏','BUG','师傅','动画','技能','攻略','同人','时间','少女','人物','DotA','TouHou','地图','建议','BGM','音乐','视频','THB','发售','中国','同人音乐','日本','THDOTA','下载','世界','申请','触手','物品','圣诞','主题','故事','BOSS','朋友','小说','教练','Project','GGC','活动','圣诞节','新闻','Defence','Apple','兔子','西瓜','电脑','速度','shrines','资源','角色','新手','英雄','据点','制作','装备','公布','人偶','bad','黑白','天子','HJISTC','Vocal','恶魔','名字','新作','模型','翻译','剧场','船长','解决','COS','馒头','大丈夫','玩家','神马','福利','情报','魔兽','amp','版主','大战','妹妹','图片','欢乐','教学','解释','守护','上海','作品','软件','道具','历史','百合'];var tagencarray = ['%B6%AB%B7%BD','%C2%FE%BB%AD','DOTS','%D0%C2%C8%CB','%BB%C3%CF%EB','THD','%C2%DB%CC%B3','%C9%B3%B0%FC','%D3%CE%CF%B7','BUG','%CA%A6%B8%B5','%B6%AF%BB%AD','%BC%BC%C4%DC','%B9%A5%C2%D4','%CD%AC%C8%CB','%CA%B1%BC%E4','%C9%D9%C5%AE','%C8%CB%CE%EF','DotA','TouHou','%B5%D8%CD%BC','%BD%A8%D2%E9','BGM','%D2%F4%C0%D6','%CA%D3%C6%B5','THB','%B7%A2%CA%DB','%D6%D0%B9%FA','%CD%AC%C8%CB%D2%F4%C0%D6','%C8%D5%B1%BE','THDOTA','%CF%C2%D4%D8','%CA%C0%BD%E7','%C9%EA%C7%EB','%B4%A5%CA%D6','%CE%EF%C6%B7','%CA%A5%B5%AE','%D6%F7%CC%E2','%B9%CA%CA%C2','BOSS','%C5%F3%D3%D1','%D0%A1%CB%B5','%BD%CC%C1%B7','Project','GGC','%BB%EE%B6%AF','%CA%A5%B5%AE%BD%DA','%D0%C2%CE%C5','Defence','Apple','%CD%C3%D7%D3','%CE%F7%B9%CF','%B5%E7%C4%D4','%CB%D9%B6%C8','shrines','%D7%CA%D4%B4','%BD%C7%C9%AB','%D0%C2%CA%D6','%D3%A2%D0%DB','%BE%DD%B5%E3','%D6%C6%D7%F7','%D7%B0%B1%B8','%B9%AB%B2%BC','%C8%CB%C5%BC','bad','%BA%DA%B0%D7','%CC%EC%D7%D3','HJISTC','Vocal','%B6%F1%C4%A7','%C3%FB%D7%D6','%D0%C2%D7%F7','%C4%A3%D0%CD','%B7%AD%D2%EB','%BE%E7%B3%A1','%B4%AC%B3%A4','%BD%E2%BE%F6','COS','%C2%F8%CD%B7','%B4%F3%D5%C9%B7%F2','%CD%E6%BC%D2','%C9%F1%C2%ED','%B8%A3%C0%FB','%C7%E9%B1%A8','%C4%A7%CA%DE','amp','%B0%E6%D6%F7','%B4%F3%D5%BD','%C3%C3%C3%C3','%CD%BC%C6%AC','%BB%B6%C0%D6','%BD%CC%D1%A7','%BD%E2%CA%CD','%CA%D8%BB%A4','%C9%CF%BA%A3','%D7%F7%C6%B7','%C8%ED%BC%FE','%B5%C0%BE%DF','%C0%FA%CA%B7','%B0%D9%BA%CF'];parsetag(531016);</script>
<div class="boardcontrol s_clear">
<table cellspacing="0" cellpadding="0" class="narrow">
<tr>
<td class="modaction">
</td>
<td>
<span class="pageback" id="visitedboards" onmouseover="$('visitedboards').id = 'visitedboardstmp';this.id = 'visitedboards';showMenu({'ctrlid':this.id})"><a href="boarddisplay.php?fid=68&amp;page=1">返回列表</a></span>
</td>
</tr>
</table>
</div>
<p id="notice"><%= notice %></p>
<%# fast reply %>
<% form_tag :controller => :posts do %>
<p>
<%= @topic.floor %>#: <%= text_area_tag "post[content]" %>
</p>
<%= hidden_field_tag "post[topic_id]", @topic.id%>
<%= submit_tag "reply" %>
<% end %>
<ul class="popupmenu_popup" id="visitedboards_menu" style="display: none">
<li><a href="boarddisplay.php?fid=2&amp;sid=MgL7lt">综合讨论</a></li></ul>
<div id="favoritewin" style="display: none">
<h5>
<a href="javascript:;" onclick="ajaxget('my.php?item=favorites&tid=23884', 'favorite_msg');return false;" class="lightlink">[收藏此主题]</a>&nbsp;
<a href="javascript:;" onclick="ajaxget('my.php?item=attention&action=add&tid=23884', 'favorite_msg');return false;" class="lightlink">[关注此主题的新回复]</a>
</h5>
<span id="favorite_msg"></span>
</div>
<div id="sharewin" style="display: none">
<h5>
<a href="javascript:;" onclick="setCopy('圣诞礼物!雪之足音!!!东方月光曲0.450发壳!\nhttp://www.touhou.cc/bbs/viewthread.php?tid=23884', '帖子地址已经复制到剪贴板<br />您可以用快捷键 Ctrl + V 粘贴到 QQ、MSN 里。')" class="lightlink" />[通过 QQ、MSN 分享给朋友]</a><br /><br />
</h5>
</div>
</div>
<%= form_for(@user) do |f| %>
<% if @user.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>
<ul>
<% @user.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :name %><br />
<%= f.text_field :name %>
</div>
<div class="field">
<%= f.label :password %><br />
<%= f.text_field :password %>
</div>
<div class="field">
<%= f.label :email %><br />
<%= f.text_field :email %>
</div>
<div class="field">
<%= f.label :credit %><br />
<%= f.text_field :credit %>
</div>
<div class="field">
<%= f.label :usergroup %><br />
<%= f.text_field :usergroup %>
</div>
<div class="field">
<%= f.label :admingroup %><br />
<%= f.text_field :admingroup %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>
<h1>Editing user</h1>
<%= render 'form' %>
<%= link_to 'Show', @user %> |
<%= link_to 'Back', users_path %>
<h1>Listing users</h1>
<table>
<tr>
<th>Name</th>
<th>Password</th>
<th>Email</th>
<th>Credit</th>
<th>Usergroup</th>
<th>Admingroup</th>
<th></th>
<th></th>
<th></th>
</tr>
<% @users.each do |user| %>
<tr>
<td><%= user.name %></td>
<td><%= user.password %></td>
<td><%= user.email %></td>
<td><%= user.credit %></td>
<td><%= user.usergroup %></td>
<td><%= user.admingroup %></td>
<td><%= link_to 'Show', user %></td>
<td><%= link_to 'Edit', edit_user_path(user) %></td>
<td><%= link_to 'Destroy', user, :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New User', new_user_path %>
<h1>New user</h1>
<%= render 'form' %>
<%= link_to 'Back', users_path %>
<p id="notice"><%= notice %></p>
<p>
<b>Name:</b>
<%= @user.name %>
</p>
<p>
<b>Password:</b>
<%= @user.password %>
</p>
<p>
<b>Email:</b>
<%= @user.email %>
</p>
<p>
<b>Credit:</b>
<%= @user.credit %>
</p>
<p>
<b>Usergroup:</b>
<%= @user.usergroup %>
</p>
<p>
<b>Admingroup:</b>
<%= @user.admingroup %>
</p>
<%= link_to 'Edit', edit_user_path(@user) %> |
<%= link_to 'Back', users_path %>
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
run Reliz::Application
require File.expand_path('../boot', __FILE__)
require 'rails/all'
# If you have a Gemfile, require the gems listed there, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env) if defined?(Bundler)
module Reliz
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Custom directories with classes and modules you want to be autoloadable.
# config.autoload_paths += %W(#{config.root}/extras)
# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named.
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
# Activate observers that should always be running.
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
# JavaScript files you want as :defaults (application.js is always included).
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
end
end
require 'rubygems'
# Set up gems listed in the Gemfile.
gemfile = File.expand_path('../../Gemfile', __FILE__)
begin
ENV['BUNDLE_GEMFILE'] = gemfile
require 'bundler'
Bundler.setup
rescue Bundler::GemNotFound => e
STDERR.puts e.message
STDERR.puts "Try running `bundle install`."
exit!
end if File.exist?(gemfile)
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql
reconnect: false
database: Reliz
pool: 5
username: zh99998-test
password: zh99998
host: bbs.66rpg.com
encoding: utf8
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: mysql2
encoding: utf8
reconnect: false
database: Reliz_test
pool: 5
username: zh99998-test
password: zh99998
host: localhost
production:
adapter: mysql2
encoding: utf8
reconnect: false
database: Reliz_production
pool: 5
username: zh99998-test
password: zh99998
host: localhost
Encoding.default_internal, Encoding.default_external = ['utf-8'] * 2
# Load the rails application
require File.expand_path('../application', __FILE__)
require File.expand_path('../../lib/mysql_utf8.rb', __FILE__)
# Initialize the rails application
Reliz::Application.initialize!
Reliz::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the webserver when you make code changes.
config.cache_classes = false
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_view.debug_rjs = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false
# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
end
Reliz::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# The production environment is meant for finished, "live" apps.
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Specifies the header that your server uses for sending files
config.action_dispatch.x_sendfile_header = "X-Sendfile"
# For nginx:
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
# If you have no front-end server that supports something like X-Sendfile,
# just comment this out and Rails will serve the files
# See everything in the log (default is :info)
# config.log_level = :debug
# Use a different logger for distributed setups
# config.logger = SyslogLogger.new
# Use a different cache store in production
# config.cache_store = :mem_cache_store
# Disable Rails's static asset server
# In production, Apache or nginx will already do this
config.serve_static_assets = false
# Enable serving of images, stylesheets, and javascripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"
# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false
# Enable threaded mode
# config.threadsafe!
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation can not be found)
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify
end
Reliz::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Raise exceptions instead of rendering exception templates
config.action_dispatch.show_exceptions = false
# Disable request forgery protection in test environment
config.action_controller.allow_forgery_protection = false
# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
# Use SQL instead of Active Record's schema dumper when creating the test database.
# This is necessary if your schema can't be completely dumped by the schema dumper,
# like if you have constraints or database-specific column types
# config.active_record.schema_format = :sql
# Print deprecation notices to the stderr
config.active_support.deprecation = :stderr
end
# Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
# Rails.backtrace_cleaner.remove_silencers!
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# (all these examples are active by default):
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
# inflect.uncountable %w( fish sheep )
# end
# Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone
# Be sure to restart your server when you modify this file.
# Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
Reliz::Application.config.secret_token = 'cc1f062f92fe8a36c495361553a3f5fa7bd19c4b680f8003f9ae83b1b8dcdaba15c55cfe8dba9f6e90f2a2ebf5bcf92fb1852c71b58eaa107c756242f4efb5ff'
# Be sure to restart your server when you modify this file.
Reliz::Application.config.session_store :cookie_store, :key => '_Reliz_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rails generate session_migration")
# Reliz::Application.config.session_store :active_record_store
# Sample localization file for English. Add more files in this directory for other locales.
# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
en:
hello: "Hello world"
Reliz::Application.routes.draw do
resources :boards
root :to => 'boards#index'
resources :users
resources :blocks
resources :boards
match 'forum' => 'boards#index'
match 'forum/:id/(/:page)' => 'boards#show', :id => /\d+/, :page => /\d+/
resources :posts
match 'forum/:topic_id/new' => 'posts#new', :topic_id => /\d+/ #·¢±í»Ø¸´
resources :topics
match 'topic/:id/(/:page)' => 'topics#show', :id => /\d+/, :page => /\d+/
match 'forum/:forum_id/new' => 'topics#new', :forum_id => /\d+/ #·¢±íÖ÷Ìâ
match ':something/:anything', :controller => 'application', :action => 'redirect_to_thc', :something => /forum|boards|topic|topics|posts/, :anything => /.*/
match '/:anything', :controller => 'application', :action => 'redirect_to_thc', :anything => /.*/
# The priority is based upon order of creation:
# first created -> highest priority.
# Sample of regular route:
# match 'products/:id' => 'catalog#view'
# Keep in mind you can assign values other than :controller and :action
# Sample of named route:
# match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
# This route can be invoked with purchase_url(:id => product.id)
# Sample resource route (maps HTTP verbs to controller actions automatically):
# resources :products
# Sample resource route with options:
# resources :products do
# member do
# get 'short'
# post 'toggle'
# end
#
# collection do
# get 'sold'
# end
# end
# Sample resource route with sub-resources:
# resources :products do
# resources :comments, :sales
# resource :seller
# end
# Sample resource route with more complex sub-resources
# resources :products do
# resources :comments
# resources :sales do
# get 'recent', :on => :collection
# end
# end
# Sample resource route within a namespace:
# namespace :admin do
# # Directs /admin/products/* to Admin::ProductsController
# # (app/controllers/admin/products_controller.rb)
# resources :products
# end
# You can have the root of your site routed with "root"
# just remember to delete public/index.html.
# root :to => "welcome#index"
# See how all your routes lay out with "rake routes"
# This is a legacy wild controller route that's not recommended for RESTful applications.
# Note: This route will make all actions in every controller accessible via GET requests.
# match ':controller(/:action(/:id(.:format)))'
end
class CreateTopics < ActiveRecord::Migration
def self.up
create_table :topics do |t|
t.references :user
t.references :type
t.references :category, :polymorphic => true
t.string :name
t.integer :displayorder
t.integer :views
t.integer :readperm
t.boolean :locked
t.boolean :reverse
t.boolean :private
t.timestamps
end
end
def self.down
drop_table :topics
end
end
class CreatePosts < ActiveRecord::Migration
def self.up
create_table :posts do |t|
t.references :topic
t.references :user
t.text :content
t.integer :displayorder
t.integer :readperm
t.boolean :private
t.boolean :anonymous
t.boolean :ubb
t.boolean :html
t.timestamps
end
end
def self.down
drop_table :posts
end
end
class CreateComments < ActiveRecord::Migration
def self.up
create_table :comments do |t|
t.references :post
t.references :user
t.text :content
t.timestamps
end
end
def self.down
drop_table :comments
end
end
class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.string :name
t.string :nickname
t.string :password
t.string :email
t.references :usergroup
t.references :admingroup
t.string :regip
t.string :lastloginip
t.integer :readnum
t.integer :viewnum
t.integer :onlinetime
t.integer :credit
t.integer :credit1
t.integer :credit2
t.integer :credit3
t.integer :credit4
t.integer :credit5
t.integer :credit6
t.integer :credit7
t.integer :credit8
t.timestamps
end
end
def self.down
drop_table :users
end
end
class CreatePms < ActiveRecord::Migration
def self.up
create_table :pms do |t|
t.references :user
t.references :from_user
t.text :content
t.timestamps
end
end
def self.down
drop_table :pms
end
end
class CreateNotices < ActiveRecord::Migration
def self.up
create_table :notices do |t|
t.references :user
t.string :type
t.references :assocaion, :polymorphic => true
t.references :from_user
t.timestamps
end
end
def self.down
drop_table :notices
end
end
class CreateBoards < ActiveRecord::Migration
def self.up
create_table :boards do |t|
t.string :name
t.text :introduction
t.text :notice
t.string :logo
t.string :banner
t.integer :readperm
t.integer :topicperm
t.integer :postperm
t.timestamps
end
end
def self.down
drop_table :boards
end
end
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20101226072024) do
# Could not dump table "boards" because of following Mysql2::Error
# Invalid date: BTREE
# Could not dump table "boards_copy" because of following Mysql2::Error
# Invalid date: BTREE
# Could not dump table "comments" because of following Mysql2::Error
# Invalid date: BTREE
# Could not dump table "comments_copy" because of following Mysql2::Error
# Invalid date: BTREE
# Could not dump table "notices" because of following Mysql2::Error
# Invalid date: BTREE
# Could not dump table "notices_copy" because of following Mysql2::Error
# Invalid date: BTREE
# Could not dump table "pms" because of following Mysql2::Error
# Invalid date: BTREE
# Could not dump table "pms_copy" because of following Mysql2::Error
# Invalid date: BTREE
# Could not dump table "posts" because of following Mysql2::Error
# Invalid date: BTREE
# Could not dump table "posts_copy" because of following Mysql2::Error
# Invalid date: BTREE
# Could not dump table "schema_migrations_copy" because of following Mysql2::Error
# Invalid date: BTREE
# Could not dump table "topics" because of following Mysql2::Error
# Invalid date: BTREE
# Could not dump table "topics_copy" because of following ActiveRecord::StatementInvalid
# Mysql2::Error: Can't create/write to file 'C:\WINDOWS\TEMP\#sql_618_0.MYI' (Errcode: 13): describe `topics_copy`
# Could not dump table "users" because of following Mysql2::Error
# Invalid date: BTREE
# Could not dump table "users_copy" because of following Mysql2::Error
# Invalid date: BTREE
end
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
# Mayor.create(:name => 'Daley', :city => cities.first)
Use this README file to introduce your application and point to useful places in the API for learning more.
Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.
require 'mysql'
class Mysql::Result
def encode(value, encoding = "utf-8")
String === value ? value.force_encoding(encoding) : value
end
def each_utf8(&block)
each_orig do |row|
yield row.map {|col| encode(col) }
end
end
alias each_orig each
alias each each_utf8
def each_hash_utf8(&block)
each_hash_orig do |row|
row.each {|k, v| row[k] = encode(v) }
yield(row)
end
end
alias each_hash_orig each_hash
alias each_hash each_hash_utf8
end
\ No newline at end of file
This diff is collapsed.
platform.active=Ruby
rails.port=3000
source.encoding=UTF-8
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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