ID:185088
 
As I stated in an earlier I post I will soon be able to provide Permanent Host Capabilities. I want to add a Hub to the website I'll be doing this on, so, does anyone know how to make a hub?
Um... I'm not quite sure what you want to do. Could you clarify?
In response to Crispy
I think he wants a BYOND gaming hub on his own site away from BYOND's hub.

~Kujila
In response to Kujila
which can be done if you use dmcgi and a line of code in each game that 'announces' itself periodically to a special webpage. unfortunately i don't think there is anything 'pre-made' (aside from the original Hub itself) that you can ust drop in place.
In response to digitalmouse
Well, there was that PHP script that ripped the info from hub entrys. I am wanting to say that Lummox posted it, but I am probably wrong.
In response to Scoobert
Scoobert wrote:
Well, there was that PHP script that ripped the info from hub entrys. I am wanting to say that Lummox posted it, but I am probably wrong.

You are correct and with a little colour here and there it looks nice.
In response to Crispy
Crispy wrote:
Um... I'm not quite sure what you want to do. Could you clarify?

What Kujila said is correct, sorry for not being more clear. I don't want anything 'Pre-Made'(Think that's right) as I want to give users of the hub their own customizable interface. I'm just asking if anyone knows how to create a hub similar to the one on this site and if so, if they could teach me how to do so.

In response to TheLunarWolf
Learn php

Put that in where ever you want the hub
<?php
$game="YOURNAME.GAMESNAME"; // this should match your world.hub setting
$fcontents=file("http://www.byond.com/hub/hub.cgi?qd=hub;hub=$game;format=text;content=|worlds|users|");
$worlds=array();
$whichworld=null;
while(list($n,$line)=each($fcontents)) {
if(preg_match("/worlds\/(\d+)/",$line,$n)) {$whichworld=$n[0]; $worlds[$whichworld]=array(); continue;}
if(preg_match("/^\s*url\s*=\s*\"(.+)\"/",$line,$n)) {$worlds[$whichworld]['url']=$n[1]; continue;}
if(preg_match("/^\s*status\s*=\s*\"(.+)\"/",$line,$n)) {$worlds[$whichworld]['status']=$n[1]; continue;}
if(preg_match("/^\s*users\s*=\s*list\((.*)\)/",$line,$n)) {
$names=preg_split("/\s*,\s*/",$n[1]);
while (list($n,$name) = each ($names)) {
preg_match("/\"(.*)\"/",$name,$unquote);
$names[$n]=stripslashes($unquote[1]);
}
$worlds[$whichworld]["users"]=$names;
}
}
if(count($worlds)) {
echo "<DIV STYLE=\"text-indent: 0\"><center><TABLE STYLE=\"border:0;margin:5px\"><TR>";
echo "<TD STYLE=\"padding-right:20px\"><H2>Games Online</h2></td>";
echo "<TD STYLE=\"padding:0\">";
while(list($n,$lst)=each($worlds)) {
$url='world.php?'.urlencode($lst['url']);
if(!$lst['status']) $lst['status']='(No status info available)';
echo "<A HREF=\"".$url."\">Join</a> [";
echo $lst['status'];
echo "]<BR><BR>Logged in: ";
echo join(" - ",$lst["users"])."<P>\n";
}
echo "</td></tr></table></center></div>";
}
?>


World.php
<?php
$query=$HTTP_SERVER_VARS["QUERY_STRING"];
if($query) {
$query=urldecode($query);
preg_match("/(\d+)$/",$query,$match);
$world=$match[1];
header("Content-type: text/vmd.dmclientscript");
header("Content-Disposition: attachment; filename=url$world.dms");
echo "/*\nThis game requires the BYOND engine to run.\n\n";
echo "This is a DM Script file. You need to install BYOND (for free!)\n";
echo "and possibly configure your browser to open this file with\n";
echo "Dream Seeker. For more information, go to: http://www.byond.com/script.\n";
echo "*/\n";
echo "#define URL \"$query\"\n";
echo "#include <byond.dms>\n";
exit;
}
$refer=header("Location: ".$HTTP_SERVER_VARS["HTTP_REFERER"]);
if($refer) header("Location: $refer");
else {
$path='http://'.$HTTP_SERVER_VARS['HTTP_HOST'].dirname($HTTP_SERVER_VARS['PHP_SELF']).'/';
header("Location: $path");
}
exit;
?>



Credits all to Lummox JR the great Lummox JR :P

*sucks up some more*
In response to A.T.H.K
Thank you.
In response to TheLunarWolf
No problem i was also looking for the same thing i had it awhile back and i had it looking like byond but my hardrive failed :(