diff --git a/app/controllers/front_controller.rb b/app/controllers/front_controller.rb index 0ef39633..eb14b25d 100644 --- a/app/controllers/front_controller.rb +++ b/app/controllers/front_controller.rb @@ -28,6 +28,10 @@ class FrontController < ApplicationController @page_id = params[:page_id] end + def show_inner_ad_image + @ad_image = AdImage.find(params[:id]) rescue nil + @ad_images = AdImage.all + end private diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index a6535c5f..57e6a5ff 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -65,7 +65,6 @@ class PagesController < ApplicationController def get_item module_app = ModuleApp.first(:conditions => {:key => params[:app_name]}) - if !params[:category_id].blank? && !params[:tag_id].blank? @item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id], :tag => params[:tag_id]}) @item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id], :tag => ''}) unless @item diff --git a/app/helpers/front_helper.rb b/app/helpers/front_helper.rb new file mode 100644 index 00000000..b44f28f2 --- /dev/null +++ b/app/helpers/front_helper.rb @@ -0,0 +1,9 @@ +module FrontHelper + + def ad_image_link(ad_image) + link = ad_image.out_link + link =front_show_inner_ad_image_path(:id=> ad_image.id) if link.blank? && !ad_image.context.blank? + + end + +end \ No newline at end of file diff --git a/app/views/front/show_banner.html.erb b/app/views/front/show_banner.html.erb index 921c360d..10dee26a 100644 --- a/app/views/front/show_banner.html.erb +++ b/app/views/front/show_banner.html.erb @@ -19,7 +19,7 @@
diff --git a/app/views/front/show_inner_ad_image.html.erb b/app/views/front/show_inner_ad_image.html.erb new file mode 100644 index 00000000..39350f62 --- /dev/null +++ b/app/views/front/show_inner_ad_image.html.erb @@ -0,0 +1,21 @@ +<%if @ad_image && @ad_image.display? %> +