• [Plugin] Batch Import 5 0 5 1
Currently:  

Author Topic: [Plugin] Batch Import  (Read 335905 times)

0 Members and 1 Guest are viewing this topic.

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
[Plugin] Batch Import
« on: October 08, 2002, 10:14:45 PM »
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
« Last Edit: May 30, 2005, 09:37:30 AM by V@no »
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline risul

  • Pre-Newbie
  • Posts: 6
    • View Profile
    • http://www.aarman.com
Wowww.. very nice
« Reply #1 on: October 09, 2002, 01:55:54 AM »
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..!!

Offline Poptard

  • Pre-Newbie
  • Posts: 5
    • View Profile
[Plugin] Batch Import
« Reply #2 on: October 09, 2002, 03:37:17 AM »
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: [Select]
Parse error: parse error, unexpected T_STRING in /home/httpd/html/4images/admin/plugins/batch_import.php on line 70


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

Code: [Select]
// Default description for each image, can be left blank
$default_image_description = ";


which I changed to:

Code: [Select]
// Default description for each image, can be left blank
$default_image_description = "";


I then ran into a new error:

Code: [Select]
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


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: [Select]
$root_path = (eregi("\/plugins\/", $PHP_SELF)) ? "./../../" : "./../";

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: [Select]
$root_path = (/home/httpd/html/4images/");

after making these two changes the plugin worked flawlessly!

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

Offline Andre

  • Newbie
  • *
  • Posts: 24
    • View Profile
[Plugin] Batch Import
« Reply #3 on: October 14, 2002, 08:04:34 PM »
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è

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
[Plugin] Batch Import
« Reply #4 on: October 15, 2002, 12:52:31 AM »
Du musst die Datenbank wieder löschen. 4images_image und 4images_categories.

Gruß Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline Andre

  • Newbie
  • *
  • Posts: 24
    • View Profile
[Plugin] Batch Import
« Reply #5 on: October 15, 2002, 01:30:57 PM »
Hi

habe Sie gelöscht.

Wie bekomme ich Sie wieder hin? Also den Namen weiß ich ja aber wie viele Felder haben denn jeweils die beiden Tabellen? Muss ich beim neu hin zu fügen unter php Admin noch etwas beachten?

Grüsse

Andrè

Offline uke

  • Pre-Newbie
  • Posts: 6
    • View Profile
batch mit wunderlichen Ergebnissen
« Reply #6 on: October 15, 2002, 04:58:22 PM »
Hallo,
ich habe die batch_import.php auch mal installiert und komme aus dem Staunen nicht
heraus. Ich habe einen Bilderordner im webroot angelegt, den src path eingetragen, wollte dann ein Bild importieren. Im CP sieht alles gut aus, src path wird angezeigt, und dann faengt er an,
Dateien aus dem Root Dir des Servers zu kopieren, also aus /.
Habe dann den ROOT Path in der php datei auf absolute Pfade gesetzt, Ergebnis ist gleich.
Wenn ich den Bilder Ordner entferne, meckert er, also er checkt ob unter dem src path ein Ordner da ist. Auf jeden Fall habe ich so problemlos einen BSD Kernel in meine Bildergalerie
eingefuegt.

Was kann denn da passiert sein, ich fall vom Glauben ab.

Gruss
Uwe
PS: Galerie ist 1.7, laeuft ansonsten voellig problemlos. 8O

Offline cyber

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
[Plugin] Batch Import
« Reply #7 on: October 15, 2002, 05:20:50 PM »
Where i can see a demo?

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
I doubt there's an online demo
« Reply #8 on: October 15, 2002, 05:55:38 PM »
The only practical way to "see" a demo of these sort of plug-ins is to download it, install it, and try it out on your own.  I can't imagine a better way of seeing how it works.

Offline cyber

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
[Plugin] Batch Import
« Reply #9 on: October 15, 2002, 06:19:27 PM »
But exactly what is does..?

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
[Plugin] Batch Import
« Reply #10 on: October 15, 2002, 06:34:09 PM »
@ Andre:
Du solltest die Tabelle eigentlich nur leeren, nicht löschen.
In der Datei "data/database/default/maysql_default.sql" findest Du einen Dump. Mit dem kannst Du die entsprechenden Tabellen neu erstellen.

@ Uke:
Unterhalb des angegeben Ordners dürfen sich natürlich nur Ordner und Dateien befinden die Du auch importieren willst.

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline uke

  • Pre-Newbie
  • Posts: 6
    • View Profile
src_path
« Reply #11 on: October 15, 2002, 06:39:36 PM »
Hi

ich habe als src_path einen absouluten Pfad angegeben wie z.B.
/usr/local/httpd/htdocs/bilder.
Er checkt ob dieser Ordner da ist, dann beginnt er Dateien aus    /    
zu kopieren, also dateien wie .cshrc, kernel etc, eben alles worauf er zugreifen kann
und was sich im root des Servers befindet (nicht im root des webservers).
Die Bilder in dem Bilder Ordner rührt er nicht an.

Gruss
Uwe :roll:

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
What Jan said
« Reply #12 on: October 15, 2002, 06:40:04 PM »
@Cyber
Quote
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.

Maybe Jan can give you more details than this but his explanation looks pretty clear to me.

Offline Andre

  • Newbie
  • *
  • Posts: 24
    • View Profile
[Plugin] Batch Import
« Reply #13 on: October 15, 2002, 07:20:41 PM »
@Jan

ja hab`s jetzt.

Leeren ging nicht. Der Button zum Leeren wurde nicht mehr angezeigt allerdings war die Tabelle noch über 2 MB groß.

Wie viele Pics hält denn 4images eigentlich aus? Bei nicht sehr viel Traffik allerdings einer doch enormen Anzahl an Bildern.

Grüsse

Andrè

Offline Seatboy

  • Pre-Newbie
  • Posts: 2
    • View Profile
Warning: open_basedir restriction in effect
« Reply #14 on: October 15, 2002, 07:21:53 PM »
Warning: open_basedir restriction in effect. File is in wrong directory in /customer9/host0001306/www/T100/admin/plugins/batch_import.php on line 314

0 images in .

Import category ...
DB Error: Bad SQL Query: SELECT cat_order FROM 4images_categories WHERE cat_parent_id = ORDER BY cat_order DESC LIMIT 1
You have an error in your SQL syntax near 'ORDER BY cat_order DESC LIMIT 1' at line 4

DB Error: Bad SQL Query: INSERT INTO 4images_categories (cat_id, cat_name, cat_description, cat_parent_id, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment) VALUES (40, '', '', , 10, 0, 0, 2, 2, 9, 0, 0, 0, 2)
You have an error in your SQL syntax near ' 10, 0, 0, 2, 2, 9, 0, 0, 0, 2)' at line 4
FAILED


Import finished!

[Back]  

Whats wrong ?