From e085bf133b3ca30cefd9f7ca13f532cf99a32e44 Mon Sep 17 00:00:00 2001 From: Pavel Date: Mon, 15 Mar 2010 19:08:14 +0200 Subject: [PATCH] client changes again --- online/app/controllers/user_controller.rb | 22 +++++++++++++--------- online/app/views/user/question1.fbml.erb | 1 - online/app/views/user/question2.fbml.erb | 1 - online/app/views/user/question3.fbml.erb | 3 +-- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/online/app/controllers/user_controller.rb b/online/app/controllers/user_controller.rb index dd51d81..350a0b4 100644 --- a/online/app/controllers/user_controller.rb +++ b/online/app/controllers/user_controller.rb @@ -72,7 +72,7 @@ class UserController < ApplicationController def question1 user_has_published_once = false user_has_published_once = question_processor - if user_has_published_once + if user_has_published_once 1 render :action => "question2" end @@ -81,8 +81,8 @@ class UserController < ApplicationController def question2 user_has_published_once = false - user_has_published_once = question_processor - if user_has_published_once + user_has_published_once = question_processor 2 + if user_has_published_once render :action => "question3" end @@ -90,16 +90,16 @@ class UserController < ApplicationController def question3 user_has_published_once = false - user_has_published_once = question_processor + user_has_published_once = question_processor (3) if user_has_published_once session_new = Facebooker::Session.create @userFB = Facebooker::User.new(session[:facebook_session].user.uid, session_new) - publishing (@userFB,@userFB,"selected thier top 5 friends: #{@userFB2.first_name}, X, Y, Z, W to win Nokia E72. How well do you know your friends? Answer and win now!","Take the Nokia E72 challenge","http://foo.com","2Take the Nokia E72 friendship challenge now to win up to 6 Nokia E72 devices","http://foo2.com","3Take the Nokia E72 friendship challenge now to win up to 6 Nokia E72 devices",'image',"http://www.finalsense.com/news/image/mobile/nokia-6124classic.jpg","http://foo3.com") + publishing (@userFB,@userFB,"selected their top 5 friends: A, X, Y, Z, W to win Nokia E72. How well do you know your friends? Answer and win now!","Take the Nokia E72 challenge","http://foo.com","2Take the Nokia E72 friendship challenge now to win up to 6 Nokia E72 devices","http://foo2.com","3Take the Nokia E72 friendship challenge now to win up to 6 Nokia E72 devices",'image',"http://www.finalsense.com/news/image/mobile/nokia-6124classic.jpg","http://foo3.com") render :action => "greetings" end end - def question_processor + def question_processor (question_number) user_has_published_once = false for i in 0...6 if params["friend_sel0#{i}"] != nil && params["friend_sel0#{i}"] != "" @@ -113,10 +113,14 @@ class UserController < ApplicationController @userFB2 =Facebooker::User.new(params["friend_sel0#{i}"], session_new) #publishing first message #p @today_quiz.feedpic.url(:normal) - - #publishing (@userFB,@userFB,"selected their top 5 friends: #{@userFB2.first_name}, X, Y, Z, W to win Nokia E72. How well do you know your friends? Answer and win now!","Take the Nokia E72 challenge","http://foo.com","2Take the Nokia E72 friendship challenge now to win up to 6 Nokia E72 devices","http://foo2.com","3Take the Nokia E72 friendship challenge now to win up to 6 Nokia E72 devices",'image',"http://www.finalsense.com/news/image/mobile/nokia-6124classic.jpg","http://foo3.com") - publishing (@userFB,@userFB2,"#{@userFB2.first_name}, you are one of my best friend here. I also picked X, Y, Z, W. Let's stay in youch","Take the Nokia E72 challenge","http://foo.com","2Take the Nokia E72 friendship challenge now to win up to 6 Nokia E72 devices","http://foo2.com","3Take the Nokia E72 friendship challenge now to win up to 6 Nokia E72 devices",'image',"http://www.finalsense.com/news/image/mobile/nokia-6124classic.jpg","http://foo3.com") + if question_number == 1 + publishing (@userFB,@userFB2,"#{@userFB2.first_name}, I chat with you the most. I also picked X, Y, Z, W. Let's stay in touch","Take the Nokia E72 challenge","http://foo.com","2Take the Nokia E72 friendship challenge now to win up to 6 Nokia E72 devices","http://foo2.com","3Take the Nokia E72 friendship challenge now to win up to 6 Nokia E72 devices",'image',"http://www.finalsense.com/news/image/mobile/nokia-6124classic.jpg","http://foo3.com") + elsif question_number == 2 + publishing (@userFB,@userFB2,"#{@userFB2.first_name}, you are of 5 most sporty friends. I also picked X, Y, Z, W. Let's stay in touch","Take the Nokia E72 challenge","http://foo.com","2Take the Nokia E72 friendship challenge now to win up to 6 Nokia E72 devices","http://foo2.com","3Take the Nokia E72 friendship challenge now to win up to 6 Nokia E72 devices",'image',"http://www.finalsense.com/news/image/mobile/nokia-6124classic.jpg","http://foo3.com") + elsif question_number == 3 + publishing (@userFB,@userFB2,"#{@userFB2.first_name}, you are of 5 most sporty friends. I also picked X, Y, Z, W. Let's stay in touch","Take the Nokia E72 challenge","http://foo.com","2Take the Nokia E72 friendship challenge now to win up to 6 Nokia E72 devices","http://foo2.com","3Take the Nokia E72 friendship challenge now to win up to 6 Nokia E72 devices",'image',"http://www.finalsense.com/news/image/mobile/nokia-6124classic.jpg","http://foo3.com") + end debug_message("Message was published into stream") user_has_published_once = true diff --git a/online/app/views/user/question1.fbml.erb b/online/app/views/user/question1.fbml.erb index b172f5b..962066b 100644 --- a/online/app/views/user/question1.fbml.erb +++ b/online/app/views/user/question1.fbml.erb @@ -1,4 +1,3 @@ -

Nokia's E72 first question of the day:


diff --git a/online/app/views/user/question2.fbml.erb b/online/app/views/user/question2.fbml.erb index 561a632..e6360da 100644 --- a/online/app/views/user/question2.fbml.erb +++ b/online/app/views/user/question2.fbml.erb @@ -1,4 +1,3 @@ -

Nokia's E72 first question of the day:


diff --git a/online/app/views/user/question3.fbml.erb b/online/app/views/user/question3.fbml.erb index dd7cf20..d6efb7c 100644 --- a/online/app/views/user/question3.fbml.erb +++ b/online/app/views/user/question3.fbml.erb @@ -1,8 +1,7 @@ -

Nokia's E72 third question of the day:


- Which of your 5 friends do you like the most? + Which of your 5 friends do you find most sporty?

-- 2.11.4.GIT