boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[Hack] Word Verifier for Comments
Goto page Previous  1, 2
 
Post new topic   Reply to topic    boardom Forum Index -> Hacks
View previous topic :: View next topic  
Author Message
Lalaith



Joined: 24 Oct 2003
Posts: 10

PostPosted: Sun Dec 05, 2004 6:30 am    Post subject: Reply with quote

The one posted by evelyne, or the last one you posted? Sorry, I'm a little confused by all this, lol.
Back to top
View user's profile Send private message Visit poster's website
Cyberian75



Joined: 26 Sep 2002
Posts: 1285
Location: Oregon

PostPosted: Sun Dec 05, 2004 7:27 am    Post subject: Reply with quote

Use this...
Code:

$word = strtolower(trim($HTTP_POST_VARS["word"]));
$postdata = get_postdata($comment_post_ID);
$content = strip_tags($postdata["Content"]);
eregi("[a-z0-9\-]+", $content, $matches);

if (empty($word) || $word != strtolower($matches[0])) {
   setcookie("comment",$comment, time()+30000000);
   echo "Error: the word you entered do not match or is empty.";
   echo "\n<br><br>\n<a href=\"javascript:history.go(-1);\">go back</a>\n\n";
   exit;
} elseif (isset($HTTP_COOKIE_VARS["comment"])) {
   setcookie("comment","", time()-30000000);
}

_________________
Michael P.



Last edited by Cyberian75 on Sat Dec 11, 2004 1:03 am; edited 1 time in total
Back to top
View user's profile Send private message AIM Address
Sigg3



Joined: 03 Jul 2003
Posts: 906
Location: Oslo, Norway

PostPosted: Mon Dec 06, 2004 3:11 pm    Post subject: Reply with quote

Added it to the b2 resource center.
_________________
Sigg3.net - You know you're worth it! | b2 Cafelog Resource Center | Fight my BattleImp!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Lalaith



Joined: 24 Oct 2003
Posts: 10

PostPosted: Tue Dec 07, 2004 4:39 am    Post subject: Reply with quote

This part:

Code:

$comment = (empty($HTTP_COOKIE_VARS["comment"])) ? "comment" : $HTTP_COOKIE_VARS["comment"];


I'm having trouble with. Where exactly do I put it in the comments page? Should I put it below this part:

Code:

$comment_author_url = (empty($HTTP_COOKIE_VARS["comment_author"])) ? "url" : trim($HTTP_COOKIE_VARS["comment_author_url"]);


Or what? Or do I not need that? Question
Back to top
View user's profile Send private message Visit poster's website
Cyberian75



Joined: 26 Sep 2002
Posts: 1285
Location: Oregon

PostPosted: Tue Dec 07, 2004 5:14 am    Post subject: Reply with quote

Lalaith wrote:
Should I put it below this part:

Code:

$comment_author_url = (empty($HTTP_COOKIE_VARS["comment_author"])) ? "url" : trim($HTTP_COOKIE_VARS["comment_author_url"]);


Yes -- before or after it.
_________________
Michael P.

Back to top
View user's profile Send private message AIM Address
Lalaith



Joined: 24 Oct 2003
Posts: 10

PostPosted: Fri Dec 10, 2004 12:50 am    Post subject: Reply with quote

I'm still having trouble with this! I've put the line of code below:

Code:

$comment = (empty($HTTP_COOKIE_VARS["comment"])) ? "comment" : $HTTP_COOKIE_VARS["comment"];


Code:

Please enter the <b>first word</b> of this post: <input type="text" name="word" size="10">


Code:

<?php echo $comment ?>


On b2comments.php and on b2commentspopup.php, but the field still doesn't show up on the commenst form! Not only that, but next to the comments link in my blog it has the following coding:

Code:

$comment = (empty($HTTP_COOKIE_VARS["comment"])) ? "comment" : $HTTP_COOKIE_VARS["comment"];


What am I doing wrong? The url to my blog is http://starlit-seas.net/blog Sorry for being such a nuisance. =\
Back to top
View user's profile Send private message Visit poster's website
Cyberian75



Joined: 26 Sep 2002
Posts: 1285
Location: Oregon

PostPosted: Fri Dec 10, 2004 2:01 am    Post subject: Reply with quote

Lalaith wrote:
What am I doing wrong? The url to my blog is http://starlit-seas.net/blog Sorry for being such a nuisance. =\


It appears to be fixed...?
_________________
Michael P.

Back to top
View user's profile Send private message AIM Address
squidy



Joined: 10 Dec 2004
Posts: 3

PostPosted: Fri Dec 10, 2004 4:52 am    Post subject: Reply with quote

how do i change the first word of the post to the first word of the title?, i have the problem with the images.
Back to top
View user's profile Send private message
Cyberian75



Joined: 26 Sep 2002
Posts: 1285
Location: Oregon

PostPosted: Fri Dec 10, 2004 5:22 am    Post subject: Reply with quote

squidy wrote:
how do i change the first word of the post to the first word of the title?, i have the problem with the images.


Change...
Code:
$content = $postdata["Content"];
to
Code:
$content = $postdata["Title"];

_________________
Michael P.

Back to top
View user's profile Send private message AIM Address
squidy



Joined: 10 Dec 2004
Posts: 3

PostPosted: Fri Dec 10, 2004 5:38 am    Post subject: Reply with quote

i have no words to express my happiness at this time, the spam is gone, i feel like crying, thanx to all who work in this, i love u all.
Back to top
View user's profile Send private message
Lalaith



Joined: 24 Oct 2003
Posts: 10

PostPosted: Fri Dec 10, 2004 10:26 pm    Post subject: Reply with quote

Cyberian75 wrote:
Lalaith wrote:
What am I doing wrong? The url to my blog is http://starlit-seas.net/blog Sorry for being such a nuisance. =\


It appears to be fixed...?


OK, it was just my computer. Thanks so much for all of your help. =D
Back to top
View user's profile Send private message Visit poster's website
Cyberian75



Joined: 26 Sep 2002
Posts: 1285
Location: Oregon

PostPosted: Sat Dec 11, 2004 1:05 am    Post subject: Reply with quote

Replace...
Code:
$postdata["Content"];
with
Code:
strip_tags($postdata["Content"]);

_________________
Michael P.

Back to top
View user's profile Send private message AIM Address
asiansoul



Joined: 29 Mar 2004
Posts: 8

PostPosted: Wed Dec 15, 2004 1:48 am    Post subject: Reply with quote

thanks. michael ur a genious!
_________________
Ivy
http://mezza-9.net
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Sigg3



Joined: 03 Jul 2003
Posts: 906
Location: Oslo, Norway

PostPosted: Wed Dec 15, 2004 11:51 am    Post subject: Reply with quote

Cyberian75 wrote:
Replace...
Code:
$postdata["Content"];
with
Code:
strip_tags($postdata["Content"]);
This is to strip out html and images?
And Content can still be replaced by Title?
_________________
Sigg3.net - You know you're worth it! | b2 Cafelog Resource Center | Fight my BattleImp!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Cyberian75



Joined: 26 Sep 2002
Posts: 1285
Location: Oregon

PostPosted: Wed Dec 15, 2004 7:02 pm    Post subject: Reply with quote

Yup! Smile
_________________
Michael P.

Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> Hacks All times are GMT + 1 Hour
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 2 © 2001, 2002 phpBB Group