gastenboek Smilies
Hier ben ik weer even,
Kan iemand mij vertellen hoe ik mijn "smilies" terug in mijn gastenboek kan laten verschijnen.
Ik heb hier namelijk mijn gastenboek laten aanpassen om berichten over verchillende pagina's te verdelen, wat me gelukt is, maar nu wil ik graag terug de smilies laten verschijnen in ons gastenboek.
Wie weet raad?
Het script zoals het eerst was:
<table border="0" width="100%">
<tr>
<td height="10" valign="top"bgcolor="#E0DFE3" class="style1"><strong>Gastenboek</strong>
<tr>
<td width="65%" valign="top"><p><font face="Arial" size="2"></font><br>
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?
$amount=300;
if ($_GET['action']=='write') {
$file=fopen('gastenboek.txt','a');
$message=str_replace("\r",'',$message);
$message=str_replace("\n",'{{',$_GET['message']);
fwrite($file,$_GET['name'].'|||'.$_GET['email'].'|||'.date('d-m-Y H:i').'|||'.$_GET['url'].'|||'.$message."\n");
fclose($file);
header('location: index.php?page=gastenboek');
}
$start=(isset($_GET['start'])?$_GET['start']:0);
$gastenboek=Array();
$gastenboek=file('gastenboek.txt');
?>
$amount=300;
if ($_GET['action']=='write') {
$file=fopen('gastenboek.txt','a');
$message=str_replace("\r",'',$message);
$message=str_replace("\n",'{{',$_GET['message']);
fwrite($file,$_GET['name'].'|||'.$_GET['email'].'|||'.date('d-m-Y H:i').'|||'.$_GET['url'].'|||'.$message."\n");
fclose($file);
header('location: index.php?page=gastenboek');
}
$start=(isset($_GET['start'])?$_GET['start']:0);
$gastenboek=Array();
$gastenboek=file('gastenboek.txt');
?>
</p>
<p><font face="Arial" size="2" color="#21536A"><a href="index.php?page=schrijf">Berichtje schrijven</a></font></p>
<hr size="1" color="#21536A">
<TABLE width="100%" cellspacing="0" cellpadding="0">
<TR>
<TD class="conttd"><font color="#21536A" size="2" face="Arial"> Totaal aantal berichtjes . </font>
<HR color="#21536A">
<TABLE width="100%">
<td><font color="#0088FF" size="2" face="Arial">
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?
$gastenboek=array_reverse($gastenboek);
for ($i=$start;$i<$start+$amount && $i<sizeof($gastenboek);$i++) {
list($name,$email,$date,$url,$message)=explode('|||',$gastenboek[$i]);
$message=str_replace('{{',"\n",$message);
$message=str_replace(':)',"<img src=smilies/smile.gif>",$message);
$message=str_replace(':|',"<img src=smilies/blink.gif>",$message);
$message=str_replace('8)',"<img src=smilies/cool.gif>",$message);
$message=str_replace(':?',"<img src=smilies/dry.gif>",$message);
$message=str_replace(':/',"<img src=smilies/happy.gif>",$message);
$message=str_replace('8|',"<img src=smilies/huh.gif>",$message);
$message=str_replace(':@',"<img src=smilies/mad.gif>",$message);
$message=str_replace(':o',"<img src=smilies/ohmy.gif>",$message);
$message=str_replace('|:-|',"<img src=smilies/ph34r.gif>",$message);
$message=str_replace('*-)',"<img src=smilies/rolleyes.gif>",$message);
$message=str_replace(':(',"<img src=smilies/sad.gif>",$message);
$message=str_replace('|-)',"<img src=smilies/sleep.gif>",$message);
$message=str_replace(':P',"<img src=smilies/tongue.gif>",$message);
$message=str_replace('8-)',"<img src=smilies/unsure.gif>",$message);
$message=str_replace(';)',"<img src=smilies/wink.gif>",$message);
$message=str_replace(':D',"<img src=smilies/biggrin.gif>",$message);
echo '<TR></font></font><TD><B><u><font color="#21536A" size="2" face="Arial">'.($email!=""?'</font><A href="mailto:'.$email.'"><font color="#21536A" size="2" face="Arial">'.$name.'</font></A><font color="#9D182D" size="2" face="Arial">':$name).'</font></u></B></TD><TD align="right"><B><font face="Arial" size="2" color="#21536A">'.$date.'</font></B></TD><font face="Arial" size="2" color="#FF0000">'."\n";
echo ($url!=""?'</font><TR><TD colspan="2"><font color="#9D182D"><font size="2" face="Arial">[
</font><A href="'.$url.'" target="_blank"><font color="#9D182D" size="2" face="Arial">'
.$url.'</font></A><font color="#9D182D" size="2" face="Arial"> ]</font></font></TD></TR><font size="2" face="Arial" color="#9D182D">':'')."\n";
echo '</font><TR><TD colspan="2"><SPAN class="SUR"><font color="#21536A" size="2" face="Arial">'.str_replace("\n",'<BR>',$message)
.'</font></SPAN></TD></TR><font size="2" face="Arial" color="#21536A">'."\n";
echo '</font><TR><TD colspan="2"><HR color="#21536A"></TD></TR><font size="2" face="Arial" color="#21536A">'."\n";
}
?>
$gastenboek=array_reverse($gastenboek);
for ($i=$start;$i<$start+$amount && $i<sizeof($gastenboek);$i++) {
list($name,$email,$date,$url,$message)=explode('|||',$gastenboek[$i]);
$message=str_replace('{{',"\n",$message);
$message=str_replace(':)',"<img src=smilies/smile.gif>",$message);
$message=str_replace(':|',"<img src=smilies/blink.gif>",$message);
$message=str_replace('8)',"<img src=smilies/cool.gif>",$message);
$message=str_replace(':?',"<img src=smilies/dry.gif>",$message);
$message=str_replace(':/',"<img src=smilies/happy.gif>",$message);
$message=str_replace('8|',"<img src=smilies/huh.gif>",$message);
$message=str_replace(':@',"<img src=smilies/mad.gif>",$message);
$message=str_replace(':o',"<img src=smilies/ohmy.gif>",$message);
$message=str_replace('|:-|',"<img src=smilies/ph34r.gif>",$message);
$message=str_replace('*-)',"<img src=smilies/rolleyes.gif>",$message);
$message=str_replace(':(',"<img src=smilies/sad.gif>",$message);
$message=str_replace('|-)',"<img src=smilies/sleep.gif>",$message);
$message=str_replace(':P',"<img src=smilies/tongue.gif>",$message);
$message=str_replace('8-)',"<img src=smilies/unsure.gif>",$message);
$message=str_replace(';)',"<img src=smilies/wink.gif>",$message);
$message=str_replace(':D',"<img src=smilies/biggrin.gif>",$message);
echo '<TR></font></font><TD><B><u><font color="#21536A" size="2" face="Arial">'.($email!=""?'</font><A href="mailto:'.$email.'"><font color="#21536A" size="2" face="Arial">'.$name.'</font></A><font color="#9D182D" size="2" face="Arial">':$name).'</font></u></B></TD><TD align="right"><B><font face="Arial" size="2" color="#21536A">'.$date.'</font></B></TD><font face="Arial" size="2" color="#FF0000">'."\n";
echo ($url!=""?'</font><TR><TD colspan="2"><font color="#9D182D"><font size="2" face="Arial">[
</font><A href="'.$url.'" target="_blank"><font color="#9D182D" size="2" face="Arial">'
.$url.'</font></A><font color="#9D182D" size="2" face="Arial"> ]</font></font></TD></TR><font size="2" face="Arial" color="#9D182D">':'')."\n";
echo '</font><TR><TD colspan="2"><SPAN class="SUR"><font color="#21536A" size="2" face="Arial">'.str_replace("\n",'<BR>',$message)
.'</font></SPAN></TD></TR><font size="2" face="Arial" color="#21536A">'."\n";
echo '</font><TR><TD colspan="2"><HR color="#21536A"></TD></TR><font size="2" face="Arial" color="#21536A">'."\n";
}
?>
</font>
</TABLE>
<CENTER>
<font size="2" face="Arial">
Code (php)
</font>
</CENTER></TD>
</TR>
</TABLE>
<font face="Arial" size="2" color="#21536A"><a href="index.php?page=schrijf">Berichtje schrijven</a></font>
</table>
<hr size="1" color="#21536A">
<table width="100%" border="0" cellpadding="0">
<tr>
<td bgcolor="#E0DFE3">
Code (php)
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
</td>
</tr>
</table>
Het script zoals het nu is :
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?
$amount=15;
if ($_GET['action']=='write') {
$file=fopen('gastenboek.txt','a');
$message=str_replace("\r",'',$message);
$message=str_replace("\n",'{{',$_GET['message']);
fwrite($file,$_GET['name'].'|||'.$_GET['email'].'|||'.date('d-m-Y').'|||'.$_GET['url'].'|||'.$message."\n");
fclose($file);
header('location: index.php?page=gastenboek& action=read&start=0');
}
$start=(isset($_GET['start'])?$_GET['start']:0);
$gastenboek=Array();
$gastenboek=file('gastenboek.txt');
?>
$amount=15;
if ($_GET['action']=='write') {
$file=fopen('gastenboek.txt','a');
$message=str_replace("\r",'',$message);
$message=str_replace("\n",'{{',$_GET['message']);
fwrite($file,$_GET['name'].'|||'.$_GET['email'].'|||'.date('d-m-Y').'|||'.$_GET['url'].'|||'.$message."\n");
fclose($file);
header('location: index.php?page=gastenboek& action=read&start=0');
}
$start=(isset($_GET['start'])?$_GET['start']:0);
$gastenboek=Array();
$gastenboek=file('gastenboek.txt');
?>
<HTML>
<HEAD>
<TITLE>Gastenboek</TITLE>
<!--
Gebruik de volgende script tag als je het SUR-script van CoR.nl wilt gebruiken
<SCRIPT language="JavaScript" src="sur.js" type="text/javascript"></SCRIPT>
Verwijder dan ook de twee slashes (//) in de onLoad van de BODY-tag
-->
<SCRIPT language="JavaScript">
function validate(form) {
if (form.name.value=="") {
alert("Vul je naam in");
return false;
} else if (form.message.value=="") {
alert("Vul je bericht in");
return false;
}
}
</SCRIPT>
<style type="text/css">
<!--
.style1 {font-style: italic}
-->
</style>
</HEAD>
<BODY onLoad="//SUR()">
<P><TABLE width="100%" cellspacing="0" cellpadding="0">
<tr>
<td height="10" valign="top"bgcolor="#E0DFE3" class="style1"><strong>Gastenboek</strong>
<TR><TD class="tittd"><p><span class="conttd"><br>
<em>Berichten tot en met . </em></span><a href="../index.php?page=schrijf">
<br>
</a><em>Bekijk eerdere berichtjes</em><a href="../index.php?page=schrijf">
Code (php)
</a> <a href="../index.php?page=schrijf"><br>
<br>
Bericht schrijven</a>
<br>
</p>
<HR color="#21536A"></TD>
</TR>
</TABLE>
<TABLE width="100%" cellspacing="0" cellpadding="0">
<TR>
<TD class="conttd">
<TABLE width="100%">
Code (php)
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
<?
$gastenboek=array_reverse($gastenboek);
for ($i=$start;$i<$start+$amount && $i<sizeof($gastenboek);$i++) {
list($name,$email,$date,$url,$message)=explode('|||',$gastenboek[$i]);
$message=str_replace('{{',"\n",$message);
echo '<TR><TD><B>'.($email!=""?'<A href="mailto:'.$email.'">'.$name.'</A>':$name).'</B></TD><TD align="right"><B>'.$date.'</B></TD></TR>'."\n";
echo ($url!=""?'<TR><TD colspan="2"><A href="'.$url.'" target="_blank">'.$url.'</A></TD></TR>':'')."\n";
echo '<TR><TD colspan="2"><SPAN class="SUR">'.str_replace("\n",'<BR>',htmlspecialchars($message)).'</SPAN></TD></TR>'."\n";
echo '<TR><TD colspan="2"><HR></TD></TR>'."\n";
}
?>
$gastenboek=array_reverse($gastenboek);
for ($i=$start;$i<$start+$amount && $i<sizeof($gastenboek);$i++) {
list($name,$email,$date,$url,$message)=explode('|||',$gastenboek[$i]);
$message=str_replace('{{',"\n",$message);
echo '<TR><TD><B>'.($email!=""?'<A href="mailto:'.$email.'">'.$name.'</A>':$name).'</B></TD><TD align="right"><B>'.$date.'</B></TD></TR>'."\n";
echo ($url!=""?'<TR><TD colspan="2"><A href="'.$url.'" target="_blank">'.$url.'</A></TD></TR>':'')."\n";
echo '<TR><TD colspan="2"><SPAN class="SUR">'.str_replace("\n",'<BR>',htmlspecialchars($message)).'</SPAN></TD></TR>'."\n";
echo '<TR><TD colspan="2"><HR></TD></TR>'."\n";
}
?>
</TABLE>
<CENTER>
<em> Bekijk eerdere berichtjes</em>
<br>
Code (php)
<br>
<br>
<HR color="#21536A">
</CENTER>
</TD></TR>
</TABLE>
<left>
<table width="100%" border="0" cellpadding="0">
<tr>
<td bgcolor="#E0DFE3">
Code (php)
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
</td>
</tr>
</table>
Er zijn nog geen reacties op dit bericht.