⌈⌋ ⎇ branch:  freshcode


Artifact [cea267f29b]

Artifact cea267f29b96aa421be81484a1880d679189f22a:

  • File page_forum.php — part of check-in [686e87487e] at 2015-03-24 18:23:10 on branch trunk — Updated stylesheet to use table-layout for #main/#sidebar split. Padding still needs work. (user: mario size: 1835)

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
<?php
/**
 * api: freshcode
 * type: main
 * title: meta/forum
 * description: Simple threaded discussion / documentation forum.
 * version: 0.2
 *
 * Distinct layout from main site and harbours its own dispatcher.
 * Editing/post features. CSS is melted in, as there's no subpaging.
 *
 */

#-- custom config
include_once("./shared.phar");  // autoloader
define("INPUT_QUIET", 1) and
include_once("lib/input.php");  // input filter
define("HTTP_HOST", $_SERVER->id["HTTP_HOST"]);
include_once("lib/deferred_openid_session.php");  // auth+session
include_once("aux.php");        // utility functions
include_once("config.local.php");
include_once("lib/db.php");     // database API
db(new PDO("sqlite:forum.db")); // separate storage


#-- set up forum handling
$f = new forum();
$f->is_admin = in_array(@$_SESSION["openid"], $moderator_ids);


#-- dispatch functions
switch ($name = $_GET->id["name"]) {

    case "submit":
        exit( $f->submit() );

    case "post":
        exit( $f->submit_form($_REQUEST->int["pid"], 0) );

    case "edit":
        exit( $f->edit_form(0, $_REQUEST->int["id"]) );

    case "index":
    case "":
    default:
        // handled below per default
}
   
?>
<!DOCTYPE html>
<html>
<head>
    <title>freshcode.club forum</title>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="gimmicks.js?019"></script>
    <meta charset=UTF-8>
    <?= "<style>\n"
      . file_get_contents("forum.css")
      . "</style>";
    ?>
</head>
<body>
<div id=title>
   <h1><a href="/"><b>fresh</b>(code)<b class=red>.</b><span class=grey>club</span></a></h1>
</div>
<br>
<ul class=forum>

   <li>
      <div class=entry>
         <a class="action forum-new" data-id=0>New Thread</a>
      </div>
   </li>
   <?php
      $f->index();
    ?>
</ul>
</body>
</html>