k666 dites non à petitmou | okaie
mais j'avoue: ya bcp de php derrière
c parti!
Code :
- <script language="Javascript">
- // état actuel de la navigation
- var current_activity_id = <?= $activity_id ?>;
- var current_offer_id = <?= $offer_id ?>;
- var current_root_offer_id = <?= $root_offer_id ?>;
- var current_user_id = <?= $user_id ?>;
- var player_ready = false;
- var debug = true;
- var tries = 0;
- <?
- if ($_GET['undocked'] == "y" )
- {
- echo "var undocked = \"y\";";
- }
- else
- {
- echo "var undocked = \"n\";";
- }
- ?>
- var obj_infobar;
- var obj_topbar;
- var obj_navbar;
- var obj_content;
- function showHelp()
- {
- var helpwindow = window.open("" );
- helpwindow.document.write("<html><body>ici aide, non dispo...</body></html>" );
- }
- function objExists(which)
- {
- if ( (which != null) )
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- function dockOrUndock()
- {
- if (undocked == "y" )
- {
- obj_navbar.close();
- this.location = "./?activity_id=" + current_activity_id + "&offer_id=" + current_offer_id + "&root_offer_id=" + current_root_offer_id + "&user_id=" + current_user_id ;
- }
- else
- {
- this.location = "./?activity_id=" + current_activity_id + "&offer_id=" + current_offer_id + "&root_offer_id=" + current_root_offer_id + "&user_id=" + current_user_id + "&undocked=y" ;
- }
- }
- function goHome()
- {
- if ( (undocked == "y" ) && objExists(obj_navbar) )
- {
- obj_navbar.close();
- }
- this.location = "../../details/?root_offer_id="+current_root_offer_id;
- }
- function goFirst()
- {
- obj_infobar.location.href = "infobar.php?activity_id=" + current_activity_id + "&offer_id=" + current_offer_id + "&root_offer_id=" + current_root_offer_id + "&user_id=" + current_user_id+ "&action=first";
- }
- function goPrevious()
- {
- obj_infobar.location.href = "infobar.php?activity_id=" + current_activity_id + "&offer_id=" + current_offer_id + "&root_offer_id=" + current_root_offer_id + "&user_id=" + current_user_id+ "&action=previous";;
- }
- function goNext()
- {
- obj_infobar.location.href = "infobar.php?activity_id=" + current_activity_id + "&offer_id=" + current_offer_id + "&root_offer_id=" + current_root_offer_id + "&user_id=" + current_user_id+ "&action=next";
- }
- function reDir(obj,newurl)
- {
- if( objExists(obj) )
- {
- obj.location.replace(newurl);
- tries = 0;
- return true;
- }
- else if ( tries < 10 )
- {
- tries++;
- setTimeout("reDir("+obj+","+newurl+" );","200" );
- }
- else
- {
- return false;
- }
- }
- function gotoActivity(activity_id,offer_id)
- {
- try
- {
- if (player_ready)
- {
- current_activity_id = activity_id;
- current_offer_id = offer_id;
- var querystring = "activity_id=" + current_activity_id + "&offer_id=" + current_offer_id + "&root_offer_id=" + current_root_offer_id + "&user_id=" + current_user_id + "&expand=" + current_offer_id + "&undocked=" + undocked;
- reDir(obj_content,"content.php?" + querystring);
- reDir(obj_topbar,"topbar.php?" + querystring);
- reDir(obj_navbar,"navbar.php?" + querystring + "#"+current_offer_id+"-"+current_activity_id);
- }
- }
- catch (e)
- {
- for (i in e)
- {
- alert(i + eval('e.' + i));
- }
- }
- }
- function tagActivity(status)
- {
- if (objExists(obj_infobar))
- {
- obj_infobar.location.href = "platform.php?activity_id=" + current_activity_id + "&offer_id=" + current_offer_id + "&root_offer_id=" + current_root_offer_id + "&user_id=" + current_user_id+ "&status="+status;
- return true;
- }
- else
- {
- return false;
- }
- }
- function doLoad()
- {
- obj_infobar = eval("infobar" );
- obj_topbar = eval("topbar" );
- obj_navbar = eval("navbar" );
- obj_content = eval("content" );
- if ( objExists(obj_infobar) && objExists(obj_topbar) && objExists(obj_navbar) && objExists(obj_content) )
- {
- player_ready = true;
- tries = 0;
- }
- else if ( tries < 10 )
- {
- tries++;
- setTimeout("doLoad();","200" );
- }
- else
- {
- player_ready = false;
- return false;
- }
- }
- function blank()
- {
- return "<html></html>";
- }
- function preloaded()
- {
- window.status = "ok";
- }
- </script>
- <?
- if ($_GET['undocked'] == "y" )
- {
- ?>
- <script language="javascript">
- var navbar = window.open("navbar.php?activity_id=<?= $activity_id ?>&offer_id=<?= $offer_id ?>&root_offer_id=<?= $root_offer_id ?>&user_id=<?= $user_id ?>&action=login&undocked=y#<?= $offer_id ?>-<?= $activity_id ?>","","height=400,width=300,status=no,toolbar=no,menubar=no,location=no,resizable,scrollbars" );
- </script>
- <frameset rows="0,50,*" frameborder="no" framespacing="0" onload="javascript:doLoad();">
- <frame name="infobar" src="blank();">
- <frame name="topbar" src="topbar.php?activity_id=<?= $activity_id ?>&offer_id=<?= $offer_id ?>&root_offer_id=<?= $root_offer_id ?>&user_id=<?= $user_id ?>&action=login">
- <frame name="content" src="content.php?activity_id=<?= $activity_id ?>&offer_id=<?= $offer_id ?>&root_offer_id=<?= $root_offer_id ?>&user_id=<?= $user_id ?>&action=login">
- </frameset>
- <?
- }
- else
- {
- ?>
- <frameset rows="0,50,*" frameborder="no" framespacing="0" onload="javascript:doLoad();">
- <frame name="infobar" src="blank();" frameborder="no">
- <frame name="topbar" src="topbar.php?activity_id=<?= $activity_id ?>&offer_id=<?= $offer_id ?>&root_offer_id=<?= $root_offer_id ?>&user_id=<?= $user_id ?>&action=login" frameborder="no">
- <frameset cols="250,*" frameborder="no">
- <frame name="navbar" src="navbar.php?activity_id=<?= $activity_id ?>&offer_id=<?= $offer_id ?>&root_offer_id=<?= $root_offer_id ?>&user_id=<?= $user_id ?>&action=login" frameborder="no">
- <frame name="content" src="content.php?activity_id=<?= $activity_id ?>&offer_id=<?= $offer_id ?>&root_offer_id=<?= $root_offer_id ?>&user_id=<?= $user_id ?>&action=login" frameborder="no">
- </frameset>
- </frameset>
- <?
- }
- ?>
- </html>
|
|