TinyPortal

Development => Feedback => Bugs/Errors => Topic started by: Akilae on March 08, 2007, 06:22:47 PM

Title: Block PHP Error
Post by: Akilae on March 08, 2007, 06:22:47 PM
Hey guys.  I was searching for block code to display my ventrilo server status and I found one but i'm getting errors.  This is the code I'm putting using a php block:


<?php
/*********************************************************************************\
| PHP-Nuke Block: Ventrilospy.net (block-VentriloSpy.php)                         |
| Copyright(c) 2006 ChrisWell - chriswell@kyoss.net - http://www.ventrilospy.net  |            
\*********************************************************************************/

//SETTINGS
//_________________________________________________________________________________
// Please check the codegenerator at http://www.ventrilospy.net/code/index.html for the values
$VSPY_IP = "defend.typefrag.com"; //your servers ip-address
$VSPY_PORT = "14814"; //default is 3784

$VSPY_WIDTH = 600;
$VSPY_HEIGHT = 400;
$VSPY_STYLE = $VSPY_WIDTH.'x'.$VSPY_HEIGHT.'_html';

//DO NOT CHANGE ANYTHING BELOW THIS LINE
//_________________________________________________________________________________
if (eregi("block-VentriloSpy.php", $PHP_SELF)) {
   
Header("Location: index.php");
   die();
}
//PROTECTION

//CONTENT
$content = '<div style="text-align:center;"><script language="javascript" type="text/javascript">
  var vspy_width='
.$VSPY_WIDTH.';
  var vspy_height='
.$VSPY_HEIGHT.';
  var vspy_style="'
.$VSPY_STYLE.'";
  var vspy_server="'
.$VSPY_IP.':'.$VSPY_PORT.'";
</script>
<script language="javascript" type="text/javascript" src="http://www.ventrilospy.net/js/show_ventrilo.js"></script></div>'
;

?>


And this is the error I get:


Parse error: parse error, unexpected '<' in /home/www/artofwarcraftguild.com/Sources/Load.php(1735) : eval()'d code(36) : eval()'d code on line 1


Any help?
Title: Re: Block PHP Error
Post by: IchBin on March 08, 2007, 06:25:26 PM
There's already one located in the block code snippets board. Just remember any time you put PHP code into a block you have to take out the <?php and ?> tags.