vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced CMPS > vBa CMPS v1.x (Archive - Closed for Posting) > Troubleshooting / "How do I..." Questions

 
 
Thread Tools Display Modes
  #1  
Old 08-02-2004, 07:46 AM
dep dep is offline
Junior Member
 
Join Date: Apr 2004
Posts: 6
Default help with a addon on

Hello i am trying to make a addon for my users i have got the php code, but am not sure how i go about converting to make it work with vbadvance.

any help would be much welcomed.

PHP Code:
<?php
error_reporting
(1);

echo 
"Status obtained on the </p>";
$offset 3600*1;
$date gmdate("jS F Y, h:i A"time() + $offset);
echo 
$date"<br><br>\n";

function 
getmicrotime(){ 
    list(
$usec$sec) = explode(" ",microtime()); 
    return ((float)
$usec + (float)$sec); 


function 
testServer ($address$port$serverName) {

  
$time_start getmicrotime();

  
$fp fsockopen ($address$port$errno$errstr5);
  if (!
$fp) {
    echo 
"<font color=red>$serverName is Down. </font><br>\n";
  } else {

    
$time_end getmicrotime();
    
$time $time_end $time_start;
    
$time round($time*1000,2);

    echo 
"<font color=green>$serverName is Up.</font><br>\n";

    
fclose ($fp);
  }
  return;
}

testServer("www.legendofmir.net"80"Offical Web Site");
testServer("forum.legendofmir.net"80"Offical Forum");
testServer("patch.legendofmir.net"21"AutoUpdate");
testServer("217.65.66.20"80"Game Server");
?>
  #2  
Old 08-02-2004, 12:58 PM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: help with a addon on

First, please take a look at the 'Creating New Modules' section in the User's Manual.
Secondly, since your script was not designed for vBulletin, you'll have to make some small changes. Either this post, or this post will help you with that.
  #3  
Old 08-02-2004, 01:29 PM
dep dep is offline
Junior Member
 
Join Date: Apr 2004
Posts: 6
Default Re: help with a addon on

thanks just noticed it and got it working ty
  #4  
Old 08-16-2005, 06:19 PM
Laz Laz is offline
Junior Member
 
Join Date: Jul 2005
Posts: 12
Default Re: help with a addon on

Dep,

Many thanks for this base code. I run an Eve-Online website and have managed to adapt your code and use it in CMPS V2.

The changes show a sites status for the game servers with graphics and also it shows web pages. When a web page is offline the link to it disappears.

Just wanted to thank you for your work here that helped me come up with something I needed on my site.

Cheers.
Attached Images
File Type: gif GameServerDown.gif (9.7 KB, 16 views)
File Type: gif SiteDown.gif (7.1 KB, 11 views)
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 -4. The time now is 12:08 AM.

Forums Powered by vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
Please note that vBadvanced is in no way affiliated with Jelsoft Enterprises Ltd, nor will Jelsoft be able to provide any support for our products.