Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Adding EditArea for Template & Plugin Editing Details »
Adding EditArea for Template & Plugin Editing
Mod Version: 0.1, by sweede (Member) sweede is offline
Developer Last Online: Jun 2014 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.7.0 Beta 2 Rating: (3 votes - 5.00 average) Installs: 23
Released: 19 Dec 2007 Last Update: Never Downloads: 5
Not Supported Code Changes Additional Files  

This isnt a Plugin or Mod, but a collection of code changes to allow the use of Edit Area to edit vbulletin templates and in the plugin code editor areas.

http://cdolivet.net/editarea/

Edit area
Here is EditArea, a free javascript editor for source code. (That is no way a WYSIWYG editor).
This editor is designed to edit souce code files in a textarea. The main goal is to allow text formatting, search and replace and real-time syntax highlight (for small text).
Download the zip file from the website above and unpack the zip file. Upload the edit_area folder into your /clientscript/ directory in your vbb installation. (See additional instructions at the bottom). You should now have a /clientscript/edit_area folder with files such as edit_area.css , edit_area.js and so on in it. Be sure that you also uploaded the images, langs, plugs and reg_syntax folders.


This requires changes to two files, one of them being optional.

The first file to edit is the includes/adminfunctions.php file
Using the UNMODIFIED 3.7.0 beta 2 version (Unsure of actual locations of the code in 3.6.8 and ealier versions, but the edits are basicly the same)

The first edit is adding the javascript to the page.
Open up the file includes/adminfunctions.php and look for the first

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

It should be around line 295.

Before that line, add

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

*Read http://cdolivet.net/editarea/editarea/docs/include.html for advanced options.

Now, we will look for the function print_textarea_row which starts around line 894

This is where the majority of the code changes are.

Comment out line 915 (add // infront of the line)

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

And then add the following code after the line you just commented out.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Please read up on http://cdolivet.net/editarea/editare...iguration.html to adjust some of the settings to your new editor interface

The last change in this file is a few lines down from the code you just pasted. Should be line 943.

Add

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

to the begining of the following line

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

It should look like

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Save and close this file!

Right now, the template editor usable and with a full screen option built into it, you shouldnt need a reason to use the Large Edit Box option. However, those changes are also quite easy to do so i will add those.

Open up the file admincp/textarea.php

On line 48,

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Change too

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Before the closing </head> tag, add

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

*Read http://cdolivet.net/editarea/editarea/docs/include.html for advanced options.

Replace the existing <body> tag (the entire line) with the following

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

And you're done.


Some screenshots of the result..

**Note:
For whatever reason, you cannot save text from the Large Edit Box into the main window IF you have the Edit Area editor enabled! you MUST uncheck the Toggle Editor checkbox before clicking the Large Edit Box button. If you fail to do that, you may or may not save your changes and you may loose the textarea data all together.

For whatever reasons, while

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

works, the reverse

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

does not, if anyone knows the secret to getting this to work, please post here!

---------------------------------------
**Addition
In the adminfunctions.php file, the line that we added that says

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

change to

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Before the line that reads

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

add


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Anything in the template editor will default to HTML syntax, anything in the plugin section will default to PHP syntax and anywhere else, HTML syntax.

you can also add other lines here that could disable the javascript editor from showing, one example is adding

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

before the default: line and this would disable the EditArea box. An alternative to searching and replacing text in many of the files.

you can also prevent the Large Area Button from being displayed by adding

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

in whatever case statements you would like (i have it in the install/uninstall, phpcode and template editors along with the default selection).

Download Now

Only licensed members can download files, Click Here for more information.

Screenshots

Click image for larger version

Name:	Large_edit_fullscreen.jpg
Views:	469
Size:	40.0 KB
ID:	73411   Click image for larger version

Name:	Large_edit_normal.jpg
Views:	427
Size:	50.3 KB
ID:	73412   Click image for larger version

Name:	plugin_editor_fullscreen.jpg
Views:	420
Size:	53.3 KB
ID:	73413   Click image for larger version

Name:	plugin_editor_normal.jpg
Views:	303
Size:	37.8 KB
ID:	73414  

Click image for larger version

Name:	template_editor.jpg
Views:	365
Size:	34.9 KB
ID:	73415  

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
  #16  
Old 29 Dec 2007, 15:51
gothicuser's Avatar
gothicuser gothicuser is offline
 
Join Date: Apr 2004
Real name: Tony
This walks on water, great and thanks.

One (major) problem for me is that it only fully works in M$ IE thingy
In FF it just displays the normal small edit box, and clicking on the 'Large Edit' opens the window and displays "False" (and nothing else) at the top of the window.

In Safari I get the full editor in the small window but again get the "False" in the large edit box.

p.s. I use FF on Linux and Safari on my Mac (where I do all my work)
__________________
Grumpy and bad tempered. I'm a pensioner, so don't care any more
Reply With Quote
  #17  
Old 29 Dec 2007, 16:08
sweede's Avatar
sweede sweede is offline
 
Join Date: Jan 2007
Originally Posted by gothicuser View Post
This walks on water, great and thanks.

One (major) problem for me is that it only fully works in M$ IE thingy
In FF it just displays the normal small edit box, and clicking on the 'Large Edit' opens the window and displays "False" (and nothing else) at the top of the window.

In Safari I get the full editor in the small window but again get the "False" in the large edit box.

p.s. I use FF on Linux and Safari on my Mac (where I do all my work)
Ya, the interaction between the normal in window (or parent) text area and when you click on the large edit box is a mess. It doesnt seem to want to communicate between the parent window (opener) and the new window both directions, I can only get it to work one way on IE.

I gave up on using the large edit box all together and used the fullscreen option in the normal parent window.
Reply With Quote
  #18  
Old 29 Dec 2007, 16:55
gothicuser's Avatar
gothicuser gothicuser is offline
 
Join Date: Apr 2004
Real name: Tony
Oops. found that the Scriptblocker addon in FF was on steroids and over enthusiastically thought the editor was not nice. All working nicely (bar the Large Edit) But yes, full page will suffice
__________________
Grumpy and bad tempered. I'm a pensioner, so don't care any more
Reply With Quote
  #19  
Old 29 Dec 2007, 18:25
KURTZ KURTZ is offline
 
Join Date: Nov 2006
Real name: Christian
i think that this isn't ad add-on but a templates edit ...
Reply With Quote
  #20  
Old 29 Dec 2007, 18:34
sweede's Avatar
sweede sweede is offline
 
Join Date: Jan 2007
Originally Posted by KURTZ View Post
i think that this isn't ad add-on but a templates edit ...
It's a code modification, no templates are edited.
Reply With Quote
  #21  
Old 09 Jan 2008, 18:45
wolfe wolfe is offline
 
Join Date: Jan 2002
one word FANTASTIC :P
__________________
Thanks
Reply With Quote
  #22  
Old 06 Apr 2009, 02:49
Mutt's Avatar
Mutt Mutt is offline
 
Join Date: Nov 2001
just wanted to say thanks. just installed this on 3.82 with no issues. (partial instalation)

I only installed it on textarea.php because I don't think I'll always need it. sometimes I'm just doing a quick edit and don't see the point in having all this. BUT if I want the full editor, I can click the "Large Edit Box" and get it. that gives me this editor on the template editor & the plugin editor while only having to edit 1 file.

I just checked and there's a 'Large Edit Box' button on the email users page too which opens this. not sure I need it there but here, it's pretty cool.
Reply With Quote
  #23  
Old 17 May 2009, 13:23
Ducks Ducks is offline
 
Join Date: Apr 2006
Adding the AJAX save button would be very nice
Reply With Quote
  #24  
Old 24 Jul 2009, 14:52
theksmith theksmith is offline
 
Join Date: Jul 2009
this is the greatest thing ever created! ever!

installed on vBulletin 3.8.3 using the latest release of the "Edit Area" component, which was 0.8.1.1, and no problems so far

the original link given is no longer working, the component can now be found here: http://www.cdolivet.com/index.php?page=editArea or here: http://sourceforge.net/projects/editarea/files/

Last edited by theksmith; 24 Jul 2009 at 15:34.
Reply With Quote
  #25  
Old 24 Sep 2012, 06:14
nerbert nerbert is offline
 
Join Date: May 2008
I got all this working for vB4 and I'm sure it will still work for vB3. I got the editArea editor working in the large edit window and it returns the text to the main page. The large editor window is now larger too. See attached image.

After you upload editArea to forum/clientscript follow these steps:
  1. Make a copy of forum/admincp/textarea.php, renaming it textarea_original.php
  2. Now upload my textarea.php to forum/admincp.
  3. Make a copy of my file, renaming it textarea_ce.php to save it next time you upgrade.

Now you have the usual text editor in the aminCP page and a code editor in the large edit window. Test it out to be sure everything works. If you want editArea in the main page follow these additional steps:
  1. Make a copy of forum/includes/adminfunctions.php, renaming it adminfunctions_original.php.
  2. Open the new version of textarea.php and copy the new function at the bottom of the file.
  3. Open forum/includes/adminfunctions.php and find function print_textarea_row(). In vB4.1.12 it's on line 999 but before that in earlier versions. Rename it print_textarea_row_old(). Now just above it paste in the new version and Save.
  4. Now copy forum/includes/adminfunctions.php, renaming it adminfunctions_new.php to save it for next time you upgrade.

You're done, no further editing required.
Attached Images
File Type: png textarea.png (58.4 KB, 7 views)
Attached Files
File Type: php textarea.php (8.8 KB, 1 views)

Last edited by nerbert; 24 Sep 2012 at 17:01.
Reply With Quote
  #26  
Old 24 Sep 2012, 16:12
nerbert nerbert is offline
 
Join Date: May 2008
OOPS! There's a glitch with this file. This works fine for templates and plug-ins but for pages with multiple textarea inputs it converts only the last one to the code editor (products, custom profile fields, etc).

I'm working on a solution and will post when I get a fix.
Reply With Quote
  #27  
Old 24 Sep 2012, 17:04
nerbert nerbert is offline
 
Join Date: May 2008
File fixed. If you have already uploaded the file you need to upload the new version and edit the corrected function into adminfunctions.php.

Sorry for the bug.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 21:35.

Layout Options | Width: Wide Color: