yaz/commit

add open beelden channel

authorMichiel Hildebrand
Thu Feb 10 10:21:23 2011 +0100
committerMichiel Hildebrand
Thu Feb 10 10:21:23 2011 +0100
commit7f7ad52d68a7fd8ef47eaa5a234e2f8d461ce3fa
tree6d2baaf70c63fc2a1f521bed604c7624ecaa6f9a
parenta8508b163f37f1a453db491fda0eac4090069d35
Diff style: patch stat
diff --git a/applications/yaz_game.pl b/applications/yaz_game.pl
index 492d7a1..37ed4da 100644
--- a/applications/yaz_game.pl
+++ b/applications/yaz_game.pl
@@ -49,17 +49,26 @@
 :- rdf_meta
         cond_object_assert(r,r,o,r).
 
+channel('http://www.openbeelden.nl/media/17674/Nederlandse_ontwikkelingshulp_voor_Indonesiƫ__sanering_waterhuishouding',
+	video('openbeelden1.flv'),
+	'Nederlandse ontwikkelingshulp voor Indonesia',
+	120).
+
+channel('http://www.openbeelden.nl/media/17260/Indische_tentoonstelling_voor_de_Nederlandse_jeugd',
+	video('openbeelden2.flv'),
+	'Inische tentoonstelling',
+	120).
 
 channel('http://nos.nl/video/217191-het-nieuws-in-60-seconden-1430-uur.html',
 	video('nos_journaal_07022011.flv'),
 	'NOS journaal 7 Feb 2011',
 	60).
 
-channel('http://g.bbcredux.com/programme/bbcone/2011-02-05/12-00-00',
+/*channel('http://g.bbcredux.com/programme/bbcone/2011-02-05/12-00-00',
 	video('bbc_news_05022011.flv'),
         'BBC News 5 Feb 2011 12:00',
         1101).
-/*
+
 channel('http://g.bbcredux.com/programme/bbcone/2010-11-21/22-00-00',
 	'http://g.bbcredux.com/programme/5542126155790075626/download/12340-1295719806-48faefbd0b0f9057050098ef47daf3a5/flash.flv',
 	'BBC News 21 Nov 2010 22:00',
diff --git a/applications/yaz_new_user.pl b/applications/yaz_new_user.pl
index 0b8259f..c54932e 100644
--- a/applications/yaz_new_user.pl
+++ b/applications/yaz_new_user.pl
@@ -16,35 +16,59 @@
 :- use_module(library(user_process)).
 :- use_module(library(yui3)).
 
-:- http_handler(yaz(start), http_yaz_start, []).
+:- http_handler(root(p1), http_yaz_p1, []).
+:- http_handler(root(p2), http_yaz_p2, []).
+
 
 video(1, 'http://nos.nl/video/217191-het-nieuws-in-60-seconden-1430-uur.html').
-%video(1, 'http://g.bbcredux.com/programme/bbcone/2011-02-05/12-00-00').
+video(2, 'http://www.openbeelden.nl/media/17674/Nederlandse_ontwikkelingshulp_voor_Indonesiƫ__sanering_waterhuishouding').
+% video(3,
+% 'http://www.openbeelden.nl/media/17260/Indische_tentoonstelling_voor_de_Nederlandse_jeugd').
 
 %%	http_yaz_start(+Request)
 %
 %	Emit game starting page for new users.
 
-http_yaz_start(Request) :-
+http_yaz_p1(Request) :-
 	http_parameters(Request,
 			[  user(User,
 				[optional(true),
 				 descritpion('Name of new user')])
 			]),
 	(   var(User)
-	->  html_page([])
+	->  html_page(http_yaz_p1, [])
 	;   current_user(User)
-	->  html_page([user(User),
+	->  html_page(http_yaz_p1,
+		      [user(User),
 		       message('name already exists')])
 	;   video(1, Video),
-	    http_link_to_id(http_yaz_game, [url(Video)], Game),
+ 	    http_link_to_id(http_yaz_game, [url(Video)], Game),
+	    password_hash(presto, PW),
+	    user_add(User, [realname(User),password(PW),allow([read(_,_),write(_,_)])]),
+	    login(User),
+	    throw(http_reply(moved_temporary(Game)))
+	).
+http_yaz_p2(Request) :-
+	http_parameters(Request,
+			[  user(User,
+				[optional(true),
+				 descritpion('Name of new user')])
+			]),
+	(   var(User)
+	->  html_page(http_yaz_p2, [])
+	;   current_user(User)
+	->  html_page(http_yaz_p2,
+		      [user(User),
+		       message('name already exists')])
+	;   video(2, Video),
+ 	    http_link_to_id(http_yaz_game, [url(Video)], Game),
 	    password_hash(presto, PW),
 	    user_add(User, [realname(User),password(PW),allow([read(_,_),write(_,_)])]),
 	    login(User),
 	    throw(http_reply(moved_temporary(Game)))
 	).
 
-html_page(Options) :-
+html_page(F, Options) :-
 	option(user(User), Options, ''),
 	option(message(Message), Options, ''),
 	reply_html_page([ title(['YAZ - new user'])
@@ -52,7 +76,7 @@ html_page(Options) :-
 			[ \html_requires(css('yaz.css')),
 			  div('style="text-align:center;margin-top:20%"',
 			      [ h3('Enter your name:'),
-				form(action(location_by_id(http_yaz_start)),
+				form(action(location_by_id(F)),
 				     [ input([type(text),name(user),value(User)])
 				     ]),
 				div([style='color:red;size:smalller'],