[PHP] Tag-Board

Hi everyone!

im using a free tagboard script for my site. after uploading and re-uploading the files thrice i have finally made it working, but with few errors. It is actually the best free tagboard i have found, they dont require links to their website.

here’s the download link:
http://www.cj-design.com/index.php?id=downloads&page=5

I have no background on PHP and im simply relying on the installation guides.

I would like to ask help to configure the errors, so everyone could use it easily. i tried asking for some help to their forum, but just look at those unanswered posts. :frowning:

http://forum.cj-design.com/viewforum.php?f=11

i’m asking help not just for my website, but so that everyone could use the script that actually works withour errors.

I think htmlcode.dat has errors in the first place.

I made some modifications of the tagboard for my site and these are the errors that i have found.

I’m using HTMLs instead of PHP, so i have to copy and paste the content of **htmlcode.dat. **if i’ll be using PHp, i will just use

<?
include(“tagboard/htmlcode.dat”);
?>

  1. The Links on the whole HTML page are affected by the modifications i made at config.php. instead of just having the links at my tagboard controlled by the modifications, everthing is messed up. So I Just deleted the the Link syntax at config.php.

  2. Everytime i post a message. an error occurs. it says :

Warning: Cannot modify header information - headers already sent by (output started at /home2/catalyst/public_html/tagboard/config.php:93) in /home2/catalyst/public_html/tagboard/tag.php on line 147
to view the post i have to refresh the page.

here’s the link to my website:
http://catalyst.shyper.com/index2.html

thank you very much! :slight_smile:

Somewhere in the script it wants to send some headers to the users browser. But there has already been sent some HTML to the user, so it’s too late to send headers. You can’t send any HTML before the headers. The HTML is sent by the code in line 93 in config.php.

If you post config.php and tag.php I’m sure someone can pinpoint the problem.

Remember that anything outside of <?php and ?> is treated as data - including whitespace (space, tab, linefeeds).

My guess is that you added a blank line to either the first or last line of the file. Remove that blank line, and you’ll probably fix the problem.

Here is the ORIGINAL CODE from the HTMLCODE.DAT

<!-- Dont edit this javascript bit… –>
<script language = “JavaScript”>
<!-- Begin
function textCounter(field, countfield, maxlimit) {
if(field.value.length > maxlimit){
field.value = field.value.substring(0, maxlimit);
}
else{
countfield.value = maxlimit - field.value.length;
}
}
function cleartagboard() {
document.tagboard.cjmsg.value=“”;
}
function popUp(URL) {
day = new Date();
id = day.getTime();
eval(“page” + id + " = window.open(URL, ‘" + id + "’, ‘toolbar=0,scrollbars=no,location=0,statusbar=0,menubar=0,resizable=0,width=300,height=250,left = 262,top = 184’);");
}
var isNav, isIE
if (parseInt(navigator.appVersion) >= 4) {
if (navigator.appName == “Netscape”)
isNav = true
else
isIE = true
}
function showKeyValue(evt) {
var keyValue
if (isNav)
keyValue = evt.which
else
keyValue = window.event.keyCode

if (keyValue == 13) {
javascript:document.tagboard.submit();
}
return false
}
// End –>
</script>

<!-- Change the location of the stylesheet if needs be –>
<link rel=“stylesheet” href=“stylesheet.php” type=“text/css”>

<!-- Change the table “width=100” to change the width of your tag board –>
<!-- Change the table “height=200” to change the height of your tag board –>
<!-- Change the border colour or size by editing “border:1 solid #HEXCOLOR” –>
<!-- For No Border, Delete >>> style=“border: 1 solid #000000” –>

<table width=100 border=0 bgcolor=“#FFFFFF” style=“border: 1 solid #000000”>
<tr><td><iframe name=“tag” border=“0” frameborder=“0” width=“100%” height=“200” align=“center” src=“display.php” target=“_blank”></iframe></td></tr>
<tr><td>
<form method=“POST” action=“tag.php” target=“tag” name=“tagboard”>
<table width=“100%” border=“0” cellspacing=“1”>
<tr>
<td>

<table border=“0” cellspacing=“0” width=“100%” cellpadding=“0”>
<tr>
<td width=“1%”><font class=“cjfont”><small>Name:</small></FONT></td>
</center>
<td width=“99%”>
<p align=“right”><font class=“cjfont”><small>[</small><A class=“cjfont” HREF=“javascript:cleartagboard()”><small>Reset Tag</small></A><small>]</small></FONT></td>
</tr>
</table>

<!-- Change the input size to change the length of the name field –>
<!-- Change the input length by changing maxlength=“30” to your desired size –>

<input size=“17” class=“cjmsg” maxlength=“30” type=“text” name=“name”>

</td>
</tr>
<tr>
<td>

<!-- Change the input size to change the length of the tag field –>
<!-- Change the input length by changing all the “200(s)” to your desired size –>

<font class=“cjfont”><small>Message:</small></FONT><br>
<textarea class=“cjmsg” rows=“3” onKeyDown=“textCounter(this.form.cjmsg,this.form.rem,200);” onKeyUp=“textCounter(this.form.cjmsg,this.form.rem,200);” onKeyPress=“showKeyValue(event)” cols=“16” type=“text” name=“cjmsg”></textarea>

</td>
</tr>
<tr>
<td>

<div align=“center”>
<center>
<table border=“0” cellspacing=“0” width=“100%”>
<tr>
<td width=“1%”>

<!-- Delete this input thing if you dont want to show the remaining characters –>
<!-- Change the input initial length by changing the 200 to your desired size –>

<input readonly class=“cjmsg” type=text name=rem size=3 maxlength=3 value=“200”></td>
<td width=“1%”><input type=“submit” class=“cjmsg” value=“Tag”>

</td>
<td width=“49%”><input type=“button” class=“xtra” value=“Xtras” OnClick=“popUp(‘insert.php’)”>

</td>
</tr>
</table>
</center>
</div>
</td>
</tr>
</table>
</td></tr>
</table>
</form>

and Here is the MODIFIED CODE from HTMLCODE.DAT which I used

<!-- Dont edit this javascript bit… –>
<script language = “JavaScript”>
<!-- Begin
function textCounter(field, countfield, maxlimit) {
if(field.value.length > maxlimit){
field.value = field.value.substring(0, maxlimit);
}
else{
countfield.value = maxlimit - field.value.length;
}
}
function cleartagboard() {
document.tagboard.cjmsg.value=“”;
}
function popUp(URL) {
day = new Date();
id = day.getTime();
eval(“page” + id + " = window.open(URL, ‘" + id + "’, ‘toolbar=0,scrollbars=no,location=0,statusbar=0,menubar=0,resizable=0,width=300,height=250,left = 262,top = 184’);");
}
var isNav, isIE
if (parseInt(navigator.appVersion) >= 4) {
if (navigator.appName == “Netscape”)
isNav = true
else
isIE = true
}
function showKeyValue(evt) {
var keyValue
if (isNav)
keyValue = evt.which
else
keyValue = window.event.keyCode

if (keyValue == 13) {
javascript:document.tagboard.submit();
}
return false
}
// End –>
</script>
<!-- Change the location of the stylesheet if needs be –>
<link rel=“stylesheet” href=“/tagboard/stylesheet.php” type=“text/css”>
<!-- Change the table “width=100” to change the width of your tag board –>
<!-- Change the table “height=200” to change the height of your tag board –>
<!-- Change the border colour or size by editing “border:1 solid #HEXCOLOR” –>
<!-- For No Border, Delete >>> style=“border: 1 solid #000000” –>
<center>
<table width=190 border=0 bgcolor=“#AFAFAF” style=“border: 0 solid #000000”>
<tr><td><iframe name=“tag” border=“0” frameborder=“0” width=“100%” height=“150” align=“center” src=“/tagboard/display.php” target=“_blank”></iframe></td></tr>
<tr><td>
<form method=“POST” action=“/tagboard/tag.php” target=“tag” name=“tagboard”>
<table width=“100%” border=“0” cellspacing=“1”></center>
<tr>
<td>
<center>
<table border=“0” cellspacing=“0” width=“100%” cellpadding=“0”>
<tr>
<td width=“1%”><center><font face=“Arial” size=“2”><b>Name:</b></font> <font face=“Arial” size=“2”><b>[<A class=“cjfont” HREF=“javascript:cleartagboard()”>Reset Tag</A>]</b></font></center></td>
</tr>
</table>
</center>
<!-- Change the input size to change the length of the name field –>
<!-- Change the input length by changing maxlength=“30” to your desired size –>
<center>
<input size=“20” class=“cjmsg” maxlength=“30” type=“text” name=“name”>
</center>
</td>
</tr>
<tr>
<td>
<!-- Change the input size to change the length of the tag field –>
<!-- Change the input length by changing all the “200(s)” to your desired size –>
<center>
<font face="Arial"size=“2”><b>Message:</b></font><br>
<textarea class=“cjmsg” rows=“4” onKeyDown=“textCounter(this.form.cjmsg,this.form.rem,200);” onKeyUp=“textCounter(this.form.cjmsg,this.form.rem,200);” onKeyPress=“showKeyValue(event)” cols=“20” type=“text” name=“cjmsg”></textarea>
</center>
</td>
</tr>
<tr>
<td>
<div align=“center”>
<center>
<table border=“0” cellspacing=“0” width=“100%”>
<tr>
<td width=“1%”>
<center>
<!-- Delete this input thing if you dont want to show the remaining characters –>
<!-- Change the input initial length by changing the 200 to your desired size –>
<input readonly class=“cjmsg” type=text name=rem size=3 maxlength=3 value=“200”><input type=“submit” class=“cjmsg” value=“Tag”><input type=“button” class=“xtra” value=“Xtras” OnClick=“tagboard/popUp(‘tagboard/insert.php’)”>
</center>
</td>
</tr>
</table>
</center>
</div>
</td>
</tr>
</table>
</td></tr>
</table>
</form>

Here is The ORIGINAL CONFIG.PHP code

<?
$user = “admin”; // your username for control panel (be original!)
$pass = “password”; // your password for control panel
$display = “display.php”; // the display file
$datfile = “tag.txt”; // the data file
$datfileall = “alltag.txt”; // where all tags are saved file
$ipbanfile = “ipban.php”; // where the banned IPs are kept
$floodfile = “flood.php”; // where flood protection is monitored
$flood_time = 15; // the amount of seconds between posts
$view = “desc”; // method of viewing the tags, desc = newest at the top, asc = newest at the bottom
$MAX_LENGTH = 200; // the maximum length of posts (you will also need to change this in htmlcode.dat)
$NUM_COMMENTS = 25; // how many comments will be displayed on your tag board
$print_how_many = 1; // set to “1” displays number of tags on the tag board, “0” turns feature off
$stats = 1; // set to “1” displays stats when hover over square image (“ip.gif”)
$meta_refresh = 1; // set to “1” tells the tag board to refresh, “0” turns feature off
$meta_refresh_rate = 120; // if you want to refresh the tag board, enter the time in seconds to wait per refresh
$smilies = 1; // set to “1” to allow smilies, “0” for no smilies : (
$printall = 1; // set to “1” to save all tags and to show link to them, “0” to not bother
$tag_spacing = 2; // distance in pixels between tags (cellpadding = ?)
$administer_amount = 200; // this is also the amount of “all tags” to keep, keep this below 500 to avoid file corruption
// I suggest you put no for the next variable if you get alot of visitors!
$send_notify = “no”; // send notification to you when a tag is made, put “yes” if you want email to be sent every tag
$yourname = “Your Name”; // required if you put yes above
$email = “yourname@email.com”; // required for notification AND post reporting
$yourwebsite = “CJ Website Design”; // required for notification
// Edit the stylesheet here!
// Tag Board “Display Post” Colours --------------------------------------------------------------------------------//
$font=“verdana”; // eg. verdana, arial, tahoma
$fontcolor=“#000000”; // general font hex colour value
$fontsize=“8pt”; // enter size in ‘pt’ i.e: 10pt
$linkfont=“#666666”; // link font colour hex value
$vlinkfont=“#666666”; // visited link font colour hex value
$hlinkfont=“#000000”; // hover over link font colour hex value
$scrollbars=“#C5C5C5”; // scrollbar colours
$scrollarrows=“#FFFFFF”; // scrollbar arrow colours
$bgcolor1 = “#F1F1F1”; // alternate background colour 1
$bgcolor2 = “#FFFFFF”; // alternate background colour 1 (best kept #FFFFFF)
// Tag Board “Form” Colours -----------------------------------------------------------------------------------------//
$formfont = “verdana”; // eg. verdana, arial, tahoma
$formfontcolor=“#000000”; // general font hex colour value
$formfontsize = “8pt”; // enter size in ‘pt’ i.e: 10pt
$formlinkfont=“#000000”; // link font colour hex value
$formvlinkfont=“#000000”; // visited link font colour hex value
$formhlinkfont=“#FF0000”; // hover over link font colour hex value
$formbgcolor = “#F1F1F1”; // form background colour
$formfgcolor = “#000000”; // form font colour
$formscrollbars=“#C5C5C5”; // textarea scrollbar colour
$formscrollarrows=“#FFFFFF”; // textarea scrollbar arrow colour
// “Xtra” Button Colours ----------------------------------------------------------------------------------------------//
$xtrabgcolor = “#FFFFFF”; // colour of the xtra buttons background
$xtrafgcolor = “#000000”; // text colour of the xtra button
// Bad Word Filter - Add as many as you like!
$badword_array[‘‘] = ‘fk’;
$badword_array['
***’] = ‘female dog’;
$badword_array[’
’] = ‘crap’;
$badword_array[‘nigger’] = ‘black man’;
$badword_array[‘nigga’] = ‘black man’;
$badword_array[‘slut’] = ‘slt’;
$badword_array[‘whore’] = ‘w**re’;
$badword_array['
***’] = ‘ck’;
$badword_array['
'] = 'py’;
?>

and here is the Modified Config.php that I Used

<?
$user = “MYUSERNAMEHERE”; // your username for control panel (be original!)
$pass = “MYPASSWORDHERE”; // your password for control panel
$display = “display.php”; // the display file
$datfile = “tag.txt”; // the data file
$datfileall = “alltag.txt”; // where all tags are saved file
$ipbanfile = “ipban.php”; // where the banned IPs are kept
$floodfile = “flood.php”; // where flood protection is monitored
$flood_time = 15; // the amount of seconds between posts
$view = “desc”; // method of viewing the tags, desc = newest at the top, asc = newest at the bottom
$MAX_LENGTH = 200; // the maximum length of posts (you will also need to change this in htmlcode.dat)
$NUM_COMMENTS = 25; // how many comments will be displayed on your tag board
$print_how_many = 0; // set to “1” displays number of tags on the tag board, “0” turns feature off
$stats = 0; // set to “1” displays stats when hover over square image (“ip.gif”)
$meta_refresh = 1; // set to “1” tells the tag board to refresh, “0” turns feature off
$meta_refresh_rate = 240; // if you want to refresh the tag board, enter the time in seconds to wait per refresh
$smilies = 1; // set to “1” to allow smilies, “0” for no smilies : (
$printall = 1; // set to “1” to save all tags and to show link to them, “0” to not bother
$tag_spacing = 2; // distance in pixels between tags (cellpadding = ?)
$administer_amount = 200; // this is also the amount of “all tags” to keep, keep this below 500 to avoid file corruption
// I suggest you put no for the next variable if you get alot of visitors!
$send_notify = “no”; // send notification to you when a tag is made, put “yes” if you want email to be sent every tag
$yourname = “Your Name”; // required if you put yes above
$email = “yourname@email.com”; // required for notification AND post reporting
$yourwebsite = “CJ Website Design”; // required for notification
// Edit the stylesheet here!
// Tag Board “Display Post” Colours --------------------------------------------------------------------------------//
$font=“verdana”; // eg. verdana, arial, tahoma
$fontcolor=“#000000”; // general font hex colour value
$fontsize=“10pt”; // enter size in ‘pt’ i.e: 10pt
$bgcolor1 = “#808080”; // alternate background colour 1
$bgcolor2 = “#969696”; // alternate background colour 1 (best kept #FFFFFF)
// Tag Board “Form” Colours -----------------------------------------------------------------------------------------//
$formfont = “verdana”; // eg. verdana, arial, tahoma
$formfontcolor=“#000000”; // general font hex colour value
$formfontsize = “10pt”; // enter size in ‘pt’ i.e: 10pt
$formlinkfont=“#000000”; // link font colour hex value
$formvlinkfont=“#000000”; // visited link font colour hex value
$formhlinkfont=“#000000”; // hover over link font colour hex value
$formbgcolor = “#FFFFFF”; // form background colour
$formfgcolor = “#000000”; // form font colour
$formscrollbars=“#AFAFAF”; // textarea scrollbar colour
$formscrollarrows=“#646464”; // textarea scrollbar arrow colour
// “Xtra” Button Colours ----------------------------------------------------------------------------------------------//
$xtrabgcolor = “#FFFFFF”; // colour of the xtra buttons background
$xtrafgcolor = “#646464”; // text colour of the xtra button
// Bad Word Filter - Add as many as you like!
$badword_array[‘‘] = ‘fk’;
$badword_array['
***’] = ‘female dog’;
$badword_array[’
’] = ‘crap’;
$badword_array[‘nigger’] = ‘black man’;
$badword_array[‘nigga’] = ‘black man’;
$badword_array[‘slut’] = ‘slt’;
$badword_array[‘whore’] = ‘w**re’;
$badword_array['
***’] = ‘ck’;
$badword_array['
'] = 'py’;
?>