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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 790
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 631
  • Total: 632
  • tino

[Block] ventrilo block

Started by Moocat, October 04, 2005, 06:34:18 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Blue Steel

can someone please tell me what's causing

undefined offset 1 errors (about 10 of them) every time i load up the page when i have this block of text in it.. BTW this block works its a Ventrilo block which i grabbed off the net (i had to use my own images)

I've also fixed all the undefined variables and constants errors
see it in action at http://ubernubes.darkstargamers.com/ (a friends site)


####################################################################
#  This file is Copyright (c) 2005 Scott Benson      #
#                                                                  #
#  Please submit changes, suggestions to             #
#  scott@sbhostingsolutions.com                         #
#                                                                   #
#  Modified by Vlorn  vlornmail@vlornsworld.com     #
#   December 2006                                           #
#  Modified by C.Arnott cameron@ecn.net.au        #
#   March 2007                                                #
####################################################################

define ("NAME", "NAME");
define ("CHANNEL", "CHANNEL");
define ("CLIENT", "CLIENT");
define ("SERVER", "SERVER");
define ("PID", "PID");
define ("CID", "CID");

$chanvar[1]=" ";
$value[1]=" ";

$content=" ";
$ventip = "202.3.110.54";
$ventport = "3952";
$ventpass = "";
$enable_graphics = "1";
$enable_link = "1";
$use_url = "1"; // if you can't use exec on the web server (safe mode prevents this) then enable to use
$ventrilo_status = "ventrilo_status"; // location of ventrilo_status - use the full path
$use_as_page = "yes"; // set to no to use as a nuke block, anything else and it will work as a regular page that can be called directly.
$username_color = "yellow";  // set color of username, use color name or Hex value, use "" for default style.css value
$show_comments = "0"; // show user comments "1" enables, "0" disables
$comment_color = "#808080"; // user comment color, use color name or Hex value, use "" for default style.css value
$scrolling_block = "0"; // Enable fixed hieght block that scrolls, "1" enables, "0" disables
$scroll_hieght = "420"; // Block hieght only used if scrolling is enabled

$graphics['1']['SERVER']= "<img src=images/ventserver.png align=middle>";
$graphics['1']['CLIENT']= "<img src=images/ventclient.png align=middle>";
$graphics['1']['CHANNEL']= "<img src=images/ventchannel.png align=middle>";

###################################################################
#
# No changes should be needed below here

##################################################################

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

if ($use_url == "1") {
   $vent_info = "http://ns2.sbhost.net/ventstatus.php?detail=2&ip=".$ventip."&port=".$ventport."&pass=".$ventpass;
   $lines = file($vent_info);
} else {
   $command = $ventrilo_status . " -c2 -t".$ventip.":".$ventport.":".$ventpass;
   $lines = `$command`;
   $lines = explode("\n", $lines);
}

$channels[] = 0;
$settings['CHANNEL'][0]['CID'] = "0";
$settings['CHANNEL'][0]['NAME'] = " Lobby";
$settings['CHANNEL'][0]['PID'] = "0";
foreach ($lines as $line) {
   if ( $line == " " ) {
      next($line);          # Ignore blankline
   }  else {
      $line = rtrim($line);  # Get rid of newline characters
      # $line = ltrim($line);  # Get rid of any leading spaces
      $value = preg_split("/\s*:\s*/", $line, 2); # split by "=" and removing blank space either side of it.
      if (($value[0] == "CHANNEL") or ($value[0] == "CLIENT")) {
         $vars = preg_split("/\s*,\s*/", $value[1]);
         foreach ($vars as $var) {
            $chanvar = preg_split("/\s*=\s*/", $var);
            if ($value[0] == "CHANNEL") {
               if ($chanvar[0] == "CID") {
                  $channels[] = $chanvar[1];
                  $id = $chanvar[1];
               }
               if ($chanvar[0] == "PID") {
                  $subchans[$id][] = $chanvar[1];
               }
            //   $key = "CID";
            } elseif ($value[0] == "CLIENT") {
               if ($chanvar[0] == "UID") {
                  $clients[] = $chanvar[1];
                  $id = $chanvar[1];
               }
               //$id = "UID";
            }
            $settings[$value[0]][$id][$chanvar[0]] = $chanvar[1];
            $key="";
         }
      } else {
         $settings[$value[0]] = $value[1]; # Create a new array with all the values.
      }
   }
}

$serverpic = $graphics[$enable_graphics][SERVER];
$clientpic = $graphics[$enable_graphics][CLIENT];
$channelpic = $graphics[$enable_graphics][CHANNEL];

$content .= "<b><center>".$serverpic.$settings[NAME]."</center></b><br>\n";
if ($scrolling_block == "1"){
$content .="<MARQUEE behavior= \"scroll\" direction= \"up\" height=\"$scroll_hieght.\" scrollamount= \"1\" scrolldelay= \"25\" onmouseover='this.stop()' onmouseout='this.start()'>";
}

foreach ($channels as $channel) {

  $pid = $settings['CHANNEL'][$channel]['PID'];
  $cid = $settings['CHANNEL'][$channel]['CID'];
   if ($pid == "0"){
  $chaname = $settings['CHANNEL'][$channel]['NAME'];
   $content .= "<b>".$channelpic.$chaname."</b><br>\n";
   if ($clients) {
      foreach ($clients as $client) {
         $current = $settings['CLIENT'][$client]['CID'];
         if ($current == $channel) {
            $name = $settings['CLIENT'][$client]['NAME'];
            $comment = $settings['CLIENT'][$client]['COMM'];
        $content .= "<font color=".$username_color.">   ".$clientpic."$name</font>\n";
            if ($show_comments == "1"){
        $content .= "<font color=".$comment_color.">  $comment<br></font>\n";
      }
      else {
      $content .= "<br>\n";
         }
      }
         }
      foreach ($channels as $channel) {
    $pid2 = $settings['CHANNEL'][$channel]['PID'];
    $cid2 = $settings['CHANNEL'][$channel]['CID'];
    if ($cid == "0"){}
    elseif ($pid2 == $cid) {
    $chaname = $settings['CHANNEL'][$channel]['NAME'];
     $content .= "<b>    ".$channelpic.$chaname."</b><br>\n";
  if ($clients) {
      foreach ($clients as $client) {
         $current = $settings['CLIENT'][$client]['CID'];
         if ($current == $channel) {
            $name = $settings['CLIENT'][$client]['NAME'];
            $comment = $settings['CLIENT'][$client]['COMM'];
        $content .= "<font color=".$username_color.">      ".$clientpic."$name</font>\n";
      if ($show_comments == "1"){
        $content .= "<font color=".$comment_color.">  $comment<br></font>\n";
      }
      else {
      $content .= "<br>\n";
         }
    }
    }
    }
         
      }
   }
}
}
}

if ($enable_link == "1") {
   $content .= "<center><a href=\"ventrilo://".$ventip.":".$ventport."/servername=".$settings[NAME]."\">Connect</a></center><br>\n";
}

if ($use_as_page != "no"){
   print "$content\n";
}


Earache

anyone know if ventrilospy.net is still working?
I can't seem to connect to it.

IchBin


tomtom9800

I am looking at the downloads section of the ventrilo website and I do not see a ventrilostatus.exe, all I see is the ventrilostatus.php zip file, am I looking at the wrong place?

Dazed

The only one I have found that works correctly is from gamespy which unfortunately is paid. The one on the ventrilo site requires an executable file to be on your server; most webhosts are unwilling to allow that... :(

IchBin

The ventrilo status file is in the server package download.

Dazed

Quote from: IchBinâ„¢ on August 07, 2007, 04:01:30 PM
The ventrilo status file is in the server package download.

But it requires an exe file on the host server doesn't it?

IchBin

As I stated in the setup post, yes. Some hosts allow it while others do not.

cheetara

Is the snippet on the front page still making a lot of errors on the site, or is it more stable now?  I would like to try to put this on my site, but am scared that there will be errors.  Thanks so much!

IchBin

It should work I'm running it on one of my sites.

This website is proudly hosted on Crocweb Cloud Website Hosting.