1 (edited by CodeXP 2006-02-16 16:34)

Topic: [Release] Update: PunBB Text/File Editor plugin 1.1.2

Update 16.02.06: See this post for the latest version 1.1.2

Hi everyone,

For the last few days, I've been working on a file/text editor for PunBB, and I now think it's ready for at least a beta release. The code still could use a *lot* of cleanup, but I've been testing it on several systems, and it have worked very well on all of them.
I'm still considering adding more features to it, but I'm sure you'll let me know what's needed wink

Some of the features:

* File browser
* Line by line editing of files, with line numbering (in line edit mode). Can switch between this mode, and free edit in a text area.
* To delete a complete line, just mark the checkbox for said line and save.
* "Save as..."
* Limit the type of files you're allowed to edit (see line: 13).
* Reject editing of specific files regardless of setting mentioned above. Defaults to reject this script, and config.php (see line: 26).

Now, as you can see, it's not the most advanced thing in the world, but as it's my first script of this type, I'm quite happy with it smile

---
Installation: Upload to your ./plugins folder, and add the CSS from the file 'add_this_to_your_style_sheet.css' to your CSS file (e.g. Oxygen.css).
---

Download: http://www.tasarinan.com/upload/AP_PunB … Editor.zip


Screens:

Browser:
http://img5.imageshack.us/img5/9907/febrowser4vt.th.png

Line editor:
http://img13.imageshack.us/img13/9058/felineedit1zm.th.png

Free edit:
http://img72.imageshack.us/img72/2859/fefreeedit6gu.th.png


EDIT: Updated script to check if the file extension specified when using "save as..." is allowed.

Re: [Release] Update: PunBB Text/File Editor plugin 1.1.2

That is awesome. Good show, Code. Good show.

I think I will install that today.

Re: [Release] Update: PunBB Text/File Editor plugin 1.1.2

Very nice CodeXP. Thank you. I think though, that I would prefer to restrict its use to a particular area of my site.  Perhaps a directory with files NOT capable of breaking pun. smile

I don't know if this is effective or not but it "SEEMS" to work for me.

// Let's configure what directory we'll be working with initially
$curdir = './files';

I really think you have done an excellent job with the AP interface.  It's easy and intuitive to use.

Mark

4 (edited by CodeXP 2006-01-20 16:47)

Re: [Release] Update: PunBB Text/File Editor plugin 1.1.2

That should work just fine.. I didn't restrict it by default, seeing as the initial reason I made the script, was that I wanted an easy way to be able to edit PunBB while @ work without access to FTP/SSH smile

Oh, and thanks for the comments to both of you! smile

Re: [Release] Update: PunBB Text/File Editor plugin 1.1.2

Installed! smile

CodeXP.... fair play mate.
I have been using a web2ftp site for even the smallest of edits... So this is a very VERY VERY useful plugin. Thank you.

6 (edited by Dr.Jeckyl 2006-01-20 19:56)

Re: [Release] Update: PunBB Text/File Editor plugin 1.1.2

CodeXP does it again. WAY COOL!

side note: any chance of you sharing that kick ass download setup/script you have on tasarinan.com and/or updating it when 1.3 comes out?

~James
FluxBB - Less is more

7 (edited by Dr.Jeckyl 2006-01-20 19:53)

Re: [Release] Update: PunBB Text/File Editor plugin 1.1.2

suggestion:

when editing a file have it say something like... 
"Editing file: filename.php  in  .../website/subdir/"

maybe a "Download file" option too?

~James
FluxBB - Less is more

Re: [Release] Update: PunBB Text/File Editor plugin 1.1.2

I will give this a go. Sounds interesting. smile

Proud hoster of PunBB's UK download mirror!

Re: [Release] Update: PunBB Text/File Editor plugin 1.1.2

@Dr. Jeckyl: I'll probably add that in the next release...along with a file backup function (meaning it'll keep a backup of any file you edit) smile

10

Re: [Release] Update: PunBB Text/File Editor plugin 1.1.2

Excellent job, this plugin really comes in handy!

11 (edited by CodeXP 2006-01-22 19:25)

Re: [Release] Update: PunBB Text/File Editor plugin 1.1.2

Happy to see someone finding this useful smile

Oh, and the next version should not be that far away from release now, so here's a screenshot of the backup function I've added. Everytime you save a file, a backup copy will be created, which you can restore by just pressing a button smile The pink rows indicated that the backed up copy is identical to the one currently loaded in the editor (md5 checksum match). The table itself is displayed below any file you're currently editing.

http://img21.imageshack.us/img21/1153/febackup3ye.th.png


EDIT:

Almost forgot to mention, I've improved the file browser navigation a bit as well. It now displays your current location as before, but you can now click the folder names to back to whatever level you wish.

http://img21.imageshack.us/img21/9713/fenav2lq.th.png

Re: [Release] Update: PunBB Text/File Editor plugin 1.1.2

so when you save an edited file, it on it's own, saves a copy of the file BEFORE the edit?

~James
FluxBB - Less is more

13

Re: [Release] Update: PunBB Text/File Editor plugin 1.1.2

Dr.Jeckyl wrote:

so when you save an edited file, it on it's own, saves a copy of the file BEFORE the edit?

Yes, that's exactly what happens smile It creates an a new entry in a backup index file, with the filename, original path, time etc, and creates a backup of the original files content, before it finally writes the new file. Quite useful actually smile

Re: [Release] Update: PunBB Text/File Editor plugin 1.1.2

Very nicely done CodeXP! Let me know when you feel that it is bug-free and I'll post it to the punbb.org download page.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

15 (edited by CodeXP 2006-01-24 14:57)

Re: [Release] Update: PunBB Text/File Editor plugin 1.1.2

Thanks Rickard, I'll be sure to do so smile

I've just prepared a new archive of version 1.1 of this plugin. It works fine now, so I decided to release it now. The code could still use some cleanup, but I don't think there should be any (serious) bugs.

Some changes from v1.0:
* Backup & restore function!
* Improved navigation in the file browser.
* Ability to set allowed files to edit, even if the file extension is disallowed (example: If you've disabled editing of .php files, you could, let's say, allow editing to the config.php file). See line 47 if you want to add file to the allowed array.
* Several minor & not-so-minor changes to the code.

Installation:
1. Extract the contents of the archive to your PunBB folder.
2. Set write permissions to the ./plugins/AP_Text_Edit_Backups/ folder (chmod 0777).
3. Add the contents of the supplied stylesheet to your existing one(s).

Let me know if there's any problems, or if you have any suggestions. I did not add a download file function (yet), as the headers are already sent out by header.php, thus causing some problems doing it the way I intended.

Download link: http://www.thesecondscreen.com/files/ap … or_1.1.zip

16

Re: [Release] Update: PunBB Text/File Editor plugin 1.1.2

Mucho nice, very useful plugin indeed.

Re: [Release] Update: PunBB Text/File Editor plugin 1.1.2

CodeXP: E-mail it to me when/if you're done. I'll probably forget otherwise.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

18

Re: [Release] Update: PunBB Text/File Editor plugin 1.1.2

Nice plugin smile

It would be great too to add an option to create a "clone" file (wich could be renamed as bidule.php.SAV and saved in a forbidden access folder) when editing a file and another option to retreive the saved file in case of "editing earthquake" on a file.

19

Re: [Release] Update: PunBB Text/File Editor plugin 1.1.2

@Rickard: I'll do so, but I think it would be best with some more feedback first from those testing it, just so that there won't be any nasty surprises wink

@habana: Well, although not exactly the same, that's kinda what the backup/restore function does really...

20

Re: [Release] Update: PunBB Text/File Editor plugin 1.1.2

Sorry for this useless post, CodeXP.

I will read full topic before submitting silly messages.
I will read full topic before submitting silly messages.
I will read full topic before submitting silly messages.
I will read full topic before submitting silly messages.
I will read full topic before submitting silly messages.
...

Thanks "quand même" from paris smile

21

Re: [Release] Update: PunBB Text/File Editor plugin 1.1.2

habana wrote:

Sorry for this useless post, CodeXP.

I will read full topic before submitting silly messages.
I will read full topic before submitting silly messages.
I will read full topic before submitting silly messages.
I will read full topic before submitting silly messages.
I will read full topic before submitting silly messages.
...

Thanks "quand même" from paris smile

Hehe, don't worry about it wink

22

Re: [Release] Update: PunBB Text/File Editor plugin 1.1.2

This FANTASTIC Plugin HAS TO BE directly in 1.3 smile

Re: [Release] Update: PunBB Text/File Editor plugin 1.1.2

atleast ported to 1.3.

~James
FluxBB - Less is more

24

Re: [Release] Update: PunBB Text/File Editor plugin 1.1.2

I'll do my best to have it ready for 1.3 as well...provided I can still access the internet at that time. Just got fired from my job for the last 4 years yesterday, so I'm not quite sure what's going to happen yet sad

Re: [Release] Update: PunBB Text/File Editor plugin 1.1.2

shitty! sorry to hear that. what is your profession?

~James
FluxBB - Less is more