Textpattern plugin fpx_image_import

In Web

I’ve needed a way to import some images into Textpattern, especially when adding more than one image the textpattern admin interface is not the best. So i found a plugin called aba_import_image, but i ran in some problems regarding double imports, and it really wasn’t so nice to use, meaning it had no interface at all. So i took it apart, reassembled it, added some stuff, and here we go.

Behold fpx_image_import.txt. This plugin does the same as aba_import_image, but you can select which files you want to import, and the imported files are not deleted anymore since this isn’t necessary. The list of files and folders is displayed below the image list in the textpattern admin interface. By selecting the “import” checkbox you can select which one you want to import. Please note that the plugin does not check (and in fact is completely unable to) if an image was already imported, so be careful when importing. If you select a folder, all the files in the folder are imported to a category with the name of the folder. If this category does not exist, it will be created.

I also added a preferences page for the settings which control the import of the images, the creation of the thumbnails, and so on. You can find the preference page in a new tab called “image import” under the “extensions” tab. This solution isn’t optimal, since you don’t see the settings when importing and can’t change them on the same page, but the inner workings of textpattern and its plugins prevented a better solution. In the following screenshot you can see the preferences page.

This plugin is based on the aba_import_image plugin which itself is based on the nhn_image_import plugin.

Please note that this is just a quick hack, i only added the display and selection of files and folders under the image tab, and the preferences. The complete image import and thumbnail creation is as it was in aba_import_image. So i hope everything there works
ok :-)

I’ve tested this plugin with Textpattern 4.0.3 and 4.0.2, and it worked for me.

Update 03/16/2008: Updated for Textpattern 4.0.6, added necessary add_privs call. Changed version to 0.4.

Plugin details:

Download latest version: fpx_image_import.txt
Current Version: 0.4
Textpattern forum: View discussion
Plugin page: View on textpattern.org
Plugin Type: Admin


Danke. Jetzt kann ich mir mit meinem Rewrite etwas mehr Zeit lassen… ;)

#1 aba 20.04.2006 18:50

Ah, da war doch noch was in der Liste, was ich zu tun hatte – dir deswegen eine Mail schreiben. Naja, hat sich ja jetzt erledigt.

#2 Dirk 20.04.2006 18:55

Sehr schön! Ich hatte kürzlich vor nhn_image_import wieder aufzunehmen, um ähnliches zu machen, aber das ist jetzt ja nicht mehr nötig. Vielen Dank :)

#3 Nils 21.04.2006 08:59

Und wie lade ich die Bilder auf den Server in das Verzeichniss? Per FTP? Antwort per eMail wäre super! Danke

#4 Sebastian 31.05.2006 13:40

Sebastian, die Files musst du irgendwie dort hochladen. Entweder per FTP, oder per SCP, wie auch immer du es am liebsten hast. Wenn keine Files da sind, ist es schwer, etwas zu importieren. :-)

Das Plugin lohnt sich auch nur, wenn man mehrere Bilder importieren will – einzelne kann man einfacher direkt in Textpattern importieren.

#5 Dirk 31.05.2006 16:22