Hits: 5951

 

Absolute path found. Loading as relative.

 

List

Try: ca/tecreations/ViewFile.php -- Online


Code before chat.<br />
<br />
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/tec_SiteRoot.php";

global $reset;

if (isset($_REQUEST['reset'])) {
    $reset = true;
} else {
    $reset = false;
}

global $db, $self;

if (!$db->hasTable("todays_chat")) {
    doCreateTable();
}

function doCreateTable($drop = false) {
    global $db;
    if ($drop) $db->issue("DROP TABLE IF EXISTS todays_chat");
    $sql =  "CREATE TABLE IF NOT EXISTS todays_chat (";
    $sql .= "    id INT(11) AUTO_INCREMENT PRIMARY KEY,";
    $sql .="    poster VARCHAR(259) NOT NULL DEFAULT 'tim',";
    $sql .="    text VARCHAR(8192) NOT NULL";
    $sql .=")";
    $db->issue($sql);
}    

?>
<body onload="focusPoster()">
    <script>
        function focusPoster() {
            let tims = document.getElementById("tims");
	    if (tims != null) tims.focus();
            else {
                document.getElementById("text").focus();
            }
        }
    </script>

<table width="100%">
    <thead>
        <tr><td colspan=6 align=center>Today's Chat</td></tr>
    </thead>
</table>

<?php 

    global $reset;

    if (!$reset) {
        if (isTim()) {
?>
    <div class="jumbotron">
      <form name="timsForm" action="/ca/tecreations/post.php" method="<?php global $METHOD; echo $METHOD; ?>">
      <table width="100%">
        <thead>
        </thead> 
        <tbody>
          <tr>
            <td colspan="1" align="left">[Anyone on Tim's Network] Post:</td>
            <td colspan="6" align="left"><input id="tims" name="tims" type="text" maxlength="8192" /></td>
            <td colspan="1" align="left"><input name="post" value="Post" type="submit" /></td>
          </tr>
        </tbody>
      </table>
      </form>
</div>
<?php
        }
    }
?>
<div class="jumbotron">
       <table width="100%">
       <thead>
       </thead>
       <tbody>
          <form name="convo_holder">

<?php
    global $reset;
    if (!$reset) {
?>
            <tr><td colspan="8"><textarea rows=8 cols=80 name="ConV0" id="ConV0" disabled>
<?php
     }
?>
<?php 
global $db;

$sql = "SELECT * FROM todays_chat";
$result = $db->select($sql);
if ($result['count'] == 0) {

} else if ($result['count'] == 1) {
    echo $result['rows']['poster'] . ": " . $result['rows']['text'];
    if ($reset) echo "<br />";
    else echo "\n";
} else {
    $rows = $result['rows'];
    for($i = 0; $i < count($rows);$i++) {
        $row = $rows[$i];
        echo $row['poster'] . ": " . $row['text'];
        if ($reset) echo "<br />";
        else echo "\n";
    }
}
?>
<?php
    global $reset;
    if (!$reset) {
?>
                                 </textarea></td></tr>
<?php
    }
?>
          </form>
       </tbody>
       </table>
</div>

<?php
    global $reset;

    if (!$reset) {
?>
       <table width="100%">
       <thead>
       </thead>
       <tbody>
    <form name='anons_Form' action="/ca/tecreations/post.php" method='<?php global $METHOD; echo $METHOD; ?>'>
    <tr>
      <td colspan="2" align="left">Poster:</td>
      <td colspan="6" align="left"><input id="poster" name="poster" type="text" value="Anon" maxlength="259"></td>
    </tr>
    <tr>
      <td colspan="2" align="left">Post Text:</td>
      <td colspan="6"><input id="text" name="text" type="text" value="" maxlength="8192"></td>
    </tr>
    <tr>
      <td colspan="1"><td><input name="post" value="Post" type="submit"></td>
    </tr>
    </form>
    </tbody>
</table>
<?php
    }
?>
</body>