Hmmm, well it would seem that my forums and the phpbb ones are coded differntly, seeing as lack the underlying knowledge of php i'm unable to convert it... If it's not to much hassle could you tell me how to convert it to match my forums?
Here is what i found (after alot of searching) for where one would put in the code blocks
formdhtmltextarea.js.php
Code:
<script type="text/javascript">
<!--
function xoopsCodeUrl(id) {
var text = prompt("<?php echo _ENTERURL;?>", "");
var dom = xoopsGetElementById(id);
if ( text != null && text != "" ) {
var text2 = prompt("<?php echo _ENTERWEBTITLE;?>", "");
if (text2 != null) {
if (text2 == "") {
var result = "[url=" + text + "]" + text + "[/url]";
} else {
var result = "[url=" + text + "]" + text2 + "[/url]";
}
dom.focus();
dom.value += result;
}
}
}
function xoopsCodeImg(id) {
var dom = xoopsGetElementById(id);
var text = prompt("<?php echo _ENTERIMGURL;?>", "");
if ( text != null && text != "" ) {
var text2 = prompt("<?php echo _ENTERIMGPOS;?>\n<?php echo _IMGPOSRORL;?>", "");
while ( ( text2 != "" ) && ( text2 != "r" ) && ( text2 != "R" ) && ( text2 != "l" ) && ( text2 != "L" ) && ( text2 != null ) ) {
text2 = prompt("<?php echo _ERRORIMGPOS;?>\n<?php echo _IMGPOSRORL;?>","");
}
if ( text2 == "l" || text2 == "L" ) {
text2 = " align=left";
} else if ( text2 == "r" || text2 == "R" ) {
text2 = " align=right";
} else {
text2 = "";
}
var result = "[img" + text2 + "]" + text + "[/img]";
dom.focus();
dom.value += result;
}
}
function xoopsCodeEmail(id) {
var text = prompt("<?php echo _ENTEREMAIL;?>", "");
var dom = xoopsGetElementById(id);
if ( text != null && text != "" ) {
var result = "[email]" + text + "[/email]";
dom.focus();
dom.value += result;
}
}
function xoopsCodeQuote(id) {
var text = prompt("<?php echo _ENTERQUOTE;?>", "");
var dom = xoopsGetElementById(id);
if ( text != null && text != "" ) {
var result = "[quote]" + text + "[/quote]";
dom.focus();
dom.value += result;
}
}
function xoopsCodeCode(id) {
var text = prompt("<?php echo _ENTERCODE;?>", "");
var dom = xoopsGetElementById(id);
if ( text != null && text != "" ) {
var result = "[code]" + text + "[/code]";
dom.focus();
dom.value += result;
}
}
function xoopsCodeText(id) {
var textareaDom = xoopsGetElementById(id);
var textDom = xoopsGetElementById(id + "Addtext");
var fontDom = xoopsGetElementById(id + "Font");
var colorDom = xoopsGetElementById(id + "Color");
var sizeDom = xoopsGetElementById(id + "Size");
var hiddenTextDomStyle = xoopsGetElementById(id + "hiddenText").style;
var textDomValue = textDom.value;
var fontDomValue = fontDom.options[fontDom.options.selectedIndex].value;
var colorDomValue = colorDom.options[colorDom.options.selectedIndex].value;
var sizeDomValue = sizeDom.options[sizeDom.options.selectedIndex].value;
if (textDomValue == "") {
alert("<?php echo _ENTERTEXTBOX;?>");
textDom.focus();
} else {
if ( fontDomValue != "FONT") {
textDomValue = "[font=" + fontDomValue + "]" + textDomValue + "[/font]";
fontDom.options[0].selected = true;
}
if ( colorDomValue != "COLOR") {
textDomValue = "[color=" + colorDomValue + "]" + textDomValue + "[/color]";
colorDom.options[0].selected = true;
}
if ( sizeDomValue != "SIZE") {
textDomValue = "[size=" + sizeDomValue + "]" + textDomValue + "[/size]";
sizeDom.options[0].selected = true;
}
if ( xoopsGetElementById(id + "Bold").checked == true ) {
textDomValue = "[b]" + textDomValue + "[/b]";
xoopsGetElementById(id + "Bold").checked = false;
}
if ( xoopsGetElementById(id + "Italic").checked == true ) {
textDomValue = "[i]" + textDomValue + "[/i]";
xoopsGetElementById(id + "Italic").checked = false;
}
if ( xoopsGetElementById(id + "Underline").checked == true ) {
textDomValue = "[u]" + textDomValue + "[/u]";
xoopsGetElementById(id + "Underline").checked = false;
}
textareaDom.focus();
textareaDom.value += textDomValue;
textDom.value = "";
}
}
function xoopsCodeSmilie(id, smilieCode) {
var textareaDom = xoopsGetElementById(id);
textareaDom.focus();
textareaDom.value += smilieCode;
}
function xoopsValidate(subjectId, textareaId, submitId) {
var maxchars = 65535;
var subjectDom = xoopsGetElementById(subjectId);
var textareaDom = xoopsGetElementById(textareaId);
var submitDom = xoopsGetElementById(submitId);
if (textareaDom.value == "") {
alert("<?php echo _PLZCOMPLETE;?>");
textareaDom.focus();
return false;
}
if (subjectDom.value == "") {
alert("<?php echo _PLZCOMPLETE;?>");
subjectDom.focus();
return false;
}
if (maxchars != 0) {
if (textareaDom.value.length > maxchars) {
alert("<?php echo _MESSAGETOOLONG;?>\n\n<?php echo _ALLOWEDCHAR;?>" + maxchars + "\n<?php echo _CURRCHAR;?>" + textareaDom.value.length + "");
textareaDom.focus();
return false;
} else {
submitDom.disabled = true;
return true;
}
} else {
submitDom.disabled = true;
return true;
}
}
//-->
</script>
and formdhtmltextarea.php
Code:
<?php
// $Id: formdhtmltextarea.php,v 1.1 2004/07/11 10:27:19 Farsus Exp $
// -------------------------------------------------------------------------//
// RUNCMS //
// //
// reliable - Unique - Nocost & Simplicity & ease off use //
// < http://www.runcms.org > //
// -------------------------------------------------------------------------//
// Original Author: Kazumi Ono
// Author Website : http://www.mywebaddons.com/ , http://www.myweb.ne.jp
// License Type : GPL: See /manual/LICENSES/GPL.txt
// ------------------------------------------------------------------------- //
if (!defined("EXOOPS_XOOPSFORMDHTMLTEXTAREA_INCLUDED")) {
define("EXOOPS_XOOPSFORMDHTMLTEXTAREA_INCLUDED", 1);
include_once(XOOPS_ROOT_PATH."/class/xoopsform/formtextarea.php");
class XoopsFormDhtmlTextArea extends XoopsFormTextArea {
function XoopsFormDhtmlTextArea($caption, $name, $value="", $rows=10, $cols=50) {
$this->XoopsFormTextArea($caption, $name, $value, $rows, $cols);
}
//---------------------------------------------------------------------------------------//
/**
* Description
*
* @param type $var description
* @return type description
*/
function render() {
global $myts, $xoopsUser;
include_once(XOOPS_ROOT_PATH."/class/xoopsform/formdhtmltextarea.js.php");
$admin = 0;
if ($xoopsUser && $xoopsUser->isAdmin()) {
$admin = 1;
}
$ret = "[img]".XOOPS_URL."/images/editor/link.gif[/img]getName()."\");' />";
$ret .= " [img]".XOOPS_URL."/images/editor/image.gif[/img]getName()."\");' />";
if ($admin || $myts->allowLibrary == 1) {
$ret .= " [img]".XOOPS_URL."/images/editor/image-m.gif[/img]getName()."\", \"images\", 350, 450);' />";
}
$ret .= "
[img]".XOOPS_URL."/images/editor/email.gif[/img]getName()."\");' />
[img]".XOOPS_URL."/images/editor/quote.gif[/img]getName()."\");' />
[img]".XOOPS_URL."/images/editor/code.gif[/img]getName()."\");' />
";
$ret .= "<select class='select' id='".$this->getName()."Size' onchange='setVisible(\"".$this->getName()."hiddenText\");setElementSize(\"".$this->getName()."hiddenText\",this.options[this.selectedIndex].value);'></a>";
$ret .= "<option value='SIZE'>"._SIZE."</option>";
$sizearray = array("xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large");
foreach ($sizearray as $size) {
$ret .= "<option value='$size'>$size</option>";
}
$ret .= "</select> ";
$fontarray = array("Arial", "Courier", "Georgia", "Helvetica", "Impact", "Verdana");
$ret .= "<select class='select' id='".$this->getName()."Font' onchange='setVisible(\"".$this->getName()."hiddenText\");setElementFont(\"".$this->getName()."hiddenText\",this.options[this.selectedIndex].value);'>";
$ret .= "<option value='FONT'>"._FONT."</option>";
foreach ($fontarray as $font) {
$ret .= "<option value='$font'>$font</option>";
}
$ret .= "</select> ";
$ret .= "<select class='select' id='".$this->getName()."Color' onchange='setVisible(\"".$this->getName()."hiddenText\"); setElementColor(\"".$this->getName()."hiddenText\", this.options[this.selectedIndex].value);'>";
$ret .= "<option value='COLOR'>"._COLOR."</option>";
$colorarray = array("00", "33", "66", "99", "CC", "FF");
foreach ($colorarray as $color1) {
foreach ($colorarray as $color2) {
foreach ($colorarray as $color3) {
$ret .= "<option value='".$color1.$color2.$color3."' style='background-color:#".$color1.$color2.$color3.";color:#".$color1.$color2.$color3.";'>#".$color1.$color2.$color3."</option>";
}
}
}
$ret .= "
</select>
<span id='".$this->getName()."hiddenText' style='visibility: hidden;'>"._EXAMPLE."</span>
<input type='checkbox' class='checkbox' id='".$this->getName()."Bold' onclick='setVisible(\"".$this->getName()."hiddenText\");makeBold(\"".$this->getName()."hiddenText\");' />B
<input type='checkbox' class='checkbox' id='".$this->getName()."Italic' onclick='setVisible(\"".$this->getName()."hiddenText\");makeItalic(\"".$this->getName()."hiddenText\");' />I
<input type='checkbox' class='checkbox' id='".$this->getName()."Underline' onclick='setVisible(\"".$this->getName()."hiddenText\");makeUnderline(\"".$this->getName()."hiddenText\");' /><u>U</u>
<input type='text' class='text' id='".$this->getName()."Addtext' size='20' />
<input type='button' class='button' onclick='xoopsCodeText(\"".$this->getName()."\")' value='"._ADD."'>
<textarea class='textarea' id='".$this->getName()."' name='".$this->getName()."' cols='".$this->getCols()."' rows='".$this->getRows()."'".$this->getExtra().">".$this->getValue()."</textarea>
";
$ret .= $this->renderSmileys();
return $ret;
}
//---------------------------------------------------------------------------------------//
/**
* Description
*
* @param type $var description
* @return type description
*/
function renderSmileys() {
$smileyPath = "images/smilies";
$ret = "getName()."\", \" :-) \");'>[img]".XOOPS_URL."/".$smileyPath."/icon_smile.gif[/img]";
$ret .= "getName()."\", \" :-( \");'>[img]".XOOPS_URL."/".$smileyPath."/icon_frown.gif[/img]";
$ret .= "getName()."\", \" :-D \");'>[img]".XOOPS_URL."/".$smileyPath."/icon_biggrin.gif[/img]";
$ret .= "getName()."\", \" ;-) \");'>[img]".XOOPS_URL."/".$smileyPath."/icon_wink.gif[/img]";
$ret .= "getName()."\", \" :-o \");'>[img]".XOOPS_URL."/".$smileyPath."/icon_eek.gif[/img]";
$ret .= "getName()."\", \" 8-) \");'>[img]".XOOPS_URL."/".$smileyPath."/icon_cool.gif[/img]";
$ret .= "getName()."\", \" :-? \");'>[img]".XOOPS_URL."/".$smileyPath."/icon_confused.gif[/img]";
$ret .= "getName()."\", \" :-P \");'>[img]".XOOPS_URL."/".$smileyPath."/icon_razz.gif[/img]";
$ret .= "getName()."\", \" :-x \");'>[img]".XOOPS_URL."/".$smileyPath."/icon_mad.gif[/img]";
$ret .= " ["._MORE."]";
return $ret;
}
//---------------------------------------------------------------------------------------//
} // END CLASS
} // END DEFINED
?>
any help would be greatly apprcieated, thanks