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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 141
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 60
  • Total: 60

Help with an error

Started by samson, November 24, 2006, 02:30:21 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

samson

Could someone please help

everytime I Try to add php block I get an error

Parse error: parse error, unexpected '<' in /home/ligsus/public_html/smf3/Sources/Load.php(1708) : eval()'d code(35) : eval()'d code on line 1

this is what I tried add


<?php
/* #####################################################################################
 *
 * $Id: countdown.php,v 1.29 2004/09/09 15:52:33 rob Exp $
 *
 * This notice must remain untouched at all times.
 *
 * Modifications to the script, except the official addons or hacks,
 * without the owners permission are prohibited.
 * All rights reserved to their proper authors.
 *
 * ---------------------------------------------
 * http://www.vwar.de || Copyright (C) 2001-2004
 * ---------------------------------------------
 *
 * #####################################################################################
 */

// ####################################### CONFIGURATION  ###############################

## NOTE:
## This extra uses own header and body tags.
## There can be complications if you include it into a non framed site!
## To prevent this, enable '$definitions' in this settings and
## include the following into your <body> - tag:
## onLoad="getTime()"
## e.g. <body onLoad="getVWarTime()">

// path to your main vwar-directory (with final ' / ')
// -> from the site, where this extra is included!
// -> use absolute path if you have it included in files with different directories!
//          (e.g. /home/www/htdocs/mysite.com/vwar/)
// -> if included in your _header.php/_footer.php, it is normally: './'
// -> if not, use: './../'
$vwar_xroot  "/home/ligsus/public_html/vwar/";

// 0 = don't use the body-definitions / 1 = use them
$definitions 1;

// include header- & footer-information (1=enabled / 0=disabled)
$include     0;

// ######################################################################################


// ################################### display countdown  ##############################

// check, if we need to get some global vars or if we need to include them
if( !defined ("VWAR_COMMON_INCLUDED") )
{
$vwar_root $vwar_xroot;
require_once ( $vwar_root "includes/functions_common.php" );
}

if ( 
$include == )
{
include_once ( $vwar_root "_header.php" );
}

updateRepeatingDatelines("vwar".$n"warid""dateline"1$waroverlap);

$dateline = (time() - ($waroverlap 60)) + ($timezoneoffset 3600);

if (!
defined("VWAR_WARS_FROMNOW"))
{
define("VWAR_WARS_FROMNOW"1);
$result $vwardb->query_first("
SELECT COUNT(warid) AS numwars
FROM vwar"
.$n."
WHERE status = '0'
AND dateline > '
$dateline'
getPublicMatchtypes(1)
);
$num_nextwars $result['numwars'];
}

if (
$num_nextwars 0)
{
$row $vwardb->query_first("
SELECT vwar"
.$n.".warid, dateline, oppnameshort, vwar".$n.".oppid, vwar".$n.".gameid, gameicon
FROM vwar"
.$n.", vwar".$n."_opponents,vwar".$n."_games
WHERE vwar"
.$n.".oppid = vwar".$n."_opponents.oppid
AND vwar"
.$n.".gameid = vwar".$n."_games.gameid
AND status='0'
AND dateline > '
$dateline'
getPublicMatchtypes(1) . "
ORDER BY dateline ASC
LIMIT 0,1
"
);

dbSelect ($row);

if ($row['gameicon'] != "" && file_exists($vwar_root "images/gameicons/" $row['gameicon']))
{
$gameicon makeimgtag($urltovwar "images/gameicons/".$row['gameicon'], $row['gamename']);
}
else
{
$gameicon="";
}

$date date("M d Y H:i:00",$row['dateline']);

if ($definitions == 1)
{
echo '<html>
<head>'
;
}

echo '
<script language="JavaScript">
<!--
function getVWarTime() {
now          = new Date();
y2k          = new Date("' 
$date '");
days         = (y2k - now) / 1000 / 60 / 60 / 24;
daysRound    = Math.floor(days);
hours        = (y2k - now) / 1000 / 60 / 60 - (24 * daysRound);
hoursRound   = Math.floor(hours);
minutes      = (y2k - now) / 1000 /60 - (24 * 60 * daysRound) - (60 * hoursRound);
minutesRound = Math.floor(minutes);
seconds      = (y2k - now) / 1000 - (24 * 60 * 60 * daysRound) - (60 * 60 * hoursRound) - (60 * minutesRound);
secondsRound = Math.round(seconds);
sec = "s";
min = "m, ";
hr  = "h, ";
dy  = "d, ";
document.vwarcform.vwarcfield.value = daysRound  + dy + hoursRound + hr + minutesRound + min + secondsRound + sec;
newtime = window.setTimeout("getVWarTime();", 1000);
}
// -->
</script>
'
;

if ( $definitions == )
{
echo '</head>
<body onLoad="getVWarTime()">
'
;
}
?>


<form name="vwarcform">
<table border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td align="center"><b>Match Countdown</b></td>
</tr>
<tr>
<td align="center" width="100%">
<?php echo $gameicon?>&nbsp;<a href="<?php echo $urltovwar?>war.php?action=nextaction&amp;formgame=<?php echo $row['gameid']; ?>#<?php echo $row['warid']; ?>">vs. <?php echo $row['oppnameshort']; ?></a><br>
<input value="" type="text" name="vwarcfield" size="17">
</td>
</tr>
<tr>
<td align="center">until Match</td>
</tr>
</table>
</form>
<?php
if ( 
$definitions == )
{
echo '
</body>
</html>'
;
}
}
else
{
?>

<table border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td align="center"><b>Match Countdown</b></td>
</tr>
<tr>
<td align="center">No upcoming Match</td>
</tr>
</table>
<?php
}
if ( 
$include == )
{
include_once ( $vwar_root "_footer.php" );
}
?>



Happy Thanksgiving

Porky

remove this at the begining <?php and the ?> at the end not needed in a php block

samson

Thank you will give it a shot

Shadow

Hey Sam,

Just asking do you have an "test forum"?  In which world's you can do all the testing and spamming on the "test forum"

If you miss up with the code ect you don't have to worry about missed up on your forum.

It's an awesome idea to get an test forum you can do all the testing and spamming. Keep that in mind ok?

I have my main forum with an diff host.  And my test forum not with the same host.

Put the code in the block with tp....and use scriptbox.  Or i can miss with that code on my test forum and i can pm you all the info what you have to do it's up to you ok?

Jpg

#4
And you might need global commands for that code if you want it to work. :)

Also good idea Shadow Queen but he can also make a block that's only visible by admin, so no one else can see a major error on his site if he screws up with a code.

Shadow

#5
Quote from: Jpg on November 24, 2006, 05:52:11 AM
And you might need global commands for that code if you want it to work. :)

Also good idea Shadow Queen but he can also make a block that's only visible by admin, so no one else can see a major error on his site if he screws up with a code.

Thankyou!!! Please call me Shadow!!!

Vary True about that!  Well sometime's the code can go bad and can miss up the whole forum......

It's be best for him to get an test forum to be on the safe side.  Who know's if he need's to modfiy the theme or what!!

Last night i just put an code in my Main and Test forum...But i did it on the test first....I have modfiy the one file on the theme i'm using!! The code is nobody can't do an right click on the any type of pic's i have....Thank's for Rose!!!

samson

well thanks for the suggestions I actually do have another site I forgot about ::) that I will use in the future for testing. But usually if I am trying a block I just copy and paste the error then delete the block.

Shadow

Quote from: samson on November 24, 2006, 07:36:28 AM
well thanks for the suggestions I actually do have another site I forgot about ::) that I will use in the future for testing. But usually if I am trying a block I just copy and paste the error then delete the block.

It's be better leave the block and change the setting's on the block to see If you have the wrong setting's on the block don't delete the block just change the setting's...That is wasting time if you do that all the time...Try it on the test forum!!! 

JPDeni

You need to get rid of all the
<?php and ?> tags.

If the rest of the syntax is correct, the following should work:

/* #####################################################################################
*
* $Id: countdown.php,v 1.29 2004/09/09 15:52:33 rob Exp $
*
* This notice must remain untouched at all times.
*
* Modifications to the script, except the official addons or hacks,
* without the owners permission are prohibited.
* All rights reserved to their proper authors.
*
* ---------------------------------------------
* http://www.vwar.de || Copyright (C) 2001-2004
* ---------------------------------------------
*
* #####################################################################################
*/

// ####################################### CONFIGURATION  ###############################

## NOTE:
## This extra uses own header and body tags.
## There can be complications if you include it into a non framed site!
## To prevent this, enable '$definitions' in this settings and
## include the following into your <body> - tag:
## onLoad="getTime()"
## e.g. <body onLoad="getVWarTime()">

// path to your main vwar-directory (with final ' / ')
// -> from the site, where this extra is included!
// -> use absolute path if you have it included in files with different directories!
//          (e.g. /home/www/htdocs/mysite.com/vwar/)
// -> if included in your _header.php/_footer.php, it is normally: './'
// -> if not, use: './../'
$vwar_xroot  = "/home/ligsus/public_html/vwar/";

// 0 = don't use the body-definitions / 1 = use them
$definitions = 1;

// include header- & footer-information (1=enabled / 0=disabled)
$include     = 0;

// ######################################################################################


// ################################### display countdown  ##############################

// check, if we need to get some global vars or if we need to include them
if( !defined ("VWAR_COMMON_INCLUDED") )
{
$vwar_root = $vwar_xroot;
require_once ( $vwar_root . "includes/functions_common.php" );
}

if ( $include == 1 )
{
include_once ( $vwar_root . "_header.php" );
}

updateRepeatingDatelines("vwar".$n, "warid", "dateline", 1, $waroverlap);

$dateline = (time() - ($waroverlap * 60)) + ($timezoneoffset * 3600);

if (!defined("VWAR_WARS_FROMNOW"))
{
define("VWAR_WARS_FROMNOW", 1);
$result = $vwardb->query_first("
SELECT COUNT(warid) AS numwars
FROM vwar".$n."
WHERE status = '0'
AND dateline > '$dateline'
" . getPublicMatchtypes(1)
);
$num_nextwars = $result['numwars'];
}

if ($num_nextwars > 0)
{
$row = $vwardb->query_first("
SELECT vwar".$n.".warid, dateline, oppnameshort, vwar".$n.".oppid, vwar".$n.".gameid, gameicon
FROM vwar".$n.", vwar".$n."_opponents,vwar".$n."_games
WHERE vwar".$n.".oppid = vwar".$n."_opponents.oppid
AND vwar".$n.".gameid = vwar".$n."_games.gameid
AND status='0'
AND dateline > '$dateline'
" . getPublicMatchtypes(1) . "
ORDER BY dateline ASC
LIMIT 0,1
");

dbSelect ($row);

if ($row['gameicon'] != "" && file_exists($vwar_root . "images/gameicons/" . $row['gameicon']))
{
$gameicon = makeimgtag($urltovwar . "images/gameicons/".$row['gameicon'], $row['gamename']);
}
else
{
$gameicon="";
}

$date = date("M d Y H:i:00",$row['dateline']);

if ($definitions == 1)
{
echo '<html>
<head>';
}

echo '
<script language="JavaScript">
<!--
function getVWarTime() {
now          = new Date();
y2k          = new Date("' . $date . '");
days         = (y2k - now) / 1000 / 60 / 60 / 24;
daysRound    = Math.floor(days);
hours        = (y2k - now) / 1000 / 60 / 60 - (24 * daysRound);
hoursRound   = Math.floor(hours);
minutes      = (y2k - now) / 1000 /60 - (24 * 60 * daysRound) - (60 * hoursRound);
minutesRound = Math.floor(minutes);
seconds      = (y2k - now) / 1000 - (24 * 60 * 60 * daysRound) - (60 * 60 * hoursRound) - (60 * minutesRound);
secondsRound = Math.round(seconds);
sec = "s";
min = "m, ";
hr  = "h, ";
dy  = "d, ";
document.vwarcform.vwarcfield.value = daysRound  + dy + hoursRound + hr + minutesRound + min + secondsRound + sec;
newtime = window.setTimeout("getVWarTime();", 1000);
}
// -->
</script>
';

if ( $definitions == 1 )
{
echo '</head>
<body onLoad="getVWarTime()">
';
}
echo '

<form name="vwarcform">
<table border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td align="center"><b>Match Countdown</b></td>
</tr>
<tr>
<td align="center" width="100%">';
echo $gameicon; ?>&nbsp;<a href="<?php echo $urltovwar?>war.php?action=nextaction&amp;formgame=<?php echo $row['gameid']; 
echo 
'#';
 echo 
$row['warid']; 
echo 
'">vs. ';
 echo 
$row['oppnameshort']; echo '
</a><br>
<input value="" type="text" name="vwarcfield" size="17">
</td>
</tr>
<tr>
<td align="center">until Match</td>
</tr>
</table>
</form>'
;
if ( $definitions == )
{
echo '
</body>
</html>'
;
}
}
else
{
echo 
'
<table border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td align="center"><b>Match Countdown</b></td>
</tr>
<tr>
<td align="center">No upcoming Match</td>
</tr>
</table>
'
;
}
if ( 
$include == )
{
include_once ( $vwar_root "_footer.php" );
}

Shadow

#9
What code is it? I'm mean's what type?

This website is proudly hosted on Crocweb Cloud Website Hosting.