vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Quick switch Editor Interface (b/w Standard and Enhanced) (https://vborg.vbsupport.ru/showthread.php?t=66352)

mtha 06-20-2004 10:00 PM

Quick switch Editor Interface (b/w Standard and Enhanced)
 
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/ https://vborg.vbsupport.ru/ https://vborg.vbsupport.ru/ https://vborg.vbsupport.ru/ https://vborg.vbsupport.ru/

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

Quote:

Originally Posted by dstruct2k
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

Quote:

Originally Posted by Boofo
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

Quote:

Originally Posted by mtha
rother that :D the update version was uploaded.

Thank you. I will use this. ;)

[high]* Boofo clicks the install button repeatedly.[/high]

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:
Code:

$bbuserinfo[showvbcode]</a>
with:
Code:

<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

Quote:

Originally Posted by Ming Keong
Added a little functionality:

Replace all:
Code:

$bbuserinfo[showvbcode]</a>
with:
Code:

<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:

HTML Code:

<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

Quote:

Originally Posted by mtha
just because I dont like seeing that text, that's why.


actually, you just need to use condition once:

HTML Code:

<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

Quote:

Originally Posted by Dennis Olson
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
PHP Code:

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


replace by

PHP Code:

        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

Quote:

Originally Posted by mtha
open the file changeinterface.php

look for
PHP Code:

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


replace by

PHP Code:

        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

Quote:

Originally Posted by Dennis Olson
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 :)


All times are GMT. The time now is 04:47 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.01289 seconds
  • Memory Usage 1,784KB
  • 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
  • (2)bbcode_html_printable
  • (4)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (21)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete