Hits: 23259
Try: ca/tecreations/ViewFile.php -- Online
Snapshots will resume upon completion of networking changes due to reification of the current version, unless Scripture comes ahead of a current thought.
<!--
< ?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);
}
?>
<html>
<head>
<script>
function focusPoster() {
let tec = document.getElementById("tec_poster");
if (tec_poster != null) tec.focus();
else {
document.getElementById("public_poster").text.focus();
}
}
</script>
</head>
<body onload="focusPoster()">
<div>
<table width="100%">
<thead>
<tr><td colspan="6" align="center">Today's Chat</td></tr>
</thead>
</table>
</div>
<div class="jumbotron">
< ?php
global $reset;
if (!$reset) {
if (isTim() | isTecNet()) {
?>
<form name="tec_form" action="/ca/tecreations/todays_chat_post.php" method="<?php global $METHOD; echo $METHOD; ?>">
<table width="100%">
<thead>
</thead>
<tbody>
<tr>
<td colspan="1"><td>Anyone On tecreations Network</td>
</tr>
<tr>
<td colspan="2" align="left">Poster:</td>
<td colspan="6" align="left"><input id="tec_poster" name="tec_poster" type="text" value="Tim" maxlength="259"></td>
</tr>
<tr>
<td colspan="2" align="left">Post Text:</td>
<td colspan="6"><input id="ttxt" name="ttxt" type="text" value="ttxt" maxlength="8192"></td>
</tr>
<tr>
<td colspan="1"><td><input name="submit" value="Post" type="submit"></td>
</tr>
</tbody>
</table>
</form>
<? php
}
}
?>
</div>
<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>
<div class="jumbotron">
< ?php
global $reset;
if (!$reset) {
?>
<table width="100%">
<thead>
</thead>
<tbody>
<form name='public_form' action="/ca/tecreations/todays_chat_post.php" method='<?php global $METHOD; echo $METHOD; ?>'>
<tr>
<td colspan="1"><td>Anyone Outside tecreations Network</td>
</tr>
<tr>
<td colspan="2" align="left">Public Poster:</td>
<td colspan="6" align="left"><input id="public_poster" name="public_poster" type="text" value="Anon" maxlength="259"></td>
</tr>
<tr>
<td colspan="2" align="left">Public Post Text:</td>
<td colspan="6"><input id="public_post" name="public_post" type="text" value="public_post" maxlength="8192"></td>
</tr>
<tr>
<td colspan="1"><td><input name="submit" value="Post" type="submit"></td>
</tr>
</form>
</tbody>
</table>
< ?php
}
?>
</div>
</body>
-->