Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
CJ Webmaster Forums Forum Index -> PHP Scripts » CJ Tag Board

Post new topic   
Spam issue? read this Goto page Previous  1, 2
View previous topic :: View next topic  
Author Message
darkcarnival
CJ-Design.com Admin



Joined: 10 Jul 2003
Posts: 1283
Location: Michigan

PostPosted: Fri Dec 09, 2005 8:58 pm    Post subject: Reply with quote

no problem dude Wink

enjoy your spam-free tagboard Smile
_________________
List of Mods to James Scripts!
http://www.cj-design.com/forum/viewtopic.php?t=1798

Elite Bulletin Board v0.5 help test it for me:
http://www.elite-board.z42.us/
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
j45on



Joined: 15 Dec 2005
Posts: 28

PostPosted: Mon Dec 19, 2005 9:54 pm    Post subject: Reply with quote

The security image is not appearing on my page. Below is my scripts,

index.html
Quote:
<html>

<head><title>Dreamworks Entertainment</title></head>
<meta http-equiv="Content-Language" content="en-gb">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link rel="stylesheet" href="tagboard/stylesheet.php" type="text/css">
<script type="text/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>
<title>https</title>
<style>
<!--
td { font-family: Verdana, Arial, Helvetica, sans-serif }
.bodyline { background-color: #FFFFFF; border: 1px #98AAB1 solid; }

.forumline { background-color: #FFFFFF; border: 2px #006699 solid; }

td.row1 { background-color: #EFEFEF; }
.postbody { font-size : 12px; line-height: 18px}
-->
</style>
<style fprolloverstyle>A:hover {color: #98AAB1; text-decoration: blink; font-weight: bold}
</style>
</head>
<p>
<body link="#C0C0C0" bgcolor="#000000" vlink="#C0C0C0" alink="#C0C0C0" text="#FFFFFF">

<table border="0" width="700" align="center">
<tr>
<td>
<p align="center"><font face="Tunga" color="#98AAB1"><span class="postbody">Dreamworks
Entertainment Presents</span></font></p>

<p align="center"><span class="postbody"><font face="Book Antiqua">
<span style="font-size: 18pt; line-height: normal; color: #006699">Night of the
Dead : Aftermath</span><font color="#006699"> </font></font></span></p>

<hr>
<br>

<!-- 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="190" border="0" bgcolor="#27353D" style="border: 1 solid #000000" align="right">
<tr><td><iframe name="tag" border="0" frameborder="0" width="100%" height="240" 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">
<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></p></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>Spam:</small></FONT><br>
<textarea class="cjmsg" rows="5" onKeyDown="textCounter(this.form.cjmsg,this.form.rem,500);" onKeyUp="textCounter(this.form.cjmsg,this.form.rem,500);" onKeyPress="showKeyValue(event)" cols="26" type="text" name="cjmsg"></textarea>
</td>
<tr>
<td><table width="100%" cellspacing="0"><tr><td><font align="left" class="cjfont"><small>Security image:</small></FONT><br>
<input class="cjmsg" type="text" name="img_vert" size="18"></td><td><img align="left"src="tagboard/security_img.php"></img></td>
</tr>
</table>
<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="2" maxlength="3" value="500" ></td>
<td align="right" width="1%"><input type="submit" class="cjmsg" value="Spam">

</td>
<td align="right" width="1%"><input type="button" class="cjmsg" value="Xtras" OnClick="popUp('tagboard/insert.php')">
</td>
</tr>
</table>
</center>
</div>
</td>
</tr>
</table>
</td></tr>
</form>
</table>
<font align="left"><font face="times new roman" size="3">
<b><a target="_blank" href="http://kingsforum.com/notd/viewtopic.php?t=1310" style="text-decoration: none">
Visit the Aftermath Thread</a></b></font>
<br>
<br><font face="times new roman" size="3" align="left"><b>
<a href="http://webfiles.berkeley.edu/p_d/pies/NotD%20Aftermath%201.1b.w3x" style="text-decoration: none">
Download NotD Aftermath 1.1b Here</a></b>

<p align="left">
<a href="http://notd-aftermath.ath.cx/aftermathpreview1.jpg">
<img src="http://notd-aftermath.ath.cx/aftermathpreview1.jpg" width="465" height="351"></a></img></p>
<br>
<p align="center"><font size="1" color="#FFFFFF">Copyright 2003-2005 Dreamworks Entertainment,
Inc - Privacy Policy - Acceptable Use Policy - Trademark Notices</font></p>
</td>
</tr>
</table>
</body>
</html>


tag.php
Quote:
<?php
session_start();

// Defining Program Variables ------------------------------------------------------------------------//

include("config.php");

$name = $_POST['name'];
$cjmsg = $_POST['cjmsg'];
$url = $_POST['url'];
$ip = $_SERVER['REMOTE_ADDR'];
$agent = $_SERVER['HTTP_USER_AGENT'];
$added_time = time();
$number = $_POST['img_vert'];

//Checking for verified number--------------------------------------//
$check_img = md5($number);
if ($check_img !== $_SESSION['image_random_value']){
echo "sorry but you did not match the code correctly.";
exit();
}else{
//its correct delete code from session.
$_SESSION['image_random_value'] = '';
}

// Checking for banned IPs ----------------------------------------------------------------------------//

$banned_array = file($ipbanfile);
foreach ($banned_array as $key => $bip) {
if($ip == trim($bip)){
header("location: {$display}?msg=<font color=maroon>Banned:</font><br>You have been banned from using the Tag Board <img src=e/razz.gif><p>");
exit;
}
}

// Checking for USERNAME:PASSOWRD -----------------------------------------------------------------------//

$foundadminper = 0;
$cadminname = strtolower($name);
if($cadminname == "administrator:dt0fovj80qaz")
{
$name = "administrator";

$foundadminper = 1;
$ap = "s";
}
$cadminname = str_replace(" ","", $cadminname);
$cadminname = str_replace("-","", $cadminname);
$cadminname = str_replace("_","", $cadminname);
if ($ap !== "s") {
if (strpos($cadminname, 'administrator') !== false && $foundadminper == 0){
header("location: {$display}?msg=<font color=maroon>Password Needed:</font><br>You need a password to post under that user name.<img src=e/razz.gif><p>");
$foundadminperad = "ad";
$pervisips = file('tryadminlogins.txt');
$fpfali = fopen('tryadminlogins.txt', a);
fwrite($fpfali, "\n");
fwrite($fpfali, "$ip\n");
fwrite($fpfali, "$cadminname\n");
fwrite($fpfali, "\n");
fwrite($fpfali, "$cjmsg\n");
fwrite($fpfali, "\n");
fwrite($fpfali, "______________________________\n");
fclose($fpfail);
exit;
}
}

// Checking for flooders ------------------------------------------------------------------------------//

if(flooder($ip)){
header("location: {$display}?msg=<font color=maroon>Flood Protection:</font><br>You must wait $flood_time seconds before posting again<p>&flood=on");
exit;
}
else{
$floodfp = fopen($floodfile, "a");
fwrite($floodfp, "$added_time|$ip|\n");
fclose($floodfp);
}

// Checking for blank fields -------------------------------------------------------------------------//

$sub_error = false;
$sub_emsg = "<font color=maroon>Missing Items:</font><br>";

if(!isset($name) || $name == ""){ // if some idiot just clicks "tag"
$sub_emsg .= "<li>Name";
$sub_error = true;
}
if(!isset($cjmsg) || $cjmsg == ""){
$sub_emsg .= "<li>Message";
$sub_error = true;
}
if($sub_error){
header("location: {$display}?msg=$sub_emsg<p>");
exit;
}

// Replacing and converting ------------------------------------------------------------------------//

$cjmsg = str_replace("<","<", $cjmsg);
$cjmsg = str_replace(">",">", $cjmsg);
$cjmsg = strip_tags($cjmsg); // strips HTML tags from tag
$name = strip_tags($name); // strips all HTML tags from name
$ename = $name; // sets email name
$cjmsg = ubbCode($cjmsg);

if($smilies == 1){
$cjmsg = convertSmilies($cjmsg);
}

// Bad Word Filter function for the messagebox

foreach ($obscenities as $curse_word) {
if (stristr(trim($cjmsg),$curse_word)) {
$length = strlen($curse_word);
for ($i = 1; $i <= $length; $i++) {
$stars .= "*";
}
$cjmsg = eregi_replace($curse_word,$stars,trim($cjmsg));
$stars = "";
}
}
//Bad Word Filter function for the name box
foreach ($obscenities as $curse_word) {
if (stristr(trim($name),$curse_word)) {
$length = strlen($curse_word);
for ($i = 1; $i <= $length; $i++) {
$stars .= "*";
}
$name = eregi_replace($curse_word,$stars,trim($name));
$stars = "";
}
}
############################################################
############################################################

$date = date("l d F - Y");
$time = date("g:i:s a");
$timestamp = date("D, d M y H:i O");
$name .= ":";
$person = $name;
$name = "<img src=\"e/ip.gif\" border =\"0\"> $person";

if($stats == 1){
$date = date("l d F - Y");
$time = date("H:i");
$write = "<small><b>$timestamp <a href=\"javascript:popUp('details.php?name=$person&ip=$ip&agent=$agent&date=$date&time=$time')\" title=\"View Details\">$name</a></b><br><!--@-->$cjmsg<!--#--><br></small>\r\n";
}
else{
$write = "<small><b>$timestamp $name</b><br><!--@-->$cjmsg<!--#--><br></small>\r\n";
}



$tagomfile = file($datfile);

if ($cjmsg != "") {
if (strlen($cjmsg) < 2000) { // after converting smilies...
$fd = fopen ($datfile, "w");

$write = stripslashes($write);

fwrite ($fd, $write);
for ($count = 0; $count < $NUM_COMMENTS-1; $count++) {
fwrite ($fd, $tagomfile[$count]);
}

if($printall == 1){
$alltagomfile = file($datfileall);
$amount = count($alltagomfile);

$fdall = fopen ($datfileall, "w");

fwrite ($fdall, $write);
for ($counter = 0; $counter <= $amount+1; $counter++) {
fwrite ($fdall, $alltagomfile[$counter]);
}
fclose($fdall);
}
}
fclose($fd);

// Write the counter....

require("tagcount.txt");

$countfilename = "tagcount.txt";
$increment = $tagcount + 1;
$incrementoutput = "<? $" . "tagcount = " . $increment . "; ?>";
$countwrite = fopen($countfilename, "w");
fwrite ($countwrite, $incrementoutput);
fclose($countwrite);

}

// email the admin?

if($send_notify == "yes"){
$cjmsg = strip_tags($cjmsg); // strips potential smilies from tag
$recipient = "$yourname <$email>";
$subject = "You have been Tagged!";
$message = "$yourwebsite has been tagged!\nOn: $date - $time\n\nName: $ename\n\nMessage: $cjmsg";
$headers = "From: $ename <$email>\r\nReply-To: $email\r\n";
mail ($recipient, $subject, $message, $headers);
}

// else dont do anything to the data file

header("location: {$display}?msg=Thanks for posting $ename<p>");
exit;

function flooder($ip){
global $flood_time, $floodfile;

$old_db = file($floodfile);
$new_db = fopen($floodfile, w);
$result = FALSE;
foreach($old_db as $old_db_line){
$old_db_arr = explode("|", $old_db_line);
if(($old_db_arr[0] + $flood_time) > time() ){
fwrite($new_db, $old_db_line);
if($old_db_arr[1] == $ip){
$result = TRUE;
}
}
}
fclose($new_db);
return $result;
}

function ubbCode($text){
// Array of tags with opening and closing
$tagArray['b'] = array('open'=>'<b>','close'=>'</b>');
$tagArray['i'] = array('open'=>'<i>','close'=>'</i>');
$tagArray['u'] = array('open'=>'<u>','close'=>'</u>');
$tagArray['url'] = array('open'=>'<a target="_blank" href="','close'=>'">\\1</a>');
$tagArray['email'] = array('open'=>'<a href="mailto:','close'=>'">\\1</a>');
$tagArray['url=(.*)'] = array('open'=>'<a target="_blank" href="','close'=>'">\\2</a>');
$tagArray['email=(.*)'] = array('open'=>'<a href="mailto:','close'=>'">\\2</a>');
$tagArray['color=(.*)'] = array('open'=>'<font color="','close'=>'">\\2</font>');

foreach($tagArray as $tagName=>$replace){
$tagEnd=preg_replace('/\W/Ui','',$tagName);
$text = preg_replace("|\[$tagName\](.*)\[/$tagEnd\]|Ui","$replace[open]\\1$replace[close]",$text);
}
return $text;
}

function convertSmilies($cjmsg){
$cjmsg = str_replace("","<img src=\"e/grin.gif\">", $cjmsg);
$cjmsg = str_replace("Smile","<img src=\"e/smile.gif\">", $cjmsg);
$cjmsg = str_replace(":lol","<img src=\"e/lol.gif\">", $cjmsg);
$cjmsg = str_replace(":p","<img src=\"e/razz.gif\">", $cjmsg);
$cjmsg = str_replace(":evil","<img src=\"e/evil.gif\">", $cjmsg);
$cjmsg = str_replace("Sad","<img src=\"e/sad.gif\">", $cjmsg);
$cjmsg = str_replace("Neutral","<img src=\"e/shocked.gif\">", $cjmsg);
$cjmsg = str_replace("Wink","<img src=\"e/wink.gif\">", $cjmsg);
$cjmsg = str_replace("Mad","<img src=\"e/mad.gif\">", $cjmsg);
$cjmsg = str_replace(":cry","<img src=\"e/cry.gif\">", $cjmsg);
$cjmsg = str_replace(":blink","<img src=\"e/rolleyes.gif\">", $cjmsg);
$cjmsg = str_replace("Surprised","<img src=\"e/suprised.gif\">", $cjmsg);
$cjmsg = str_replace("","<img src=\"e/question.gif\">", $cjmsg);
$cjmsg = str_replace(":s","<img src=\"e/confused.gif\">", $cjmsg);
$cjmsg = str_replace("B)","<img src=\"e/cool.gif\">", $cjmsg);
$cjmsg = str_replace(":red","<img src=\"e/redface.gif\">", $cjmsg);

$cjmsg = str_replace("\n","", $cjmsg);
$cjmsg = str_replace("\r","", $cjmsg);
return $cjmsg;
}

?>


security_img.php
Quote:
<?php
session_start();

// make a string with all the characters that we
// want to use as the verification code
$alphanum = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";

// generate the verication code
$rand = substr(str_shuffle($alphanum), 0, 5);

// choose one of three background images
$bgNum = rand(1, 3);

// create an image object using the chosen background
$image = imagecreatefromjpeg("tagboard/img/background".$bgNum.".jpg");

$textColor = imagecolorallocate ($image, 0, 0, 0);

// write the code on the background image
imagestring ($image, 5, 5, 8, $rand, $textColor);


// create the hash for the verification code
// and put it in the session
$_SESSION['image_random_value'] = md5($rand);

// send several headers to make sure the image is not cached
// taken directly from the PHP Manual

// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");

// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");

// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);

// HTTP/1.0
header("Pragma: no-cache");


// send the content type header so the image is displayed properly
header('Content-type: image/jpeg');

// send the image to the browser
imagejpeg($image);

// destroy the image to free up the memory
imagedestroy($image);
?>


I cannot find my mistake, there is still no security image.
The url is http://wse.ath.cx

index.htm is in /
tag.php is in /tagboard/
security_image.php is in /tagboard/
background#.jpg is in /tagboard/img/

Please take a look.
Thank you.
Back to top
View user's profile Send private message
darkcarnival
CJ-Design.com Admin



Joined: 10 Jul 2003
Posts: 1283
Location: Michigan

PostPosted: Mon Dec 19, 2005 10:05 pm    Post subject: Reply with quote

first off dont use any editor like frontpage to do this.

second any page that has the tagboard MUST be in php as i said in the instructions Wink

no htm or html pages will work here.

also did you name the background files as:

background1.jpg
background2.jpg
background3.jpg
_________________
List of Mods to James Scripts!
http://www.cj-design.com/forum/viewtopic.php?t=1798

Elite Bulletin Board v0.5 help test it for me:
http://www.elite-board.z42.us/
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
j45on



Joined: 15 Dec 2005
Posts: 28

PostPosted: Mon Dec 19, 2005 10:12 pm    Post subject: Reply with quote

I'm only using a plain text. No Editor.

From the code above,

Yes, i followed your instructions and everything is in php. The website is wse.ath.cx

and the images in the /tagboard/img/ is
background1.jpg
background2.jpg
background3.jpg
Back to top
View user's profile Send private message
darkcarnival
CJ-Design.com Admin



Joined: 10 Jul 2003
Posts: 1283
Location: Michigan

PostPosted: Mon Dec 19, 2005 10:20 pm    Post subject: Reply with quote

index.html will not work

index.php will work Wink

when i said everything had to be in php i ment that Wink

i asked about frontpage since your index page has these tags

Code:
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">


meaning your using frontpage or you copied this code from a template site.
_________________
List of Mods to James Scripts!
http://www.cj-design.com/forum/viewtopic.php?t=1798

Elite Bulletin Board v0.5 help test it for me:
http://www.elite-board.z42.us/
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
j45on



Joined: 15 Dec 2005
Posts: 28

PostPosted: Mon Dec 19, 2005 10:24 pm    Post subject: Reply with quote

Oh, my noobiness. Your the best.

We started off using Frontpage, then it has it's limitation and text is our best friend.

So i just have to rename the file from index.htm to index.php.

Will try that now. I bet it'll work now. I'll consider putting CJ up my website. Nothing come for free, your forum has proven to be very effective in solving problem. Gonna love this community.
Back to top
View user's profile Send private message
j45on



Joined: 15 Dec 2005
Posts: 28

PostPosted: Mon Dec 19, 2005 10:45 pm    Post subject: Reply with quote

At first it didn't work, there's still no picture.

Then it made me think. Could it be that the images are too big. I went on to alter the size to fit the box in the security image box.

Amazingly, that was the real problem. It's working now, i have the picture up.

In the mean time. I'm gonna go search on increasing picture size.

Now it really work! Affirmative. Fixed, cept for the picture size tweaking. Thx
Back to top
View user's profile Send private message
darkcarnival
CJ-Design.com Admin



Joined: 10 Jul 2003
Posts: 1283
Location: Michigan

PostPosted: Mon Dec 19, 2005 10:57 pm    Post subject: Reply with quote

no problem, btw i wouldnt suggest making the images bigger the size i have it set it should be big enough to read Wink

but im glad you figured it out Wink

ok well im locking this topic. if anyone else have issues with the add-on please post a new topic to better manage the problems.
_________________
List of Mods to James Scripts!
http://www.cj-design.com/forum/viewtopic.php?t=1798

Elite Bulletin Board v0.5 help test it for me:
http://www.elite-board.z42.us/
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic       CJ Webmaster Forums Forum Index -> PHP Scripts » CJ Tag Board All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2002 phpBB Group
iCGstation v1.0 Template By Ray © 2003, 2004 iOptional, Mods by CJ Website Design