NKUT footer displaying number of visitors and last update time

This commit is contained in:
Manson Wang 2013-11-19 15:28:47 +08:00
parent 82ffc7c3fd
commit 05faefb301
3 changed files with 8 additions and 0 deletions

View File

@ -38,6 +38,8 @@ $(document).ready(function() {
}
}
})
$('.page_footer').append($('#last_update_date')[0]);
});
// Ad Banner FX code [end]

View File

@ -2,6 +2,7 @@ class PagesController < ApplicationController
include ApplicationHelper
before_filter :get_item, :only => [:index_from_link, :show_from_link]
before_filter :check_frontend_open, :only => [:index,:show]
before_filter :get_last_update_date, :only => [:index,:show]
# caches_page :index
def index
@ -214,4 +215,8 @@ class PagesController < ApplicationController
return false
end
end
def get_last_update_date
@last_update_date = t(:total_visitors)+' : '+ Impression.count.to_s+' | '+t(:update_at)+' : '+Bulletin.order_by(:updated_at.desc).limit(1).first[:updated_at].to_s
end
end

View File

@ -41,5 +41,6 @@
}
</style>
<% end %>
<div id='last_update_date_wrap' style='display:none;'><div id='last_update_date'><%= @last_update_date %></div></div>
</body>
</html>