PDA

View Full Version : Quick switch Editor Interface (b/w Standard and Enhanced)


mtha
06-20-2004, 10:00 PM
Hack name: Quick switch Editor Interface
Author: HacNho
Version: 1.0.1
Description:
This hack will switch Editor Interface to Standard or Enhanced Editor (WYSIWYG) (in user profile) by one click when you are editing/posting

File to edit: 0
File to upload: 1 (changeinterface.php)
Template to edit: 4 ( editpost, newthread, newreply, pm_newpm)

Limitation:
The pm_newpm only work when sending to 1 user, or pmid exists


Screenshot: EditorInterface.gif (20.2 KB)

Installation:
changeinterface-install.txt (3.4 KB)

Step 1:
Upload changeinterface.php to your forum directory

Step2:
Edit templates editpost
...

Step 3:
Edit templates newthread
...

Step 4
Edit templates newreply
...

Step 5
Edit template pm_newpm


Step 6
Test change interface when (1) edit, (2) post new reply, (3) post new thread, (4) send new PM and reply PM


Do I miss anything?

Maybe a script to autodetect the sending process (edit or reply or newthread or PM) would be nice, so you dont have to edit individual templates ... but I dont know how yet :D, dont want to execute too many scripts either.


Update: version 1.0.1
- add switch for sending pm
- optimize the php file and templates

(upgrade instruction: redo all the steps)

https://vborg.vbsupport.ru/ (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=66352) https://vborg.vbsupport.ru/ (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=66352) https://vborg.vbsupport.ru/ (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=66352) https://vborg.vbsupport.ru/ (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=66352) https://vborg.vbsupport.ru/ (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=66352) https://vborg.vbsupport.ru/ (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=66352)

dstruct2k
06-21-2004, 05:31 AM
2 problems.

changeinterface.php is missing
instructions should be in a text file so unregistered users cannot view it
All in all, an awesome idea for a hack! :D

mtha
06-21-2004, 05:40 AM
2 problems.

changeinterface.php is missing
instructions should be in a text file so unregistered users cannot view it
All in all, an awesome idea for a hack! :D
oops sorry, forgot the file

... and the instruction file too

Boofo
06-21-2004, 05:43 AM
Please post the instructions in a text file. That way it will be easier to download and save for future use also, instead of having to come to this thread the re-install it on an upgrade. Thank you. ;)

mtha
06-21-2004, 07:14 AM
Please post the instructions in a text file. That way it will be easier to download and save for future use also, instead of having to come to this thread the re-install it on an upgrade. Thank you. ;)
rother that :D the update version was uploaded.

Dean C
06-21-2004, 08:15 AM
Thankyou for sharing your modification with the community :)

Intex
06-21-2004, 08:37 AM
Nice work mtha - I'll probably use this.

Boofo
06-21-2004, 08:47 AM
rother that :D the update version was uploaded.
Thank you. I will use this. ;)

* Boofo clicks the install button repeatedly.

Ming Keong
06-21-2004, 02:03 PM
In step 5:

Look for:

$vbphrase[reply_to_thread]

should be

Look for:

$vbphrase[post_new_private_message]

right?

Ming Keong
06-21-2004, 02:15 PM
Added a little functionality:

Replace all:
$bbuserinfo[showvbcode]</a>

with:
<if condition="$bbuserinfo[showvbcode]=='2'">WYSIWYG Editor<else />Standard Editor</if></a>

marcel-ea
06-25-2004, 09:21 PM
Install and added mod from Ming

Thx to all :)

mtha
06-26-2004, 04:25 AM
Added a little functionality:

Replace all:
$bbuserinfo[showvbcode]</a>

with:
<if condition="$bbuserinfo[showvbcode]=='2'">WYSIWYG Editor<else />Standard Editor</if></a>
just because I dont like seeing that text, that's why.


actually, you just need to use condition once:

<if condition="$bbuserinfo[showvbcode]=='2'">
(<a href="changeinterface.php?$session[sessionurl]do=newthread&eid=1&f=$foruminfo[forumid]" title="Click to change Editor Interface to Standard">WYSIWYG Editor</a>)
<else />
(<a href="changeinterface.php?$session[sessionurl]do=newthread&eid=2&f=$foruminfo[forumid]" title="Click to change Editor to WYSIWYG Interface">Standard Editor</a>)
</if>


do the same with other templates.


However, if Guest is allowed to post, you may get error if you dont have userid=0. then, adding

<if condition="$bbuserinfo[userid]!=0"> above,
and </if> bellow the code should help.

In my case, if guest, $bbuserinfo[showvbcode] = empty, there's no link :D

Merjawy
06-26-2004, 05:23 AM
Nice hack installed :).. infact I need it to help some users with bbcodes as one editor does it beter :)

thanks

Boofo
06-26-2004, 06:16 AM
just because I dont like seeing that text, that's why.


actually, you just need to use condition once:

<if condition="$bbuserinfo[showvbcode]=='2'">
(<a href="changeinterface.php?$session[sessionurl]do=newthread&eid=1&f=$foruminfo[forumid]" title="Click to change Editor Interface to Standard">WYSIWYG Editor</a>)
<else />
(<a href="changeinterface.php?$session[sessionurl]do=newthread&eid=2&f=$foruminfo[forumid]" title="Click to change Editor to WYSIWYG Interface">Standard Editor</a>)
</if>


do the same with other templates.


However, if Guest is allowed to post, you may get error if you dont have userid=0. then, adding

<if condition="$bbuserinfo[userid]!=0"> above,
and </if> bellow the code should help.

In my case, if guest, $bbuserinfo[showvbcode] = empty, there's no link :D

Can you attach the install file with your changes? ;)

Imperial Fritz
01-21-2005, 08:24 PM
Many thanks, I needed this so much...

Dennis Olson
02-15-2005, 11:19 PM
when opting for number 2 it is automatically inserting a Quote from the last post.

How to fix?

mtha
02-16-2005, 01:16 AM
when opting for number 2 it is automatically inserting a Quote from the last post.

How to fix?

open the file changeinterface.php

look for
case'newreply': $url ="newreply.php?$session[sessionurl]do=newreply&p=$p"; break;


replace by

case'newreply': $url ="newreply.php?$session[sessionurl]do=newreply&noquote=1&p=$p"; break;


Note, this will put no quote in editing, even if you had "quoted" before.

I wouldnt mind just seeing the quote, select all, and delete it. :)

Dennis Olson
02-16-2005, 01:43 AM
open the file changeinterface.php

look for
case'newreply': $url ="newreply.php?$session[sessionurl]do=newreply&p=$p"; break;


replace by

case'newreply': $url ="newreply.php?$session[sessionurl]do=newreply&noquote=1&p=$p"; break;


Note, this will put no quote in editing, even if you had "quoted" before.

I wouldnt mind just seeing the quote, select all, and delete it. :)
Ideally, the behavior of the editor switch should be:

Whatever was in the text-entry window is carried over into the new editor-window. Nothing added or removed.

mtha
02-26-2005, 09:39 PM
Ideally, the behavior of the editor switch should be:

Whatever was in the text-entry window is carried over into the new editor-window. Nothing added or removed.

you are right, but "whatever in the text-entry window" is out of my control :(
I'd love to see it implemented somehow :D

This is only quick mod and I didnt put all posibilities into account.
Adding auto quote detection option shouldnt be too hard, just need toread the noquote value from url,put into changeinterface.php, and youare done.
I might add the addition sometime later

Lionel
03-31-2005, 11:56 PM
This comes in handy. I use the advanced, but many times there is a need to clean out the extra tags from the cut n paste. That's where this option is very handy. Thanks.

Imperial Fritz
05-07-2005, 08:59 PM
Yea, for me it's probably the most useful hack I've installed so far :)