PDA

View Full Version : URL Status Checker


Slynderdale
02-27-2003, 10:00 PM
This is a simple hack, Just copy and paste two bits of code into two files (admin/functions.php and member.php), it adds a real handy url status checker function that checks for these web statuses:

"N/A"=>"Ikke HTTP",
"OK"=>"Valid hostname",
"FEJL"=>"Invalid hostname",
"D?d"=>"No response",
"100"=>"Continue",
"101"=>"Switching Protocols",
"200"=>"OK",
"201"=>"Created",
"202"=>"Accepted",
"203"=>"Non-Authoritative Information",
"204"=>"No Content",
"205"=>"Reset Content",
"206"=>"Partial Content",
"300"=>"Multiple Choices",
"301"=>"Moved Permanently",
"302"=>"Found",
"303"=>"See Other",
"304"=>"Not Modified",
"305"=>"Use Proxy",
"307"=>"Temporary Redirect",
"400"=>"Bad Request",
"401"=>"Unauthorized",
"402"=>"Payment Required",
"403"=>"Forbidden",
"404"=>"Not Found",
"405"=>"Method Not Allowed",
"406"=>"Not Acceptable",
"407"=>"Proxy Authentication Required",
"408"=>"Request Timeout",
"409"=>"Conflict",
"410"=>"Gone",
"411"=>"Length Required",
"412"=>"Precondition Failed",
"413"=>"Request Entity Too Large",
"414"=>"Request-URI Too Long",
"415"=>"Unsupported Media Type",
"416"=>"Requested Range Not Satisfiable",
"417"=>"Expectation Failed",
"500"=>"Internal Server Error",
"501"=>"Not Implemented",
"502"=>"Bad Gateway",
"503"=>"Service Unavailable",
"504"=>"Gateway Timeout",
"505"=>"HTTP Version Not Supported"

Screen Shot:
https://vborg.vbsupport.ru/attachment.php?s=&postid=359438

If you like it and install it on your board, all I ask of you is to support the hack and click install (https://vborg.vbsupport.ru/misc.php?s=&action=install&threadid=49470), thank you.

Slynderdale
02-28-2003, 12:20 PM
Screen Shot

Slynderdale
02-28-2003, 12:24 PM
Also, you can use this function any where, not just the profile, this is real handy if you have a link list and so on and you wanna show the current status of the site.

PSI|Dr-X
02-28-2003, 01:24 PM
Thnx will install :)

NuclioN
02-28-2003, 01:42 PM
wow slynderdale, install immediatly. :)

works exellent on 2.2.6.

Sun Boy
02-28-2003, 03:37 PM
Fatal error: Call to undefined function: check_url() in /home/****/public_html/forum/member.php on line 1256

Slynderdale
02-28-2003, 03:40 PM
Originally posted by Sun Boy
Fatal error: Call to undefined function: check_url() in /home/****/public_html/forum/member.php on line 1256

Did you add the check_url function to functions.php and uploaded it? If your using it on a non vB page, make sure the function is on the page where it is called or is included in the file.

TranceMaster
02-28-2003, 03:54 PM
like this one man
installed and working fine :)

EchoHype.com
02-28-2003, 07:36 PM
VERY nice.

I installed on 2.2.9 and works perfect.

good job

Chris Gwynne
02-28-2003, 10:07 PM
Very handy hack. :) *clicks install*

Erwin
02-28-2003, 10:13 PM
Great idea. :)

cymru2000
02-28-2003, 10:15 PM
Very nice hack, :)

sonic3d
02-28-2003, 11:53 PM
nice.

/me goes to install the hack

l8er
sonic

Slynderdale
03-01-2003, 01:32 AM
Im also working on a email checker that had 3 levels of checking, the first level is a format check, it checks to see if its a correct email format, the second checks the email MX server and see if its an actual email server thats accepting emails, the third check will check the MX server but also check if the user (user@domain.com) actual has a working email account there, Im gonna make it into a functions such as this and you can check emails by check_email($email,$level);

EchoHype.com
03-01-2003, 01:34 AM
ooo

be sure to let me know when that is done :)

Funkie
03-01-2003, 05:22 PM
@ Slynderdale

Also, you can use this function any where, not just the profile, this is real handy if you have a link list and so on and you wanna show the current status of the site.

How would you add this to a posbit to check Http posted links within a post??

Can it be done??

If so i will use it as it look well handy...

Thanx for the good work you all do..

EchoHype.com
03-01-2003, 06:28 PM
I think you need to be it in the include of the templates to work on all.

but I may be wrong

Aaron1
03-02-2003, 10:10 AM
Nice hack, but after installing, accessing profiles went very slow.
I'd prefer without!

Dean C
03-02-2003, 10:50 AM
Narin - you are full of these awesome ideas. Keep em coming pal ;)

- miSt

Funkie
03-02-2003, 02:40 PM
worxs fine in the members bit:)
Thanx fella.

I still dont get it working in the potbit:(.
but what the hell.
Nice lill hack

rick barclay
03-04-2003, 02:24 PM
I need your email checker hack asap. We've had a couple of
spam attacks within the last couple of weeks, and people are
starting to get a little annoyed. Thanks a bunch.

msimplay
03-06-2003, 05:23 PM
excellent hack :D

Boofo
03-06-2003, 09:19 PM
I had to uninstall this hack. It made viewing some member's profiles wat too slow and it even gave me a "no response" on a link that when clicked, works fine. It definitely needs some tweaking somewhere. ;)

Slynderdale
03-06-2003, 10:26 PM
Originally posted by Boofo
I had to uninstall this hack. It made viewing some member's profiles wat too slow and it even gave me a "no response" on a link that when clicked, works fine. It definitely needs some tweaking somewhere. ;)

Hmm yea, It might slow the page down a little depending on your server's speed, what it does is connects to the server the page and on and checks the page and exracts the headers and then outputs it, I might be able to ass a timeout to it so if it takes to long to connect to the server, it stops instead of showing a no respomse, but if ou have a fast server like I do and some others do, you should see just a slight speed difference if any at all

Boofo
03-06-2003, 10:40 PM
It was fast on all the other profiles. I just had one that it slowed to a crawl on. That was the one that reported back "no response" but when you clicked on the link, his site came up fine.

limey
03-07-2003, 03:55 AM
No offense, but whats the point of this hack? To make sure a website in a profile is up and running?

BTW Slynderdale I think your hacks are truly creative, I'm just trying to understand this one better. :D

Slynderdale
03-07-2003, 04:02 AM
Originally posted by limey
No offense, but what's the point of this hack? To make sure a web site in a profile is up and running?

BTW Slynderdale I think your hacks are truly creative, I'm just trying to understand this one better. :D

Yea, it tells you the current status of the site I the profile and you can also use the function any wheres you want, not just for the member page and even not just for the forum. If you have a link list page, this can come in handy.

Slynderdale
03-07-2003, 04:44 AM
If you wanna add this to the postbit in admin/functions.php find:

if ($post[showemail] and $displayemails) {
eval("\$post[useremail] = \"".gettemplate("postbit_useremail")."\";");
} else {
$post[useremail]="";
}


and replace it with:

if ($post[showemail] and $displayemails) {
if ($post[homepage]!="http://" and $post[homepage]!="www" and $post[homepage]!="http://www." and $post[homepage]!="") {
$page_status = check_url($post[homepage]);
}
eval("\$post[useremail] = \"".gettemplate("postbit_useremail")."\";");
} else {
$post[useremail]="";
}


Then place $page_status any wheres in the postbit you want, it will just show the page status so you maybe want to add (Status: $page_status) if you want, its up to you.

Also use this at your own risk, I havn't tested it in the post so I have no idea on how it will affect the server load or page loading time or any thing like that, If you do use this, please post and tell me how it works out.

Funkie
03-07-2003, 05:02 AM
Thanx for the help fella,:)
Done it to the letter,but nothing will show up apart from

Status:

limey
03-08-2003, 02:33 AM
Originally posted by Slynderdale
If you have a link list page, this can come in handy.

AH now we're talking!

padblaz
05-23-2003, 06:48 AM
*click*
thanks for this hack