1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- function tpl_redirect($path)
- {
- header("Location: http://jk.gs/git/bot/$path");
- exit;
- }
- function tpl_header()
- {
- print <<<EOT
- <!DOCTYPE HTML>
- <html><head><title>#git bot interface</title>
- <link rel="stylesheet" type="text/css" href="../style.css">
- <link rel="stylesheet" type="text/css" href="hljs/styles/arduino-light.css">
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <link rel="shortcut icon" href="/git/bot/favicon.ico">
- </head><body>
- <h1>#git bot interface</h1>
- EOT;
- if ($user = logged_in()) {
- print <<<EOT
- <div id="login_menu">Hi <strong>$user</strong>. <a href="logout.php">Log
- out</a> or go do fun stuff.</div>
- EOT;
- }
- if (isset($_GET['ok'])) {
- print "<div id=\"msg\">Operation successful. Yay!</div>";
- }
- }
- function tpl_footer()
- {
- print <<<EOT
- </body></html>
- EOT;
- }
- function format_plain_linked($t)
- {
- return preg_replace('/\\b(https?:\/\/\\S+)(?<![.,!?;>])/', '<a href="$1">$1</a>', htmlspecialchars($t));
- }
|