vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   WYSIWYG Post Editor v1.0 (https://vborg.vbsupport.ru/showthread.php?t=40283)

josh929 06-29-2002 08:03 AM

I'm trying to add vbcode buttons.

I removed the src=vbcode.js from the vbcode_buttons template, and added it to the non-WYSIWYG templates. Then I added the variable for $vbcode_buttons, and that worked fine.

Now, what I tried to do instead of the above was this:
Add all the code from the vbcode_buttons template EXCEPT for the src=vbcode.js thing to one of the WYSIWYG templates. It seems like this would work, since should be the same thing as above, right?

But it doesn't, and I was wondering if anyone knew why.

Any help on this would be greatly appreciated.

P.S.
The reason I wanted this to work is so that I could add only some of the vbcode buttons.

eiSecure 06-29-2002 03:04 PM

Just a note to the person who said this hack 'sucks'.

If you downloaded the lastest copy of the install file that's on the first post, you will see that it contains almost every single update that's been talked about in these 9 pages.

If you were less ignorant of topics such as PHP and JavaScript, you will see how foolish your demands were.

Not only were you rude in making those requests, you were completely selfish, thinking only about how you can sit on your couch all day and not have to do a single thing while you tell us to make all the modifications for you.

If you don't like the condition of the original hack, then shut up, leave, and don't install it.

If you have any respect at all you'll see that we are not full-time vB hackers, we have jobs to do, and we can't possibly have the time to fully support a hack like how Jelsoft supports vBulletin.

We are real people, with lives outside of a computer, which means that we do not have that much time to support our hacks. If we can't even support all of our hacks, what makes you think that we will spend countless hours of our lives trying to outhack Microsoft Internet Explorer and accomplish something that can't even be done (cursor position in iFrame) without either finding a backdoor or do what you do, and write nasty emails to Microsoft, forcing that they spend countless resources and update their free browser.

Boofo 06-30-2002 02:23 PM

The reason I asked is because I wanted to make sure I was doing it right and not going blindly into it. I'm still learning about PHP code and don't always feel comfortable messing with stuff I don't understand completely. Hopefully, I didn't mess anything up but I think I got it done.

Quote:

Originally posted by Erwin
Boofo: The tweaks are all in the thread. Just read through it - the main one is making the default font the same as your forum.

eiSecure 06-30-2002 02:52 PM

All the updates are included in the first post on this thread.

The only thing that's not included is the part for making the font the same as your forum.

Boofo 06-30-2002 03:08 PM

I did that in all three WYSIWYG files. I also changed the query in all three files (with the appropriate names in them) to what Firefly posted. Is that ok to do? :)

Quote:

Originally posted by eiSecure
All the updates are included in the first post on this thread.

The only thing that's not included is the part for making the font the same as your forum.


Superman53142 06-30-2002 03:37 PM

Quote:

Originally posted by eiSecure
and accomplish something that can't even be done (cursor position in iFrame)
Actually, I think it *might* be possible. This forum was down yesturday, but I believe the regular smilies hack used createRange() which is supported by iframes. We'll have to see.

EDIT: w00t! Excellent news. It appears that I am able to insert smilies at the cursor position in a test page I have created using an iframe editor. I pretty much had to copy the vbcode.js from the other hack and do some modifications. Cool beans. I'll get it in there in the next update.

Larz 06-30-2002 04:08 PM

I could be mistaken, but haven't you guys forgotten to put this in your install.txt:

Quote:

Copy vbcode2.js to the root of your forums dir.
It's not in there, is it? :p

Boofo 06-30-2002 04:45 PM

When you type your message and want to edit the words size or font, after you make the first word, for example, size 5, if you want to change another word to size 5 also, you have to select something else, for example size 2, before you can then select size 5 again and have it take effect. This works the same way on the font. Is there any way to have it reset to the default size and font after each change like Word does?

Also, could paragraph alignments, left, right and center, be implemented fairly easily? That would make a great addition to an already fantasic hack! :)

eiSecure 06-30-2002 06:22 PM

Paragraph alignments cannot be made, as the current BBCodes do not support them.

They will be supported in vB3, which ironically, will include this hack.

Boofo 06-30-2002 06:33 PM

I kindof figured that, but the wife wanted me to ask. You made a fan out of her on this one. :)

Can the font and size be set back to default after use, though?

Larz 06-30-2002 07:27 PM

Any way to put those back in? I tried to do as was suggested in a previous thread and received numerous jscript errors.

eiSecure 06-30-2002 07:28 PM

huh? I'm kinda confuesd about what you two are asking... :confused:

Larz 06-30-2002 07:31 PM

Sorry, here goes again:

The standard buttons from the old editor, Quote and IMG, is there an easy way of hacking those into your WYSIWYG editor? I installed the editor, and my users are split half and half between loving it, and switching it off because they're missing those two buttons.

eiSecure 06-30-2002 07:35 PM

Yes, it is possible to add thoes buttons to the toolbar. However, they will only print out the vBCode, and not show how they will look when the user submits the form.

Erwin 06-30-2002 07:38 PM

Superman - care to share your vbcode.js for the cursor position??? :)

Boofo 06-30-2002 07:47 PM

If you select a different font and/or size for one of the words in a message after you have written it and want to edit it before sending it, it will set it fine. But if you go to do another word right after that, it is still set to what it was on the last word instead of going back to the default size like when you first came into the message. Sorry if it sounds confusing but the wife did the best she could at explaining it with what she had (me). :)

Quote:

Originally posted by eiSecure
huh? I'm kinda confuesd about what you two are asking... :confused:

Superman53142 06-30-2002 08:05 PM

Quote:

Originally posted by Boofo
If you select a different font and/or size for one of the words in a message after you have written it and want to edit it before sending it, it will set it fine. But if you go to do another word right after that, it is still set to what it was on the last word instead of going back to the default size like when you first came into the message. Sorry if it sounds confusing but the wife did the best she could at explaining it with what she had (me). :)


OK, I see what you're saying. Now that I know how to do the cursor thing I should be able to get this and the depressed B/I/U buttons done.

Superman53142 06-30-2002 08:06 PM

Quote:

Originally posted by Erwin
Superman - care to share your vbcode.js for the cursor position??? :)
Not done yet. I just have a prototype finished. Basically I made a blank page with an iframe and neutered the vbcode.js so I had just the relevant functions and I was able to get it to work. I have to be at my church in about 30 minutes, but I'll see if I can't bang out some code super-fast :)

Boofo 06-30-2002 08:11 PM

If you can get that done then maybe I won't get a beatin' from the wife tonight. You just might have saved me from the horror. :)

Quote:

Originally posted by Superman53142


OK, I see what you're saying. Now that I know how to do the cursor thing I should be able to get this and the depressed B/I/U buttons done.


Superman53142 06-30-2002 08:22 PM

OK, I don't have the B/I/U thing done yet, but here is the code to put the smily at the cursor position. It may be buggy: I don't have time to thouroughly test it right now. Also the pop-up smily box won't work correctly.

First of all, you need to find the line in the ****_wysiwyg templates that says:

Code:

<iframe width=......>
Add this to the end of that line before the >:

Code:

onblur="getActiveText(this);"
Then use the updated vbcode2.js attached. Make a backup of your previous copy of vbcode2.js before uploading this one in case it doesn't work. Works fine on my forum. :)

EDIT: Oops! Forgot to give credit to the original creator of the hack to insert the smilies at the cursor! Thanks!

Erwin 07-01-2002 01:22 AM

Works beautifully!!!

You are indeed Superman of Javascript! ;)

Superman53142 07-01-2002 01:38 AM

Quote:

Originally posted by Erwin
Works beautifully!!!

You are indeed Superman of Javascript! ;)

LOL, I guess that's what happens when you are oblivious to the existance of PHP for a few years :) :p

I'm happy that it's working well for ya :)

Birdie501 07-01-2002 05:52 AM

Thanks!!!!!! You make my life easier till vb3 comes out :-)

WallStreat 07-02-2002 07:07 AM

This is a great hack & i took the liberty to amend some of the codes to suit my needs i.e. instead of allowing users to choose to use this editor (which requires amending the database), this editor will show only if user's browser is Microsoft IE version 5.5 (windows version) & above:
PHP Code:

Open global.php, and find the following:
-----
// ###################### Start sessions #######################
-----

Add above it with this code:
-----
// // HTMLEdit Hack
if (eregi("Win",$HTTP_USER_AGENT) && (eregi("MSIE 5.5",$HTTP_USER_AGENT) || eregi("MSIE 6.",$HTTP_USER_AGENT))) { // browser is Win IE 5.5 & abv
    
$enableHTMLEdit 1;
} else {
    
$enableHTMLEdit 0;
}
// // HTMLEdit Hack

3. Open newthread.php, and find the following:
-----
eval(
"dooutput(\"".gettemplate("newthread")."\");");
-----

Replace it with this code:
-----
  if(
$enableHTMLEdit == 1){ eval("dooutput(\"".gettemplate("newthread_wysiwyg")."\");");
  } else { eval(
"dooutput(\"".gettemplate("newthread")."\");"); }
-----

4. Open newreply.php, and find the following:
-----
eval(
"dooutput(\"".gettemplate("newreply")."\");");
-----

Replace it with this code:
-----
  if(
$enableHTMLEdit == 1) { eval("dooutput(\"".gettemplate("newreply_wysiwyg")."\");");
  } else { eval(
"dooutput(\"".gettemplate("newreply")."\");"); }
-----

5. Open editpost.php, and find the following:
-----
eval(
"dooutput(\"".gettemplate("editpost")."\");");
-----

Replace it with this code:
-----
  if(
$enableHTMLEdit == 1) { eval("dooutput(\"".gettemplate("editpost_wysiwyg")."\");");
  } else { eval(
"dooutput(\"".gettemplate("editpost")."\");"); }
-----
----- 


eiSecure 07-02-2002 01:05 PM

That's a very nice mod!:)

Birdie501 07-02-2002 01:27 PM

@eisecure

can you update the install file with the modification from Wallstreat ? Thanks!

@wallstreat
i wanted this and never found. I gonna include this to my index page as well. Thanks!

eiSecure 07-02-2002 03:09 PM

Well, I'm going to release the install file with full updates and everything, so people don't have to keep on updating their installations.

I'm going to put a link to this post for now, and when we have a few of the other bugs worked out, I'll release an official update to it.:)

BigJohnson 07-02-2002 03:37 PM

With the new big update eiSecure your saying your going to release. Will it have the mod that wallstreet had or is it going to have the way it was made to be with the usercp because I really like wallstreets idea with the mod.

eiSecure 07-02-2002 03:57 PM

It'll probably be Wallstreet's hack, but I'm not too sure just yet...

What are some other people's experiences with Wallstreet's mod?

Superman53142 07-02-2002 04:08 PM

Hey, Alex, I've still got a few more things coming up, so as soon as I get those done we can release a 1.1 version.

Birdie501 07-02-2002 06:08 PM

Quote:

Originally posted by eiSecure

What are some other people's experiences with Wallstreet's mod? [/B]
*updated* it works for me
i just tried to install but it doesn't seem to work for me.
I have Win Xp with IE 6.0 but the code does not recognize me as IE 5.5+ user?????



I also think it is the best to combine the mod from Wallstreat and the possibility to disable this hack. I tried this:
PHP Code:

if ( ($enableHTMLEdit == 1) AND ( ($bbuserinfo['enablewysiwyg']) ) ) {
  eval(
"dooutput(\"".gettemplate("newthread_wysiwyg")."\");");
  } else {
  eval(
"dooutput(\"".gettemplate("newthread")."\");");
  } 

and it works!


For all German speaking users i attached two german buttons for bold and italic :)

Velocd 07-02-2002 06:28 PM

Great job Wallstreet, that defiantly helps! Alot of my members still didn't really know about the WYSIWYG editor because they had to switch it on, mostly the new registered users. One small problem is this WYSIWYG still has some bugs I and my members have noticed, if a member just doesn't want to use it I don't want to force them to install some older browser, I like to give them the option of turning it off....but that requires calling some queries.

Another problem though, you said it checks if the browser is older than IE 5.5, but what about other browsers? I know alot of people use Mozilla, and as I last heard Mozilla 1.0 isn't compatible with the WYSIWYG, will it also check this and bypass it?

Larz 07-02-2002 06:32 PM

If you start a thread and forget to enter a subject, your text disappears.

With the old editor, you could click the back button and the text would still be there - not with this editor.

Could you fix that, in any way?

Birdie501 07-02-2002 06:36 PM

Quote:

Originally posted by Larz
If you start a thread and forget to enter a subject, your text disappears.

With the old editor, you could click the back button and the text would still be there - not with this editor.

Could you fix that, in any way?

I think this was also with the old editor, wasn't it?

Larz 07-02-2002 06:54 PM

Nah Birdie, the old editor checks for a subject when you press submit - and stops you if there isn't one.

Only with the new editor is text lost.

Birdie501 07-02-2002 07:50 PM

@Larz

just do this:

search the function validate(theform)

and replace it with this:
sorry you have to translate back in english :)

PHP Code:

function validate(theform) {
    
set_x();
        
switchit();
    if (
vbform.message.value=="") {
        
alert("Bitte einen Nachrichtentext eingeben.");
        return 
false; }
    if (
theform.subject.value=="") {
        
alert("Bitte einen Betreff eingeben.");
        return 
false; }
    if (
postmaxchars != 0) {
        if (
theform.message.value.length $postmaxchars) {
            
alert("Deine Nachricht ist zu lang.\n\nBitte Nachricht auf $postmaxchars Zeichen reduzieren.\nMomentan sind es "+theform.message.value.length+" Zeichen.");
            return 
false; }
        else { return 
true; }
    } else { return 
true; }



Larz 07-02-2002 07:55 PM

Did you check my nationality or smth?

Es ist doch gut das ich ein bischen Deutsch sprichts, und das ich viel verstehe. :) (and have absolutely no clue about your stupid grammar :alien: )
Translated:
PHP Code:

function validate(theform) {
    
set_x();
        
switchit();
    if (
vbform.message.value=="") {
        
alert("Please fill out the message.");
        return 
false; }
    if (
theform.subject.value=="") {
        
alert("Please specify a subject.");
        return 
false; }
    if (
postmaxchars != 0) {
        if (
theform.message.value.length $postmaxchars) {
            
alert("Your message is too long.\n\nPlease limit the text to $postmaxchars characters.\nYour text is"+theform.message.value.length+" characters long.");
            return 
false; }
        else { return 
true; }
    } else { return 
true; }


Just wanna add, it works perfectly. :)

Birdie501 07-02-2002 08:02 PM

:)
But please keep in mind not to copy this to newreply_wysiwyg template because otherwise the subject field is no longer optional.

Birdie501 07-02-2002 11:12 PM

Quote:

Originally posted by FireFly
You can just replace this:
Code:

$threadengine = $DB_site->query_first("SELECT enablewysiwyg FROM user WHERE userid='$bbuserinfo[userid]'");

  if($threadengine[enablewysiwyg]){ eval("dooutput(\"".gettemplate("newthread_wysiwyg")."\");");

  } else { eval("dooutput(\"".gettemplate("newthread")."\");"); }

With:
Code:

  if($bbuserinfo['enablewysiwyg']) {
    eval('dooutput("'.gettemplate('newthread_wysiwyg').'");');
  } else {
    eval('dooutput("'.gettemplate('newthread').'");');
  }

No query needed.

Am i right that i also don't need this query:

PHP Code:

$replyengine $DB_site->query_first("SELECT enablewysiwyg FROM user WHERE userid='$bbuserinfo[userid]'");

 if(
$replyengine[enablewysiwyg] == 1) { eval("dooutput(\"".gettemplate("newreply_wysiwyg")."\");");

  } else { eval(
"dooutput(\"".gettemplate("newreply")."\");"); } 

?????

Birdie501 07-02-2002 11:55 PM

mmmh, i still have problems with the text size! if i choose another text size it is shown as it should, but after submit the text size is always very small??


All times are GMT. The time now is 08:46 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01584 seconds
  • Memory Usage 1,876KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (5)bbcode_php_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete