Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-17-2008, 06:31 PM
evenmonkeys's Avatar
evenmonkeys evenmonkeys is offline
 
Join Date: Aug 2004
Location: Iowa
Posts: 896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Pinging a Server - Need Help

I am working with scratch here. I've been searching these forums all day and I can't seem to make any sense of what I'm finding. I'm going insane here.

I just want something very simple. I want to be able to display the status of my server on the forum somewhere, anywhere. I don't care. I can move things around rather easily. I'm just struggling creating it.

Anyways, what I want to do is ping my computer here and home to show whether or not it is connected to the internet. I run a private gaming server for my friends and I to play on, but it'd be nice if they knew whether or not it was up and running before they tried logging in. If the computer is turned on, the server is turned on.

Could someone either build me something or point me toward something SIMPLE. All I want to do is see if the thing's turned on. I am interested in placing the status in my header.

$ping = ping yarub's server;
$status = $ping;

Obviously that's not accurate, but you get my idea. Please help me. =(
Reply With Quote
  #2  
Old 09-17-2008, 06:36 PM
SEOvB's Avatar
SEOvB SEOvB is offline
 
Join Date: May 2007
Location: Indianapolis
Posts: 2,451
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

use a pinging script that will give you the output, then use the hooks and plugin system as instructed in the vBulletin manual and insert the code into your template
Reply With Quote
  #3  
Old 09-17-2008, 06:37 PM
evenmonkeys's Avatar
evenmonkeys evenmonkeys is offline
 
Join Date: Aug 2004
Location: Iowa
Posts: 896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's the point. I can't find one that's simple enough for my mind to understand. =\
Reply With Quote
  #4  
Old 09-17-2008, 08:05 PM
SEOvB's Avatar
SEOvB SEOvB is offline
 
Join Date: May 2007
Location: Indianapolis
Posts: 2,451
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here's a easy one

http://www.greenbird.info/xantus-webdevelopment/ping
Reply With Quote
  #5  
Old 09-17-2008, 09:23 PM
evenmonkeys's Avatar
evenmonkeys evenmonkeys is offline
 
Join Date: Aug 2004
Location: Iowa
Posts: 896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's the one I was trying. Could you possible help me make a plugin that would make it work? >_> 'Cause it's not working.
Reply With Quote
  #6  
Old 09-18-2008, 02:34 AM
MoT3rror MoT3rror is offline
 
Join Date: Mar 2007
Posts: 423
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=8&txtCodeId=1786" target="_blank">http://www.planet-source-code.com/vb...txtCodeId=1786</a>
Reply With Quote
  #7  
Old 09-18-2008, 02:57 AM
evenmonkeys's Avatar
evenmonkeys evenmonkeys is offline
 
Join Date: Aug 2004
Location: Iowa
Posts: 896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So if it doesn't connect to the server, it prints out a million lines of error. That's not what I'm looking for. I want something simple. There's got to be an easier way to do this.

Server is Offline
Server if Online

That's all I want in the end.

EDIT: Maybe I'm asking for the wrong thing. I don't want to ping anything. I just want to see if the darn thing is connected to the internet. That's all I want.
Reply With Quote
  #8  
Old 09-18-2008, 05:25 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
$site 'yoursite.com';
$port 80;
$check = @fsockopen($site$port);

if (!
$check)
{
    echo 
'Server is Currently Down!';
}
else 
{
    echo 
'Server is Currently Up!';

Reply With Quote
  #9  
Old 09-18-2008, 05:53 AM
gfxhelp.com gfxhelp.com is offline
 
Join Date: Aug 2008
Posts: 99
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have a look at http://www.greycube.com/ and check out LGSL, not sure if it's what you're looking for, but it checks if game servers are up and can show stats for them too like players, maps, settings etc. It generally outputs a list of game servers which you specify by IP, but if you plan on making a small menu for just one game server you can easily redo the layout for a small menu.
Reply With Quote
  #10  
Old 09-18-2008, 07:43 AM
MrEyes MrEyes is offline
 
Join Date: Nov 2004
Posts: 380
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does your local server run a web server of any description and if not is it possible to install one?

If yes, then there is a much easier solution....

Create a "server is online" image and put it on your local webserver, for example:

http://mylocalwebserver.dyndns.com/online.gif

Then create a "server is offline" image and put it on your internet/forum server, for example:

http://www.myinternetforum.com/offline.gif

Once you have the two images, you would then use javascript to attempt to load the "online.gif" image from your local server and if not possible it displays the "offline.gif" from the internet server.

Job done

EDIT: I did this for a project a few years ago, I will see if I can dig out the JS for it. No promises though

EDIT: Found it:

Code:
<html>
	<head>
	</head>

	<body>
		<img name="serverStatusImage" src="checking.gif" alt="Checking Server Status...">
		<script type="text/javascript">
		<!--
			function SetOnlineStatus() {
				document["serverStatusImage"].src = onlineImageSrc;
				document["serverStatusImage"].alt = 'Server Online';
			}
	
			function SetOfflineStatus() {
				document["serverStatusImage"].src = offlineImageSrc;
				document["serverStatusImage"].alt = 'Server Offline';
			}
			
			var onlineImageSrc = 'http://www.google.co.uk/images/nav_logo3.png'
			var offlineImageSrc = 'http://www.myinternetsite.com/offline.gif'
			
			var onlineImage = new Image();
			onlineImage.onload = SetOnlineStatus;
			onlineImage.onerror = SetOfflineStatus;
			onlineImage.src = onlineImageSrc;
		//-->
		</script>
	</body>
</html>
The only thing I forgot is the "checking.gif" image which is displayed until the server check has been performed
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:17 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05300 seconds
  • Memory Usage 2,253KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete