View previous topic :: View next topic |
Author |
Message |
Cyberian75
Joined: 26 Sep 2002 Posts: 1278 Location: Oregon
|
Posted: Tue Dec 21, 2004 6:42 pm Post subject: |
|
|
Use this instead... Code: | [^http:\/\/]?[a-z0-9]*\.?[a-z0-9\-]+\.[a-z]{2,6} |
_________________ Michael P.
 |
|
Back to top |
|
 |
ReiXou
Joined: 06 Aug 2003 Posts: 10
|
Posted: Wed Dec 22, 2004 8:58 am Post subject: |
|
|
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 |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1278 Location: Oregon
|
Posted: Thu Dec 30, 2004 2:53 am Post subject: |
|
|
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.  _________________ Michael P.
 |
|
Back to top |
|
 |
stevem
Joined: 15 Mar 2003 Posts: 326
|
Posted: Thu Dec 30, 2004 12:40 pm Post subject: |
|
|
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 |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1278 Location: Oregon
|
Posted: Thu Dec 30, 2004 6:45 pm Post subject: |
|
|
Thanks for the idea.  _________________ Michael P.
 |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1278 Location: Oregon
|
Posted: Thu Dec 30, 2004 8:45 pm Post subject: |
|
|
Code: | //CHANGELOG
//
//0.8.0: Implemented a smarter URL matching (step 4).
// |
_________________ Michael P.
 |
|
Back to top |
|
 |
ReiXou
Joined: 06 Aug 2003 Posts: 10
|
Posted: Thu Jan 06, 2005 9:41 am Post subject: |
|
|
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 |
|
 |
turtelina
Joined: 25 Jan 2002 Posts: 45 Location: Austria
|
Posted: Thu Jan 06, 2005 3:19 pm Post subject: |
|
|
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 |
|
 |
ReiXou
Joined: 06 Aug 2003 Posts: 10
|
Posted: Thu Jan 06, 2005 3:45 pm Post subject: |
|
|
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 |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1278 Location: Oregon
|
Posted: Thu Jan 06, 2005 7:03 pm Post subject: |
|
|
_________________ Michael P.
 |
|
Back to top |
|
 |
salterbomb
Joined: 11 Jan 2005 Posts: 6
|
Posted: Sat Jan 15, 2005 11:16 pm Post subject: |
|
|
well i seem to have a small problem now. someone hacked my b2 files to where i couldn't see anything when i logged into b2. i re-installed b2 (forgot to save my templates!!!) but now when i install the blacklist from fresh i get a blank page when i click the link on the admin page.
any ideas? |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1278 Location: Oregon
|
Posted: Sat Jan 15, 2005 11:29 pm Post subject: |
|
|
salterbomb wrote: | well i seem to have a small problem now. someone hacked my b2 files to where i couldn't see anything when i logged into b2. i re-installed b2 (forgot to save my templates!!!) but now when i install the blacklist from fresh i get a blank page when i click the link on the admin page.
any ideas? |
Do your posts show up on the admin page??? _________________ Michael P.
 |
|
Back to top |
|
 |
salterbomb
Joined: 11 Jan 2005 Posts: 6
|
Posted: Sat Jan 15, 2005 11:40 pm Post subject: |
|
|
yeah, i see everything now. i can click on ban and delete when i view the comments but when i click on the blacklist link to go to the blacklists page and search for IP's, etc, i get a blank white page.
i'm going over the coding in the instructions again but i am 100% sure i did it right. it used to work except i had that bug that was fixed on page 7. now that i had to reinstall everything due to some jerk, it's not coming up correctly. |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1278 Location: Oregon
|
Posted: Sat Jan 15, 2005 11:46 pm Post subject: |
|
|
salterbomb wrote: | yeah, i see everything now. i can click on ban and delete when i view the comments but when i click on the blacklist link to go to the blacklists page and search for IP's, etc, i get a blank white page.
|
Perhaps there are no commemts...? I haven't seen or had a problem like that. _________________ Michael P.
 |
|
Back to top |
|
 |
salterbomb
Joined: 11 Jan 2005 Posts: 6
|
Posted: Sat Jan 15, 2005 11:51 pm Post subject: |
|
|
hmmmmm, let me try to explain it better.
if i log into b2, i am immediately taken to the "post/edit" page. from there i can scroll down and see every post i've ever made and the comments made in them. from there i can click on the comments link and it will show me comments from the post i am looking at. in that instance i can click on "ban & delete" under each comment made for said post and it will go away.
however, if i click on the "blacklist" link on the top of the b2 menu (blacklist is next to "template" in the menu) i get nothing but a blank white page. it just doesn't display the normal blacklist page at all. i see nothing therefore i can't do the normal thing like search for IP's or search for keywords or even see the dropdown list of who has been banned.
edit: i just fixed it. here's what needs to be redone in the blacklist instructions:
when you make the blacklist.php file, there are 2 things wrong. one is that there's one extra <?php in the beginning of the coding. that needs to be deleted. the next is at the very bottom it should read /* </Blacklist> */ but it reads /* </Blanklist> */. just change the N to a C and all is well. |
|
Back to top |
|
 |
|