TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 30, 2024, 03:14:05 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,174
  • Total Topics: 21,220
  • Online today: 147
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 118
  • Total: 118

Block Code for BHD Server Status

Started by BCB, March 15, 2006, 03:21:05 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

BCB

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

here is what I have gotten so far and am still working on it.

<?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.