PageRenderTime 54ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/include_header.php

http://thinktankforums.googlecode.com/
PHP | 81 lines | 61 code | 16 blank | 4 comment | 7 complexity | 550e5757a9c66f1d206e669e9d5c7aa1 MD5 | raw file
Possible License(s): 0BSD
  1. <?php
  2. /* think tank forums
  3. *
  4. * include_header.php
  5. */
  6. header('Content-Type: text/html; charset=utf-8');
  7. if (empty($ttf_title)) {
  8. $ttf_htmltitle = $ttf_cfg["forum_name"];
  9. } else {
  10. $ttf_htmltitle = $ttf_cfg["forum_name"]." &raquo; ".$ttf_title;
  11. };
  12. echo <<<EOF
  13. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  14. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  15. <head>
  16. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  17. <title>{$ttf_htmltitle}</title>
  18. <link rel="stylesheet" type="text/css" href="style.css" />
  19. </head>
  20. <body>
  21. <h1><a href="./">{$ttf_cfg["forum_name"]}</a></h1>
  22. <h2>{$ttf_label}</h2>
  23. <div id="enclosure">
  24. <div class="menu_title">
  25. EOF;
  26. if (isset($ttf["uid"])) {
  27. if (isset($ttf["avatar_type"])) {
  28. echo ' <img src="avatars/'.$ttf["uid"].'.'.$ttf["avatar_type"].'" alt="your avatar" width="30" height="30" class="avatar" />'."\n";
  29. };
  30. echo <<<EOF
  31. hi, {$ttf["username"]}!
  32. </div>
  33. <div class="menu_body">
  34. &middot; <a href="search.php">search</a><br />
  35. &middot; <a href="editprofile.php">edit your profile</a><br />
  36. EOF;
  37. if ($ttf["perm"] == 'admin') {
  38. echo ' &middot; <a href="admin_userlist.php">user list</a><br />'."\n";
  39. };
  40. echo ' &middot; <a href="logout.php">log out</a>'."\n";
  41. } else {
  42. $force_https = $ttf_cfg["cookie_secure"] ? 'https://'.$ttf_cfg["address"].'/' : '';
  43. echo <<<EOF
  44. log in to {$ttf_cfg["forum_shortname"]}
  45. </div>
  46. <div class="menu_body">
  47. <form action="{$force_https}login.php" method="post">
  48. <div>
  49. <input type="text" name="username" maxlength="16" size="16" /><br />
  50. <input type="password" name="password" maxlength="32" size="16" /><br />
  51. <input type="submit" value="let's go!" />
  52. </div>
  53. </form>
  54. </div>
  55. <div class="menu_title">
  56. can't log in?
  57. </div>
  58. <div class="menu_body">
  59. &middot; <a href="register.php">register an account</a><br />
  60. &middot; <a href="recover.php">recover your account</a><br />
  61. &middot; <a href="search.php">search the forums</a>
  62. EOF;
  63. };
  64. ?>
  65. </div>