-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
357 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class EydfGalleryController < ApplicationController | ||
skip_before_filter :authorize | ||
|
||
def gallery_list | ||
@total_avatars = EydAvatar.find_by_sql("select ava.* from eyd_avatars ava where ava.user_id=1 order by ava.updated_at desc limit 280") | ||
end | ||
|
||
def tag_gallery_list | ||
@total_avatars = EydAvatar.tagged_with(params[:id]) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
class EydfGuestbkController < ApplicationController | ||
skip_before_filter :authorize | ||
before_filter :fetch_categories, :fetch_archivals | ||
before_filter :build_comment, :only=> [:guest_list] | ||
|
||
def fetch_categories | ||
session[:userId]=1 | ||
unless read_fragment('category_fragment'+session[:userId].to_s) | ||
@constants = EydConstant.find_by_sql("select constant.* from eyd_constants constant where constant.user_id=1 order by constant.updated_at desc") | ||
end | ||
end | ||
|
||
def fetch_archivals | ||
unless read_fragment('archival_fragment'+session[:userId].to_s) | ||
@archivals = EydBlog.find_by_sql("select year(created_at) as year, month(created_at) as month, count(id)as count from eyd_blogs where user_id=1 group by year(created_at),month(created_at) order by year(created_at) desc, month(created_at) desc") | ||
end | ||
end | ||
|
||
def guest_list | ||
@total_comments = EydComment.paginate_by_sql ["select comment.* from eyd_comments comment where comment.is_guestbook=true order by comment.updated_at desc"], :page => params[:page], :per_page=>10 | ||
end | ||
|
||
protected | ||
def build_comment | ||
@eyd_comment = EydComment.new | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
class EydfIbookController < ApplicationController | ||
skip_before_filter :authorize | ||
before_filter :fetch_categories, :fetch_archivals | ||
|
||
def fetch_categories | ||
session[:userId]=2 | ||
unless read_fragment('category_fragment'+session[:userId].to_s) | ||
@constants = EydConstant.find_by_sql("select constant.* from eyd_constants constant where constant.user_id=2 order by constant.updated_at desc") | ||
end | ||
end | ||
|
||
def fetch_archivals | ||
unless read_fragment('archival_fragment_tech'+session[:userId].to_s) | ||
@archivals = EydBlog.find_by_sql("select year(created_at) as year, month(created_at) as month, count(id)as count from eyd_blogs where user_id=2 group by year(created_at),month(created_at) order by year(created_at) desc, month(created_at) desc") | ||
end | ||
end | ||
|
||
def ibook_list | ||
@total_ibooks = EydIbook.paginate_by_sql ["select ibook.* from eyd_ibooks ibook where ibook.user_id=2 order by ibook.updated_at desc"], :page => params[:page], :per_page=>20 | ||
end | ||
|
||
def tag_ibook_list | ||
@total_ibooks = EydIbook.tagged_with(params[:id]).paginate :page => params[:page], :per_page => 50 | ||
end | ||
|
||
def download | ||
@ibook = EydIbook.find(params[:id]) | ||
sync_download_count(@ibook) | ||
if @ibook.ibook.url!=nil | ||
url = @ibook.ibook.url.split("?") | ||
send_file "#{RAILS_ROOT}/public"+url[0] unless @ibook.ibook.url.nil? | ||
end | ||
end | ||
|
||
def sync_download_count(ibook) | ||
ibook.download_count+=1 | ||
ibook.update_attribute("download_count",ibook.download_count) | ||
end | ||
|
||
end |
Oops, something went wrong.