nu kan ik ze alleen intoetsen maar hoe krijg ik zo'n keuze menu


<?php

function italic($code) {
$code = "<i>".$code."</i>";
return $code;
}

function bold($code) {
$code = "<b>".$code."</b>";
return $code;
}

function underlined($code) {
$code = "<u>".$code."</u>";
return $code;
}


function ubb($bericht)
{


$kleur1 = "#EAF0FA";
$kleur2 = "#F7F7F7";
$borderkleur = "#D3D3D3";



$bericht = htmlspecialchars("$bericht");
$bericht = stripslashes($bericht);
$bericht = nl2br("$bericht");

// Hier begint het code systeem



$bericht = str_replace("[center]", "<center>", $bericht);
$bericht = str_replace("[/center]", "</center>", $bericht);
$bericht = str_replace("", "<small>", $bericht);
$bericht = str_replace("
", "</small>", $bericht);
$bericht = str_replace("
", "<small>Quote:</small><br><table width=\"100%\" bgcolor=\"$kleur1\" style=\"BORDER-RIGHT: $borderkleur 2px solid; BORDER-TOP: $borderkleur 1px solid; BORDER-BOTTOM: $borderkleur 2px solid; BORDER-LEFT: $borderkleur 1px solid\" cellspacing=\"0\" cellpadding=\"1\"><tr><td><font color=\"#000000\">", $bericht);
$bericht = str_replace("
", "</font></td></tr></table>", $bericht);
$bericht = str_replace("[ul]", "<ul>", $bericht);
$bericht = str_replace("[/ul]", "</ul>", $bericht);
$bericht = str_replace("[li]", "<li>", $bericht);
$bericht = str_replace("[/li]", "</li>", $bericht);
//$bericht = eregi_replace("http://[^[:space:]]+","<a href=\"\\0\" target=\"_blank\">\\0</a>",$bericht);
$bericht = eregi_replace("([a-zA-Z0-9_-]+)@([a-zA-Z0-9\._-]+)(\.[a-zA-Z]+)", "<a href=\"mailto:\\1@\\2\\3\">\\1@\\2\\3</a>", $bericht);
$bericht = preg_replace('_\[i\](.*?)\[/i\]_ise', "italic(' \\1 ')", $bericht);
$bericht = preg_replace('_\[b\](.*?)\[/b\]_ise', "bold(' \\1 ')", $bericht);
$bericht = preg_replace('_\[u\](.*?)\[/u\]_ise', "underlined(' \\1 ')", $bericht);
$bericht = str_replace("","<img src=\"http://",$bericht); $bericht = str_replace("","\">",$bericht);
$bericht = eregi_replace("\[url\]www.([^\[]*)","<a href=\"http://www.\\1\"; target=_blank>\\1", $bericht);
$bericht = eregi_replace("\[url\]([^\[]*)","<a href=\"\\1\" target=_blank>\\1", $bericht);
$bericht = eregi_replace("(\[url=)([A-Za-z0-9_~&=;\?:%@#./\-]+[A-Za-z0-9/])(\])", "<a href=\"http://\\2\" target=_blank>", $bericht);
$bericht = eregi_replace("\[url](http://(.*))";, "<a href=\"\\1\" target=\"_blank\">\\1", $bericht);
$bericht = eregi_replace("(\[/url\])", "</a>", $bericht);
$bericht = str_replace("http://http://";, "http://", $bericht);

//ubb codes
$bericht = eregi_replace("\\[color=([^\\[]*)\\]([^\\[]*)\\[/color\\]","<font color=\"\\1\">\\2</font>",$bericht);
$bericht = eregi_replace("\\[size=([^\\[]*)\\]([^\\[]*)\\[/size\\]","<font size=\"\\1\">\\2</font>",$bericht);
$bericht = eregi_replace("\\[font=([^\\[]*)\\]([^\\[]*)\\[/font\\]","<font face=\"\\1\">\\2</font>",$bericht);
$bericht = eregi_replace("\\[img height=([^\\[]*)\\ width=([^\\[]*)\\]([^\\[]*)\\[/img\\]","<img src=\"\\3\" height=\"\\1\" width=\"\\2\">",$bericht);
$bericht = eregi_replace("\\[img]([^\\[]*)\\[/img\\]","<img src=\"\\1\">",$bericht);
$bericht = eregi_replace("\\[flash=([^\\[]*)\\,([^\\[]*)\\]([^\\[]*)\\[/flash\\]","<object classid=\"clsid: D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\\1 height=\\2><param name=movie value=\\3><param name=play value=true><param name=loop value=true><param name=quality value=high><embed src=\\3 width=\\1 height=\\2 play=true loop=true quality=high></embed></object>",$bericht);
$bericht = eregi_replace("\\[align=([^\\[]*)\\]([^\\[]*)\\[/align\\]","<p align=\"\\1\">\\2</p>",$bericht);
$bericht = eregi_replace("\\[shadow=([^\\[]*)\\,([^\\[]*)\\,([^\\[]*)\\]([^\\[]*)\\[/shadow\\]","<font style=\"Filter: Shadow(color=\\1, Direction=\\2); Width=\\3px;\">\\4</font>",$bericht);
$bericht = eregi_replace("\\[glow=([^\\[]*)\\,([^\\[]*)\\,([^\\[]*)\\]([^\\[]*)\\[/glow\\]","<font style=\"Filter: Glow(color=\\1, Strength=\\2); Width=\\3px;\">\\4</font>",$bericht);
$bericht = eregi_replace("\\[url\\]www.([^\\[]*)\\[/url\\]";, "<a href=\"http://www.\\1\"; target=_blank>\\1</a>",$bericht);
$bericht = eregi_replace("\\[url\\]([^\\[]*)\\[/url\\]","<a href=\"\\1\" target=_blank>\\1</a>",$bericht);
$bericht = eregi_replace("\\[url=([^\\[]*)\\]([^\\[]*)\\[/url\\]","<a href=\"\\1\" target=_blank>\\2</a>",$bericht);
$bericht = eregi_replace("(^|[>[:space:]\n])([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])([<[:space:]\n]|$)","\\1<a href=\"\\2://\\3\\4\" target=\"_blank\">\\2://\\3\\4</a>\\5",$bericht);

$bericht = str_replace("", "<b>",$bericht);
$bericht = str_replace("
","</b>",$bericht);
$bericht = str_replace("","<i>",$bericht);
$bericht = str_replace("
","</i>",$bericht);
$bericht = str_replace("","<u>",$bericht);
$bericht = str_replace("
","</u>",$bericht);

$bericht = str_replace(":)","<img src=\"smilies/smile.gif\">",$bericht);
$bericht = str_replace(":(","<img src=\"smilies/mad.gif\">",$bericht);
$bericht = str_replace(":'(","<img src=\"smilies/cry.gif\">",$bericht);
$bericht = str_replace(";)","<img src=\"smilies/knipoog.gif\">",$bericht);
$bericht = str_replace(":D","<img src=\"smilies/biggrin.gif\">",$bericht);
$bericht = str_replace(":S","<img src=\"smilies/verbaasd.gif\">",$bericht);
$bericht = str_replace(":P","<img src=\"smilies/tongue.gif\">",$bericht);
$bericht = str_replace(":nerd:","<img src=\"smilies/nerd.gif\">",$bericht);
$bericht = str_replace(":cool:","<img src=\"smilies/cool.gif\">",$bericht);
$bericht = str_replace("9:6","<img src=\"smilies/worshippy.gif\">",$bericht);
$bericht = str_replace(":evil:","<img src=\"smilies/evil.gif\">",$bericht);
$bericht = str_replace(":vinger:","<img src=\"smilies/vinger.gif\">",$bericht);
$bericht = str_replace(":lijst:","<img src=\"smilies/lijstje.gif\">",$bericht);
$bericht = str_replace(":bier:","<img src=\"smilies/bier.gif\">",$bericht);
$bericht = str_replace(":king:","<img src=\"smilies/koning.gif\">",$bericht);
$bericht = str_replace(":koffie:","<img src=\"smilies/koffie.gif\">",$bericht);
$bericht = str_replace("|:/","<img src=\"smilies/professor.gif\">",$bericht);
$bericht = str_replace(":trek:","<img src=\"smilies/naamloos.bmp\">",$bericht);
$bericht = str_replace(":gangerstar:","<img src=\"smilies/gun.gif\">",$bericht);
$bericht = str_replace(":shoot:","<img src=\"smilies/schooting.gif\">",$bericht);

return $bericht;
}



?>
<select>
<option>Keuze 1</opion>
<option>Keuze 2</opion>
<option>Keuze 3</opion>
</select>

En dan een javascript dat de boel afhandeld.
ja en waar vindt ik die
hier zal er wel eentje tussen staan. Je kan het evt. ook wel met php doen, nadeel is dan alleen dat de pagina steeds ververst moet worden bij het invoegen.

edit:
Met een beetje aanpassen kun je dit ook wel gebruiken.
ik snap er niks van !!!
ja maar hoe krijg ik het werkend ik ben niet zo goed in php
function icon(theicon){
document.text.text.value += " "+theicon;
document.text.text;
}

<select>
<option selected>Keuze:</option>
<option onClick="javascript:icon('[left] [/left]')">Links</option>
<option onClick="javascript:icon('[center] [/center]')">Midden</option>
<option onClick="javascript:icon('[right] [/right]')">Rechts</option>
<option onClick="javascript:icon('[justify] [/justify]')">Uitvullen</option>
</select>

bron
en dat moet ik dus toevoegen aan ubb.php en dan moet ie het doen :$
wie kan me dat aub ff snel in elkaar zetten ik snap er werkelijk waar niks meer van !

Reageren