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 New thread/Reply (https://vborg.vbsupport.ru/showthread.php?t=40130)

eiSecure 06-24-2002 06:02 PM

The are seriousely waay too many changes to list.

If you want to know exactly what was modified, you can use something like Beyond Compare or Araxis Merge.

Keyser S?ze 06-24-2002 11:32 PM

where is the selcolor.htm? i can select a color without it :(

BigJohnson 06-24-2002 11:40 PM

There is way to many changes in the Templates?
I would do anything and this hack is amazing.

eiSecure 06-25-2002 12:47 AM

Quote:

Originally posted by IceMalee
where is the selcolor.htm? i can select a color without it :(
I believe it's located on the second page of this thread.:)

Superman53142 06-25-2002 12:53 AM

Quote:

Originally posted by eiSecure
The are seriousely waay too many changes to list.

If you want to know exactly what was modified, you can use something like Beyond Compare or Araxis Merge.

Yeah, this thing has been turned topsy-turvy many times.

BigJohnson 06-25-2002 01:29 AM

Beyond Compare or Araxis Merge

What are these things?

Erwin 06-25-2002 01:38 AM

Waiting for the BBCode version with anticipation... :)

eiSecure 06-25-2002 01:42 AM

Quote:

Originally posted by BigJohnson
Beyond Compare or Araxis Merge

What are these things?

Those are programs for helping you compare and modify different versions of files.

Erwin 06-25-2002 01:46 AM

Also, Firefly, if this thing works with no problems (and works without HTML), I suggest that you add this WYSIWYG feature into version 3 of vB. It really makes posting very user-friendly even for newbies.

eiSecure 06-25-2002 02:05 AM

This is already going to be in v3

Keyser S?ze 06-25-2002 02:50 AM

Quote:

Originally posted by eiSecure
This is already going to be in v3
how do u know that?

Velocd 06-25-2002 03:32 AM

I'm sure FireFly has contacted him someway about it, or maybe he suggested it to Firefly. Either way, as I've mentioned in another post, it would be most primitive not to use something like this in the new version.

Erwin 06-25-2002 03:49 AM

Quote:

Originally posted by eiSecure
This is already going to be in v3
Great to hear! I can't wait for v3 to come out...

Velocd 06-25-2002 07:12 AM

I just made a mini-addition for this hack, giving the users an option in their UserCP --> options page to choose which posting engine they would like to use (WYSIWYG or default). If anybody else is interested give a shout can I'll post it up.

;)

edit:

I just started messing with this and I must say eiSecure, its amazing!!! So so much easier ;) Thank you again for making this hack!

Velocd 06-25-2002 07:48 AM

One last little request. How about getting this to work with editpost? ;)

eiSecure 06-25-2002 11:57 AM

hehehe... Sure. The only reason I didn't make it work with editpost and the PM templates is that I knew we were going to have bugs, so it would be a real pain to have to change 5 templates every time something is messed up. We had to rewrite the templates many times. :D

As to how I knew this was going to be in vB3... Kier told me.:)

Birdie501 06-25-2002 01:42 PM

Quote:

Originally posted by Velocd
I just made a mini-addition for this hack, giving the users an option in their UserCP --> options page to choose which posting engine they would like to use (WYSIWYG or default). If anybody else is interested give a shout can I'll post it up.

;)

edit:

I just started messing with this and I must say eiSecure, its amazing!!! So so much easier ;) Thank you again for making this hack!

can you post it?
Thanks
:smoke:

eiSecure 06-25-2002 01:48 PM

Yeah, release it, so I can assimilate its technical and cultural distinctiveness into my own.;)

Paul 06-25-2002 02:54 PM

Is this hack working fully yet with font/size stuff, etc? I saw the dicussion over on vb.com but wasn't sure what the latest status is.

Paul

eiSecure 06-25-2002 03:53 PM

Everything is working, except for the HTML to BBCode conversion.

Velocd 06-25-2002 05:21 PM

as requested...

Add-On: Allow users to choose which posting engine to use via UserCp Options
A nice addition by Velocd


This will help users whose browser does not support the WYSIWYG editor, such as Mozilla 1.0 (stated by GameCrash earlier in this thread). Also, everything is about user preference so its good to give your members an option. ;)

Very easy to install, shouldn't take long at all. Although, if you currently have the WYSIWYG editor installed you will have to do a few things on your own.


--------------------------------------------------------------
Install Procedure:
--------------------------------------------------------------

1. Run the following query in PhpMyAdmin:
Code:

alter table user
add enablewysiwyg smallint(5) UNSIGNED not null default '0';

2. In member.php, find the following:
PHP Code:

    $showsignaturesnotchecked="checked";


Directly below it add:
PHP Code:

if ($bbuserinfo[enablewysiwyg]) {
     
$enablewysiwygchecked="checked";
     
$enablewysiwygnotchecked="";
  } else {
     
$enablewysiwygchecked="";
     
$enablewysiwygnotchecked="checked";
  } 

Now find:
PHP Code:

$options=iif($showsignatures=="yes",1,0); 

Below it add:
PHP Code:

$enablewysiwyg=iif($enablewysiwyg=="yes",1,0); 

Last but no least, find:
PHP Code:

$DB_site->query("UPDATE user
                     SET "
.$updatestyles."adminemail='$adminemail',enablewysiwyg='$enablewysiwyg',allowrate='$allowrate',
                        showemail='
$showemail',invisible='$invisible',cookieuser='$cookieuser',
                        maxposts='"
.addslashes($umaxposts)."',daysprune='".addslashes($prunedays)."',
                        timezoneoffset='"
.addslashes($timezoneoffset)."',emailnotification='$emailnotification',
                        startofweek='"
.addslashes($startofweek)."',options='$options',receivepm='$receivepm',
                        emailonpm='
$emailonpm',pmpopup='$pmpopup',usergroupid='$bbuserinfo[usergroupid]',
                        nosessionhash='
$nosessionhash'
                   WHERE userid='
$bbuserinfo[userid]'"); 

And see in that code on the 2nd line where I have:
PHP Code:

enablewysiwyg='$enablewysiwyg'

You wanna add that too ;)
After your finish that, save member.php


3. Open newthread.php, and find the following:
PHP Code:

eval("dooutput(\"".gettemplate("newthread")."\");"); 

Replace it with this code:
PHP 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")."\");"); } 

4. Open newreply.php, and find the following:
PHP Code:

eval("dooutput(\"".gettemplate("newreply")."\");"); 

Replace it with this code:
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")."\");"); } 

5. The same thing still needs to be done with the private.php and editpost.php, only problem is that their templates have not yet been implemented with the WYSIWYG system, so we will have to wait awhile...

6. Go into your admin/functions.php, find the following:
PHP Code:

global $vbcodemode,$vbcode_smilies

Replace it with:
PHP Code:

global $DB_site,$vbcodemode,$vbcode_smilies

Now find:
PHP Code:

eval ("\$vbcode_buttons = \"".gettemplate("vbcode_buttons")."\";"); 

Place above it on a new line the following:
PHP Code:

$vbcodetype $DB_site->query_first("SELECT enablewysiwyg FROM user WHERE userid='$bbuserinfo[userid]'");
    if(
$vbcodetype[enablewysiwyg]) { $vbcodetype "vbcode2.js"; } else { $vbcodetype "vbcode.js"; } 

7.. Now to create new templates! In your Admin Cp, create the following template with its content:

newreply_wysiwyg:
newreply.txt that was provided in the hack zip needs to be in this template.

newthread_wysiwyg:
newthread.txt that was provided in the hack zip needs to be in this template.


8. Now you need to revert the templates, or change back to what you originally had, newthread and newreply.


9. Now to modify a couple templates, and then we're finished. In vbcode_buttons find the following:
Code:

<script language="Javascript" src="vbcode.js"></script>
Replace it with:
Code:

<script language="Javascript" src="$vbcodetype"></script>

10. In the template modifyoptions, find the following:
Code:

<input type="radio" name="pmpopup" $pmpopupnotchecked value="no"> no
        </normalfont></td>
</tr>
<!-- *** -->

And just below it place:
Code:

<tr>
<td bgcolor="#1D6AA0" colspan="2"><normalfont color="#EEEEFF"><b>New Thread, Reply & Personal Messaging Engine</b></normalfont></td>
</tr>
<tr>
        <td bgcolor="#1C5780"><normalfont><b>Use the WYSIWYG enhanced HTML engine? *IS IN BETA*</b></normalfont><br>
        <smallfont>Selecting yes will enable the new WYSIWYG posting engine, which does not require the use of some VBcode tags and has a typing interface similar to that of Microsoft Word.  <br><b><u>Note:</u> May be incompatible with some internet browsers.</b><br><b><u>Note2:</u> To use such VBcodes as the [img] tag, you must first initialize <i>enhanced mode</i> on the posting screen.  Then simply type in the tags and close them as you would normally do.</b>
</smallfont></td>
        <td bgcolor="#1C5780"><normalfont>
                <input type="radio" name="enablewysiwyg" value="yes" $enablewysiwygchecked> yes
                <input type="radio" name="enablewysiwyg" value="no" $enablewysiwygnotchecked> no
        </normalfont></td>
</tr>

When the WYSIWYG is out of beta, meaning fixed of bugs, you should probably reomve the *IS IN BETA* from the chunk above.

--------------------------------------------------------------

Well thats it! If I missed anything or there are problems be sure to let me know, but I'm fairly sure I got everything down.

;)


UPDATE:

To reduce the ues of extra queries, its always good to add the custom templates to the $templatesused = "" list.

1. In newthread.php, find:
PHP Code:

$templatesused "newpost_postpreview, 

Replace it with this:
PHP Code:

$templatesused "newpost_postpreview, newthread_wysiwyg, 

2. In newreply.php, find:
PHP Code:

$templatesused "quotereply, 

Replace it with this:
PHP Code:

$templatesused "quotereply, newreply_wysiwyg, 


eiSecure 06-25-2002 05:28 PM

whoohoo! We've finished the HTML -> BBCode conversion code!:)

I will test it out to see how it works, and, if velocd lets me, I'll release everything as a complete package. (With credit given, of course.:))

:bunny:

Velocd 06-25-2002 05:34 PM

Sounds like an excellent idea ^_^

eiSecure 06-25-2002 05:47 PM

Velocd, just wondering...

...any chance you can make your addon autodetect if the user is using IE5.5 or above?

For example, if the user is using IE5.5, then WYSIWYG will automatically be default, but if the user is on Netscape/Mozilla, it will autodefault to regular mode, and not let them switch, because it won't be possible.

Paul 06-25-2002 06:33 PM

Quote:

Originally posted by eiSecure
Everything is working, except for the HTML to BBCode conversion.
Hah. That's the biggest part. Allowing HTML is like leaving your car keys in the ignition, the doors unlocked, and installing a big flashing neon sign on the roof of your car that blinks "STEAL ME" in bright pink.

;D

Velocd 06-25-2002 07:06 PM

Quote:

Originally posted by eiSecure
Velocd, just wondering...

...any chance you can make your addon autodetect if the user is using IE5.5 or above?

For example, if the user is using IE5.5, then WYSIWYG will automatically be default, but if the user is on Netscape/Mozilla, it will autodefault to regular mode, and not let them switch, because it won't be possible.

I have no idea how to do that, sorry eiSecure..:(
I'm sure it requires some javascript which I don't have much knowledge in..

eiSecure 06-25-2002 07:06 PM

It's all fixed now.

It has almost no bugs now, and the only problem is compatibility.:)

Superman53142 06-25-2002 07:08 PM

Quote:

Originally posted by LoveShack


Hah. That's the biggest part. Allowing HTML is like leaving your car keys in the ignition, the doors unlocked, and installing a big flashing neon sign on the roof of your car that blinks "STEAL ME" in bright pink.

;D

It's done. We finished this afternoon. It will be officially released tomorrow. Don't ask me why :p

Superman53142 06-25-2002 07:09 PM

Quote:

Originally posted by Velocd


I have no idea how to do that, sorry eiSecure..:(
I'm sure it requires some javascript which I don't have much knowledge in..

I'll take a look at it after I get a snack. I'm pretty sure PHP grabs all the user variables when the user requests a page. Should be in there somewhere.

Admin 06-26-2002 04:31 AM

Can I close this thread now that there's a new one?

Speak now or forever hold your peace. :)

Superman53142 06-26-2002 04:33 AM

Quote:

Originally posted by FireFly
Can I close this thread now that there's a new one?

Speak now or forever hold your peace. :)

Sounds good to me :)

Erwin 06-26-2002 10:35 AM

Maybe merge the threads. :)


All times are GMT. The time now is 12:29 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.02067 seconds
  • Memory Usage 1,860KB
  • 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
  • (5)bbcode_code_printable
  • (18)bbcode_php_printable
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (32)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