Discussion Board Code

  Home arrow Discussion Board Code arrow Super Simple Discussion 4 sysadmins
DISCUSSION BOARD CODE

Super Simple Discussion 4 sysadmins
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 2
    2003-05-11

    Table of Contents:

     
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement
    A small board for communication between
    sysadmins or such like. Or at least thats why I designed it. If you need to keep admins up to date then use this. Its simple easy and basic. Only has 4 user support, but its brill for a small team building a website.

    By : rock

    <?php
    /*
    A small board for communication between
    sysadmins or such like.

    The board uses file access to display the
    messages. Search and replace message2 with
    the users name required and do the same for
    the other users. Once logged in just Click
    on the radio box you wish to post to and
    then just write your message. Click POST
    and hey presto Bob's your uncle.

    The user is identified by $REMOTE_USER
    If the user is identified then he/she can
    delete his/her own messages.

    $REMOTE_USER is an apache variable and can
    be used. Or you can write a login script to
    parse the variable.

    */

    ?>

    <html>
    <head>
    </head>
    <body>


    <?

    function date_str($timestamp) {
    $date_str = getdate($timestamp);
    $year = $date_str["year"];
    $mon = $date_str["mon"];
    $mday = $date_str["mday"];
    $hours = $date_str["hours"];
    $minutes = $date_str["minutes"];
    $seconds = $date_str["seconds"];

    return "$hours:$minutes:$seconds $mday/$mon/$year";
    }

    $message1 = "message1.txt";
    $message2 = "message2.txt";
    $message3 = "message3.txt";
    $message4 = "message4.txt";


    if ($deluser) {
    copy("./blank.txt", "./$deluser.txt");
    }
    $message1fp = fopen("./message1.txt", "a+");
    $message2fp = fopen("./message2.txt", "a+");
    $message3fp = fopen("./message3.txt", "a+");
    $message4fp = fopen("./message4.txt", "a+");
    if ($postto == "message2") fwrite($message2fp, $posttext);
    else if ($postto == "messagel") fwrite($message1fp, $posttext);
    else if ($postto == "message3") fwrite($message3fp, $posttext);
    else if ($postto == "message4") fwrite($message4fp, $posttext);
    else echo "......";

    if ($REMOTE_USER) echo "Welcome: $REMOTE_USER";
    else echo "Welcome: Unknow person";





    ?>

    <form method=post action="./post.php">
    <table width=100% border=1>
    <tr><td bgcolor=gray width=50%><font size=1><b>message2</b> &nbsp; - &nbsp; Last Modified <? echo date_str(filemtime($message2)); ?> &nbsp; &nbsp &nbsp; <input type=radio name="postto" value="message2">
    <td bgcolor=gray width=50%><font size=1><b>message3</b> &nbsp; - &nbsp; Last Modified <? echo date_str(filemtime($message3)); ?> &nbsp; &nbsp &nbsp; <input type=radio name="postto" value="message3">

    <tr><td><?
    $lines = file($message2);
    while (list($ElementIndexValue, $ElementContents) = each($lines))
    {
    echo $ElementContents."<br>";
    }
    ?><td> <?
    $lines = file($message3);
    while (list($ElementIndexValue, $ElementContents) = each($lines))
    {
    echo $ElementContents."<br>";
    }
    ?>
    <tr><td bgcolor=gray width=50%><font size=1><b>message1</b> &nbsp; - &nbsp; Last Modified <? echo date_str(filemtime($message1)); ?> &nbsp; &nbsp &nbsp; <input type=radio name="postto" value="message1">
    <td bgcolor=gray width=50%><font size=1><b>message4</b> &nbsp; - &nbsp; Last Modified <? echo date_str(filemtime($message4)); ?> &nbsp; &nbsp &nbsp; <input type=radio name="postto" value="message4">
    <tr><td> <?
    $lines = file($message1);
    while (list($ElementIndexValue, $ElementContents) = each($lines))
    {
    echo $ElementContents."<br>";
    }
    ?> <td> <?
    $lines = file($message4);
    while (list($ElementIndexValue, $ElementContents) = each($lines))
    {
    echo $ElementContents."<br>";
    }
    ?>
    </table>


    <center>
    <TEXTAREA name="posttext" cols=60 rows=15></TEXTAREA>
    <br>
    <input type=submit value="Post Message">
    </form>
    <p>
    <form method=post action="./post.php">

    <input type=hidden name="deluser" value="<? echo $REMOTE_USER; ?>">
    <input type=submit value="Delete my messages">
    </form>
    <p>


    <?
    fclose($message1fp);
    fclose($message2fp);
    fclose($message4fp);
    fclose($message3fp);
    ?>
    </html>
    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More Discussion Board Code Articles
    More By Codewalkers

    blog comments powered by Disqus

    DISCUSSION BOARD CODE ARTICLES

    - phpBB Google Sitemap XML generator v2.1
    - myPHPWiKi
    - Simple Shoutbox 1.3
    - Chipmunk Board
    - TagIt! Tagboard v2.1.B Build 2 - UPDATED 11....
    - Internal Mail System
    - phpAdBoard
    - Super Simple Discussion 4 sysadmins
    - Powerbox Version 0.2
    - SXMB
    - J.A.G. (Just Another Guestbook)
    - PowerBox
    - TagIt! Tagboard
    - Tom's Corkboard
    - MiniChat

    Developer Shed Affiliates

     



    © 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap