Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

Inserting/Clicking BBcode and smileys Don't Work


Print Track
Sry, if this matter has been discussed somewhere. I just found this bug on my site and I have to go away from home at the moment.
So I'll make it quickly.

I updated from 6.00.106 to 6.00.110 and then to 6.00.203. I finally got the DB restored.
Now.. When making a post, you can't add BBcode by clicking on the buttons. Also the smileys. It just won't do ANYTHING. Like they weren't buttons at all. I can enter [ b][ /b], : | : D and so on manually as well, but many of the users can't. Also adding colours to the text won't work.
This problem I have in posting forms to forum. ALso in the form to post comments (that's all I've checked at the moment).

12 replies

Do you have any MOD's installed at all? Anything that uses javascript. I suggest reuploading the fusion_script.js file and also maincore.php.

Quote

Rayxen wrote:
Do you have any MOD's installed at all? Anything that uses javascript. I suggest reuploading the fusion_script.js file and also maincore.php.

Yes, I have uploads installed. But this problem occured just before I posted the problem here. And at that time I hadn't applyed any mods.
btw - there is no such file, as fusion_script.js
not in the current files, nor in the backup from the old .106 version and I couldn't find it at .203 install files either... :/

Uploading maincore.php it not such a good idea. I have mods, you know.. :P I would rather not do this, if possible (well, thanks to the documention I made, it should be easier now to enter the code changes again).
I reuploaded /includes/jscript.js and /maincore.php

No luck. Still the same deal. Help please. I need to get this fixed ASAP. :|
Sorry, it was called fusion_script.js in v5.01, it's now jscript.js (as you've found out). What is the error message you're getting? You should be getting a javascript error when you click on a smiley.
Ok, well I signed up at your site and tested it out. I know what the problem is. Either you didn't upload jscript.js like you said, or you uploaded a modified version and not the original.

This your current insertText function in jscript.js:

function insertText(formname, elname, what) {
if (document.forms[formname].elements[elname].createTextRange) {
document.forms[formname].elements[elname].focus();
document.selection.createRange().duplicate().text = what;
} else if ((typeof document.forms[formname].elements[elname].selectionStart) != 'undefined') { // for Mozilla
var tarea = document.forms[formname].elements[elname];
var selEnd = tarea.selectionEnd;
var txtLen = tarea.value.length;
var txtbefore = tarea.value.substring(0,selEnd);
var txtafter = tarea.value.substring(selEnd, txtLen);
var oldScrollTop = tarea.scrollTop;
tarea.value = txtbefore + what + txtafter;
tarea.selectionStart = txtbefore.length + what.length;
tarea.selectionEnd = txtbefore.length + what.length;
tarea.scrollTop = oldScrollTop;
tarea.focus();
} else {
document.forms[formname].elements[elname].value += what;
document.forms[formname].elements[elname].focus();
}


This is what it should be:

function insertText(elname, what) {
  if (document.forms['inputform'].elements[elname].createTextRange) {
    document.forms['inputform'].elements[elname].focus();
    document.selection.createRange().duplicate().text = what;
  } else if ((typeof document.forms['inputform'].elements[elname].selectionStart) != 'undefined') { // for Mozilla
    var tarea = document.forms['inputform'].elements[elname];
    var selEnd = tarea.selectionEnd;
    var txtLen = tarea.value.length;
    var txtbefore = tarea.value.substring(0,selEnd);
    var txtafter =  tarea.value.substring(selEnd, txtLen);
    var oldScrollTop = tarea.scrollTop;
    tarea.value = txtbefore + what + txtafter;
    tarea.selectionStart = txtbefore.length + what.length;
    tarea.selectionEnd = txtbefore.length + what.length;
    tarea.scrollTop = oldScrollTop;
    tarea.focus();
  } else {
    document.forms['inputform'].elements[elname].value += what;
    document.forms['inputform'].elements[elname].focus();
  }
}


The difference? Yours is designed to handle pages with multiple form elements that support smileys, ie. "Comments + Shoutbox", "Quick Reply + Shoutbox". In Fusion core there is never multiple forms with smileys on the same page, so that modification isn't required. For an easy fix, replace your insertText function with the one above (or jscript.js with the original, unmodified version).
Thank you very much!
Now the smileys are working. But the bbcode still isn't... i'm tired. I'll go to bed now and i'll try to look into the jscript.js file to fix this tomorrow. If you have the time, please post a similiar fix to this aswell..
It would cost me a huge amout of time, 'cause I'll probably fix this for hours, if not days.
(by bbcode still not working, I mean, that if you click on a smiley when posting a post to the forums of wdw, then it is now automatically added to the selected part of the post. like it should be. but the bbcoe ( url, img, b, i, u and so on - those functions still won't work... :| )
Thanks again for your help and myabe you can give me a hint on the bbcode aswell. good night for now.
Try replacing the addText function as well. Although I don't think there's anything wrong with it.

Quote

Rayxen wrote:
Try replacing the addText function as well. Although I don't think there's anything wrong with it.

The problem is, I don't have an original file. Well.. I don't know. I reuploaded the one I got with the .203 version php-files. And as you see, it didn't work..
But if the addText is fine, then there has to be an error somewhere in the code. :|
NOTE: It's working now. :)
Woult you like to keep or to delete the account you registered?
Glad it's working. Just leave the account, that's fine.
Glade i found this thread, I have the same problem only difference is that in my case the smileys are working but this (b, i, u, url, mail..) and Font color aren't. Any idea? my site is www.exyuweb.com
anyone??
author Vanuch
forumBugs and Errors - 6
replies13 posts
viewed2,996 times
activeLast updated on 14 years ago
You can view all discussion threads in this forum.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You cannot download attachments in this forum.