3
I think Ive found the problem.
What if i have several blocks of php scripting mixed with plain html i want to put into the website block?
This is the code:
-
$vwar_xroot= "absolute path";
$numnextactions= 3;
$showparticipants = 1;
$showirc = 1;
$include = 0;
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)
{
$result=$vwardb->query("
SELECT vwar".$n.".warid, vwar".$n.".gameid, vwar".$n.".gametypeid, vwar".$n.".matchtypeid, status, vwar".$n.".dateline,
oppnameshort, oppircnetwork, oppircchannel, playerperteam, vwar".$n.".oppid, matchtypename, gametypename,
gameicon,gamenameshort
FROM vwar".$n.", vwar".$n."_matchtype, vwar".$n."_gametype, vwar".$n."_opponents, vwar".$n."_games
WHERE vwar".$n.".oppid = vwar".$n."_opponents.oppid
AND vwar".$n.".gametypeid = vwar".$n."_gametype.gametypeid
AND vwar".$n."_matchtype.matchtypeid = vwar".$n.".matchtypeid
AND status = '0' AND vwar".$n.".dateline > '$dateline'
AND vwar".$n.".gameid = vwar".$n."_games.gameid
" . getPublicMatchtypes(1) . "
GROUP BY vwar".$n.".warid
ORDER BY dateline ASC
LIMIT 0, $numnextactions
");
while ($row = $vwardb->fetch_array($result))
{
dbSelect ($row);
if ($row['gameicon'] != "" && file_exists($vwar_root . "images/gameicons/".$row['gameicon']))
{
$gameicon = makeimgtag($urltovwar . "images/gameicons/".$row['gameicon'], $row['gamename']);
}
else
{
$gameicon = "";
}
?>
vs. |
» |
if ($showirc == 1 && !empty($row['oppircnetwork']) && !empty($row['oppircchannel']))
{
?>
» IRC: |
}
if ($showparticipants == 1)
{
$result2 = $vwardb->query_first("
SELECT COUNT(partid) AS parts
FROM vwar".$n."_participants
WHERE available = '1'
AND warid = '" . $row['warid'] . "'
");
$parts = $result2['parts'];
?>
» Participants: "> |
}
?>
» ">details
|
}
$vwardb->free_result($result);
}
else
{
?>
No Next Actions |
}
?>
if ($include == 1)
{
include_once ($vwar_root . "_footer.php");
}
?>
Anyways its funny because when i copy this text into the block source code and i choose HTML, when i preview it i can see the block working perfectly. When I sumbmit the source code to the DB i cant view the block in the main page as it should show.