/** * show_admin_page_header * * * * * * * * * */ function show_admin_page_header($site_title) { echo ' <body> <div id="outer_wrapper"> <div id="inner_wrapper"> <!-- header section --> <div id="header"> <div id="header_content"> <div id="header_text"> <p> <a href="index.php" title="edit room home page">Wicked Words Edit Room</a> </p> <small><a href="' . WW_WEB_ROOT . '" title="click here to view your site">' . $site_title . '</a></small> </div> <div id="header_panel"> <p>you\'re using <a href="http://www.evilchicken.biz">wicked words</a></p> <p>PHP time: ' . date('d/m/y H:i') . '</p> <p>MySQL time: ' . date('d/m/y H:i', strtotime(get_mysql_time())) . '</p>'; // show additional timezone info if we're not in GMT if (date('T') != 'GMT') { echo ' <div class="gmt_info"> <p>' . date('T') . ' | offset from GMT: ' . date('O') . '</p> <p>GMT: ' . gmdate('d/m/y H:i') . '</p> </div>'; } echo ' </div> </div> </div>'; // nav echo ' <!-- nav section --> <div id="nav"> <ul id="nav_links"> <li><a href="' . WW_REAL_WEB_ROOT . '/ww_edit/index.php?page_name=write">Write!</a></li> <li><a href="' . WW_REAL_WEB_ROOT . '/ww_edit/index.php?page_name=articles">Articles</a></li> <li><a href="' . WW_REAL_WEB_ROOT . '/ww_edit/index.php?page_name=comments">Comments</a></li> '; if (empty($_SESSION[WW_SESS]['guest'])) { // author only links echo ' <li><a href="' . WW_REAL_WEB_ROOT . '/ww_edit/index.php?page_name=files">Files</a></li> <li><a href="' . WW_REAL_WEB_ROOT . '/ww_edit/index.php?page_name=links">Links</a></li> <li><a href="' . WW_REAL_WEB_ROOT . '/ww_edit/index.php?page_name=settings">Settings</a></li>'; } else { // editor / contributor links echo ' <li><a href="' . WW_REAL_WEB_ROOT . '/ww_edit/index.php?page_name=images">Images</a></li> <li><a href="' . WW_REAL_WEB_ROOT . '/ww_edit/index.php?page_name=attachments">Attachments</a></li>'; } echo ' </ul> </div>'; // start main content section echo ' <!-- content wrapper section --> <div id="content_wrapper">'; }
<?php include 'php/signalling.php'; // Client gets it's client id; $client_id = new_client_id(); $join_timestamp = get_mysql_time(); // Client joins a room. The room could be specified in the url otherwise // a random room is made. if (isset($_GET['room_id'])) { $room_id = $_GET['room_id']; if (strlen($room_id) != 6) { $error = "Error! invalid room"; } else { ensure_room_exists($room_id, $client_id); } } else { $room_id = new_room($client_id); } // Join the room. A join room signal will be broadcast by the server on // the client's behalf, even before the signaller is built on the client. // Maybe you want to let client send join message with her signaller join_room($room_id, $client_id); $initiator_id = get_initiator($room_id); // The initiator of the room is passive, and waits for newcommers to // initiate. Hence, the room initiator is never the call-initiator! $initiator = $initiator_id == $client_id ? 'false' : 'true'; $is_first = $initiator_id == $client_id ? 'true' : 'false'; // Generate a url for this room. Users might share by email or IM to // get connected $room_file_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; $room_id_url = "?room_id={$room_id}";