![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
King of Portal
|
Filename: post.php
Purpose: To create the first post of a thread. <html>
<head>
<title>
Post Thread
</title>
</head>
<body bgcolor="#000031" link="##91DAFF" vlink="##91DAFF">
<table height="100%" width="100%" border="0" cellpadding="0">
<td width="115" align="left" valign="top">
<font color="##91DAFF" face="verdana" size="1">
JRForum<br>
<br>
</font>
<img src="../skull.gif">
</td>
<td width="1" bgcolor="#FFFFFF"align="left" valign="top"></td>
<td background="../jr.gif" align="left" valign="top">
<font color="#FFFFFF" face="verdana" size="1">
<b>POST</b><br>
<br>
</font>
<font color="#F8BF24" face="verdana" size="1">
This form is used to post a thread.<br>
</font>
<font color="#FFFFFF" face="verdana" size="1">
<form method="post" action="create_post.php">
<?php
if($_COOKIE['jrforum'] != NULL)
{
$contents = $_COOKIE['jrforum'];
$end_tag = 'EOINPUT';
$thread_contents = explode($end_tag, $contents);
unset($thread_contents[count($thread_contents) - 1]);
}
echo "\t\t\t\t\t\t" . 'Alias:<br>' . "\n";
echo "\t\t\t\t\t\t" . '<input type="text" name="formalias" size="39"';
if($_COOKIE['jrforum'] != NULL)
{
echo ' value="' . $thread_contents[0] . '"';
}
echo '><br>' . "\n";
echo "\t\t\t\t\t\t" . 'Avatar:<br>' . "\n";
echo "\t\t\t\t\t\t" . '<input type="text" name="formimageurl" size="39"';
if($_COOKIE['jrforum'] != NULL)
{
echo ' value="' . $thread_contents[1] . '"';
}
echo '><br>' . "\n";
echo "\t\t\t\t\t\t" . 'E-mail:<br>' . "\n";
echo "\t\t\t\t\t\t" . '<input type="text" name="formemail" size="39"';
if($_COOKIE['jrforum'] != NULL)
{
echo ' value="' . $thread_contents[2] . '"';
}
echo '><br>' . "\n";
echo "\t\t\t\t\t\t" . 'Subject:<br>' . "\n";
echo "\t\t\t\t\t\t" . '<input type="text" name="formsubject" size="39"><br>' . "\n";
echo "\t\t\t\t\t\t" . 'Message:<br>' . "\n";
echo "\t\t\t\t\t\t" . '<textarea name="formmessage" cols="30" rows="4"></textarea><br>' . "\n";
echo "\t\t\t\t\t\t" . 'Signature:<br>' . "\n";
echo "\t\t\t\t\t\t" . '<input type="text" name="formsignature" size="39"';
if($_COOKIE['jrforum'] != NULL)
{
echo ' value="' . $thread_contents[3] . '"';
}
echo '><br>' . "\n";
?>
<br>
<input type="submit" name="formsubmit" value="Post">
<input type="reset" name="formreset" value="Reset">
</form>
</font>
</td>
</table>
</body>
</html>
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis |
|
|
|
|
|
#12 |
|
King of Portal
|
Filename: create_post.php
Purpose: Adds form data from post.php into database and edits thread index. <html>
<head>
<title>
Post Successful
</title>
</head>
<body bgcolor="#000031" link="##91DAFF" vlink="##91DAFF">
<table height="100%" width="100%" border="0" cellpadding="0">
<td width="115" align="left" valign="top">
<font color="##91DAFF" face="verdana" size="1">
JRForum<br>
<br>
</font>
<img src="skull.gif">
</td>
<td width="1" bgcolor="#FFFFFF"align="left" valign="top">
</td>
<td background="jr.gif" align="left" valign="top">
<font color="#FFFFFF" face="verdana" size="1">
<?php
require('date.inc');
$timestamp = get_time();
archive_message();
function archive_message()
{
global $timestamp;
$alias = stripslashes($_POST['formalias']);
$imageurl = stripslashes($_POST['formimageurl']);
$email = stripslashes($_POST['formemail']);
$subject = stripslashes($_POST['formsubject']);
$message = stripslashes($_POST['formmessage']);
$signature = stripslashes($_POST['formsignature']);
$replace = array(" ", "\t", "\n", "\r", "\0", "\x0B");
if(is_int(strpos(strtolower(str_replace($replace, '', $alias)), 'script')) || is_int(strpos(strtolower(str_replace($replace, '', $imageurl)), 'script')) || is_int(strpos(strtolower(str_replace($replace, '', $email)), 'script')) || is_int(strpos(strtolower(str_replace($replace, '', $subject)), 'script')) || is_int(strpos(strtolower(str_replace($replace, '', $message)), 'script')) || is_int(strpos(strtolower(str_replace($replace, '', $signature)), 'script')))
{
die('The input fields cannot contain the literal word <em><strong>script</strong></em> or any of its variants. Please press <strong>BACK</strong> in your browser window and revise the inputs. To include the word <em><strong>script</strong></em> in your post, you must use the HTML equivalent entities. In other words, replace the word <em><strong>script</strong></em> with the following:<br><br>All lowercase letters (script):<br><font color="#F8BF24">script</font><br><br>All uppercase letters (SCRIPT):<br><font color="#F8BF24">SCRIPT</font><br><br>First letter capitalized (Script):<br><font color="#F8BF24">Script</font>');
}
if(strlen(trim($subject)) > 0)
{
$end_tag = 'EOINPUT';
$threadcontents = $alias . $end_tag;
$threadcontents .= $imageurl . $end_tag;
$threadcontents .= $email . $end_tag;
$threadcontents .= $signature . $end_tag;
$threadcontents = htmlentities($threadcontents, ENT_QUOTES);
setcookie('jrforum', $threadcontents, time() + 60 * 60 * 24 * 30);
$filename = $timestamp . '.txt';
$threadcontents = $timestamp . $end_tag;
$threadcontents .= $alias . $end_tag;
$threadcontents .= $imageurl . $end_tag;
$threadcontents .= $email . $end_tag;
$threadcontents .= $subject . $end_tag;
$threadcontents .= nl2br($message) . $end_tag;
$threadcontents .= $signature . $end_tag;
$threadcontents = htmlentities($threadcontents, ENT_QUOTES);
if(!$handle = fopen($filename, 'w'))
{
echo "Cannot open file ($filename)";
exit();
}
if(fwrite($handle, $threadcontents) === FALSE)
{
echo "Cannot write to file ($filename)";
exit();
}
echo "Success, wrote ($threadcontents) to file ($filename)";
fclose($handle);
$filename = 'threads.txt';
$threadcontents = $timestamp . $end_tag;
$threadcontents .= $subject . $end_tag;
$threadcontents .= $alias . $end_tag;
$threadcontents .= '0' . $end_tag;
$threadcontents .= $timestamp . $end_tag;
$threadcontents .= $alias . $end_tag;
$threadcontents = htmlentities($threadcontents, ENT_QUOTES);
if(!$handle = fopen($filename, 'a'))
{
echo "Cannot open file ($filename)";
exit();
}
if(fwrite($handle, $threadcontents) === FALSE)
{
echo "Cannot write to file ($filename)";
exit();
}
echo "Success, wrote ($threadcontents) to file ($filename)";
fclose($handle);
echo '<br><br>Your post was successful please <a href="display.php?thread=';
echo $timestamp;
echo '">click here</a> to continue.';
}
else
{
echo 'You did not enter a subject for your post, please hit the <strong>BACK</strong> button on your browser.';
}
}
?>
</font>
</td>
</table>
</body>
</html>
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis |
|
|
|
|
|
#13 |
|
King of Portal
|
Filename: reply.php
Purpose: To create a reply to a thread. <html>
<head>
<title>
<?php
$main_thread = $_GET['main'];
$inner_thread = $_GET['inner'];
echo "\t\t\tReplying in " . $main_thread . "\n";
?>
</title>
</head>
<body bgcolor="#000031" link="##91DAFF" vlink="##91DAFF">
<table height="100%" width="100%" border="0" cellpadding="0">
<td width="115" align="left" valign="top">
<font color="##91DAFF" face="verdana" size="1">
JRForum<br>
<br>
</font>
<img src="skull.gif">
</td>
<td width="1" bgcolor="#FFFFFF" align="left" valign="top"></td>
<td background="jr.gif" align="left" valign="top">
<font color="#FFFFFF" face="verdana" size="1">
All dates and times are based on the server's GMT offset and listed as <em>yyyy/mm/dd</em> and <em>hh:mm:ss</em><br>
<br>
</font>
<?php
$filename = $main_thread .'.txt';
if(!$handle = fopen($filename, 'r'))
{
echo "Cannot open file ($filename)";
exit();
}
$contents = fread($handle, filesize($filename));
fclose($handle);
$end_tag = 'EOINPUT';
$thread_contents = explode($end_tag, $contents);
unset($thread_contents[count($thread_contents) - 1]);
for($i = 0; $i < count($thread_contents); $i += 7)
{
if($thread_contents[$i] == $inner_thread)
{
$timestamp = html_entity_decode($thread_contents[$i + 0], ENT_QUOTES);
$alias = html_entity_decode($thread_contents[$i + 1], ENT_QUOTES);
$imageurl= html_entity_decode($thread_contents[$i + 2], ENT_QUOTES);
$email = html_entity_decode($thread_contents[$i + 3], ENT_QUOTES);
$subject = html_entity_decode($thread_contents[$i + 4], ENT_QUOTES);
$signature = html_entity_decode($thread_contents[$i + 6], ENT_QUOTES);
}
}
$page_content = <<<EOPAGE
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td colspan="6" height="1" bgcolor="#FFFFFF"></td>
</tr>
<tr>
<td rowspan="5" width="1" bgcolor="#FFFFFF"></td>
<td rowspan="2" align="center" bgcolor="#B0B7D3">
<font color="#FF6600" face="verdana" size="2">
<strong>
EOPAGE;
$page_content .= strval($alias);
$page_content .= <<<EOPAGE
</strong>
</font>
</td>
<td rowspan="5" width="1" bgcolor="#FFFFFF"></td>
<td align="left" bgcolor="#B0B7D3">
<font color="#003366" face="verdana" size="2">
<em><strong>
EOPAGE;
$page_content .= strval($subject);
$page_content .= <<<EOPAGE
</strong></em>
</font>
</td>
<td align="right" bgcolor="#B0B7D3">
<font color="#FFFFFF" face="verdana" size="1">
<a href="reply.php?main=
EOPAGE;
$page_content .= strval($thread_contents[0]);
$page_content .= <<<EOPAGE
&inner=
EOPAGE;
$page_content .= strval($timestamp);
$page_content .= <<<EOPAGE
"><img src="reply.gif" alt="Reply to Post" border="0"></a> <a href="thread.php"><img src="home.gif" alt="Return to JRForum" border="0"></a>
</font>
</td>
<td rowspan="5" width="1" bgcolor="#FFFFFF"></td>
</tr>
<tr>
<td colspan="2" height="1" bgcolor="#FFFFFF"></td>
</tr>
<tr>
<td align="center" valign="middle" bgcolor="#B0B7D3" width="20%">
<img src="
EOPAGE;
$page_content .= strval($imageurl);
$page_content .= <<<EOPAGE
" border="0">
</td>
<td colspan="2" valign="top" bgcolor="#D9E1E7">
<iframe src="inner_display.php?main=
EOPAGE;
$page_content .= strval($thread_contents[0]);
$page_content .= <<<EOPAGE
&inner=
EOPAGE;
$page_content .= strval($timestamp);
$page_content .= <<<EOPAGE
" width="100%" height="100%" align="left" marginwidth="0" marginheight="0"></iframe>
</td>
</tr>
<tr>
<td rowspan="2" align="center" valign="middle" bgcolor="#B0B7D3">
<font color="#FFFFFF" face="verdana" size="1">
EOPAGE;
$page_content .= substr($timestamp, 0, 4);
$page_content .= '/';
$page_content .= substr($timestamp, 4, 2);
$page_content .= '/';
$page_content .= substr($timestamp, 6, 2);
$page_content .= '<br>';
$page_content .= substr($timestamp, 8, 2);
$page_content .= ':';
$page_content .= substr($timestamp, 10, 2);
$page_content .= ':';
$page_content .= substr($timestamp, 12, 2);
$page_content .= <<<EOPAGE
</font>
</td>
<td colspan="2" height="1" bgcolor="#FFFFFF"></td>
</tr>
<tr>
<td colspan="2" align="right" valign="bottom" bgcolor="#D9E1E7">
<font color="#000031" face="verdana" size="1">
EOPAGE;
$page_content .= strval($signature);
$page_content .= '<br><a href="mailto:';
$page_content .= strval($email);
$page_content .= '">';
$page_content .= strval($email);
$page_content .= <<<EOPAGE
</a>
</font>
</td>
</tr>
<tr>
<td colspan="6" height="1" bgcolor="#FFFFFF"></td>
</tr>
</table>
<br>
EOPAGE;
$page_content = htmlentities($page_content, ENT_QUOTES);
echo html_entity_decode($page_content, ENT_QUOTES);
?>
<font color="#FFFFFF" face="verdana" size="1">
<b>REPLY</b><br>
<br>
</font>
<font color="#F8BF24" face="verdana" size="1">
This form is used to reply to a thread.<br>
</font>
<font color="#FFFFFF" face="verdana" size="1">
<form method="post" action="create_reply.php">
<?php
if($_COOKIE['jrforum'] != NULL)
{
$contents = $_COOKIE['jrforum'];
$end_tag = 'EOINPUT';
$thread_contents = explode($end_tag, $contents);
unset($thread_contents[count($thread_contents) - 1]);
}
echo "\t\t\t\t\t\t" . 'Alias:<br>' . "\n";
echo "\t\t\t\t\t\t" . '<input type="text" name="formalias" size="39"';
if($_COOKIE['jrforum'] != NULL)
{
echo ' value="' . $thread_contents[0] . '"';
}
echo '><br>' . "\n";
echo "\t\t\t\t\t\t" . 'Avatar:<br>' . "\n";
echo "\t\t\t\t\t\t" . '<input type="text" name="formimageurl" size="39"';
if($_COOKIE['jrforum'] != NULL)
{
echo ' value="' . $thread_contents[1] . '"';
}
echo '><br>' . "\n";
echo "\t\t\t\t\t\t" . 'E-mail:<br>' . "\n";
echo "\t\t\t\t\t\t" . '<input type="text" name="formemail" size="39"';
if($_COOKIE['jrforum'] != NULL)
{
echo ' value="' . $thread_contents[2] . '"';
}
echo '><br>' . "\n";
echo "\t\t\t\t\t\t" . 'Subject:<br>' . "\n";
$page_content = 'Re: ';
$page_content .= substr($timestamp, 0, 4);
$page_content .= '/';
$page_content .= substr($timestamp, 4, 2);
$page_content .= '/';
$page_content .= substr($timestamp, 6, 2);
$page_content .= ' @ ';
$page_content .= substr($timestamp, 8, 2);
$page_content .= ':';
$page_content .= substr($timestamp, 10, 2);
$page_content .= ':';
$page_content .= substr($timestamp, 12, 2);
echo "\t\t\t\t\t\t" . '<input type="hidden" name="formsubject" value="';
echo $page_content;
echo '">' . "\n";
echo "\t\t\t\t\t\t" . '<input type="text" name="formsubjectdisplay" size="39" value="';
echo $page_content;
echo '" disabled><br>' . "\n";
echo "\t\t\t\t\t\t" . 'Message:<br>' . "\n";
echo "\t\t\t\t\t\t" . '<textarea name="formmessage" cols="30" rows="4"></textarea><br>' . "\n";
echo "\t\t\t\t\t\t" . 'Signature:<br>' . "\n";
echo "\t\t\t\t\t\t" . '<input type="text" name="formsignature" size="39"';
if($_COOKIE['jrforum'] != NULL)
{
echo ' value="' . $thread_contents[3] . '"';
}
echo '><br>' . "\n";
?>
<br>
<input type="submit" name="formsubmit" value="Reply">
<input type="reset" name="formreset" value="Reset">
<?php
echo "\t\t\t\t\t\t" . '<input type="hidden" name="thread" value="';
echo $main_thread;
echo '">' . "\n";
?>
</form>
</font>
</td>
</table>
</body>
</html>
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis |
|
|
|
|
|
#14 |
|
King of Portal
|
Filename: create_reply.php
Purpose: Adds form data from reply.php into database and edits thread index. <html>
<head>
<title>
Reply Successful
</title>
</head>
<body bgcolor="#000031" link="##91DAFF" vlink="##91DAFF">
<table height="100%" width="100%" border="0" cellpadding="0">
<td width="115" align="left" valign="top">
<font color="##91DAFF" face="verdana" size="1">
JRForum<br>
<br>
</font>
<img src="skull.gif">
</td>
<td width="1" bgcolor="#FFFFFF"align="left" valign="top">
</td>
<td background="jr.gif" align="left" valign="top">
<font color="#FFFFFF" face="verdana" size="1">
<?php
require('date.inc');
$timestamp = get_time();
archive_message();
function archive_message()
{
global $timestamp;
$main_thread = $_POST['thread'];
$alias = stripslashes($_POST['formalias']);
$imageurl = stripslashes($_POST['formimageurl']);
$email = stripslashes($_POST['formemail']);
$subject = stripslashes($_POST['formsubject']);
$message = stripslashes($_POST['formmessage']);
$signature = stripslashes($_POST['formsignature']);
$replace = array(" ", "\t", "\n", "\r", "\0", "\x0B");
if(is_int(strpos(strtolower(str_replace($replace, '', $alias)), 'script')) || is_int(strpos(strtolower(str_replace($replace, '', $imageurl)), 'script')) || is_int(strpos(strtolower(str_replace($replace, '', $email)), 'script')) || is_int(strpos(strtolower(str_replace($replace, '', $subject)), 'script')) || is_int(strpos(strtolower(str_replace($replace, '', $message)), 'script')) || is_int(strpos(strtolower(str_replace($replace, '', $signature)), 'script')))
{
die('The input fields cannot contain the literal word <em><strong>script</strong></em> or any of its variants. Please press <strong>BACK</strong> in your browser window and revise the inputs. To include the word <em><strong>script</strong></em> in your post, you must use the HTML equivalent entities. In other words, replace the word <em><strong>script</strong></em> with the following:<br><br>All lowercase letters (script):<br><font color="#F8BF24">script</font><br><br>All uppercase letters (SCRIPT):<br><font color="#F8BF24">SCRIPT</font><br><br>First letter capitalized (Script):<br><font color="#F8BF24">Script</font>');
}
$end_tag = 'EOINPUT';
$threadcontents = $alias . $end_tag;
$threadcontents .= $imageurl . $end_tag;
$threadcontents .= $email . $end_tag;
$threadcontents .= $signature . $end_tag;
$threadcontents = htmlentities($threadcontents, ENT_QUOTES);
setcookie('jrforum', $threadcontents, time() + 60 * 60 * 24 * 30);
$filename = $main_thread . '.txt';
$threadcontents = $timestamp . $end_tag;
$threadcontents .= $alias . $end_tag;
$threadcontents .= $imageurl . $end_tag;
$threadcontents .= $email . $end_tag;
$threadcontents .= $subject . $end_tag;
$threadcontents .= nl2br($message) . $end_tag;
$threadcontents .= $signature . $end_tag;
$threadcontents = htmlentities($threadcontents, ENT_QUOTES);
if(!$handle = fopen($filename, 'a'))
{
echo "Cannot open file ($filename)";
exit();
}
if(fwrite($handle, $threadcontents) === FALSE)
{
echo "Cannot write to file ($filename)";
exit();
}
echo "Success, wrote ($threadcontents) to file ($filename)";
fclose($handle);
$filename = 'threads.txt';
if(!$handle = fopen($filename, 'r'))
{
echo "Cannot open file ($filename)";
exit();
}
$contents = fread($handle, filesize($filename));
fclose($handle);
$end_tag = 'EOINPUT';
$thread_contents = explode($end_tag, $contents);
unset($thread_contents[count($thread_contents) - 1]);
for($i = 0; $i < count($thread_contents); $i += 6)
{
if($thread_contents[$i] === $main_thread)
{
$thread_contents[$i + 3] = htmlentities(intval($thread_contents[$i + 3]) + 1, ENT_QUOTES);
$thread_contents[$i + 4] = htmlentities($timestamp, ENT_QUOTES);
$thread_contents[$i + 5] = htmlentities($alias, ENT_QUOTES);
}
}
$threadcontents = implode($end_tag, $thread_contents) . $end_tag;
$filename = 'threads.txt';
if(!$handle = fopen($filename, 'w'))
{
echo "Cannot open file ($filename)";
exit();
}
if(fwrite($handle, $threadcontents) === FALSE)
{
echo "Cannot write to file ($filename)";
exit();
}
echo "Success, wrote ($threadcontents) to file ($filename)";
fclose($handle);
echo '<br><br>Your reply was successful please <a href="display.php?thread=';
echo $main_thread;
echo '">click here</a> to continue.';
}
?>
</font>
</td>
</table>
</body>
</html>
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis |
|
|
|
|
|
#15 |
|
King of Portal
|
Filename: display.php
Purpose: Creates the outer display boxes of each post. <html>
<head>
<title>
<?php
$main_thread = $_GET['thread'];
echo "\t\t\t" . $main_thread . "\n";
?>
</title>
</head>
<body bgcolor="#000031" link="##91DAFF" vlink="##91DAFF">
<table height="100%" width="100%" border="0" cellpadding="0">
<td width="115" align="left" valign="top">
<font color="##91DAFF" face="verdana" size="1">
JRForum<br>
<br>
</font>
<img src="skull.gif">
</td>
<td width="1" bgcolor="#FFFFFF" align="left" valign="top"></td>
<td background="jr.gif" align="left" valign="top">
<font color="#FFFFFF" face="verdana" size="1">
All dates and times are based on the server's GMT offset and listed as <em>yyyy/mm/dd</em> and <em>hh:mm:ss</em><br>
<br>
</font>
<?php
$filename = $main_thread . '.txt';
if(!$handle = fopen($filename, 'r'))
{
echo "Cannot open file ($filename)";
exit();
}
$contents = fread($handle, filesize($filename));
fclose($handle);
$end_tag = 'EOINPUT';
$thread_contents = explode($end_tag, $contents);
unset($thread_contents[count($thread_contents) - 1]);
$page_content = '';
for($i = 0; $i < count($thread_contents); $i += 7)
{
$timestamp = html_entity_decode($thread_contents[$i + 0], ENT_QUOTES);
$alias = html_entity_decode($thread_contents[$i + 1], ENT_QUOTES);
$imageurl= html_entity_decode($thread_contents[$i + 2], ENT_QUOTES);
$email = html_entity_decode($thread_contents[$i + 3], ENT_QUOTES);
$subject = html_entity_decode($thread_contents[$i + 4], ENT_QUOTES);
$signature = html_entity_decode($thread_contents[$i + 6], ENT_QUOTES);
$page_content .= <<<EOPAGE
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td colspan="6" height="1" bgcolor="#FFFFFF"></td>
</tr>
<tr>
<td rowspan="5" width="1" bgcolor="#FFFFFF"></td>
<td rowspan="2" align="center" bgcolor="#B0B7D3">
<font color="#FF6600" face="verdana" size="2">
<strong>
EOPAGE;
$page_content .= strval($alias);
$page_content .= <<<EOPAGE
</strong>
</font>
</td>
<td rowspan="5" width="1" bgcolor="#FFFFFF"></td>
<td align="left" bgcolor="#B0B7D3">
<font color="#003366" face="verdana" size="2">
<em><strong>
EOPAGE;
$page_content .= strval($subject);
$page_content .= <<<EOPAGE
</strong></em>
</font>
</td>
<td align="right" bgcolor="#B0B7D3">
<font color="#FFFFFF" face="verdana" size="1">
<a href="reply.php?main=
EOPAGE;
$page_content .= strval($thread_contents[0]);
$page_content .= <<<EOPAGE
&inner=
EOPAGE;
$page_content .= strval($timestamp);
$page_content .= <<<EOPAGE
"><img src="reply.gif" alt="Reply to Post" border="0"></a> <a href="thread.php"><img src="home.gif" alt="Return to JRForum" border="0"></a>
</font>
</td>
<td rowspan="5" width="1" bgcolor="#FFFFFF"></td>
</tr>
<tr>
<td colspan="2" height="1" bgcolor="#FFFFFF"></td>
</tr>
<tr>
<td align="center" valign="middle" bgcolor="#B0B7D3" width="20%">
<img src="
EOPAGE;
$page_content .= strval($imageurl);
$page_content .= <<<EOPAGE
" border="0">
</td>
<td colspan="2" valign="top" bgcolor="#D9E1E7">
<iframe src="inner_display.php?main=
EOPAGE;
$page_content .= strval($thread_contents[0]);
$page_content .= <<<EOPAGE
&inner=
EOPAGE;
$page_content .= strval($timestamp);
$page_content .= <<<EOPAGE
" width="100%" height="100%" align="left" marginwidth="0" marginheight="0"></iframe>
</td>
</tr>
<tr>
<td rowspan="2" align="center" valign="middle" bgcolor="#B0B7D3">
<font color="#FFFFFF" face="verdana" size="1">
EOPAGE;
$page_content .= substr($timestamp, 0, 4);
$page_content .= '/';
$page_content .= substr($timestamp, 4, 2);
$page_content .= '/';
$page_content .= substr($timestamp, 6, 2);
$page_content .= '<br>';
$page_content .= substr($timestamp, 8, 2);
$page_content .= ':';
$page_content .= substr($timestamp, 10, 2);
$page_content .= ':';
$page_content .= substr($timestamp, 12, 2);
$page_content .= <<<EOPAGE
</font>
</td>
<td colspan="2" height="1" bgcolor="#FFFFFF"></td>
</tr>
<tr>
<td colspan="2" align="right" valign="bottom" bgcolor="#D9E1E7">
<font color="#000031" face="verdana" size="1">
EOPAGE;
$page_content .= strval($signature);
$page_content .= '<br><a href="mailto:';
$page_content .= strval($email);
$page_content .= '">';
$page_content .= strval($email);
$page_content .= <<<EOPAGE
</a>
</font>
</td>
</tr>
<tr>
<td colspan="6" height="1" bgcolor="#FFFFFF"></td>
</tr>
</table>
<br>
EOPAGE;
}
$page_content = htmlentities($page_content, ENT_QUOTES);
echo html_entity_decode($page_content, ENT_QUOTES);
?>
</td>
</table>
</body>
</html>
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis |
|
|
|
|
|
#16 |
|
King of Portal
|
Filename: inner_display.php
Purpose: To create the content displayed in the iframes of each post. <html>
<body bgcolor="#D9E1E7" link="##91DAFF" vlink="##91DAFF">
<font color="#000031" face="verdana" size="1">
<?php
$main_thread = $_GET['main'];
$inner_thread = $_GET['inner'];
$filename = $main_thread . '.txt';
if(!$handle = fopen($filename, 'r'))
{
echo "Cannot open file ($filename)";
exit();
}
$contents = fread($handle, filesize($filename));
fclose($handle);
$end_tag = 'EOINPUT';
$thread_contents = explode($end_tag, $contents);
unset($thread_contents[count($thread_contents) - 1]);
for($i = 0; $i < count($thread_contents); $i += 7)
{
if($thread_contents[$i] == $inner_thread)
{
echo html_entity_decode($thread_contents[$i + 5], ENT_QUOTES);
}
}
?>
</font>
</body>
</html>
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis |
|
|
|
|
|
#17 |
|
King of Portal
|
Filename: thread.php
Purpose: To display the available threads. <html>
<head>
<title>
Threads
</title>
</head>
<body bgcolor="#000031" link="##91DAFF" vlink="##91DAFF">
<table height="100%" width="100%" border="0" cellpadding="0">
<td width="115" align="left" valign="top">
<font color="##91DAFF" face="verdana" size="1">
JRForum<br>
<br>
</font>
<img src="skull.gif">
</td>
<td width="1" bgcolor="#FFFFFF" align="left" valign="top"></td>
<td background="jr.gif" align="left" valign="top">
<font color="#FFFFFF" face="verdana" size="1">
All dates and times are based on the server's GMT offset and listed as <em>yyyy/mm/dd</em> and <em>hh:mm:ss</em>
</font>
<?php
$filename = 'threads.txt';
if(!$handle = fopen($filename, 'r'))
{
echo "Cannot open file ($filename)";
exit();
}
$contents = fread($handle, filesize($filename));
fclose($handle);
$end_tag = 'EOINPUT';
$thread_contents = explode($end_tag, $contents);
unset($thread_contents[count($thread_contents) - 1]);
$page_content = <<<EOPAGE
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td colspan="11"><hr></td>
</tr>
<tr>
<td colspan="11" align="center">
<font color="#FFFFFF" face="verdana" size="2">
<a href="post.php">POST</a> | <a href="faq.html">FAQ</a>
</font>
</td>
</tr>
<tr>
<td colspan="11"><hr></td>
</tr>
<tr>
<td colspan="11" height="1" bgcolor="#FFFFFF"></td>
</tr>
<tr>
<td width="1" bgcolor="#FFFFFF"></td>
<td align="center" bgcolor="#000031">
<font color="#FFFFFF" face="verdana" size="2">
<strong><em>Thread</em></strong>
</font>
</td>
<td width="1" bgcolor="#FFFFFF"></td>
<td align="center" bgcolor="#000031">
<font color="#FFFFFF" face="verdana" size="2">
<strong><em>Subject</em></strong>
</font>
</td>
<td width="1" bgcolor="#FFFFFF"></td>
<td align="center" bgcolor="#000031">
<font color="#FFFFFF" face="verdana" size="2">
<strong><em>Author</em></strong>
</font>
</td>
<td width="1" bgcolor="#FFFFFF"></td>
<td align="center" bgcolor="#000031">
<font color="#FFFFFF" face="verdana" size="2">
<strong><em>Replies</em></strong>
</font>
</td>
<td width="1" bgcolor="#FFFFFF"></td>
<td align="center" bgcolor="#000031">
<font color="#FFFFFF" face="verdana" size="2">
<strong><em>Latest Post</em></strong>
</font>
</td>
<td width="1" bgcolor="#FFFFFF"></td>
</tr>
<tr>
<td colspan="11" height="1" bgcolor="#FFFFFF"></td>
</tr>
EOPAGE;
for($i = 0; $i < count($thread_contents); $i += 6)
{
$timestamp = html_entity_decode($thread_contents[$i + 0], ENT_QUOTES);
$subject = html_entity_decode($thread_contents[$i + 1], ENT_QUOTES);
$alias = html_entity_decode($thread_contents[$i + 2], ENT_QUOTES);
$reply_count = html_entity_decode($thread_contents[$i + 3], ENT_QUOTES);
$replystamp = html_entity_decode($thread_contents[$i + 4], ENT_QUOTES);
$replier = html_entity_decode($thread_contents[$i + 5], ENT_QUOTES);
if((($i / 6) % 2) == 0)
{
$thread_color = '"#D9E1E7"';
}
else
{
$thread_color = '"#B0B7D3"';
}
$page_content .= <<<EOPAGE
<tr>
<td width="1" bgcolor="#FFFFFF"></td>
<td width="65" align="right" bgcolor=
EOPAGE;
$page_content .= $thread_color;
$page_content .= <<<EOPAGE
>
<font color="#003366" face="verdana" size="2">
EOPAGE;
$page_content .= strval($i / 6 + 1) . '. ';
$page_content .= <<<EOPAGE
</font>
</td>
<td width="1" bgcolor="#FFFFFF"></td>
<td align="center" bgcolor=
EOPAGE;
$page_content .= $thread_color;
$page_content .= <<<EOPAGE
>
<font color="#003366" face="verdana" size="2">
<strong><a href="display.php?thread=
EOPAGE;
$page_content .= strval($timestamp);
$page_content .= '">';
$page_content .= strval($subject);
$page_content .= <<<EOPAGE
</a></strong>
</font>
</td>
<td width="1" bgcolor="#FFFFFF"></td>
<td align="center" bgcolor=
EOPAGE;
$page_content .= $thread_color;
$page_content .= <<<EOPAGE
>
<font color="#FF6600" face="verdana" size="2">
EOPAGE;
$page_content .= strval($alias);
$page_content .= <<<EOPAGE
</font>
</td>
<td width="1" bgcolor="#FFFFFF"></td>
<td width="70" align="center" bgcolor=
EOPAGE;
$page_content .= $thread_color;
$page_content .= <<<EOPAGE
>
<font color="#003366" face="verdana" size="2">
EOPAGE;
$page_content .= strval($reply_count);
$page_content .= <<<EOPAGE
</font>
</td>
<td width="1" bgcolor="#FFFFFF"></td>
<td align="right" bgcolor=
EOPAGE;
$page_content .= $thread_color;
$page_content .= <<<EOPAGE
>
<font color="#0066FF" face="verdana" size="1">
<div align="left"><strong>
EOPAGE;
$page_content .= strval($replier);
$page_content .= '</strong></div>';
$page_content .= substr($replystamp, 0, 4);
$page_content .= '/';
$page_content .= substr($replystamp, 4, 2);
$page_content .= '/';
$page_content .= substr($replystamp, 6, 2);
$page_content .= '<br>';
$page_content .= substr($replystamp, 8, 2);
$page_content .= ':';
$page_content .= substr($replystamp, 10, 2);
$page_content .= ':';
$page_content .= substr($replystamp, 12, 2);
$page_content .= <<<EOPAGE
</font>
</td>
<td width="1" bgcolor="#FFFFFF"></td>
</tr>
<tr>
<td colspan="11" height="1" bgcolor="#FFFFFF"></td>
</tr>
EOPAGE;
}
$page_content .= '</table>';
$page_content = htmlentities($page_content, ENT_QUOTES);
echo html_entity_decode($page_content, ENT_QUOTES);
?>
</td>
</table>
</body>
</html>
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis |
|
|
|