Initial commit
83
CHANGES
Normal file
|
@ -0,0 +1,83 @@
|
|||
April 16, 2002 - version 0.6.1
|
||||
--------------------------------------------------------------------------------
|
||||
Finally eliminated any exploits that allow someone to execute arbitrary code
|
||||
(I think). Also added an "email detect" that will detect if the user was a
|
||||
dummy and put in their email address instead of a URL, and add "mailto: to the
|
||||
front of it.
|
||||
|
||||
April 15, 2002 - version 0.6.0
|
||||
--------------------------------------------------------------------------------
|
||||
Recoded the majority of the script. Optimized the code for speed and to fit
|
||||
cleancode.org's coding standards. Also added timestamping.
|
||||
|
||||
March 26, 2002 - version 0.5.1
|
||||
--------------------------------------------------------------------------------
|
||||
Fixed a security bug that allowed for a user to execute JavaScript from the
|
||||
URL field.
|
||||
|
||||
March 14, 2002 - version 0.5.0
|
||||
--------------------------------------------------------------------------------
|
||||
Fixed some problems with the code I optimized that killed the ability to use a
|
||||
MySQL database. This version works with both the flat file, or MySQL, hence
|
||||
the jump in version number. Also added a couple more variables to customize
|
||||
the email that is sent when someone posts (if you have that option enabled).
|
||||
|
||||
February 25, 2002 - version 0.4.1
|
||||
--------------------------------------------------------------------------------
|
||||
Fixed an error that occured when the 'notify by email' option was enabled.
|
||||
|
||||
February 23, 2002 - version 0.4.0
|
||||
--------------------------------------------------------------------------------
|
||||
Compatibility issues with Mozilla, Netscape and older version of IE have been
|
||||
resolved. The error messages are now customizable from within the
|
||||
'required.php' file, and the index page for the tag board is generated
|
||||
dynamically with the version number, set the max length of each field, and
|
||||
will post a link for emoticon help if emoticons are enabled. Quite a bit of
|
||||
the code has been optimized. The big feature is the ability to choose either
|
||||
using a MySQL database, or a flat file (./tagboard.dat). The new flat file
|
||||
has to have the correct permissions to run correctly (chmod 666), and runs in
|
||||
the same fashion as the MySQL version does. The only limitation to the flat
|
||||
file is that it posts the entire contents of the file, and doesn't allow you
|
||||
to choose the order (yet).
|
||||
|
||||
February 17, 2002 - version 0.3.2
|
||||
--------------------------------------------------------------------------------
|
||||
Fixed the problem where the tag board wouldn't refresh itself after a user
|
||||
posts a message.
|
||||
|
||||
February 15, 2002 - version 0.3.1
|
||||
--------------------------------------------------------------------------------
|
||||
Fixed a security hole allowing the use of server-side includes, as well as
|
||||
HTML comments, <!-- blah -->.
|
||||
|
||||
February 14, 2002 - version 0.3.0
|
||||
--------------------------------------------------------------------------------
|
||||
Tweaked out some code, and added emoticons.
|
||||
|
||||
January 31, 2002 - version 0.2.0
|
||||
--------------------------------------------------------------------------------
|
||||
Added the ability to limit the length of words (to prevent postings such as
|
||||
"wwwwwaaaaaassssssssuuuuupppppp!". A global variable has been added to
|
||||
determine what character will be used to seperate the name and the message,
|
||||
for easy customization. The flood protection is not optional, in case you
|
||||
want to turn it off. You can now specify the max length of the nick and the
|
||||
message. Please note, if you go over the recommended max, without updating
|
||||
the database, then your messages will be cut off. The final update is the
|
||||
addition of an HTML filter, to prohibit people from posting HTML to the tag
|
||||
board, this will keep the kids from posting <H1> text, and screwing everything
|
||||
up.
|
||||
|
||||
January 28, 2002 - version 0.1.1
|
||||
--------------------------------------------------------------------------------
|
||||
Added the option to display the posts in ascending or descending order, based
|
||||
on when it was posted.
|
||||
|
||||
December 13, 2001 - version 0.1.0
|
||||
--------------------------------------------------------------------------------
|
||||
All cusomizable variables added to required.php for easy cusomization. Better
|
||||
flood protection added by not letting the same IP post twice, and the addition
|
||||
of an optional keyword (profanity) checker.
|
||||
|
||||
December 12, 2001 - version 0.0.2
|
||||
--------------------------------------------------------------------------------
|
||||
Initial release.
|
21
COPYING
Normal file
|
@ -0,0 +1,21 @@
|
|||
/******************************************************************************\
|
||||
* Copyright (C) 2001-2002 Tag Board by Josh Sherman *
|
||||
* *
|
||||
* This source and program come as is, WITHOUT ANY WARRANTY and/or WITHOUT *
|
||||
* ANY IMPLIED WARRANTY. *
|
||||
* *
|
||||
* Users of said software should realize that they cannot and will not hold *
|
||||
* bombthebox.com reliable or responsible for any purpose WHAT SO EVER. *
|
||||
* Please read all documentation and use said software responsibly. *
|
||||
* *
|
||||
* ANY COMMERCIAL REDISTRIBUTION OR ANY PROPRIETARY REDISTRIBUTION OF THIS *
|
||||
* OR ANY SOURCE FROM BOMBTHEBOX.COM IS PROHIBITED UNDER CERTAIN CONDITIONS *
|
||||
* AND SHALL NOT BE RE-SOLD OR REDISTRIBUTED WITHOUT PRIOR AGREEMENTS WITH *
|
||||
* BOMBTHEBOX.COM *
|
||||
* *
|
||||
* I can be reached by electronic mail if there are any questions or *
|
||||
* concerns about this or any other software that was written/distributed by *
|
||||
* bombthebox.com - josh@bombthebox.com *
|
||||
* *
|
||||
* Software supplied and written by http://www.bombthebox.com/ *
|
||||
\******************************************************************************/
|
29
README
Normal file
|
@ -0,0 +1,29 @@
|
|||
Before the tag board will function, we have to do a few things...
|
||||
|
||||
1. Make sure you have PHP on your server, if not, it won't work
|
||||
|
||||
2. Unpack the .ZIP file to a directory on your server (/tagboard will be fine)
|
||||
|
||||
3. a. If you decide to use a text file, then make sure you change the
|
||||
permissions on the file to 666 (chmod 666 tagboard)
|
||||
|
||||
b. If you are going to use a MySQL database, you will need to create your
|
||||
database for the script to work off of:
|
||||
|
||||
create table tagboard
|
||||
(
|
||||
id int(10) not null auto_increment,
|
||||
nick varchar(16) not null,
|
||||
url varchar(128) not null,
|
||||
message varchar(128) not null,
|
||||
datetime varchar(255) not null,
|
||||
ip varchar(15) not null,
|
||||
primary key(id)
|
||||
);
|
||||
|
||||
4. Edit required.php to reflect your set up, along with the other
|
||||
customizations
|
||||
|
||||
5. Enjoy your new tag board!
|
||||
|
||||
CHEERS!
|
16
THANKS
Normal file
|
@ -0,0 +1,16 @@
|
|||
No one has really contributed to the coding portion of this project, but a
|
||||
couple of people are worth mentioning.
|
||||
|
||||
ME! <josh@bombthebox.com> Who else would waste this much time on a project so
|
||||
mediocre in size?
|
||||
|
||||
Dean <dean@geekoid.org> All around good coder, and is always making
|
||||
suggestions, even when they aren't asked for.
|
||||
|
||||
Matt <sirmalloc@gmx.net> Not sure if he has a personal vendetta against me,
|
||||
or if he is starving for my attention, but this guy
|
||||
keeps breaking my code and finding holes in it.
|
||||
Hopefully mentioning him here will get him to move
|
||||
on to bigger and better things.
|
||||
|
||||
If your name wasn't mentioned, then you mustn't be that important!
|
7
TODO
Normal file
|
@ -0,0 +1,7 @@
|
|||
I would like to add in a way to use plugins, to make it easier for me to keep my
|
||||
version and the version I release to the public in sync, and so that way you
|
||||
kids don't get to use some of my custom mods ;)
|
||||
|
||||
Eventually I want to add more dummy proof filters to the URL field, and give
|
||||
you the option to specify if they put in their URL, an email address, or either
|
||||
one.
|
1
VERSION
Normal file
|
@ -0,0 +1 @@
|
|||
0.6.1
|
66
emoticons.php
Normal file
|
@ -0,0 +1,66 @@
|
|||
<?
|
||||
|
||||
/******************************************************************************\
|
||||
* Copyright (C) 2001-2002 Tag Board by Josh Sherman *
|
||||
* *
|
||||
* This script is for explaining the use of emoticons on the Tag Board. *
|
||||
* *
|
||||
* Last modified : April 15th, 2002 *
|
||||
******************************************************************************
|
||||
* This source and program come as is, WITHOUT ANY WARRANTY and/or WITHOUT *
|
||||
* ANY IMPLIED WARRANTY. *
|
||||
* *
|
||||
* Users of said software should realize that they cannot and will not hold *
|
||||
* bombthebox.com reliable or responsible for any purpose WHAT SO EVER. *
|
||||
* Please read all documentation and use said software responsibly. *
|
||||
* *
|
||||
* ANY COMMERCIAL REDISTRIBUTION OR ANY PROPRIETARY REDISTRIBUTION OF THIS *
|
||||
* OR ANY SOURCE FROM BOMBTHEBOX.COM IS PROHIBITED UNDER CERTAIN CONDITIONS *
|
||||
* AND SHALL NOT BE RE-SOLD OR REDISTRIBUTED WITHOUT PRIOR AGREEMENTS WITH *
|
||||
* BOMBTHEBOX.COM *
|
||||
* *
|
||||
* I can be reached by electronic mail if there are any questions or *
|
||||
* concerns about this or any other software that was written/distributed by *
|
||||
* bombthebox.com - josh@bombthebox.com *
|
||||
* *
|
||||
* Software supplied and written by http://www.bombthebox.com/ *
|
||||
\******************************************************************************/
|
||||
|
||||
require ("required.php");
|
||||
|
||||
echo "<HTML>\n";
|
||||
echo " <HEAD>\n";
|
||||
echo " <LINK rel=\"stylesheet\" type=\"text/css\" href=\"tagboard.css\">\n";
|
||||
echo " </HEAD>\n";
|
||||
echo " <BODY bgcolor=\"#EEEEEE\">\n";
|
||||
echo " <TABLE width=\"400\">\n";
|
||||
echo " <TR>\n";
|
||||
echo " <TD>\n";
|
||||
echo " <P align=\"justify\">\n";
|
||||
echo " The following is a run down of the emoticons supported by $scriptname version $version. They are case insensitive, so if someone uses <B>:-X</B> or <B>:-x</B> it will still show up as <IMG src=\"./images/lipssealed.gif\">. If you're daring, then feel free to change out the images with your own, or even code in more faces and expressions and such.\n";
|
||||
echo " </P>\n";
|
||||
echo " <TABLE border=\"1\" align=\"center\">\n";
|
||||
echo " <TR><TD><IMG src=\"./images/smile.gif\"></TD><TD>Smile</TD><TD>:-) or :)</TD></TR>\n";
|
||||
echo " <TR><TD><IMG src=\"./images/frown.gif\"></TD><TD>Frown</TD><TD>:-( or :(</TD></TR>\n";
|
||||
echo " <TR><TD><IMG src=\"./images/grin.gif\"></TD><TD>Big grin</TD><TD>:-D or :D</TD></TR>\n";
|
||||
echo " <TR><TD><IMG src=\"./images/surprise.gif\"></TD><TD>Surprise</TD><TD>:-O or :O</TD></TR>\n";
|
||||
echo " <TR><TD><IMG src=\"./images/tongue.gif\"></TD><TD>Sticking out tongue</TD><TD>:-P or :P</TD></TR>\n";
|
||||
echo " <TR><TD><IMG src=\"./images/lipssealed.gif\"></TD><TD>My lips are sealed</TD><TD>:-X or :X</TD></TR>\n";
|
||||
echo " <TR><TD><IMG src=\"./images/foot.gif\"></TD><TD>Foot in mouth</TD><TD>:-! or :!</TD></TR>\n";
|
||||
echo " <TR><TD><IMG src=\"./images/money.gif\"></TD><TD>Put your money where your mouth is</TD><TD>:-$ or :$</TD></TR>\n";
|
||||
echo " <TR><TD><IMG src=\"./images/kiss.gif\"></TD><TD>Kiss</TD><TD>:-* or :*</TD></TR>\n";
|
||||
echo " <TR><TD><IMG src=\"./images/embarass.gif\"></TD><TD>Embarassed</TD><TD>:-[ or :[</TD></TR>\n";
|
||||
echo " <TR><TD><IMG src=\"./images/unsure.gif\"></TD><TD>Unsure</TD><TD>:-\ or :\</TD></TR>\n";
|
||||
echo " <TR><TD><IMG src=\"./images/wink.gif\"></TD><TD>Wink</TD><TD>;-) or ;)</TD></TR>\n";
|
||||
echo " <TR><TD><IMG src=\"./images/shades.gif\"></TD><TD>Wearing sun glasses</TD><TD>8-) or 8)</TD></TR>\n";
|
||||
echo " <TR><TD><IMG src=\"./images/cry.gif\"></TD><TD>Crying</TD><TD>:'(</TD></TR>\n";
|
||||
echo " <TR><TD><IMG src=\"./images/angel.gif\"></TD><TD>Angel</TD><TD>O:-) or O:)</TD></TR>\n";
|
||||
echo " <TR><TD><IMG src=\"./images/yell.gif\"></TD><TD>Yelling</TD><TD>>:-O or >:O</TD></TD>\n";
|
||||
echo " </TABLE>\n";
|
||||
echo " </TD>\n";
|
||||
echo " </TR>\n";
|
||||
echo " </TABLE>\n";
|
||||
echo " </BODY>\n";
|
||||
echo "</HTML>\n";
|
||||
|
||||
?>
|
BIN
images/angel.gif
Normal file
After Width: | Height: | Size: 111 B |
BIN
images/cry.gif
Normal file
After Width: | Height: | Size: 103 B |
BIN
images/embarass.gif
Normal file
After Width: | Height: | Size: 109 B |
BIN
images/foot.gif
Normal file
After Width: | Height: | Size: 102 B |
BIN
images/frown.gif
Normal file
After Width: | Height: | Size: 102 B |
BIN
images/grin.gif
Normal file
After Width: | Height: | Size: 104 B |
BIN
images/kiss.gif
Normal file
After Width: | Height: | Size: 137 B |
BIN
images/lipssealed.gif
Normal file
After Width: | Height: | Size: 100 B |
BIN
images/money.gif
Normal file
After Width: | Height: | Size: 103 B |
BIN
images/shades.gif
Normal file
After Width: | Height: | Size: 96 B |
BIN
images/smile.gif
Normal file
After Width: | Height: | Size: 97 B |
BIN
images/surprise.gif
Normal file
After Width: | Height: | Size: 102 B |
BIN
images/tongue.gif
Normal file
After Width: | Height: | Size: 107 B |
BIN
images/unsure.gif
Normal file
After Width: | Height: | Size: 101 B |
BIN
images/wink.gif
Normal file
After Width: | Height: | Size: 102 B |
BIN
images/yell.gif
Normal file
After Width: | Height: | Size: 104 B |
78
index.php
Normal file
|
@ -0,0 +1,78 @@
|
|||
<?
|
||||
|
||||
/******************************************************************************\
|
||||
* Copyright (C) 2001-2002 Tag Board by Josh Sherman *
|
||||
* *
|
||||
* This script is for displaying the Tag Board, and providing the form for a *
|
||||
* user to post their data. *
|
||||
* *
|
||||
* Last modified : April 15th, 2002 *
|
||||
******************************************************************************
|
||||
* This source and program come as is, WITHOUT ANY WARRANTY and/or WITHOUT *
|
||||
* ANY IMPLIED WARRANTY. *
|
||||
* *
|
||||
* Users of said software should realize that they cannot and will not hold *
|
||||
* bombthebox.com reliable or responsible for any purpose WHAT SO EVER. *
|
||||
* Please read all documentation and use said software responsibly. *
|
||||
* *
|
||||
* ANY COMMERCIAL REDISTRIBUTION OR ANY PROPRIETARY REDISTRIBUTION OF THIS *
|
||||
* OR ANY SOURCE FROM BOMBTHEBOX.COM IS PROHIBITED UNDER CERTAIN CONDITIONS *
|
||||
* AND SHALL NOT BE RE-SOLD OR REDISTRIBUTED WITHOUT PRIOR AGREEMENTS WITH *
|
||||
* BOMBTHEBOX.COM *
|
||||
* *
|
||||
* I can be reached by electronic mail if there are any questions or *
|
||||
* concerns about this or any other software that was written/distributed by *
|
||||
* bombthebox.com - josh@bombthebox.com *
|
||||
* *
|
||||
* Software supplied and written by http://www.bombthebox.com/ *
|
||||
\******************************************************************************/
|
||||
|
||||
require ("required.php");
|
||||
|
||||
echo "<HTML>\n";
|
||||
echo " <HEAD>\n";
|
||||
echo " <LINK rel=\"stylesheet\" type=\"text/css\" href=\"tagboard.css\">\n";
|
||||
echo " </HEAD>\n";
|
||||
echo " <BODY bgcolor=\"#EEEEEE\">\n";
|
||||
echo " <FORM action=\"post.php\" method=\"POST\" target=\"tagboard\" name=\"post\" id=\"post\">\n";
|
||||
echo " <TABLE cellpadding=\"0\" cellspacing=\"2\" width=\"1%\">\n";
|
||||
echo " <TR>\n";
|
||||
echo " <TD>\n";
|
||||
echo " <B>$scriptname v$version:</B>\n";
|
||||
echo " </TD>\n";
|
||||
echo " </TR>\n";
|
||||
echo " <TR>\n";
|
||||
echo " <TD align=\"center\">\n";
|
||||
echo " <IFRAME src=\"tagboard.php\" width=\"100%\" height=\"200\" frameborder=\"0\" scrolling=\"auto\" name=\"tagboard\"></IFRAME>\n";
|
||||
echo " </TD>\n";
|
||||
echo " </TR>\n";
|
||||
echo " <TR>\n";
|
||||
echo " <TD align=\"center\">\n";
|
||||
echo " <INPUT type=\"text\" name=\"nick\" size=25 value=\"nick\" maxlength=\"$nicklength;\">\n";
|
||||
echo " </TD>\n";
|
||||
echo " </TR>\n";
|
||||
echo " <TR>\n";
|
||||
echo " <TD align=\"center\">\n";
|
||||
echo " <INPUT type=\"text\" name=\"url\" size=\"25\" value=\"http://\" maxlength=\"$urllength\">\n";
|
||||
echo " </TD>\n";
|
||||
echo " </TR>\n";
|
||||
echo " <TR>\n";
|
||||
echo " <TD align=\"center\">\n";
|
||||
echo " <INPUT type=\"text\" name=\"message\" size=\"25\" value=\"message\" maxlength=\"$messagelength\">\n";
|
||||
echo " </TD>\n";
|
||||
echo " </TR>\n";
|
||||
echo " <TR>\n";
|
||||
echo " <TD align=\"center\">\n";
|
||||
echo " <INPUT type=\"submit\" value=\"Tag It!\" name=\"submit\">\n";
|
||||
|
||||
if ($emoticon=="1")
|
||||
echo " <BR>[ <A href=\"emoticons.php\">Emoticon Help</A> ]\n";
|
||||
|
||||
echo " </TD>\n";
|
||||
echo " </TR>\n";
|
||||
echo " </TABLE>\n";
|
||||
echo " </FORM>\n";
|
||||
echo " </BODY>\n";
|
||||
echo "</HTML>\n";
|
||||
|
||||
?>
|
212
post.php
Normal file
|
@ -0,0 +1,212 @@
|
|||
<?
|
||||
|
||||
/******************************************************************************\
|
||||
* Copyright (C) 2001-2002 Tag Board by Josh Sherman *
|
||||
* *
|
||||
* This script is for parsing the data the user wants to post to the board, *
|
||||
* and then either adds it to the MySQL database, or to a flat file. *
|
||||
* *
|
||||
* Last modified : April 16th, 2002 *
|
||||
******************************************************************************
|
||||
* This source and program come as is, WITHOUT ANY WARRANTY and/or WITHOUT *
|
||||
* ANY IMPLIED WARRANTY. *
|
||||
* *
|
||||
* Users of said software should realize that they cannot and will not hold *
|
||||
* bombthebox.com reliable or responsible for any purpose WHAT SO EVER. *
|
||||
* Please read all documentation and use said software responsibly. *
|
||||
* *
|
||||
* ANY COMMERCIAL REDISTRIBUTION OR ANY PROPRIETARY REDISTRIBUTION OF THIS *
|
||||
* OR ANY SOURCE FROM BOMBTHEBOX.COM IS PROHIBITED UNDER CERTAIN CONDITIONS *
|
||||
* AND SHALL NOT BE RE-SOLD OR REDISTRIBUTED WITHOUT PRIOR AGREEMENTS WITH *
|
||||
* BOMBTHEBOX.COM *
|
||||
* *
|
||||
* I can be reached by electronic mail if there are any questions or *
|
||||
* concerns about this or any other software that was written/distributed by *
|
||||
* bombthebox.com - josh@bombthebox.com *
|
||||
* *
|
||||
* Software supplied and written by http://www.bombthebox.com/ *
|
||||
\******************************************************************************/
|
||||
|
||||
require ("required.php");
|
||||
|
||||
echo "<HTML>\n";
|
||||
echo " <HEAD>\n";
|
||||
echo " <LINK rel=\"stylesheet\" type=\"text/css\" href=\"tagboard.css\">\n";
|
||||
echo " </HEAD>\n";
|
||||
echo " <BODY topmargin=\"2\" leftmargin=\"2\" bottommargin=\"2\" rightmargin=\"2\">\n";
|
||||
|
||||
$beginning = "<CENTER>";
|
||||
$ending = "<BR><BR><B><A href=\"tagboard.php\">Return</A></B></CENTER>";
|
||||
|
||||
if ($REQUEST_METHOD == "POST")
|
||||
{
|
||||
/* Determine if the nick and message exceed their limits */
|
||||
if (strlen($nick) > $nicklength || strlen($message) > $messagelength || strlen($url) > $urllength )
|
||||
{
|
||||
echo "<CENTER>$error_length<BR><BR><B><A href=\"tagboard.php\">Return</A></B></CENTER>";
|
||||
exit;
|
||||
}
|
||||
|
||||
/* Filter out HTML commands */
|
||||
if ($htmlfilter == 1)
|
||||
{
|
||||
$nick = strip_tags ($nick);
|
||||
$url = strip_tags ($url);
|
||||
$message = strip_tags ($message);
|
||||
}
|
||||
|
||||
/* Make sure the person isn't trying to exploit the board */
|
||||
$url = trim($url);
|
||||
|
||||
if ( !eregi("^(http://|ftp://)?(www\.)?([a-z0-9\.-])+(\.[a-z])+(:[0-9])?(/{1}[\.a-z0-9\+_-])*", $url) && $url != "" && $url != "http://" )
|
||||
{
|
||||
if (eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*$", $url))
|
||||
$url = "mailto:" . $url;
|
||||
else
|
||||
{
|
||||
echo $beginning . "Don't you have better shit to do with your time? Go read a book, bitch." . $ending;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( !stristr($url, "http://") && !stristr($url, "ftp://") )
|
||||
$url = "http://" . $url;
|
||||
}
|
||||
|
||||
/* Filters out big words, larger than X characters long */
|
||||
if ($bigword == 1)
|
||||
{
|
||||
$word_array = split(" ", $message);
|
||||
for($i = 0; $i < count($word_array); $i++)
|
||||
{
|
||||
if (strlen($word_array[$i]) > $maxword)
|
||||
{
|
||||
echo "$beginning$error_wordlen$ending";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Filters out keywords, can be used to limit profanity */
|
||||
if ($filter == 1)
|
||||
{
|
||||
for ($i = 0; $i <= sizeof($keywords); $i++)
|
||||
{
|
||||
if (stristr($nick, $keywords[$i]) || stristr($message, $keywords[$i]))
|
||||
{
|
||||
$error = str_replace("[KEYWORD]", $keywords[$i], $error_keyword);
|
||||
echo "$beginning$error$ending";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Check to make sure they aren't trying to post a blank message or use the default values */
|
||||
if ( $nick == "" || substr($nick, 0, 4) == "nick" || trim($nick) == "" )
|
||||
{
|
||||
echo "$beginning$error_nonick$ending";
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( $message == "" || substr($message, 0, 7) == "message" || trim($message) == "" )
|
||||
{
|
||||
echo "$beginning$error_nomsg$ending";
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($usemysql == 1)
|
||||
{
|
||||
if ($floodprotect == 1)
|
||||
{
|
||||
/* This part will limit flooding of the board */
|
||||
$SQL = "SELECT * FROM $tablname ORDER BY -id LIMIT 1;";
|
||||
$results = mysql_db_query($database, "$SQL", $connection);
|
||||
if (!$results)
|
||||
return ("ERROR: " . mysql_error() . "\n$SQL\n");
|
||||
|
||||
while ($row = mysql_fetch_array($results))
|
||||
$prev_ip = $row["ip"];
|
||||
|
||||
$SQL = "SELECT COUNT(*) as dupeips FROM $tablname WHERE ip='$REMOTE_ADDR' ORDER BY -id LIMIT $floodtotal;";
|
||||
$results = mysql_db_query($database, "$SQL", $connection);
|
||||
if (!$results)
|
||||
return ("ERROR: " . mysql_error() . "\n$SQL\n");
|
||||
|
||||
while ($row = mysql_fetch_array($results))
|
||||
$dupeips = $row["dupeips"];
|
||||
|
||||
/* If the IP was the same IP that posted last time, then deny them */
|
||||
if ($dupeips >= $floodtotal)
|
||||
{
|
||||
echo "$beginning$error_flood$ending";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
/* Put the tag into the database... */
|
||||
$SQL = "INSERT INTO $tablname (nick, url, message, datetime, ip) VALUES ('$nick', '$url', '$message', '" . date($ts_format) . "', '$REMOTE_ADDR');";
|
||||
$results = mysql_db_query($database, "$SQL", $connection);
|
||||
if (!$results)
|
||||
return ("ERROR: " . mysql_error() . "\n$SQL\n");
|
||||
|
||||
/* Close up that databsae connection like a good code monkey */
|
||||
mysql_close($connection);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($floodprotect == 1)
|
||||
{
|
||||
$file_lines = file($flatfile);
|
||||
$how_many_times = 0;
|
||||
$ip_addy = substr($file_lines[0], ((strpos($file_lines[0], "##")) + 2), ((strlen(substr($file_lines[0], ((strpos($file_lines[0], "##")) + 2)))) - 1));
|
||||
|
||||
if ($REMOTE_ADDR == $ip_addy)
|
||||
{
|
||||
|
||||
for ($i = 0; $i+1 <= $floodtotal; $i++)
|
||||
{
|
||||
$ip_addy = substr($file_lines[$i], (strpos($file_lines[$i], "##"))+2, (strlen(substr($file_lines[$i], ((strpos($file_lines[0], "##")) + 2)))) - 1);
|
||||
|
||||
if ($ip_addy == $REMOTE_ADDR)
|
||||
{
|
||||
$how_many_times++;
|
||||
|
||||
if ($how_many_times == $floodtotal)
|
||||
{
|
||||
echo "$beginning$error_flood$ending";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$output = "";
|
||||
$file_lines = file($flatfile);
|
||||
|
||||
foreach($file_lines as $line)
|
||||
$output .= $line;
|
||||
|
||||
if ($url != "" && $url != "http://")
|
||||
{
|
||||
$nick = "<A href=\"$url\" target=\"_blank\">$nick</A>";
|
||||
}
|
||||
|
||||
$ff_input = "$nick%%$message@@" . date($ts_format) . "##$REMOTE_ADDR\n" . $output;
|
||||
$fp = fopen($flatfile, "w");
|
||||
fwrite($fp, stripslashes($ff_input));
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
if ($emailnotify == 1)
|
||||
mail($emailaddy, $emailsubject, $emailbody, "From: $scriptname");
|
||||
|
||||
/* Then redirect back to the board, instead of saying "click here to see your post"... lame. */
|
||||
echo " <META HTTP-EQUIV=\"REFRESH\" CONTENT=\"0; URL=tagboard.php\">\n";
|
||||
}
|
||||
|
||||
echo " </BODY>\n";
|
||||
echo "</HTML>";
|
||||
|
||||
?>
|
164
required.php
Normal file
|
@ -0,0 +1,164 @@
|
|||
<?
|
||||
|
||||
/******************************************************************************\
|
||||
* Copyright (C) 2001-2002 Tag Board by Josh Sherman *
|
||||
* *
|
||||
* This script contains all the variables needed to customize the Tag Board, *
|
||||
* and should be the only file you need to edit. *
|
||||
* *
|
||||
* Last modified : April 16th, 2002 *
|
||||
******************************************************************************
|
||||
* This source and program come as is, WITHOUT ANY WARRANTY and/or WITHOUT *
|
||||
* ANY IMPLIED WARRANTY. *
|
||||
* *
|
||||
* Users of said software should realize that they cannot and will not hold *
|
||||
* bombthebox.com reliable or responsible for any purpose WHAT SO EVER. *
|
||||
* Please read all documentation and use said software responsibly. *
|
||||
* *
|
||||
* ANY COMMERCIAL REDISTRIBUTION OR ANY PROPRIETARY REDISTRIBUTION OF THIS *
|
||||
* OR ANY SOURCE FROM BOMBTHEBOX.COM IS PROHIBITED UNDER CERTAIN CONDITIONS *
|
||||
* AND SHALL NOT BE RE-SOLD OR REDISTRIBUTED WITHOUT PRIOR AGREEMENTS WITH *
|
||||
* BOMBTHEBOX.COM *
|
||||
* *
|
||||
* I can be reached by electronic mail if there are any questions or *
|
||||
* concerns about this or any other software that was written/distributed by *
|
||||
* bombthebox.com - josh@bombthebox.com *
|
||||
* *
|
||||
* Software supplied and written by http://www.bombthebox.com/ *
|
||||
\******************************************************************************/
|
||||
|
||||
/* For the variables, 0 = off and 1 = on, unless otherwise specified. */
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
/* Universal Variables */
|
||||
|
||||
/* 0 = Use Flat file; 1 = Use MySQL */
|
||||
$usemysql = 0;
|
||||
|
||||
/* Maximum length for each field */
|
||||
$nicklength = 16;
|
||||
$urllength = 128;
|
||||
$messagelength = 128;
|
||||
|
||||
/* How many items to display in the tag board */
|
||||
$howmany = 25;
|
||||
|
||||
/* Character(s) used to seperate the name and message */
|
||||
$spacer = "»";
|
||||
|
||||
/* Enable timestamping */
|
||||
$timestamping = 0;
|
||||
|
||||
/* Timestamp format (refer to http://www.php.net/manual/en/function.date.php) */
|
||||
$ts_format = "r";
|
||||
|
||||
/* Enable emoticons */
|
||||
$emoticon = 1;
|
||||
|
||||
/* Enable the keyword filter */
|
||||
$filter = 1;
|
||||
|
||||
/* Words to filter, if the keyword filter is enabled */
|
||||
$keywords = array('shit','damn','fuck','ass','cunt','pussy','piss','cock','suck');
|
||||
|
||||
/* Enable HTML stripping from the board (recommended) */
|
||||
$htmlfilter = 1;
|
||||
|
||||
/* Enable flood protection (multiple posts) */
|
||||
$floodprotect = 1;
|
||||
|
||||
/* Number of messages allowed in succession from the same IP (floodprotect must be enabled) */
|
||||
$floodtotal = 1;
|
||||
|
||||
/* Enable the big word filter */
|
||||
$bigword = 1;
|
||||
|
||||
/* Max length allowed when the big word filter is on */
|
||||
$maxword = 10;
|
||||
|
||||
/* Enable email notification for each new post */
|
||||
$emailnotify = 0;
|
||||
|
||||
/* Address, subject and body to send. */
|
||||
$emailaddy = "your@email.com";
|
||||
$emailsubject = "You tag board has been violated!";
|
||||
$emailbody = "Well, not really, but someone did tag it recently!";
|
||||
|
||||
/* End Universal Variables */
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
/* Custom error message for... */
|
||||
|
||||
/* when HTML is diabled */
|
||||
$error_html = "No HTML allowed!";
|
||||
|
||||
/* the user's nick is too long */
|
||||
$error_length = "Your nick, url or message contains too many characters.";
|
||||
|
||||
/* a word is longer than the maximum word length */
|
||||
$error_wordlen = "You can't post words that large, they must be 10 characters or less.";
|
||||
|
||||
/* the user posts a word that is in the "ban" list, use [KEYWORD] to have the violating keyword in the error message */
|
||||
$error_keyword = "The word \"[KEYWORD]\" is not allowed.";
|
||||
|
||||
/* when the user doesn't specify a nick */
|
||||
$error_nonick = "You must specify a nick.";
|
||||
|
||||
/* when the user doesn't specify a message */
|
||||
$error_nomsg = "You have to post a message.";
|
||||
|
||||
/* when the user tries flooding the board */
|
||||
$error_flood = "What do you think this is, a chat client? Flooding is bad.. mmmkay.";
|
||||
|
||||
/* when the URL isn't formatted correctly */
|
||||
$error_badurl = "That URL is not valid.";
|
||||
|
||||
/* End custom error messages */
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
/* Flat File Only Variables */
|
||||
|
||||
/* Path and file name of your flat file, must be chmod 666 */
|
||||
$flatfile = "./tagboard.dat";
|
||||
|
||||
/* End Flat File Only Variables */
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
/* MySQL Only Variables */
|
||||
|
||||
/* Login information for your database */
|
||||
$username = "";
|
||||
$password = "";
|
||||
|
||||
/* Name of the database we are trying to access */
|
||||
$database = "";
|
||||
|
||||
/* Hostname for the database, typically "localhost" */
|
||||
$hostname = "localhost";
|
||||
|
||||
/* Table that contains your tag board data */
|
||||
$tablname = "tagboard";
|
||||
|
||||
/* What order to display the data. 0 = descending (most recent first); 1 = ascending */
|
||||
$order = 0;
|
||||
|
||||
/* End MySQL Only Variables */
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
/** IF YOU KNOW WHAT'S GOOD FOR YOU, YOU WON'T EDIT BELOW THIS LINE!! **/
|
||||
|
||||
/* MySQL Connection String */
|
||||
$connection = mysql_connect($hostname, $username, $password);
|
||||
if (!$connection)
|
||||
echo ("ERROR: " . mysql_error() . "\n");
|
||||
|
||||
/* Script Information */
|
||||
$scriptname = "Tag It!";
|
||||
$version = "0.6.1";
|
||||
|
||||
?>
|
24
tagboard.css
Normal file
|
@ -0,0 +1,24 @@
|
|||
INPUT, IFRAME
|
||||
{
|
||||
border: #000000 1px solid;
|
||||
font-family: Verdana;
|
||||
font-size: 7pt;
|
||||
}
|
||||
|
||||
BODY, TD
|
||||
{
|
||||
font-family: Verdana;
|
||||
font-size: 7pt;
|
||||
}
|
||||
|
||||
A
|
||||
{
|
||||
color: #666666;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
A:hover
|
||||
{
|
||||
color: #000000;
|
||||
text-decoration: underline;
|
||||
}
|
3
tagboard.dat
Normal file
|
@ -0,0 +1,3 @@
|
|||
josh%%cheers! you got the tag board working!@@04/15/2002 12:00:00 PM##000.000.000.000
|
||||
josh%%you probably want to clear this file out before you implement the board :)@@04/15/2002 12:00:00 PM##000.000.000.000
|
||||
josh%%remember to chmod 666 this file, so that people have access to write to it!@@04/15/2002 12:00:00 PM##000.000.000.000
|
170
tagboard.php
Normal file
|
@ -0,0 +1,170 @@
|
|||
<?
|
||||
|
||||
/******************************************************************************\
|
||||
* Copyright (C) 2001-2002 Tag Board by Josh Sherman *
|
||||
* *
|
||||
* This script parses the data from the database or flat file, and then *
|
||||
* displays it in a nice neat layout. *
|
||||
* *
|
||||
* Last modified : April 16th, 2002 *
|
||||
******************************************************************************
|
||||
* This source and program come as is, WITHOUT ANY WARRANTY and/or WITHOUT *
|
||||
* ANY IMPLIED WARRANTY. *
|
||||
* *
|
||||
* Users of said software should realize that they cannot and will not hold *
|
||||
* bombthebox.com reliable or responsible for any purpose WHAT SO EVER. *
|
||||
* Please read all documentation and use said software responsibly. *
|
||||
* *
|
||||
* ANY COMMERCIAL REDISTRIBUTION OR ANY PROPRIETARY REDISTRIBUTION OF THIS *
|
||||
* OR ANY SOURCE FROM BOMBTHEBOX.COM IS PROHIBITED UNDER CERTAIN CONDITIONS *
|
||||
* AND SHALL NOT BE RE-SOLD OR REDISTRIBUTED WITHOUT PRIOR AGREEMENTS WITH *
|
||||
* BOMBTHEBOX.COM *
|
||||
* *
|
||||
* I can be reached by electronic mail if there are any questions or *
|
||||
* concerns about this or any other software that was written/distributed by *
|
||||
* bombthebox.com - josh@bombthebox.com *
|
||||
* *
|
||||
* Software supplied and written by http://www.bombthebox.com/ *
|
||||
\******************************************************************************/
|
||||
|
||||
require ("required.php");
|
||||
|
||||
echo "<!-- $scriptname v$version Start -->\n\n";
|
||||
echo "<HTML>\n";
|
||||
echo " <HEAD>\n";
|
||||
echo " <LINK rel=\"stylesheet\" type=\"text/css\" href=\"tagboard.css\">\n";
|
||||
echo " </HEAD>\n";
|
||||
echo " <BODY topmargin=\"2\" leftmargin=\"2\" bottommargin=\"2\" rightmargin=\"2\">\n";
|
||||
|
||||
if ($usemysql == 1)
|
||||
{
|
||||
/* Load the tagboard, the X number of most recent posts */
|
||||
if ($order == "0")
|
||||
$SQL = "SELECT * FROM $tablname ORDER BY -id LIMIT $howmany";
|
||||
else
|
||||
$SQL = "SELECT * FROM $tablname ORDER BY id LIMIT $howmany";
|
||||
|
||||
$results = mysql_db_query($database, "$SQL", $connection);
|
||||
if (!$results)
|
||||
return ("ERROR: " . mysql_error() . "\n$SQL\n");
|
||||
|
||||
while ($row = mysql_fetch_array($results))
|
||||
{
|
||||
$nick = $row["nick"];
|
||||
$url = $row["url"];
|
||||
$message = $row["message"];
|
||||
$datetime = $row["datetime"];
|
||||
|
||||
/* Add Emoticons to the user's message */
|
||||
if ($emoticon == 1)
|
||||
emoticon($message);
|
||||
|
||||
/* Some people don't have web sites, so we check to see if they put a URL in the database */
|
||||
if ($url=="" or $url=="http://") /* If they didn't then we just display the nick and the message */
|
||||
$nick = "<B>$nick";
|
||||
else /* If they did, then we link it!! */
|
||||
$nick = "<B><a href=\"$url\" target=\"_blank\">$nick</a>";
|
||||
|
||||
if ($timestamping == 1)
|
||||
echo " $nick ($datetime)$spacer</B> $message<BR>\n";
|
||||
else
|
||||
echo " $nick$spacer</B> $message<BR>\n";
|
||||
}
|
||||
|
||||
/* Like always, we close the connection to the database */
|
||||
mysql_close($connection);
|
||||
}
|
||||
else
|
||||
{
|
||||
$i = 0;
|
||||
$file_lines = file($flatfile);
|
||||
|
||||
foreach($file_lines as $line)
|
||||
{
|
||||
if ($i <= $howmany)
|
||||
{
|
||||
$delim = strpos($line, "%%");
|
||||
$ts_delim = strpos($line, "@@");
|
||||
$ip_delim = strpos($line, "##");
|
||||
|
||||
$nick = substr($line, 0, $delim);
|
||||
$message = substr($line, $delim + 2, $ts_delim - $delim - 2);
|
||||
$ts = substr($line, $ts_delim + 2, $ip_delim - $ts_delim - 2);
|
||||
|
||||
if ($timestamping == 1)
|
||||
echo " <B>$nick ($ts)$spacer</B> ";
|
||||
else
|
||||
echo " <B>$nick$spacer</B> ";
|
||||
|
||||
if ($emoticon == 1)
|
||||
echo (emoticon($message));
|
||||
else
|
||||
echo "$message";
|
||||
|
||||
echo "<BR>\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo " <BR>\n";
|
||||
echo " <CENTER>\n";
|
||||
echo " <A href=\"http://www.bombthebox.com/opensource/tagboard/\" target=\"_blank\">$scriptname v$version</A>\n";
|
||||
echo " </CENTER>\n";
|
||||
echo " </BODY>\n";
|
||||
echo "</HTML>\n";
|
||||
echo "\n<!-- $scriptname v$version End -->";
|
||||
|
||||
function emoticon($msg)
|
||||
{
|
||||
$msg = str_replace("o:-)", "<IMG src=\"./images/angel.gif\">", $msg);
|
||||
$msg = str_replace("o:)", "<IMG src=\"./images/angel.gif\">", $msg);
|
||||
$msg = str_replace("O:-)", "<IMG src=\"./images/angel.gif\">", $msg);
|
||||
$msg = str_replace("O:)", "<IMG src=\"./images/angel.gif\">", $msg);
|
||||
$msg = str_replace(":-)", "<IMG src=\"./images/smile.gif\">", $msg);
|
||||
$msg = str_replace(":)", "<IMG src=\"./images/smile.gif\">", $msg);
|
||||
$msg = str_replace(":-(", "<IMG src=\"./images/frown.gif\">", $msg);
|
||||
$msg = str_replace(":(", "<IMG src=\"./images/frown.gif\">", $msg);
|
||||
$msg = str_replace(":-\\", "<IMG src=\"./images/unsure.gif\">", $msg);
|
||||
$msg = str_replace(":\\", "<IMG src=\"./images/unsure.gif\">", $msg);
|
||||
$msg = str_replace(":-p", "<IMG src=\"./images/tongue.gif\">", $msg);
|
||||
$msg = str_replace(":p", "<IMG src=\"./images/tongue.gif\">", $msg);
|
||||
$msg = str_replace(":-P", "<IMG src=\"./images/tongue.gif\">", $msg);
|
||||
$msg = str_replace(":P", "<IMG src=\"./images/tongue.gif\">", $msg);
|
||||
$msg = str_replace(";-)", "<IMG src=\"./images/wink.gif\">", $msg);
|
||||
$msg = str_replace(";)", "<IMG src=\"./images/wink.gif\">", $msg);
|
||||
$msg = str_replace(":-*", "<IMG src=\"./images/kiss.gif\">", $msg);
|
||||
$msg = str_replace(":*", "<IMG src=\"./images/kiss.gif\">", $msg);
|
||||
$msg = str_replace(":-*", "<IMG src=\"./images/kiss.gif\">", $msg);
|
||||
$msg = str_replace(":*", "<IMG src=\"./images/kiss.gif\">", $msg);
|
||||
$msg = str_replace(":-!", "<IMG src=\"./images/foot.gif\">", $msg);
|
||||
$msg = str_replace(":!", "<IMG src=\"./images/foot.gif\">", $msg);
|
||||
$msg = str_replace(":'(", "<IMG src=\"./images/cry.gif\">", $msg);
|
||||
$msg = str_replace(">:-o", "<IMG src=\"./images/yell.gif\">", $msg);
|
||||
$msg = str_replace(">:o", "<IMG src=\"./images/yell.gif\">", $msg);
|
||||
$msg = str_replace(">:-O", "<IMG src=\"./images/yell.gif\">", $msg);
|
||||
$msg = str_replace(">:O", "<IMG src=\"./images/yell.gif\">", $msg);
|
||||
$msg = str_replace(":-o", "<IMG src=\"./images/surprise.gif\">", $msg);
|
||||
$msg = str_replace(":o", "<IMG src=\"./images/surprise.gif\">", $msg);
|
||||
$msg = str_replace(":-O", "<IMG src=\"./images/surprise.gif\">", $msg);
|
||||
$msg = str_replace(":O", "<IMG src=\"./images/surprise.gif\">", $msg);
|
||||
$msg = str_replace(":-$", "<IMG src=\"./images/money.gif\">", $msg);
|
||||
$msg = str_replace(":$", "<IMG src=\"./images/money.gif\">", $msg);
|
||||
$msg = str_replace(":-[", "<IMG src=\"./images/embarass.gif\">", $msg);
|
||||
$msg = str_replace(":[", "<IMG src=\"./images/embarass.gif\">", $msg);
|
||||
$msg = str_replace(":-X", "<IMG src=\"./images/lipssealed.gif\">", $msg);
|
||||
$msg = str_replace(":X", "<IMG src=\"./images/lipssealed.gif\">", $msg);
|
||||
$msg = str_replace(":-x", "<IMG src=\"./images/lipssealed.gif\">", $msg);
|
||||
$msg = str_replace(":x", "<IMG src=\"./images/lipssealed.gif\">", $msg);
|
||||
$msg = str_replace("8-)", "<IMG src=\"./images/shades.gif\">", $msg);
|
||||
$msg = str_replace("8)", "<IMG src=\"./images/shades.gif\">", $msg);
|
||||
$msg = str_replace(":-d", "<IMG src=\"./images/grin.gif\">", $msg);
|
||||
$msg = str_replace(":d", "<IMG src=\"./images/grin.gif\">", $msg);
|
||||
$msg = str_replace(":-D", "<IMG src=\"./images/grin.gif\">", $msg);
|
||||
$msg = str_replace(":D", "<IMG src=\"./images/grin.gif\">", $msg);
|
||||
|
||||
return $msg;
|
||||
}
|
||||
|
||||
?>
|