PDA

View Full Version : Problem with the creation of a hack


meteore
04-21-2003, 01:28 PM
I am doing a hack that let user add a date in a special agenda and when it that day they hear a sound when they connect to the forum.
And in the Cp they can view the list of the things they add in this agenda.
So for the moment I just did this part, but nothings is shown in the list :(

Following code contains some french but that's not code so don't pay attention to it

here is php code:

if($action=="voir") {

eval("dooutput(\"".gettemplate("afficheagenda")."\");");



$voiragendas=$DB_site->query("SELECT * FROM agenda");

while($voiragenda=$DB_site->fetch_array($voiragendas)) {
if($voiragenda[username]==$bbuserinfo[username]) {

eval("\$listerappel.= \"".gettemplate('agenda_listerappels')."\";");
$trouve="1";
}
}
if($listerappel=="")
$listerappel="Aucun Rappel";
}

the template that do the showing part:

{htmldoctype}
<html>
<head><title>$bbtitle - Panneau de contr?le utilisateur de $bbuserinfo[username]</title>
$headinclude
<script language="Javascript">
function who(threadid) { window.open("misc.php?s=$session[sessionhash]&action=whoposted&threadid="+threadid, "whoposted", "toolbar=no,scrollbars=yes,resizable=yes,width=230, height=200"); }
</script>
</head>
<body>
$header

<!-- breadcrumb -->
<table cellpadding="2" cellspacing="0" border="0" width="{contenttablewidth}" {tableinvisibleextra} align="center">
<tr>
<td><img src="{imagesfolder}/vb_bullet.gif" align="middle" alt="vBulletin">
<normalfont><b><a href="index.php?s=$session[sessionhash]">$bbtitle</a> &gt;
<a href="usercp.php">Panneau de contr?le utilisateur de $bbuserinfo[username]</a> &gt; Agenda</b></normalfont></td>
<td align="right">$forumjump</td>
</tr>
</table>
<!-- /breadcrumb -->

<br>

$cpnav

<br>

<table cellpadding="0" cellspacing="0" border="0" bgcolor="{tablebordercolor}" {tableouterextra} width="90%" align="center"><tr><td>
<table cellpadding="4" cellspacing="1" border="0" {tableinnerextra} width="100%">
<tr>
<td bgcolor="{categorybackcolor}">
<normalfont color="{categoryfontcolor}" colspan="3"><b><center>Rappel Agenda par Meteore? 2003?</center></b></normalfont>
</td>
</tr>
<tr>
<td bgcolor="{firstaltcolor}">
<normalfont>Date</normalfont>
</td>
<td bgcolor="{secondaltcolor}">
<normalfont>Description</normalfont>
</td>
<td bgcolor="{firstaltcolor}">
<normalfont>Action</normalfont>
</td>
</tr>
$listerappel
</table>
</table>
$footer

</body>
</html>

and the template for the rappel:

<tr>
<td>
$voiragenda[jour]/$voiragenda[mois]/$voiragenda[annee]
</td>
<td>
$voiragenda[description]
</td>
<td>
<a href="agenda.php?action=editer&id=$voiragenda[id]"><normalfont>Editer</normalfont></a>|<a href="agenda.php?action=supprimer&id=$voiragenda[id]"><normalfont>Supprimer</normalfont></a>
</td>
</tr>

I don't understand why nothing is shown :(

mr e
04-21-2003, 05:41 PM
im pretty sure the dooutput goes AFTER all the code

meteore
04-21-2003, 06:27 PM
I don't think because the things that are after are called via the template

meteore
04-26-2003, 09:50 AM
nobody can help me ?

Brad
04-26-2003, 11:03 AM
Use this:



if($action=="voir") {

$voiragendas=$DB_site->query("SELECT * FROM agenda");

while($voiragenda=$DB_site->fetch_array($voiragendas)) {
if($voiragenda[username]==$bbuserinfo[username]) {

eval("\$listerappel.= \"".gettemplate('agenda_listerappels')."\";");
$trouve="1";
}
}
if($listerappel=="") {
$listerappel="Aucun Rappel";
}
eval("dooutput(\"".gettemplate("afficheagenda")."\");");
}

Templates must always be evaled after the php code for them.

meteore
05-03-2003, 05:20 PM
thx so much man it works great now