I'm having problems with a new PHP Nuke Module made by me about Direct Connect Public Hublists.
I have made all the list database with all the hubs inside with no problem.
Now I have to generate the PublicHubList.config file (I'll compress it later with bz2).
I use the following code to generate the list:
Code: Select all
while ($hubrow = mysql_fetch_array($hubqry)) {
$listarray[$i] = $hubrow["nome"]."|".$hubrow["indirizzo"]."|".$hubrow["descrizione"]."|".$hubrow["utenti"];
$i++;
}
unset($hubrow);
$page = join("|||||",$listarray);
echo $page;
As I save its content in a file named PublicHubList.config or else my DC++ client successfully opens it, BUT....
When I call the PHP script directly from the URL, with Apache's Rewrite Mod, Internet Explorer opens it, but DC++ doesn't. The error message is "Error: Disconnected (http://www.p2pmania.it/PublicHubList.config)".
I'm using the Rewrite Mod because I thaught that DC++ couldn't recognize .php files, but I was wrong.
Now I ask you: have I to send some special headers to the client when downloading the list? I mean, do I have to put
Code: Select all
header("Content-type: text/plain");
I was actually thinking about creating a special directory containing only the Public Lists, generated by the server at certain hours. It would be a HUGE directory, containing all the possible hublists (bz2 compressed and not compressed, for old clients, country's hublist, etc.). I have no disk space problems, but I think it would be smarter to auto-generate the list at each connection, even if it is a little performance-slowing.