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)

Martin CX 07-03-2002 01:22 AM

When doing updates please remember that less is more in regards to size. It's enough that what was less than a 2K page (creating a new thread) is now more than 4K (horrific sizes, I know) - but the script runs slower the bigger it gets.

It would be very cool if your script was modular in the sense that it is easy to suss out what to delete because you don't need it, and it won't wreck the script. For example, I don't use smilies at all in my forums (my users vehemently abhors them!) so I don't need lots of extra code to do them properly - thus that is a part of the script I would delete.

Erwin 07-03-2002 01:36 AM

Thanks for the updates - works real well.

memobug 07-03-2002 01:47 AM

This is a great hack, but I'd love to see some kind of image handling, not necessarily an upload feature, which is kind of redundant, but maybe something similar to the links button that will let you insert an image already on the web.

Pops up an http://_____________ box, accepts a url and inserts it in a wyswig way.

It's the first thing I looked for when I saw your post. sniff

Oh well, this is about 100x better than the standard stoneage editor!

Regards,

Matt

WallStreat 07-03-2002 09:01 AM

Quote:

Originally posted by Velocd
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.


as per birdie 501, incorp my mod & the user table hack, nake enabling wysiwyg as the default. hence for users who dun want to use it, they need to explicity trun it off:

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

Quote:

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?
my code checks for browers that are MS IE & running under Windows OS & version is 5.5 & 6.x . I'm still researching on a way to make this evern more foolproof :)

Boofo 07-03-2002 09:46 AM

Is there any way to have it check for their browser and if it isn't IE 5.5 or 6.0, not even show the option to turn it on or off?

Birdie501 07-03-2002 10:22 AM

Quote:

Originally posted by Boofo
Is there any way to have it check for their browser and if it isn't IE 5.5 or 6.0, not even show the option to turn it on or off?
i got it, just have to write instructions!

Birdie501 07-03-2002 10:41 AM

Quote:

Originally posted by Boofo
Is there any way to have it check for their browser and if it isn't IE 5.5 or 6.0, not even show the option to turn it on or off?

Here we go:

Add a new template called wysiwyg_modifyoption:
Sorry but you have to translate back in english :)

PHP Code:

<tr>
<
td bgcolor="#1D6AA0" colspan="2"><normalfont color="#EEEEFF"><b>WYSIWYG Modul</b></normalfont></td>
</
tr>
<
tr>
    <
td bgcolor="#1C5780"><normalfont><b>M?chtest Du dasWYSIWYG Modul benutzen?</b></normalfont><br>
    <
smallfont>Wenn Du ja w?hlstkannst du den Text beim schreiben/?ndern eines Beitrages nach deinen W?nschen formatieren, ?hnlich wie in MS Word. (WYSIWYG What You See Is What You Get) <br><b><u>Achtung:</uFunktioniert nicht mit allen Internet browserIE 6empfohlen!</b>
</
smallfont></td>
    <
td bgcolor="#1C5780"><normalfont>
        <
input type="radio" name="enablewysiwyg" value="yes" $enablewysiwygcheckedja
        
<input type="radio" name="enablewysiwyg" value="no" $enablewysiwygnotcheckednein
    
</normalfont></td>
</
tr



in template modifyoptions

find:

PHP Code:

<tr>
<
td bgcolor="#1D6AA0" colspan="2"><normalfont color="#EEEEFF"><b>WYSIWYG Modul</b></normalfont></td>
</
tr>
<
tr>
    <
td bgcolor="#1C5780"><normalfont><b>M?chtest Du dasWYSIWYG Modul benutzen?</b></normalfont><br>
    <
smallfont>Wenn Du ja w?hlstkannst du den Text beim schreiben/?ndern eines Beitrages nach deinen W?nschen formatieren, ?hnlich wie in MS Word. (WYSIWYG What You See Is What You Get) <br><b><u>Achtung:</uFunktioniert nicht mit allen Internet browserIE 6empfohlen!</b>
</
smallfont></td>
    <
td bgcolor="#1C5780"><normalfont>
        <
input type="radio" name="enablewysiwyg" value="yes" $enablewysiwygcheckedja
        
<input type="radio" name="enablewysiwyg" value="no" $enablewysiwygnotcheckednein
    
</normalfont></td>
</
tr

and replace with

PHP Code:

$wysiwyg_option 



in member.php

find:

PHP Code:


if ($bbuserinfo[userid]==or $permissions['canmodifyprofile']==0) {
    
show_nopermission();
  } 

after that add:

PHP Code:


if ($enableHTMLEdit == 1) {
    if (
$bbuserinfo[enablewysiwyg]) {
     
$enablewysiwygchecked="checked";
     
$enablewysiwygnotchecked="";
  } else {
     
$enablewysiwygchecked="";
     
$enablewysiwygnotchecked="checked";
  }
    eval (
"\$wysiwyg_option .= \"".gettemplate("wysiwyg_modifyoption")."\";");
    } else {
    
$wysiwyg_option="";
  } 


Thats all.

It works for me, i just tested with Navigator 6.0 and nothing was shown! :)

Boofo 07-03-2002 11:05 AM

I hate to be a pain here, but can somebaody translate this part for me? :)

PHP Code:

<tr>
<
td bgcolor="#1D6AA0" colspan="2"><normalfont color="#EEEEFF"><b>WYSIWYG Modul</b></normalfont></td>
</
tr>
<
tr>
    <
td bgcolor="#1C5780"><normalfont><b>M?chtest Du dasWYSIWYG Modul benutzen?</b></normalfont><br>
    <
smallfont>Wenn Du ja w?hlstkannst du den Text beim schreiben/?ndern eines Beitrages nach deinen W?nschen formatieren, ?hnlich wie in MS Word. (WYSIWYG What You See Is What You Get) <br><b><u>Achtung:</uFunktioniert nicht mit allen Internet browserIE 6empfohlen!</b>
</
smallfont></td>
    <
td bgcolor="#1C5780"><normalfont>
        <
input type="radio" name="enablewysiwyg" value="yes" $enablewysiwygcheckedja
        
<input type="radio" name="enablewysiwyg" value="no" $enablewysiwygnotcheckednein
    
</normalfont></td>
</
tr


Birdie501 07-03-2002 11:47 AM

just use this part from the original instruction file :)

Boofo 07-03-2002 12:08 PM

Which section should this go under? I put it under the start modify options section.

Code:

if ($enableHTMLEdit == 1) {
    if ($bbuserinfo[enablewysiwyg]) {
    $enablewysiwygchecked="checked";
    $enablewysiwygnotchecked="";
  } else {
    $enablewysiwygchecked="";
    $enablewysiwygnotchecked="checked";
  }
    eval ("\$wysiwyg_option .= \"".gettemplate("wysiwyg_modifyoption")."\";");
    } else {
    $wysiwyg_option="";
  }

There are 4 sections in there with:

Code:

if ($bbuserinfo[userid]==0 or $permissions['canmodifyprofile']==0) {
    show_nopermission();
  }

Quote:

Originally posted by Birdie501
just use this part from the original instruction file :)

Birdie501 07-03-2002 12:20 PM

Quote:

Originally posted by Boofo
Which section should this go under? I put it under the start modify options section.

Code:

if ($enableHTMLEdit == 1) {
    if ($bbuserinfo[enablewysiwyg]) {
    $enablewysiwygchecked="checked";
    $enablewysiwygnotchecked="";
  } else {
    $enablewysiwygchecked="";
    $enablewysiwygnotchecked="checked";
  }
    eval ("\$wysiwyg_option .= \"".gettemplate("wysiwyg_modifyoption")."\";");
    } else {
    $wysiwyg_option="";
  }

There are 4 sections in there with:

Code:

if ($bbuserinfo[userid]==0 or $permissions['canmodifyprofile']==0) {
    show_nopermission();
  }



yep sorry, it is
// ############################### start modify options ###############################

Boofo 07-03-2002 12:44 PM

Afetr moving it there, it doesn't show up in the options menu now. Do I have to install the fix by Walstreet to make it work? I don't want it enabled by default. I just want it to only show in the options if you have the browser needed for it.

Birdie501 07-03-2002 12:57 PM

Yes you have to and also make the changes i mentioned above!
if you do all i did it will work, i promise! :)

Boofo 07-03-2002 01:03 PM

Ok, Birdie501, now I am completely lost. I did everything you said in Post #167. What else do i have to do to make it work. I need to do Walstreet's fix right? What else? And will it make it so it is off by default like I want it to be? It's kindof confusing. Please point me to the posts I need to do. :)

Quote:

Originally posted by Birdie501
Yes you have to and also make the changes i mentioned above!
if you do all i did it will work, i promise! :)


Birdie501 07-03-2002 01:20 PM

Hope nobody will kill me, because i wrote several pages in this thread :)

Ok you should do:

1) https://vborg.vbsupport.ru/showthrea...206#post268206
2) https://vborg.vbsupport.ru/showthrea...340#post268340
3) https://vborg.vbsupport.ru/showthrea...651#post268651

then you also should put this into your register template:
(not sure if it is ok??)
For all new members it will be off! For the old one you have to use the mysql code mentioned in this thread somewhere!

PHP Code:

<input type="hidden" name="enablewysiwyg" value="no"


ziggy 07-03-2002 03:10 PM

Hey everyone...great hack!

I was wondering what all is included in the WYSIWYG download on page 1 of this thread & what I still have to change myself?
I skipped pages 3-9 =)

I'll be adding .js & actionscript syntax highlighting as well, I also need a SWF button alongside the IMG buttton so I can post SWF's under 50k (I think this SWF butt might already exist & is just commented out in 2.2.1? (anyone confirm/deny?))

I'm updating to 2.2.6 today!

Thanx for any answers/help you can give me!...ziggy

Boofo 07-03-2002 03:35 PM

Do I need to do what is in this post to all 3 php files (newthread, newreply and editpost)?

And where is this and what is it?

Quote:

For all new members it will be off! For the old one you have to use the mysql code mentioned in this thread somewhere!
One last thing. What template do I put this in and where?

Code:

<input type="hidden" name="enablewysiwyg" value="no">

Birdie501 07-03-2002 04:04 PM

Quote:

Originally posted by Boofo
Do I need to do what is in this post to all 3 php files (newthread, newreply and editpost)?


And where is this and what is it?



Yes put it to all three files, but you have to change the template names. That should be logic.


Quote:

Originally posted by Boofo
One last thing. What template do I put this in and where?

Code:

<input type="hidden" name="enablewysiwyg" value="no">

you put this to your registration template called : registeradult and if you use the coppa form also put it in registercoppa.

Just have a look to this templates and put it right behind the other similar fields, e.g.
<input type="hidden" name="showavatars" value="yes">

and last but not least:
Quote:

For all new members it will be off! For the old one you have to use the mysql code mentioned in this thread somewhere!
in phpmyadmin run this query to set it off!
PHP Code:

alter table user
alter column enablewysiwyg set 
default '0'

:classic:

Boofo 07-03-2002 04:28 PM

Ouch! That hurt! :)

Quote:


Yes put it to all three files, but you have to change the template names. That should be logic.

I took out the code for setting the option for the editor in my registeradult template and put this code in it instead like you instructed.

Quote:


you put this to your registration template called : registeradult and if you use the coppa form also put it in registercoppa.

Just have a look to this templates and put it right behind the other similar fields, e.g.
<input type="hidden" name="showavatars" value="yes">

And done! :) Thank you very much for all of the help.

Quote:


in phpmyadmin run this query to set it off!
PHP Code:

alter table user
alter column enablewysiwyg set 
default '0'

:classic:


Birdie501 07-03-2002 06:09 PM

Quote:

Originally posted by Boofo
Ouch! That hurt! :)




heheh :)

Quote:

I took out the code for setting the option for the editor in my registeradult template and put this code in it instead like you instructed.
What do you mean with "took out"? You have to add the code not to replace!?

Quote:

And done! :) Thank you very much for all of the help.

You`re welcome!

Boofo 07-03-2002 08:12 PM

What I meant was, I took out the option to set the editor when you log on as a new user and regsiter. There is no way to check which browser they are using in the registeradult template so why have an option in there to turn something on that they will never see anyway if they don't use IE? :)

[quote] Boofo quoted:

I took out the code for setting the option for the editor in my registeradult template and put this code in it instead like you instructed.

Birdie501 quoted:

What do you mean with "took out"? You have to add the code not to replace!?
[quote]

Erwin 07-04-2002 02:01 AM

I added this in registeradult:

right after the vBcode section </tr>


Code:

<tr>
        <td bgcolor="{ secondaltcolor}"><normalfont><b>Use the WYSIWYG interface on your message input screens?</b></normalfont><br>
        <smallfont>Enabling this option allows you to quickly manipulate different aspects of your posts including color, font, and size using an Microsoft Word-like interface.
        In addition you can click on smilies to have them inserted into your posts.
        You may disable this option if it causes problems for you.</smallfont></td>
        <td bgcolor="{ secondaltcolor}"><normalfont>
                <input type="radio" name="enablewysiwyg" value="yes" checked> yes
                <input type="radio" name="enablewysiwyg" value="no"> no
        </normalfont></td>
</tr>

This way on registration the user can choose to enable or disable this.

Also, remove the space from { secondaltcolor}.

Boofo 07-04-2002 02:16 AM

Yes, but if you give them the option to turn it on or off in there and their browser won't support it, then won't that confuse them even more when it won't show up for them if they don't have the right browser? :)

Erwin 07-04-2002 03:12 AM

Well, if their browser won't support it, it won't show up. I amended the description to say "Only supported by IE 5.5 or higher".

Boofo 07-04-2002 03:58 AM

Erwin,

Ok, I went ahead and put it in the registeradult template, but I changed it to have the "no" checked by default instead of yes. Do I need to put it in the regsitercoppa, too? And do I need to still have the below code in the registeradult template if I have the code you suggested in there?

Code:

<input type="hidden" name="enablewysiwyg" value="no">
Quote:

Originally posted by Erwin
Well, if their browser won't support it, it won't show up. I amended the description to say "Only supported by IE 5.5 or higher".

Birdie501 07-04-2002 05:19 AM

Quote:

Originally posted by Boofo
[B]What I meant was, I took out the option to set the editor when you log on as a new user and regsiter. There is no way to check which browser they are using in the registeradult template so why have an option in there to turn something on that they will never see anyway if they don't use IE? :)

Well, of course it checks which browser they are using, because you have the code for that in global.php!!
But it is not shown even if they use IE because the code i mentioned turn it off by default. I use that because i have literegistration installed, where the user only have to fill in username ,email and password., nothing else.

If the user want to use it and use IE he can turn it on in his options , otherwise he won't even see this option!
:laugh:

Birdie501 07-04-2002 05:23 AM

Quote:

Originally posted by Erwin
I added this in registeradult:

right after the vBcode section </tr>


Code:

<tr>
        <td bgcolor="{ secondaltcolor}"><normalfont><b>Use the WYSIWYG interface on your message input screens?</b></normalfont><br>
        <smallfont>Enabling this option allows you to quickly manipulate different aspects of your posts including color, font, and size using an Microsoft Word-like interface.
        In addition you can click on smilies to have them inserted into your posts.
        You may disable this option if it causes problems for you.</smallfont></td>
        <td bgcolor="{ secondaltcolor}"><normalfont>
                <input type="radio" name="enablewysiwyg" value="yes" checked> yes
                <input type="radio" name="enablewysiwyg" value="no"> no
        </normalfont></td>
</tr>

This way on registration the user can choose to enable or disable this.

Also, remove the space from { secondaltcolor}.

Hi Erwin,

why don't you use my change with $wysiwyg_option ??
If you do it like you did, the option will be also seen by users that don't use IE??!!

Erwin 07-04-2002 08:22 PM

No, because I have installed Walstreat's addon too - so even if Netscape users switch it on, they won't see it as only IE 5.5 or higher users see the WYSIWYG interface.

It works fine on my site so far. :)

Boofo 07-05-2002 02:28 AM

I know that this was probably already discussed in here, but can it be made to work in private messages, too?

eiSecure 07-05-2002 02:41 AM

Yes, you just need to extend the templates to the private message templates too.

We will try to provide private message support in our next update, for those who don't want to mess with their templates.:)

Birdie501 07-05-2002 05:28 AM

Quote:

Originally posted by Erwin
No, because I have installed Walstreat's addon too - so even if Netscape users switch it on, they won't see it as only IE 5.5 or higher users see the WYSIWYG interface.

It works fine on my site so far. :)

Yes but it think it makes no sense to show netscape user something they can switch on but nothing happens!! Therefore i made the change boofo requested.

Schorsch 07-08-2002 03:48 AM

thanks Alex for this really nice modification !!! :classic:

just one thing, when I enter a new line there is so much space between line one and line 2!! can I change this ?

thanks,
Schorsch

http://www.fetter-esel.com

EDIT: I just found out that my smilies don't work with this hack ?? what's wrong ??

Boofo 07-08-2002 03:52 AM

Just hit Shift+Enter and that will give you no spaces between the lines. That's a Microsoft Word thing, I think.)

Schorsch 07-08-2002 04:01 AM

a big thanks :)

did you already read my Edit ?

thx
Schorsch

Boofo 07-08-2002 04:15 AM

I'm not sure about the smilie thing. I know they have talked about it in a few places in this thread. :)

Schorsch 07-08-2002 04:25 AM

puuuhh this thread is quite long :) but I'll try to find it...

cu
Schorsch

Boofo 07-08-2002 04:30 AM

I'd have to read through it too to find it. :)

Schorsch 07-08-2002 04:33 AM

ahh ok my fault I forgot to upload vbcode2.js to vB root directory!!

thanks for this great hack!!!!

cu
Schorsch

Schumi 07-08-2002 03:20 PM

Hi,

I installed this hack, but if I open newthread.php, I get this mistake:

http://www.burning-board.de/Fehler.JPG

Who can help me?

bye
Schumi

eiSecure 07-08-2002 03:39 PM

Quote:

Originally posted by Schumi
Hi,

I installed this hack, but if I open newthread.php, I get this mistake:

http://www.burning-board.de/Fehler.JPG

Who can help me?

bye
Schumi

If all the install directions are followed correctly, and if the vbcode2.js file is uploaded correctly, then you should not have any errors.


All times are GMT. The time now is 09:08 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.01699 seconds
  • Memory Usage 1,907KB
  • 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
  • (10)bbcode_code_printable
  • (9)bbcode_php_printable
  • (22)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