Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

August 09, 2022, 05:26:40 AM

Login with username, password and session length
Members
  • Total Members: 3842
  • Latest: Kokoro
Stats
  • Total Posts: 193479
  • Total Topics: 21088
  • Online today: 57
  • Online ever: 1035
  • (November 26, 2020, 04:45:12 AM)
Users Online
Users: 0
Guests: 44
Total: 44

Author Topic: Block Code for BHD Server Status  (Read 17558 times)

0 Members and 1 Guest are viewing this topic.

BCB

  • Guest
Re: Block Code for BHD Server Status
« Reply #10 on: March 16, 2006, 07:19:43 AM »
hhhhhmmmmmmmmmm  I will see if that works. I am new to this and want to learn as much as i can, and actually I didnot think that was possible.



Well before I hit the post button I tried just that and yes it did work however, it takes up the page, the whole page and pushes everything else out . I will see if maybe I can take some of the coding form that and see if I can get that to work. :S

BCB

  • Guest
Re: Block Code for BHD Server Status
« Reply #11 on: March 23, 2006, 10:54:32 AM »
here is what I have gotten so far and am still working on it.

Code: [Select]
<?php
$dbhost     
"localhost"; // Database host
$dbname     "DATABASE NAME"; // Database name
$dbusername "DBUSER"; // Database user name
$dbuserpw   "DBPASS"; // Database password

$link_id mysql_connect($dbhost,$dbusername,$dbuserpw)
               or die(
"Could not connect to MySQL.");
//echo("Connection Successfull.<br>");
$selected mysql_select_db($dbname,$link_id)
               or die(
"Could not select database");

$result mysql_query("SELECT name, server_name, map_name, game_type, dedicated, time, max_players, num_players  FROM chronos_servers ORDER BY time DESC LIMIT 0, 1");
while (
$row mysql_fetch_row($result)) {
$name $row[0];
$sname htmlspecialchars(base64_decode($row[1]));
$max $row[6];
$map htmlspecialchars(base64_decode($row[2]));
$mapname $row[2];
$dedi $row[4];
$type $row[3];
$num $row[7];
$sertime $row[5];
$curtime time();
$tdiff $curtime $sertime;
if (
$tdiff 120) {
echo 
"Offline<br>";
} else { 
$result1 mysql_query("SELECT name, thumbnail, game_type, id FROM chronos_maps WHERE name = '$mapname' AND game_type = '$type' ");
while (
$row2 mysql_fetch_array($result1)) {
$mtn $row2[1];
$mpid $row2[3];
}
}
}
$url "<a href=http://YOURDOMAIN.com/STATDIRECTORY/index.php?action=map_details&id=".$mpid.">";


echo 
"$name<br>";
echo 
"Online!<br>";
echo 
"$sname<br>";
echo 
"$type<br>";
echo 
"$url<img src='http://YOURDOMAIN.com/STATDIRECTORY/$mtn'></a><br>";
echo 
"$map<br>";
echo 
"Dedicated:$dedi<br>";
echo 
"Server Address for Pinger<br>";
echo 
"SERVER IP:SERVER GAME PORT<br>";
echo 
"Players : $num/$max<br>";


?>


This is what the finished product will look like as it is with the above coding



Where the Online! is in the photo I would like to either put in some images of ONLINE or OFFLINE but still trying to figure that part out.