Author Topic: BBcode Editor, von PM für Kommentare nutzen??  (Read 3918 times)

0 Members and 1 Guest are viewing this topic.

Offline Sir Sky-Walker

  • Full Member
  • ***
  • Posts: 107
    • View Profile
BBcode Editor, von PM für Kommentare nutzen??
« on: October 19, 2006, 12:32:27 PM »
Hallo,
ich würde gerne den BBCode von meinen Privaten Nachtichten auch für meine KOmmentare nutzen, da bei dem aktuell nciht viel funktioniert. Hab im anhang mal die beiden Codes eingefügt. Was muss ich bei dem von den PM's ändern, das ich den bei den Kommentaren einfügen kann ??



Einmal der aktuelle zum Kommentare schreiben (Smilies werde nicht angezeigt)
Code: [Select]

<br />
<script language="JavaScript" type="text/javascript">
tag_prompt = "{lang_tag_prompt}";

link_text_prompt = "{lang_link_text_prompt}";
link_url_prompt = "{lang_link_url_prompt}";
link_email_prompt = "{lang_link_email_prompt}";

list_type_prompt = "{lang_list_type_prompt}";
list_item_prompt = "{lang_list_item_prompt}";

tags = new Array();

function getarraysize(thearray) {
for (i = 0; i < thearray.length; i++) {
if ((thearray[i] == "undefined") || (thearray[i] == "") || (thearray[i] == null)) {
return i;
}
}
return thearray.length;
}

function arraypush(thearray,value) {
thearraysize = getarraysize(thearray);
thearray[thearraysize] = value;
}

function arraypop(thearray) {
thearraysize = getarraysize(thearray);
retval = thearray[thearraysize - 1];
delete thearray[thearraysize - 1];
return retval;
}

function bbcode(theform,bbcode,prompttext) {
inserttext = prompt(tag_prompt+"\n["+bbcode+"]xxx[/"+bbcode+"]",prompttext);
if ((inserttext != null) && (inserttext != "")) {
theform.comment_text.value += "["+bbcode+"]"+inserttext+"[/"+bbcode+"] ";
theform.comment_text.focus();
}
}

function namedlink(theform,thetype) {
linktext = prompt(link_text_prompt,"");
var prompttext;
if (thetype == "URL") {
prompt_text = link_url_prompt;
prompt_contents = "http://";
}
else {
prompt_text = link_email_prompt;
prompt_contents = "";
}
linkurl = prompt(prompt_text,prompt_contents);
if ((linkurl != null) && (linkurl != "")) {
if ((linktext != null) && (linktext != "")) {
theform.comment_text.value += "["+thetype+"="+linkurl+"]"+linktext+"[/"+thetype+"] ";
}
else {
theform.comment_text.value += "["+thetype+"]"+linkurl+"[/"+thetype+"] ";
}
}
theform.comment_text.focus();
}

function dolist(theform) {
listtype = prompt(list_type_prompt, "");
if ((listtype == "a") || (listtype == "1")) {
thelist = "[list="+listtype+"]\n";
listend = "[/list="+listtype+"] ";
}
else {
thelist = "[list]\n";
listend = "[/list] ";
}
listentry = "initial";
while ((listentry != "") && (listentry != null)) {
listentry = prompt(list_item_prompt, "");
if ((listentry != "") && (listentry != null)) {
thelist = thelist+"[*]"+listentry+"\n";
}
}
theform.comment_text.value += thelist+listend;
theform.comment_text.focus();
}


// Smilie Mod
function smilie(theform,smiliecode) {
theform.comment_text.value += smiliecode;
theform.comment_text.focus();
}
// End Smilie Mod

</script>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td >
<table border="0" cellspacing="1" cellpadding="3">
<tr>
<td class="head1">{lang_bbcode}</td>
</tr>
<tr>
<td class="row1">
<input type="button" value=" B " onclick="bbcode(this.form,'B','')" name="button" class="button" />
<input type="button" value=" I " onclick="bbcode(this.form,'I','')" name="button" class="button" />
<input type="button" value=" U " onclick="bbcode(this.form,'U','')" name="button" class="button" />
<input type="button" value="IMG" title="IMG" onclick="bbcode(this.form,'IMG','http://')" name="button" class="button" />
<input type="button" value="http://" title="URL" onclick="namedlink(this.form,'URL')" name="button" class="button" />
<input type="button" value="Code" title="CODE" onclick="bbcode(this.form,'code','')" name="button" class="button" />
<input type="button" value="List" title="LIST" onclick="dolist(this.form)" name="button" class="button" />
</td>
</tr>

<!-- Smilie Mod -->
<tr>
<td class="row1">
<input type="button" value=" " onClick="smilie(this.form,'  ')" name="button" class="smilie" style="background-image: url('{template_url}/smiles/big_smile.gif'); width: 18px" />
<input type="button" value=" " onClick="smilie(this.form,'  ')" name="button" class="smilie" style="background-image: url('{template_url}/smiles/happy.gif'); width: 18px" />
<input type="button" value=" " onClick="smilie(this.form,'  ')" name="button" class="smilie" style="background-image: url('{template_url}/smiles/sad.gif'); width: 18px" />
<input type="button" value=" " onClick="smilie(this.form,'  ')" name="button" class="smilie" style="background-image: url('{template_url}/smiles/surprised.gif'); width: 18px" />
<input type="button" value=" " onClick="smilie(this.form,'  ')" name="button" class="smilie" style="background-image: url('{template_url}/smiles/wink.gif'); width: 18px" />
<input type="button" value=" " onClick="smilie(this.form,'  ')" name="button" class="smilie" style="background-image: url('{template_url}/smiles/confused.gif'); width: 18px" />
<input type="button" value=" " onClick="smilie(this.form,'  ')" name="button" class="smilie" style="background-image: url('{template_url}/smiles/cool.gif'); width: 18px" />
<input type="button" value=" " onClick="smilie(this.form,'  ')" name="button" class="smilie" style="background-image: url('{template_url}/smiles/sad.gif'); width: 18px" />
<input type="button" value=" " onClick="smilie(this.form,'  ')" name="button" class="smilie" style="background-image: url('{template_url}/smiles/very_sad.gif'); width: 22px" />
<input type="button" value=" " onClick="smilie(this.form,'  ')" name="button" class="smilie" style="background-image: url('{template_url}/smiles/mad.gif'); width: 18px" />
<input type="button" value=" " onClick="smilie(this.form,'  ')" name="button" class="smilie" style="background-image: url('{template_url}/smiles/whistling.gif'); width: 18px" />
<input type="button" value=" " onClick="smilie(this.form,'  ')" name="button" class="smilie" style="background-image: url('{template_url}/smiles/applause.gif'); width: 18px" />
<input type="button" value=" " onClick="smilie(this.form,'  ')" name="button" class="smilie" style="background-image: url('{template_url}/smiles/peace.gif'); width: 22px" />
<input type="button" value=" " onClick="smilie(this.form,'  ')" name="button" class="smilie" style="background-image: url('{template_url}/smiles/nono.gif'); width: 22px" />
<input type="button" value=" " onClick="smilie(this.form,'  ')" name="button" class="smilie" style="background-image: url('{template_url}/smiles/asleep.gif'); width: 18px" />
<input type="button" value=" " onClick="smilie(this.form,'  ')" name="button" class="smilie" style="background-image: url('{template_url}/smiles/kiss.gif'); width: 18px" />
<input type="button" value=" " onClick="smilie(this.form,'  ')" name="button" class="smilie" style="background-image: url('{template_url}/smiles/in_love.gif'); width: 18px" />
<input type="button" value=" " onClick="smilie(this.form,'  ')" name="button" class="smilie" style="background-image: url('{template_url}/smiles/tongue.gif'); width: 18px" />
<input type="button" value=" " onClick="smilie(this.form,'  ')" name="button" class="smilie" style="background-image: url('{template_url}/smiles/sick.gif'); width: 18px" />
<input type="button" value=" " onClick="smilie(this.form,' ' )" name="button" class="smilie" style="background-image: url('{template_url}/smiles/liar.gif'); width: 18px" />
<input type="button" value=" " onClick="smilie(this.form,'  ')" name="button" class="smilie" style="background-image: url('{template_url}/smiles/danzing.gif'); width: 18px" />
</td>
</tr>
<!-- End Smilie Mod -->

</table>
</td>
</tr>
</table>
<br />

Und zum zweiten der, der aktuell zum PM-schreiben verwendet wird. Hier funktioniert der 1a!
Hab den einfach mal über den ersten geschrieben, dann werden jedoch die Smilies garnicht angezeigt und der Mouseover effekt ebenfalls nciht. Was muss ich ändern?
Hier der Code
Code: [Select]

<br />
<script language="JavaScript" type="text/javascript">
// Helpline messages
{bbc_help}
</script>
<script language="JavaScript" type="text/javascript" src="bbcode2.js"></script>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="head1">
<table border="0" cellspacing="1" cellpadding="3">
<tr>
<td class="head1">{lang_bbcode}</td>
</tr>
<tr>
<td class="row1">
<table border="0" cellspacing="0" cellpadding="1" width="300">
<tr>
<td onMouseOver="helpline('sm')">
{smiles_text} <a href="smiles.php" onclick="window.open('smiles.php', '_4imagessmilies', 'resizable=yes,scrollbars=yes,WIDTH=225, HEIGHT=310');return false;" target="_4imagessmilies">{lang_all}</a>
</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="1" width="305">
<tr>
<td>
<input type="button" class="bbcbutton" accesskey="b" name="addbbcode0" value="B" style="font-weight:bold; width: 30px" onClick="bbstyle(0)" onMouseOver="helpline('b')" />
</td>
<td>
<input type="button" class="bbcbutton" accesskey="i" name="addbbcode2" value="i" style="font-style:italic; width: 30px" onClick="bbstyle(2)" onMouseOver="helpline('i')" />
</td>
<td>
<input type="button" class="bbcbutton" accesskey="u" name="addbbcode4" value="u" style="text-decoration: underline; width: 30px" onClick="bbstyle(4)" onMouseOver="helpline('u')" />
</td>
<td>
<input type="button" class="bbcbutton" accesskey="" name="addbbcode6" value="S" style="text-decoration: line-through; width: 30px" onClick="bbstyle(6)" onMouseOver="helpline('st')" />
</td>
<td>
<input type="button" class="bbcbutton" accesskey="" name="addbbcode8" value="Sub" style="width: 40px" onClick="bbstyle(8)" onMouseOver="helpline('sb')" />
</td>
<td>
<input type="button" class="bbcbutton" accesskey="" name="addbbcode10" value="Sup" style="width: 40px" onClick="bbstyle(10)" onMouseOver="helpline('sp')" />
</td>
<td>
<input type="button" class="bbcbutton" accesskey="" name="addbbcode12" value="Shadow" style="width: 55px" onClick="bbstyle(12)" onMouseOver="helpline('sh')" />
</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="1" width="300">
<tr>
<td>
<input type="button" class="bbcbutton" accesskey="w" name="addbbcode27" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(27)" onMouseOver="helpline('w')" />
</td>
<td>
<input type="button" class="bbcbutton" accesskey="e" name="addbbcode29" value="Email" style="width: 50px" onClick="bbstyle(29)" onMouseOver="helpline('e')" />
</td>
<td>
<input type="button" class="bbcbutton" accesskey="q" name="addbbcode21" value="Quote" style="width: 50px" onClick="bbstyle(21)" onMouseOver="helpline('q')" />
</td>
<td>
<input type="button" class="bbcbutton" accesskey="" name="addbbcode14" value="Glow" style="width: 40px" onClick="bbstyle(14)" onMouseOver="helpline('g')" />
</td>
<td>
<input type="button" class="bbcbutton" accesskey="" name="addbbcode31" value="Flash" style="width: 50px" onClick="bbstyle(31)" onMouseOver="helpline('fl')" />
</td>
<td>
<input type="button" class="bbcbutton" accesskey="p" name="addbbcode25" value="Img" style="width: 40px" onClick="bbstyle(25)" onMouseOver="helpline('p')" />
</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td nowrap>
<select class="select" name="addbbcode34" onChange="bbfontstyle('.value + ']','');this.form.addbbcode34.selectedIndex=0;" onmouseover="helpline('s')">
<option style="color:black; background-color: #FAFAFA" value="black" >Font colour</option>
<option style="color:black; background-color: #FAFAFA" value="#444444" >Default</option>
<option style="color:darkred; background-color: #FAFAFA" value="darkred" >Dark Red</option>
<option style="color:red; background-color: #FAFAFA" value="red" >Red</option>
<option style="color:orange; background-color: #FAFAFA" value="orange" >Orange</option>
<option style="color:brown; background-color: #FAFAFA" value="brown" >Brown</option>
<option style="color:yellow; background-color: #FAFAFA" value="yellow" >Yellow</option>
<option style="color:green; background-color: #FAFAFA" value="green" >Green</option>
<option style="color:olive; background-color: #FAFAFA" value="olive" >Olive</option>
<option style="color:cyan; background-color: #FAFAFA" value="cyan" >Cyan</option>
<option style="color:blue; background-color: #FAFAFA" value="blue" >Blue</option>
<option style="color:darkblue; background-color: #FAFAFA" value="darkblue" >Dark Blue</option>
<option style="color:indigo; background-color: #FAFAFA" value="indigo" >Indigo</option>
<option style="color:violet; background-color: #FAFAFA" value="violet" >Violet</option>
<option style="color:white; background-color: #FAFAFA" value="white" >White</option>
<option style="color:black; background-color: #FAFAFA" value="black" >Black</option>
</select>
<select class="select" name="addbbcode35" onChange="bbfontstyle('.value + ']','');this.form.addbbcode35.selectedIndex=0;" onmouseover="helpline('f')">
<option value="" >Font size</option>
<option value="7" >Tiny (7px)</option>
<option value="9" >Small (9px)</option>
<option value="10" >Medium (10px)</option>
<option value="12" >Normal (12px)</option>
<option value="16" >X-Large (16px)</option>
<option value="18" >Large (18px)</option>
<option value="24" >Huge (24px)</option>
</select>
<select class="select" name="addbbcode36" onChange="bbfontstyle('.value + ']','');this.form.addbbcode36.selectedIndex=0;" onmouseover="helpline('ff')">
<option value="" >Font face</option>
<option value="Arial" >Arial</option>
<option value="Courier New" >Courier New</option>
<option value="Helvetica" >Helvetica</option>
<option value="Impact" >Impact</option>
<option value="sans-serif" >sans-serif</option>
<option value="Tahoma" >Tahoma</option>
<option value="Times New Roman" >Times New Roman</option>
<option value="Verdana" >Verdana</option>
</select>
</td>
</tr>
<tr>
<td>
 <a href="javascript:bbstyle(-1)" onMouseOver="helpline('a')">{lang_close_tags}</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="right">
<div class="gensmall">
<textarea name="helpbox" size="100" maxlength="100" class="helpline" readonly rows="1" cols="20">{bbc_help_default}</textarea></div>


</td>
</tr>
</table>