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] Comments Blacklist
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9
 
Post new topic   Reply to topic    boardom Forum Index -> Hacks
View previous topic :: View next topic  
Author Message
Cyberian75



Joined: 26 Sep 2002
Posts: 1274
Location: Oregon

PostPosted: Tue Dec 21, 2004 6:42 pm    Post subject: Reply with quote

Use this instead...
Code:
[^http:\/\/]?[a-z0-9]*\.?[a-z0-9\-]+\.[a-z]{2,6}

_________________
Michael P.

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



Joined: 06 Aug 2003
Posts: 10

PostPosted: Wed Dec 22, 2004 8:58 am    Post subject: Reply with quote

Cyberian75 wrote:
Actually, "http://www.google.com" should come out as ".google.com" which is used to compared with the URLs in the database. I just did my own testing, and it passed. In your case, you may have a term "google" in your database.


No I have not. And the same happens with every adress starting with "www." !
I must have a problem somewhere. Or maybe a different version of php.
_________________
Olivier
Back to top
View user's profile Send private message Visit poster's website
Cyberian75



Joined: 26 Sep 2002
Posts: 1274
Location: Oregon

PostPosted: Thu Dec 30, 2004 2:53 am    Post subject: Reply with quote

Could someone please provide me with a pattern that can take (or match) only the domain name portion of an URL??? For example, from "http://www.example.com," it should be able to take only ".example."

I will credit you accordingly. Thanks. Smile
_________________
Michael P.

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



Joined: 15 Mar 2003
Posts: 325

PostPosted: Thu Dec 30, 2004 12:40 pm    Post subject: Reply with quote

Regular expressions can be somewhat of a pain so why don't you use something like the following, which is simple to use if turned into a function
Code:
$host=str_replace("http://","",$host);
$array=explode(".",$host);
if (substr($array[0],0,3)=="www"){
     $answer=$array[1];
} else {
     $answer=$array[0];
}
echo $answer;

Ths will give you example (easy to add in . if you want) for
Code:
$host="http://www.example.com"
$host="www.example.com"
$host="http://www2.example.com"
$host="http://example.com"
etc
Back to top
View user's profile Send private message
Cyberian75



Joined: 26 Sep 2002
Posts: 1274
Location: Oregon

PostPosted: Thu Dec 30, 2004 6:45 pm    Post subject: Reply with quote

Thanks for the idea. Smile
_________________
Michael P.

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



Joined: 26 Sep 2002
Posts: 1274
Location: Oregon

PostPosted: Thu Dec 30, 2004 8:45 pm    Post subject: Reply with quote

Code:
//CHANGELOG
//
//0.8.0: Implemented a smarter URL matching (step 4).
//

_________________
Michael P.

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



Joined: 06 Aug 2003
Posts: 10

PostPosted: Thu Jan 06, 2005 9:41 am    Post subject: Reply with quote

Your modification is working fine, thank you.

But now I have another pb (gasp !) :

for EVERY comment that I want to add to the balcklist, I have the same message :
Quote:
Deleting...
Comment ID #13430 (insert error: Duplicate entry '127' for key 1)


Do you know where this comes from ?
_________________
Olivier
Back to top
View user's profile Send private message Visit poster's website
turtelina



Joined: 25 Jan 2002
Posts: 45
Location: Austria

PostPosted: Thu Jan 06, 2005 3:19 pm    Post subject: Reply with quote

EDIT:

See this is what happens when you dont check the thread regularly like I did. Michael posted a bugfix for it on page 7.
Back to top
View user's profile Send private message Visit poster's website
ReiXou



Joined: 06 Aug 2003
Posts: 10

PostPosted: Thu Jan 06, 2005 3:45 pm    Post subject: Reply with quote

turtelina wrote:
EDIT:

See this is what happens when you dont check the thread regularly like I did. Michael posted a bugfix for it on page 7.


Thanks a lot I try it immediatly (and yes, I missed that message).

EDIT (OK it works I was limited to only 127 IPs, that is, mmmh)
_________________
Olivier
Back to top
View user's profile Send private message Visit poster's website
Cyberian75



Joined: 26 Sep 2002
Posts: 1274
Location: Oregon

PostPosted: Thu Jan 06, 2005 7:03 pm    Post subject: Reply with quote


_________________
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, 3, 4, 5, 6, 7, 8, 9
Page 9 of 9

 
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