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.
Not a member yet? Click here to register.
Forgot Password?

Inserting/Clicking BBcode and smileys Don't Work

Asked Modified Viewed 3,755 times
V
Vanuch
V
Vanuch 10
I spent 90% of my money on women and drink. The rest I wasted..
  • Junior Member, joined since
  • Contributed 13 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
asked
Junior Member

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).
Edited by Rayxen on 19-10-2005 23:06,
0 replies

12 posts

R
Rayxen
R
Rayxen 10
  • Member, joined since
  • Contributed 153 posts on the community forums.
  • Started 21 threads in the forums
answered
Member

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.
0 replies
V
Vanuch
V
Vanuch 10
I spent 90% of my money on women and drink. The rest I wasted..
  • Junior Member, joined since
  • Contributed 13 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
answered
Junior Member

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).
0 replies
V
Vanuch
V
Vanuch 10
I spent 90% of my money on women and drink. The rest I wasted..
  • Junior Member, joined since
  • Contributed 13 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
answered
Junior Member

I reuploaded /includes/jscript.js and /maincore.php

No luck. Still the same deal. Help please. I need to get this fixed ASAP. :|
0 replies
R
Rayxen
R
Rayxen 10
  • Member, joined since
  • Contributed 153 posts on the community forums.
  • Started 21 threads in the forums
answered
Member

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.
0 replies
R
Rayxen
R
Rayxen 10
  • Member, joined since
  • Contributed 153 posts on the community forums.
  • Started 21 threads in the forums
answered
Member

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).
0 replies
V
Vanuch
V
Vanuch 10
I spent 90% of my money on women and drink. The rest I wasted..
  • Junior Member, joined since
  • Contributed 13 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
answered
Junior Member

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.
0 replies
R
Rayxen
R
Rayxen 10
  • Member, joined since
  • Contributed 153 posts on the community forums.
  • Started 21 threads in the forums
answered
Member

Try replacing the addText function as well. Although I don't think there's anything wrong with it.
0 replies
V
Vanuch
V
Vanuch 10
I spent 90% of my money on women and drink. The rest I wasted..
  • Junior Member, joined since
  • Contributed 13 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
answered
Junior Member

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. :|
0 replies
V
Vanuch
V
Vanuch 10
I spent 90% of my money on women and drink. The rest I wasted..
  • Junior Member, joined since
  • Contributed 13 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
answered
Junior Member

NOTE: It's working now. :)
Woult you like to keep or to delete the account you registered?
0 replies
R
Rayxen
R
Rayxen 10
  • Member, joined since
  • Contributed 153 posts on the community forums.
  • Started 21 threads in the forums
answered
Member

Glad it's working. Just leave the account, that's fine.
0 replies
— 3 months later —
S
Sirah
S
Sirah 10
  • Newbie, joined since
  • Contributed 2 posts on the community forums.
answered
Newbie

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
Edited by Sirah on 28-01-2006 16:34,
0 replies
S
Sirah
S
Sirah 10
  • Newbie, joined since
  • Contributed 2 posts on the community forums.
answered
Newbie

anyone??
0 replies

Category Forum

Bugs and Errors - 6

Labels

None yet

Statistics

  • Views 0 views
  • Posts 12 posts
  • Votes 0 votes
  • Topic users 3 members

0 participants

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet