Need help with a block i am trying to create.

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Need help with a block i am trying to create.
malavel
CZ Newbie
malavel has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Oct 30, 2005
0.00 posts per day
Posts: 1
Points: 130
   
I'm trying to make a Lineage 2 Server Status Block using the following code...

<table width="100%" height="100%" cellspacing="0" cellpadding="0"><tr>
<td valign="top" align="center">

<table cellspacing="0" cellpadding="0" class="status" border="0">
    <tr><td colspan="2" class="top"></td></tr>

<?php
function doTestDown($line){
    if(stristr($line, 'down')==TRUE){
        $x = "<span class='down'>" . $line . '</span>';
        return $x;
    }else{
        $x = "<span class='up'>" . $line . '</span>';
        return $x;
    }
}
// Let's get the data as an array
$lines = file('http://www.glop.org/lineage2/backend.txt');
for($i=0; $i<count($lines); $i+=2)
{
    $servers[] = array('name' => $lines[$i], 'connection' => doTestDown($lines[$i+1]));
}

echo"<td class='left' nowrap>";
echo"<span class='yellow'>";
echo"0. ";
echo $servers[1]['name'];
echo"</span></td><td class='right' nowrap>";
echo $servers[1]['connection'];
echo"</span> ms</td></tr>";


echo"<td class='left' nowrap>";
echo"<span class='yellow'>";
echo"1. ";
echo $servers[2]['name'];
echo"</span></td><td class='right' nowrap>";
echo $servers[2]['connection'];
echo"</span> ms</td></tr>";


echo"<td class='left' nowrap>";
echo"<span class='yellow'>";
echo"2. ";
echo $servers[3]['name'];
echo"</span></td><td class='right' nowrap>";
echo $servers[3]['connection'];
echo"</span> ms</td></tr>";


echo"<td class='left' nowrap>";
echo"<span class='yellow'>";
echo"3. ";
echo $servers[4]['name'];
echo"</span></td><td class='right' nowrap>";
echo $servers[4]['connection'];
echo"</span> ms</td></tr>";


echo"<td class='left' nowrap>";
echo"<span class='yellow'>";
echo"4. ";
echo $servers[5]['name'];
echo"</span></td><td class='right' nowrap>";
echo $servers[5]['connection'];
echo"</span> ms</td></tr>";


echo"<td class='left' nowrap>";
echo"<span class='yellow'>";
echo"5. ";
echo $servers[6]['name'];
echo"</span></td><td class='right' nowrap>";
echo $servers[6]['connection'];
echo"</span> ms</td></tr>";


echo"<td class='left' nowrap>";
echo"<span class='yellow'>";
echo"6. ";
echo $servers[7]['name'];
echo"</span></td><td class='right' nowrap>";
echo $servers[7]['connection'];
echo"</span> ms</td></tr>";


echo"<td class='left' nowrap>";
echo"<span class='yellow'>";
echo"7. ";
echo $servers[8]['name'];
echo"</span></td><td class='right' nowrap>";
echo $servers[8]['connection'];
echo"</span> ms</td></tr>";


echo"<td class='left' nowrap>";
echo"<span class='yellow'>";
echo"8. ";
echo $servers[9]['name'];
echo"</span></td><td class='right' nowrap>";
echo $servers[9]['connection'];
echo"</span> ms</td></tr>";


echo"<td class='left' nowrap>";
echo"<span class='yellow'>";
echo"A. ";
echo $servers[10]['name'];
echo"</span></td><td class='right' nowrap>";
echo $servers[10]['connection'];
echo"</span> ms</td></tr>";

?>

</table>

</td></tr></table>


Could someone tell me how exactly i can turn this script into a phpnuke block as i've had no luck so far.

Thanks for your help.


Back to top Reply with quote
#2   re: Need help with a block i am trying to create.
floppydrivez
CZ Addict
 Codezwiz Site Donator
floppydrivez has been a member for over 18 year's 18 Year Member
usa.gif mississippi.gif
Occupation: graphic design
Age: 43
Gender: Male
Website:
Status: Offline
Joined: Feb 26, 2006
0.08 posts per day
Posts: 518
Points: 4,848
AIM Address Yahoo Messenger MSN Messenger 
that is code from a module and not a block. If thats your code I think its incomplete.



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
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
You cannot attach files in this forum
You cannot download files in this forum