4images Modifications / Modifikationen > Plugins

[Plugin] Batch Import

(1/43) > >>

Jan:
Batch Import-Script (Beta)

Das Script importiert Bilddateien aus einer bestehenden Ordnerstruktur. Dabei werde Ordner rekursiv durchlaufen, für jeden Ordner eine Kategorie erstellt (Subkategorien für Subordner) und die Bilder importiert.
---------------------------------------------------------------------------------
This script will import image data from an existing folder structure. The script goes recursively through the folders, creates categories for each folder (subcategories for subfolders) and imports the images.


Installation:

- Erstelle ein neues Verzeichnis plugins im admin Ordner (sollte es noch nicht existieren)
- Entpacke das zip und öffne die Datei batch_import.php
- Am Anfang der Datei findest Du den Konfigurationsteil. Pass diesen nach Deinen Anforderungen an. Die einzelnen Teile werden dort erklärt.
- Kopiere die Datei batch_import.php in das plugins-Verzeichnis
- Logge Dich ins Control Panel ein, in der linken Navigation sollte unter "PlugIns" eine neuer Menüpunkt erscheinen
- Draufklicken und Spass haben
---------------------------------------------------------------------------------
- Create a new directory called plugins in your admin-folder (if it yet does not exist)
- Extract the zip and open the file batch_import.php
- At the top you will find the configuration part. Edit this part according to your requirements. You will find an explanation there for each part
- Copy the file batch_import.php to the plugins-directory
- Log in to your Control Panel, a new link should appear in the left navigation frame beneath "PlugIns"
- Click it and have fun


Download: batch_import.zip

risul:
This is what i've been waiting for..!!

For the last couple of days.. i've been working hard to make something like this on my own since I didn't got any response in this forum about batch import!

But I must say.. this script is way better than I could do myself :)

Jan.. you're the best..!!

Poptard:
had a few problems with this mod, but got them worked out on my side with a few changes.. first error that came up was:


--- Code: ---Parse error: parse error, unexpected T_STRING in /home/httpd/html/4images/admin/plugins/batch_import.php on line 70

--- End code ---


i believe that was  because of the missing " on line 67:


--- Code: ---// Default description for each image, can be left blank
$default_image_description = ";
--- End code ---


which I changed to:


--- Code: ---// Default description for each image, can be left blank
$default_image_description = "";
--- End code ---


I then ran into a new error:


--- Code: ---Fatal error: Failed opening required './../admin/admin_global.php' (include_path='.:/usr/lib/php') in /home/httpd/html/4images/admin/plugins/batch_import.php on line 29

--- End code ---


which threw me off for a while, but I realized that for whatever reason, my system was not properly reading the root_path using this line:


--- Code: ---$root_path = (eregi("\/plugins\/", $PHP_SELF)) ? "./../../" : "./../";
--- End code ---


the only way I could get it to work with my limited knowledge of PHP was just to customize it specifically to my system which turned out to be:


--- Code: ---$root_path = (/home/httpd/html/4images/");
--- End code ---


after making these two changes the plugin worked flawlessly!

btw, great addition, this was a major feature I was looking forward to, thanks!  :D

Andre:
Hallo

das Skript ist wirklich Erstklassig.

Leider habe ich beim ersten Test einen Fehler gemacht.

Ich habe also alle durch das Skript angelegten Kategorien gelöscht und auch per FTP unter Data/media bzw. /Thumbs die entsprechend angelegten Ordner mit den Inhalten wieder gelöscht. Jetzt habe ich das Skript nochmals gestartet und es kommt dann immer die Meldung das die Daten bereits vorhanden sind. Es werden alle Kategorien wieder angelegt und auch die Ordner unter data.. sind mit vollen Inhalten wieder da. Wenn ich mir dann die Bilder anschauen möchte werden lediglich die Kategorien angezeigt und es sind angeblich 0 Bilder drin.

Was mache ich falsch? Wo muss ich gegebenenfalls noch was löschen bevor ich das Skript noch einmal ausführe?

Danke für die Hilfe.

Grüsse

Andrè

Jan:
Du musst die Datenbank wieder löschen. 4images_image und 4images_categories.

Gruß Jan

Navigation

[0] Message Index

[#] Next page

Go to full version