PHP interesse |
|
ik zit met een klein probleempje, ik ben namelijk bezig met het proberen te maken van een eigen cmssysteem, dus met template systeem (gekozen voor templatepower)
nu heb ik dus het volgende probleem:
als ik uigelogd bent zie ik het 2e blok wel rechts, maar als ik ingelogd ben, alleen het bovenste blok,
te zien op:
http://213.239.140.31/~rob/
user: demo, pass: demo
ik heb het volgende stukje code in mijn index:
<?php
if ($db->numRows($query) >= 1)
{
while($sql = $db->dump($query))
{
$tpl->newBlock('RIGHT_BLOCKS');
if (file_exists('blocks/'.$sql['dir'].'/'.$sql['file']))
{
$tpl->assign('BLOCK_TITLE', $sql['name']);
include ('blocks/'.$sql['dir'].'/'.$sql['file']);
}
}
}
?>
<?php if ($db->numRows($query) >= 1) { while($sql = $db->dump($query)) { $tpl->newBlock('RIGHT_BLOCKS'); if (file_exists('blocks/'.$sql['dir'].'/'.$sql['file'])) { $tpl->assign('BLOCK_TITLE', $sql['name']); include ('blocks/'.$sql['dir'].'/'.$sql['file']); } } } ?>
in mijn tempalate staat de volgende code:
</td>
<td width="5%"> </td>
<td width="20%">
<!-- START BLOCK : RIGHT_BLOCKS -->
<table border="0" width="100%" cellspacing="0" cellpadding="2" style="border: 1 solid #333333">
<tr>
<td width="100%" class="BACKGROUND" style="border-bottom: 1 solid #333333"><b>{BLOCK_TITLE}</b></td>
</tr>
<tr>
<td width="100%" bgcolor="#FFFFFF">
{CONTENT}
</td>
</tr>
</table><br>
<!-- END BLOCK : RIGHT_BLOCKS -->
</td> <td width="5%"> </td> <td width="20%"> <!-- START BLOCK : RIGHT_BLOCKS --> <table border="0" width="100%" cellspacing="0" cellpadding="2" style="border: 1 solid #333333"> <tr> <td width="100%" class="BACKGROUND" style="border-bottom: 1 solid #333333"><b>{BLOCK_TITLE}</b></td> </tr> <tr> <td width="100%" bgcolor="#FFFFFF"> {CONTENT} </td> </tr> </table><br> <!-- END BLOCK : RIGHT_BLOCKS -->
en omdat het loginblock het veroorzaakt denk ik, hierbij een gedeelte van de code van mijn loginblock:
<?php
if (isset ($_SESSION['LOGINID']) && defined('USER_NAME'))
{
$content = 'Hey, <b>'.USER_NAME.'</b><br><br>';
$content .= '<a href="index.php?action=logoff">'._LOG_OFF.'</a><br>';
if ($db->isAdmin($_SESSION['LOGINID']))
{
$content .= '<a href="index.php?module=admin">'._ADMIN.'</a><br>';
}
$content .= '<br><form method="POST" action="">';
$content .= '<select size="1" name="template">';
$query = $db->query('SELECT name, dir FROM templates ORDER BY name ASC');
while($sql = $db->dump($query))
{
if ($sql['dir'] == USER_TEMPLATE)
{
$content .= '<option value="'.$sql['dir'].'" selected>'.htmlentities($sql['name']).'</option>';
}
else
{
$content .= '<option value="'.$sql['dir'].'">'.htmlentities($sql['name']).'</option>';
}
}
$content .= '</select> ';
$content .= '<input type="submit" value="'._TEMPLATE.'" name="template_post">';
$content .= '</form>';
}
else
{
$content = '<form method="POST" action="">';
if (isset ($_POST['login_post']) && $_POST['loginname'] != _LOGINNAME && $_POST['pass'] != _PASS)
{
$content .= '<input type="text" name="loginname" size="20" value="'.$_POST['loginname'].'"><br>';
$content .= '<input type="password" name="pass" size="20" value="'.$_POST['pass'].'"><br>';
}
else
{
$content .= '<input type="text" name="loginname" size="20" value="'._LOGINNAME.'" onFocus=\'this.value=""\'><br>';
$content .= '<input type="password" name="pass" size="20" value="'.PASS.'" onFocus=\'this.value=""\'><br>';
}
$content .= '<input type="submit" value="Login" name="login_post">';
$content .= '</form><br>';
$content .= '<a href="index.php?module=profile&action=register"><b>'._REGISTER.'</b></a>';
}
$tpl->assign('CONTENT', $content);
?>
<?php { $content = 'Hey, <b>'.USER_NAME.'</b><br><br>'; $content .= '<a href="index.php?action=logoff">'._LOG_OFF.'</a><br>'; if ($db->isAdmin($_SESSION['LOGINID'])) { $content .= '<a href="index.php?module=admin">'._ADMIN.'</a><br>'; } $content .= '<br><form method="POST" action="">'; $content .= '<select size="1" name="template">'; $query = $db->query('SELECT name, dir FROM templates ORDER BY name ASC'); while($sql = $db->dump($query)) { if ($sql['dir'] == USER_TEMPLATE) { $content .= '<option value="'.$sql['dir'].'" selected>'.htmlentities($sql['name']).'</option>'; } else { $content .= '<option value="'.$sql['dir'].'">'.htmlentities($sql['name']).'</option>'; } } $content .= '</select> '; $content .= '<input type="submit" value="'._TEMPLATE.'" name="template_post">'; $content .= '</form>'; } else { $content = '<form method="POST" action="">'; if (isset ($_POST['login_post']) && $_POST['loginname'] != _LOGINNAME && $_POST['pass'] != _PASS ) { $content .= '<input type="text" name="loginname" size="20" value="'.$_POST['loginname'].'"><br>'; $content .= '<input type="password" name="pass" size="20" value="'.$_POST['pass'].'"><br>'; } else { $content .= '<input type="text" name="loginname" size="20" value="'._LOGINNAME.'" onFocus=\'this.value=""\'><br>'; $content .= '<input type="password" name="pass" size="20" value="'.PASS.'" onFocus=\'this.value=""\'><br>'; } $content .= '<input type="submit" value="Login" name="login_post">'; $content .= '</form><br>'; $content .= '<a href="index.php?module=profile&action=register"><b>'._REGISTER.'</b></a>'; } $tpl->assign('CONTENT', $content); ?>
ik kan het echt niet vinden, kan iemand mij helpen, dank u
|