PHP Web Host - Quality Web Hosting For All PHP Applications $35/month $250/year (Unlimited) - $25/month - 200,000 impressions - Your Ad Could be Here - Click For Details
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
Argus
Client


Joined: Oct 06, 2003
Posts: 81

PostPosted: Sun May 30, 2004 1:58 pm Reply with quote Back to top

Hey there,

I'm using your example to work on a custom block of my own. Here's what the page I am getting the information from looks like now:

Image

I've gotten this far with the code:

Code:
<?php

if (eregi("block-ventrilo.php",$_SERVER['PHP_SELF'])) {
    Header("Location: index.php");
    die();
}

$address = "http://rentals.nuclearfallout.net/query/vstat.pl?&id=generalmayhem";

$begin = "<span class=\"clients-avail\">";
$end = "</span>";

ob_start();
$fetch = readfile($address);
$fetch = ob_get_contents();
ob_end_clean();

$clients = explode($begin, $fetch);
$clients = explode($end, $clients[1]);

$content .= "<center><b>General Mayhem Ventrilo</b></center><br>";
$content .= "<font size=\"1\">Loc: ventrilo.nuclearfallout.net:7320<br>";
$content .= "Connected Players: ";
$content .= $clients[0];
$content .= "/16<br><br>";
$content .= "<b>Channels:</b><br>"



***EDITTED***
The channels are static so I will just manually add them. The clients connected tho are not. My problem is that I have to grab all the clients in a given channel. Here's what it looks like with two channels. One with no clients and one with two clients in it.

Code:

<ul class="channel-list">
<li class="channel-line">

<span class="channel-subline-locked">
<span class="channel-start">Channel:</span>
<span class="channel-name">CyberAssault</span>
<span class="channel-id">(ID: 2)</span>
</span>
</li>


</ul>
<ul class="channel-list">
<li class="channel-line">
<span class="channel-subline-locked">
<span class="channel-start">Channel:</span>

<span class="channel-name">General Mayhem</span>
<span class="channel-id">(ID: 3)</span>
</span>
</li>

<li class="client-line">
<span class="client-subline">
<span class="client-name">I am talking to you</span>
<span class="client-ping">(Ping: 50)</span>
<span class="client-time">(5m)</span>
<span class="client-id">(ID: 42)</span>

<span class="client-admin">(normal)</span>
</span>
</li>
<li class="client-line">
<span class="client-subline">
<span class="client-name">Jon</span>
<span class="client-ping">(Ping: 54)</span>
<span class="client-time">(46m)</span>
<span class="client-id">(ID: 40)</span>
<span class="client-admin">(normal)</span>
</span>

</li>

</ul>


The full page source is available at:
Only registered users can see links on this board!
Get registered or login to the forums!


My problem as you may have guessed is how to grab multiple users if there are any in THAT channel. I'm stumbling on here but would appreciate any tips anyone has.

Thanks,

-Arg
View user's profile Send private message
Argus
Client


Joined: Oct 06, 2003
Posts: 81

PostPosted: Mon May 31, 2004 2:12 pm Reply with quote Back to top

Heya,

Ok I worked a bit further on this, but I get really sketchy where it comes to looping. Here's what I was trying to do, but it hasn't worked yet. It may be a syntax thing, I'm not sure.

Code:

$begin = "<span class=\"channel-id\">(ID: 2)</span>
</span>
</li>";
$end = "</ul>";

ob_start();
$fetch = readfile($address);
$fetch = ob_get_contents();
ob_end_clean();

<!-- If $fetch is blank, that means there were no clients in the channel as there would be no data between $begin and $end.  IF there are then we need to look for the client data.  The first one looks easy enough, but then I'm unsure if you can increment the same data tags to look down the page for a 2nd identical tag, and if so how to do it. -->

if($fetch != ""){
      $begin = "<span class=\"client-name\">";
      $end = "</span>";

      ob_start();
      $fetch = readfile($address);
      $fetch = ob_get_contents();
      ob_end_clean();

      $clients = explode($begin, $fetch);
      $clients = explode($end, $clients[1]);

      $content .= "    - ";
      $content .= $clients[0];
      $content .= "<br>";


      }

$content .= "<br>";

$content .= "    <font color=\"red\">General Mayhem<br></font>";


Any suggestions will be gratefully received.

-Arg
View user's profile Send private message
Argus
Client


Joined: Oct 06, 2003
Posts: 81

PostPosted: Mon May 31, 2004 2:30 pm Reply with quote Back to top

Ok so what the preceding does is this: If there is one client in one channel, the code above displays that client as being in all channels.

EDIT: The if statement is buggered for one.
View user's profile Send private message
Argus
Client


Joined: Oct 06, 2003
Posts: 81

PostPosted: Wed Jun 02, 2004 3:46 pm Reply with quote Back to top

Does anyone know if this is doable? if so, is it a major pita? Does anyone know where a tutorial for this kind of problem might exist?

Thanks much,

-Arg
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum