4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Plugins => Topic started by: Jan on October 08, 2002, 10:14:45 PM

Title: [Plugin] Batch Import
Post by: Jan 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 (http://www.4homepages.de/plugins/batch_import.zip)
Title: Wowww.. very nice
Post by: risul 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..!!
Title: [Plugin] Batch Import
Post by: Poptard 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
Title: [Plugin] Batch Import
Post by: Andre 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è
Title: [Plugin] Batch Import
Post by: Jan on October 15, 2002, 12:52:31 AM
Du musst die Datenbank wieder löschen. 4images_image und 4images_categories.

Gruß Jan
Title: [Plugin] Batch Import
Post by: Andre 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è
Title: batch mit wunderlichen Ergebnissen
Post by: uke 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
Title: [Plugin] Batch Import
Post by: cyber on October 15, 2002, 05:20:50 PM
Where i can see a demo?
Title: I doubt there's an online demo
Post by: Chris 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.
Title: [Plugin] Batch Import
Post by: cyber on October 15, 2002, 06:19:27 PM
But exactly what is does..?
Title: [Plugin] Batch Import
Post by: Jan 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
Title: src_path
Post by: uke 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:
Title: What Jan said
Post by: Chris 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.
Title: [Plugin] Batch Import
Post by: Andre 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è
Title: Warning: open_basedir restriction in effect
Post by: Seatboy 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 ?
Title: [Plugin] Batch Import
Post by: Jan on October 15, 2002, 07:35:45 PM
This is a restriction in the php.ini. Some server are configured in this (bad) way. Try to move the folder with your images inside the plugins folder.

Jan
Title: If you want a textbox for Imagename and description
Post by: Seatboy on October 15, 2002, 09:13:05 PM
If you want a textbox for Imagename and description



<?php // PLUGIN_TITLE: Batch Import
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: batch_import.php                                     *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7                                                  *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/

$nozip = 1;
define('IN_CP', 1);
$root_path = (eregi("\/plugins\/", $PHP_SELF)) ? "./../../" : "./../";
define('ROOT_PATH', $root_path);
require(ROOT_PATH.'admin/admin_global.php');

//-----------------------------------------------------
//--- Configuration -----------------------------------
//-----------------------------------------------------

// Path to the directory the image data are stored.
// No trailing slash!
$data_src_path = "/customer9/host0001306/www/T100/admin/plugins";

// Thumbnail options
// suffix:     Optional, can be left blank
// prefix:     Optional, can be left blank
// subfolder:  If you images are stored in a subfolder,
//             set the folder name here. Example: "thumbnails/"
//             Optional, can be left blank
// extensions: Valid thumbnail extensions
$thumbnail_options = array(
  "prefix"     => "",
  "suffix"     => "",  
  "subfolder"  => "",
  "extensions" => array("jpg", "JPG", "jpeg", "JPEG", "gif", "GIF", "png", "PNG")
);

// As default, the script will only copy the image files
// from your source folders to the 4images folders.
// After import you will have your image data twice on
// your server.
// If you have not enough server space set this to 1.
// Then the script will move the image files.
// Be carefully with this, your data could be lost!!!
$move_image_files = 0;

// Set this to 1 to use file modification time as date?
// Otherwise the current date will be used.
$use_image_filemtime = 1;

// Default description for each image, can be left blank
//$default_image_description = "";

// Default keywords for each image, can be left blank
// Separated by spaces. Example: "keyword1 keyword2 keyword3"
$default_image_keywords = "";

// Set this to the id of the user who should be the owner of each image.
// If 0, the user id of the current logged in user will be used. That's you ;)
$default_user_id = 0;

// Default description for each category, can be left blank
$default_cat_description = "";

// Default category permissions
// AUTH_ALL   = All
// AUTH_USER  = Registered Users
// AUTH_ACL   = Private
// AUTH_ADMIN = Administrators
$auth_viewcat      = AUTH_ALL;
$auth_viewimage    = AUTH_ALL;
$auth_download     = AUTH_USER;
$auth_upload       = AUTH_USER;
$auth_directupload = AUTH_ADMIN;
$auth_vote         = AUTH_ALL;
$auth_sendpostcard = AUTH_ALL;
$auth_readcomment  = AUTH_ALL;
$auth_postcomment  = AUTH_USER;

//-----------------------------------------------------
//--- End Configuration -------------------------------
//-----------------------------------------------------

include(ROOT_PATH.'includes/search_utils.php');
$data_src_path = ereg_replace("\/$", "", $data_src_path);

$default_image_keywords = str_replace(",", " ", $default_image_keywords);
$default_image_keywords = ereg_replace("( ){2,}", " ", $default_image_keywords);

if (!empty($thumbnail_options['subfolder']) && !ereg("\/$", $thumbnail_options['subfolder'])) {
  $thumbnail_options['subfolder'] = $thumbnail_options['subfolder']."/";
}

$default_user_id = intval($default_user_id);

if ($action == "") {
  $action = "importintro";
}

function copy_image($image_src, $image_dest) {
  global $move_image_files;
  if (@is_file($image_src) && file_exists($image_src)) {
    if (file_exists($image_dest)) {
      return "File already exist";
    }
    else {
      if (copy($image_src, $image_dest)) {
        @chmod($image_dest, CHMOD_FILES);
        if ($move_image_files == 1) {
          unlink($image_src);
        }
        return "OK";
      }
      else {
        return "Error while copying image ".$image_src;
      }
    }
  }
  else {
    return "File not found";
  }
}

function next_step($get_options) {
  global $site_sess, $PHP_SELF;
  $page = $PHP_SELF."?action=doimport";
  foreach ($get_options as $key => $val) {
    $page .= "&".$key."=".$val;
  }
  $page = $site_sess->url($page);
  if ($get_options['autoredirect'] == 1) {
?>
<script language="javascript">
myvar = "";
timeout = 15;
function dorefresh() {
  window.status="Redirecting"+myvar;
  myvar = myvar + " .";
  timerID = setTimeout("dorefresh();", 100);
  if (timeout > 0) {
    timeout -= 1;
  }
  else {
    clearTimeout(timerID);
    window.status="";
    window.location="<?php echo $page; ?>";
  }
}
dorefresh();
<?php
}
?>
</script>
<br /><br />
</p>
<table border="0" cellspacing="0" cellpadding="1">
  <tr>
    <td class="tableseparator">
      <table width="100%" border="0" cellspacing="0" cellpadding="3">
        <tr>
          <td class="tablerow2" align="center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="<?php echo $page; ?>"><b>Click here to continue</b></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<br />
<?php
}

function get_dir($dir, $id, $pos = 0) {
  global $dir_array, $dir_parent_array, $id, $data_src_path, $thumbnail_options;

  $handle = opendir($dir);
  $folders = array();
  while ($file = @readdir($handle)) {
    if (@is_dir($dir.$file) && !eregi("^\.{1,2}$", $file) && $file != basename($thumbnail_options['subfolder'])) {
      $folders[] = $file;
    }
  }
  @closedir($handle);
  sort($folders);
  foreach ($folders as $file) {
    $id++;
    $dir_array[$id] = array(
      "cat_name" => $file,
      "cat_path" => $dir.$file,
      "cat_folder_path" => str_replace($data_src_path."/", "", $dir.$file),
      "parent_id" => $pos
    );
    $dir_parent_array[$pos][] = $id;
    get_dir($dir.$file."/", $id, $id);
  }
  return true;
}

function show_category_array($dir_parent_array, $cat = 0, $cid = 0, $depth = 1) {
  global $dir_array;
  if (!isset($dir_parent_array[$cid])) {
    return false;
  }
  echo ($cid == 0) ? "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n" : "";
  foreach ($dir_parent_array[$cid] as $val) {
    echo "<tr>\n<td align=\"right\">\n";
    echo ($val == $cat) ? "<blink><span class=\"marktext\">Scanning -&raquo;</span></blink>&nbsp;\n" : "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n";
    echo "</td><td>";
    if ($depth > 1) {
      echo str_repeat("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", $depth - 1)."<img src=\"".ROOT_PATH."admin/images/folder_path.gif\" alt=\"\">\n";
    }
    echo ($val == $cat) ? "<b>".$dir_array[$val]['cat_name']."</b>" : $dir_array[$val]['cat_name'];
    echo " ".$val."\n</td>\n</tr>\n";
    show_category_array($dir_parent_array, $cat, $val, $depth + 1);
  }
  echo ($cid == 0) ? "</table>\n" : "";
  return true;
}

$headinsert = "
  <script language=\"javascript\">
  function doBlink() {
    var blink = document.all.tags(\"BLINK\")
    for (var i = 0; i < blink.length; i++) {
      blink.style.visibility = blink.style.visibility == \"\" ? \"hidden\" : \"\";
    }
  }

  function startBlink() {
    if (document.all) {
      setInterval(\"doBlink()\",500)
    }
  }
  window.onload = startBlink;
  </script>
";
show_admin_header($headinsert);

if ($action == "doimport") {
  $get_options = array();
  if (isset($HTTP_GET_VARS['cat_max_id']) || isset($HTTP_POST_VARS['cat_max_id'])) {
    $cat_max_id = (isset($HTTP_GET_VARS['cat_max_id'])) ? intval($HTTP_GET_VARS['cat_max_id']) : intval($HTTP_POST_VARS['cat_max_id']);
  }
  else {
    $sql = "SELECT MAX(cat_id) as max_id
          FROM ".CATEGORIES_TABLE;
    $row = $site_db->query_firstrow($sql);
    $cat_max_id = (!empty($row['max_id'])) ? $row['max_id'] : 0;
  }

  if (isset($HTTP_GET_VARS['cat']) || isset($HTTP_POST_VARS['cat'])) {
    $cat = (isset($HTTP_GET_VARS['cat'])) ? intval($HTTP_GET_VARS['cat']) : intval($HTTP_POST_VARS['cat']);
  }
  else {
    $cat = $cat_max_id + 1;
  }

  if (isset($HTTP_GET_VARS['batchstart']) || isset($HTTP_POST_VARS['batchstart'])) {
    $batchstart = (isset($HTTP_GET_VARS['batchstart'])) ? intval($HTTP_GET_VARS['batchstart']) : intval($HTTP_POST_VARS['batchstart']);
  }
  else {
    $batchstart = 0;
  }

  if (isset($HTTP_GET_VARS['batchsize']) || isset($HTTP_POST_VARS['batchsize'])) {
    $batchsize = (isset($HTTP_GET_VARS['batchsize'])) ? intval($HTTP_GET_VARS['batchsize']) : intval($HTTP_POST_VARS['batchsize']);
    if (!$batchsize) {
      $batchsize = 25;
    }
  }
  else {
    $batchsize = 25;
  }

  if (isset($HTTP_GET_VARS['autoredirect']) || isset($HTTP_POST_VARS['autoredirect'])) {
    $autoredirect = (isset($HTTP_GET_VARS['autoredirect'])) ? intval($HTTP_GET_VARS['autoredirect']) : intval($HTTP_POST_VARS['autoredirect']);
  }
  else {
    $autoredirect = 0;
  }

  if (!is_dir($data_src_path)) {
    echo "<p><b class=\"marktext\">The  data source path \"$data_src_path\" seems to be incorrect!</b></p>";
    show_text_link($lang['back'], $PHP_SELF);
    show_admin_footer();
    exit;
  }

  @set_time_limit(120);
  $dir_array = array();
  $dir_parent_array = array();

  $id = $cat_max_id;
  get_dir($data_src_path."/", $cat_max_id);
  $num_cats = sizeof($dir_array);
  echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"right\"><tr><td>";
  show_category_array($dir_parent_array, $cat);
  echo "</td></tr></table>";

  $dir = $dir_array[$cat]['cat_path']."/";
  $files = array();
  $handle = opendir($dir);
  while ($file = @readdir($handle)) {
    if (@is_file($dir.$file)) {
      if (!empty($thumbnail_options['prefix']) && preg_match("/^".$thumbnail_options['prefix']."/", $file)) {
        continue;
      }
      if (!empty($thumbnail_options['suffix']) && preg_match("/".$thumbnail_options['suffix']."\.([a-z]{1,4})$/", $file)) {
        continue;
      }
      $files[] = $file;
    }
  }
  @closedir($handle);
  sort($files);

  $total = sizeof($files);

  $batchend = $batchstart + $batchsize - 1;
  if ($batchend >= $total - 1) {
    $batchend = $total - 1;
  }

  echo "<p><b>".$total."</b> images in <b>".$dir_array[$cat]['cat_name']."</b>.";
  echo ($total > 0) ? " Importing image <b>".($batchstart + 1)."</b> to <b>".($batchend + 1)."</b></p>" : "</p>";

  if ($batchstart == 0) {
    echo "Import category <b>".$dir_array[$cat]['cat_name']."</b>";
    if (isset($dir_array[$dir_array[$cat]['parent_id']]['cat_name'])) {
      echo " (Parent category: <b>".$dir_array[$dir_array[$cat]['parent_id']]['cat_name']."</b>)";
    }
    echo " ... ";
    flush();
    @set_time_limit(120);

    $cat_name      = str_replace("_", " ", $dir_array[$cat]['cat_name']);
    $cat_parent_id = $dir_array[$cat]['parent_id'];

    $sql = "SELECT cat_order
            FROM ".CATEGORIES_TABLE."
            WHERE cat_parent_id = $cat_parent_id
            ORDER BY cat_order DESC
            LIMIT 1";
    $cat_order = $site_db->query_firstrow($sql);

    $sql = "INSERT INTO ".CATEGORIES_TABLE."
            (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
            ($cat, '".addslashes($cat_name)."', '".addslashes($default_cat_description)."', $cat_parent_id, ".($cat_order['cat_order'] + 10).", $auth_viewcat, $auth_viewimage, $auth_download, $auth_upload, $auth_directupload, $auth_vote, $auth_sendpostcard, $auth_readcomment, $auth_postcomment)";
    $result = $site_db->query($sql);
    $cat_id = $site_db->get_insert_id();

    if ($result && $cat_id) {
      $oldumask = umask(0);
      mkdir(MEDIA_PATH."/".$cat_id, CHMOD_DIRS);
      mkdir(THUMB_PATH."/".$cat_id, CHMOD_DIRS);
      umask($oldumask);
      echo "<b>OK</b><br><br>";
    }
    else {
      echo "<b class='marktext'>FAILED</b><br><br>";
    }
  }

  if ($total > 0) {
    for ($i = $batchstart; $i <= $batchend; $i++) {
      $file = $files[$i];
      echo "<b>".($i + 1).".</b> Importing image <b>".$file."</b><br />";
      flush();
      @set_time_limit(120);
      $output = "";
     
      $uid = ($default_user_id > 0) ? $default_user_id : $user_info['user_id'];
     
      $image_date = ($use_image_filemtime) ? filemtime($dir_array[$cat]['cat_path']."/".$file) : time();

      $image_votes = 0;
      $image_rating = '0.00';
      $image_hits = 0;

      //Copy Images
      $output .= "<b>Copy Image:</b> ";
      $msg = copy_image($dir_array[$cat]['cat_path']."/".$file, MEDIA_PATH."/".$cat."/".$file);
      $output .= $msg."<br />";

      if ($msg != "OK") {
        echo $output."Skipping.....<br /><br />";
        continue;
      }

      $file_name = get_file_name($file);

      $new_thumb_name = "";
      if (!empty($thumbnail_options['prefix']) || !empty($thumbnail_options['suffix']) || !empty($thumbnail_options['subfolder'])) {
        $output .= "<b>Copy Thumbnail:</b> ";
        foreach ($thumbnail_options['extensions'] as $extension) {
          $thumb_name = $thumbnail_options['prefix'].$file_name.$thumbnail_options['suffix'].".".$extension;
          if (file_exists($dir_array[$cat]['cat_path']."/".$thumbnail_options['subfolder'].$thumb_name)) {
            $msg = copy_image($dir_array[$cat]['cat_path']."/".$thumbnail_options['subfolder'].$thumb_name, THUMB_PATH."/".$cat."/".$file_name.".".$extension);
            $new_thumb_name = $file_name.".".$extension;
            $output .= $msg."<br />";
            break;
          }
        }
      }
      $output .= ($new_thumb_name == "") ? "No thumbnail found<br />" : "";

     // $image_name = str_replace("_", " ", $file_name);

      $output .= "<b>Image name:</b> ".htmlspecialchars($image_name)."<br>";
      $output .= "<b>Date:</b> ".format_date($config['date_format']." ".$config['time_format'], $image_date)."<br>";

      $sql = "INSERT INTO ".IMAGES_TABLE."
              (cat_id, user_id, image_name, image_description, image_keywords, image_date, image_active, image_media_file, image_thumb_file, image_download_url, image_allow_comments, image_comments, image_downloads, image_votes, image_rating, image_hits)
              VALUES
              ($cat, $uid, '".addslashes($image_name)."', '".addslashes($default_image_description)."', '".addslashes($default_image_keywords)."', $image_date, 1, '$file', '$new_thumb_name', '', 1, 0, 0, $image_votes, '$image_rating', $image_hits)";
      $result = $site_db->query($sql);
      $image_id = $site_db->get_insert_id();
 
      if (!empty($default_image_description)) {
        $image_description = $default_image_description;
      }

      if (!empty($default_image_keywords)) {
        $image_keywords = $default_image_keywords;
      }

      if ($result) {
        $search_words = array();
        foreach ($search_match_fields as $image_column => $match_column) {
          if (isset(${$image_column})) {
            $search_words[$image_column] = stripslashes(${$image_column});
          }
        }
        add_searchwords($image_id, $search_words);
      }
      echo $output."<br />";
    }
  }

  if ((($cat - $cat_max_id) < $num_cats) || $batchend < $total - 1) {
    if ($batchend < $total - 1) {
      $batchstart = $batchend + 1;
    }
    else {
      $batchstart = 0;
      $cat++;
    }

    $get_options['cat_max_id']   = $cat_max_id;
    $get_options['cat']          = $cat;
    $get_options['batchstart']   = $batchstart;
    $get_options['batchsize']    = $batchsize;
    $get_options['autoredirect'] = $autoredirect;
    next_step($get_options);
    show_text_link("Cancel", $PHP_SELF);
  }
  else {
    echo "<p><b>Import finished!</b></p>";
    show_text_link("Back", $PHP_SELF);
  }
}

if ($action == "importintro") {
  show_form_header($PHP_SELF, "doimport");
  show_table_header("Batch Import", 2);
  show_custom_row("Data Source Path", $data_src_path);

  show_input_row("Number of images to do per cycle", "batchsize", 50, 15);
  show_input_row("Default imagename for the images", "image_name", name, 30);
  show_input_row("Default text for the description", "default_image_description", description, 30);
  show_radio_row("Include automatic JavaScript redirect to next page", "autoredirect", 0);
  show_form_footer($lang['submit'], $lang['reset'], 2);
}

show_admin_footer();
?>
Title: Danke!
Post by: limes on October 18, 2002, 10:36:21 PM
habe das script getestet: ist echt die wucht! danke dir!
hat mir auf www.chauvi-seite.de viel arbeit erspart.
thx
markus oeder
Title: Nachtrag
Post by: limes on October 19, 2002, 12:10:38 AM
nachdem das importscript super funktioniert hat (alle bilder sind mit kategorie importiert worden) habe ich leider festgestellt, dass die anzahl der bilder bei einigen kategorien nicht ganz stimmt. kann ich dies "per hand" einmalig korrigieren? könnte mir jemand einen tip geben?
schon mal danke
markus oeder
Title: [Plugin] Batch Import
Post by: Jan on October 19, 2002, 09:47:07 AM
Was heisst "die Anzahl stimmt nicht" genau? Sind nicht alle Bilder importiert worden, oder stimmt die Anzeige der Anzahl hinter dem Kategorienamen nicht?

Jan
Title: sorry
Post by: limes on October 19, 2002, 12:22:55 PM
sorry, da habe ich mich wohl etwas zu ungenau ausgedrückt. es ging um die anzeige der anzahl hinter der rubrik, die stimmte nicht.

das verrrückte: als ich soeben auf meiner website nachgesehen habe,
stimmten alle anzeigen!!!

kann es sein, das die sql-datenbank eine gewisse zeit fürs durchzählen braucht???
jedenfalls stimmt die anzahl jetzt ohne mein zutun....
mfg
markus oeder
Title: [Plugin] Batch Import
Post by: Jan on October 19, 2002, 12:36:38 PM
Die Anzhal wird eigentlich "live" bei jedem Aufruf ermittelt. Wahrscheinlich hast Du falsch geschaut oder Du warst nicht engeloggt un ein paar private Kategorien wurde nicht angezeigt oder oder oder... ;)

Gruß Jan
Title: danke
Post by: limes on October 19, 2002, 01:33:47 PM
du hast es nicht einfach mit mir *g*.
danke für die prompte antwort, aber ich war eingeloggt und alle kategorien wurden angezeigt. evtl. hat der alte schlund&partner-server doch ein bisserl zäh reagiert. das import-script ist jedenfalls erste sahne.
markus
Title: Re: [Plugin] Batch Import
Post by: Poul on October 21, 2002, 03:10:19 AM
I have a problem....

i got this : The data source path "/admin/import" seems to be incorrect!
When i try to use Batch Import.

What is wrong ?
Title: [Plugin] Batch Import
Post by: V@no on October 21, 2002, 05:45:27 AM
u have to put full path for import folder ( $data_src_path = "D:/4images/admin/import" ) in the
batch_import.php file
Title: Re: [Plugin] Batch Import
Post by: Poul on October 21, 2002, 10:07:05 AM
O.K. i think i got something wrong !

I have made a map (import) on the server where i have uploadet the images. ( 4images/admin/import )

When i go to = control panel - plugin - Batch import and submit.
It cant find the map (import)

What do i have to do ???
Where is the right place fore my map (import)
What is the right path ?
Title: [Plugin] Batch Import
Post by: Jan on October 21, 2002, 10:22:24 AM
Create a new php file in your import folder with this code in it:
Code: [Select]
<?php
echo dirname&#40;$_SERVER["PATH_TRANSLATED"&#93;&#41;;
?>

This should show you the absolute path to your import folder.

Jan
Title: [Plugin] Batch Import
Post by: Poul on October 21, 2002, 10:42:26 AM
O.K. I got it right now...

When i run batch import i got this :
-----------------------------------------------------
2 images in . Importing image 1 to 2

Import category ...
DB Error: Bad SQL Query: SELECT cat_order FROM postkortcategories 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 postkortcategories (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 (34, '', '', , 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

1. Importing image gmon.out

Warning: Unable to create './../../data/media/34/gmon.out': No such file or directory in /home/sites/site48/web/photocards/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image /gmon.out
Skipping.....

2. Importing image mxrelay

Warning: Unable to create './../../data/media/34/mxrelay': No such file or directory in /home/sites/site48/web/photocards/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image /mxrelay
Skipping.....


Import finished!
--------------------------------------------

What can i do to fix this problem ?
Title: [Plugin] Batch Import
Post by: Poul on October 21, 2002, 12:00:04 PM
O.K. I got it right........jubiiii it is working perfect.

Thanks fore the help on this.

/Poul
Title: [Plugin] Batch Import
Post by: WoodShedd on October 22, 2002, 03:45:48 AM
Today I installed 4images; very good system.

I came here to look for batch import script and here i find it. good :)

One problem, though:

I am running this on a windows server and when I enter path as this
Code: [Select]

$data_src_path = "c:\images\lake";


and run script, script tries to import all files from my c:\ directory.

Can this be fixed?

Thank you :)
Title: Re: [Plugin] Batch Import
Post by: Poul on October 22, 2002, 06:16:48 AM
I got the batch_import and it is working fine when i import images.

But i can't get the thumbnail...i got the files on my server (The thumbnails got the same name as the imagefiles)....to where do i opload the thumbnailfiles ?

I have try'ed to uploade to /data/thumbnails = not working.
I have try'ed to uploade to /data/tmp_thumbnails = not working.

I am not using the auto_thumbnailer system (i can't, no IM, GB or NetPBM on my server)

What do i do to import the thumbnail with the images ?????
Title: [Plugin] Batch Import
Post by: Jan on October 22, 2002, 08:02:12 AM
@WoodShedd:
Try to use / (slashes) instead of \ (backslahes in the path.

@Poul:
Are you talking about the batch_import.php or about the "Check new images"-function in the Control Panel.

Jan
Title: [Plugin] Batch Import
Post by: Poul on October 22, 2002, 09:08:26 AM
Quote from: jan

@Poul:
Are you talking about the batch_import.php or about the "Check new images"-function in the Control Panel.

Jan


Hi Jan

I am talking about batch_import.php

Poul
Title: [Plugin] Batch Import
Post by: Jan on October 22, 2002, 09:24:40 AM
If you upload images and thumbnails directly to the category folders (media/<cat_id> and/or thubnails/<cat_id>) you can add these images with "Check new images". Try this...

The batch_import.php is only useful if you have already a lot of images on the server.

Jan
Title: [Plugin] Batch Import
Post by: Poul on October 22, 2002, 10:46:25 AM
Quote from: Jan
If you upload images and thumbnails directly to the category folders (media/<cat_id> and/or thubnails/<cat_id>) you can add these images with "Check new images". Try this...

The batch_import.php is only useful if you have already a lot of images on the server.

Jan


OK the "Check new images" is working fine.

Thank you, Jan.
Title: [Plugin] Batch Import
Post by: WoodShedd on October 22, 2002, 06:28:12 PM
Quote from: Jan
@WoodShedd:
Try to use / (slashes) instead of \ (backslahes in the path.
Jan


Thanks, Jan, but no change :(
Title: [Plugin] Batch Import
Post by: Jan on October 22, 2002, 08:33:03 PM
Are you sure? I tried it with exact the same path on my windows system. It works...

Jan
Title: [Plugin] Batch Import
Post by: Amosnet on October 22, 2002, 10:19:31 PM
Hi Jan, erstmal tolles Script.

Kann ich nicht einfach von meiner alten Website Importieren mit diesem Script ? Alle Bilder liegen in Verzeichnissen incl. Thumbnails.

Ich habe so an die 1000 Bilder auf meiner Page und will nicht alle nochmal Uploaden, geht das irgendwie Jan ?

Vielen Dank dir
Title: [Plugin] Batch Import
Post by: Jan on October 22, 2002, 11:00:28 PM
Da Du ja hier im Beitrag gepostet hast, bist Du ja schon auf dem richtigen Weg. Jetzt musst Du nur noch das Script ausprobieren.

Jan
Title: [Plugin] Batch Import
Post by: Amosnet on October 22, 2002, 11:20:31 PM
Habe ich ja schon, und du kansst als Source leider nicht einen anderen Server/Website mit Unterverzeichnissen angeben, und genau das will ich ja.. noch eine Idee ?
Title: [Plugin] Batch Import
Post by: WoodShedd on October 23, 2002, 01:14:15 AM
Quote from: Jan
Are you sure? I tried it with exact the same path on my windows system. It works...

Jan


Yes, I'm sure.

The configuration for this appears as:
Code: [Select]

Path to the directory the image data are stored.
// No trailing slash!
$data_src_path = "c:/FoxServ/lake";
//


When I attepmt to import the images I get the following:
Quote

1. Importing image AUTOEXEC.BAT

Warning: Unable to create './../../data/media/3/AUTOEXEC.BAT': No such file or directory in c:\foxserv\www\4images\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /AUTOEXEC.BAT
Skipping.....

2. Importing image CONFIG.SYS

Warning: Unable to create './../../data/media/3/CONFIG.SYS': No such file or directory in c:\foxserv\www\4images\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /CONFIG.SYS
Skipping.....

3. Importing image Delapp.bat

Warning: Unable to create './../../data/media/3/Delapp.bat': No such file or directory in c:\foxserv\www\4images\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /Delapp.bat
Skipping.....

4. Importing image INSTALL.LOG

Warning: Unable to create './../../data/media/3/INSTALL.LOG': No such file or directory in c:\foxserv\www\4images\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /INSTALL.LOG
Skipping.....

5. Importing image IO.SYS

Warning: Unable to create './../../data/media/3/IO.SYS': No such file or directory in c:\foxserv\www\4images\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /IO.SYS
Skipping.....

6. Importing image MSDOS.SYS

Warning: Unable to create './../../data/media/3/MSDOS.SYS': No such file or directory in c:\foxserv\www\4images\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /MSDOS.SYS
Skipping.....


and it continues on and on.

I'm not sure what to do.
Title: [Plugin] Batch Import
Post by: Jan on October 23, 2002, 08:37:53 AM
@Amosnet:
Nein da geht nicht. Das Script kann keine Dateien von einem auf den andere Server transferieren.

@WoodShedd:
Strange...last chance, try to use a relativ path.
Code: [Select]
$data_src_path = "../../../lake";

Jan
Title: [Plugin] Batch Import
Post by: Amosnet on October 23, 2002, 09:16:04 AM
Ich würde gerne nicht immer die Variable data_src_path = in deinem Script eingeben, sondern in der Weboberfläche, ist das möglich?
Title: [Plugin] Batch Import
Post by: Jan on October 23, 2002, 09:22:20 AM
Das Script ist eigentlich nur für einmalige Imports gedacht. Wenn Du regelmässig Dateien per FTP uploaden willst, kannst Du sie in die Kategorie-Ordner laden und dann per "neue Bilder checken" hinzufügen.

Jan
Title: [Plugin] Batch Import
Post by: Scene on October 25, 2002, 05:57:55 PM
Bei mir kommt immer:

15 images in . Importing image 1 to 15

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 (2, '', '', , 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

1. Importing image .domains

Warning: Unable to create './../../data/media/2/.domains': No such file or directory in D:\wampp13a\htdocs\gallary\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /.domains
Skipping.....

2. Importing image .htaccess

Warning: Unable to create './../../data/media/2/.htaccess': No such file or directory in D:\wampp13a\htdocs\gallary\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /.htaccess
Skipping.....

3. Importing image .passwd

Warning: Unable to create './../../data/media/2/.passwd': No such file or directory in D:\wampp13a\htdocs\gallary\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /.passwd
Skipping.....

4. Importing image .password

Warning: Unable to create './../../data/media/2/.password': No such file or directory in D:\wampp13a\htdocs\gallary\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /.password
Skipping.....

5. Importing image Bilder der heiligen Drachen.doc

Warning: Unable to create './../../data/media/2/Bilder der heiligen Drachen.doc': No such file or directory in D:\wampp13a\htdocs\gallary\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /Bilder der heiligen Drachen.doc
Skipping.....

6. Importing image DRAGONBALL GT-Die sieben Heiligen Drachen.doc

Warning: Unable to create './../../data/media/2/DRAGONBALL GT-Die sieben Heiligen Drachen.doc': No such file or directory in D:\wampp13a\htdocs\gallary\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /DRAGONBALL GT-Die sieben Heiligen Drachen.doc
Skipping.....

7. Importing image Dragonball-TV-Guide.doc

Warning: Unable to create './../../data/media/2/Dragonball-TV-Guide.doc': No such file or directory in D:\wampp13a\htdocs\gallary\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /Dragonball-TV-Guide.doc
Skipping.....

8. Importing image Dragonball.doc

Warning: Unable to create './../../data/media/2/Dragonball.doc': No such file or directory in D:\wampp13a\htdocs\gallary\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /Dragonball.doc
Skipping.....

9. Importing image batch_import.php

Warning: Unable to create './../../data/media/2/batch_import.php': No such file or directory in D:\wampp13a\htdocs\gallary\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /batch_import.php
Skipping.....

10. Importing image bg.gif

Warning: Unable to create './../../data/media/2/bg.gif': No such file or directory in D:\wampp13a\htdocs\gallary\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /bg.gif
Skipping.....

11. Importing image new_name.exe

Warning: Unable to create './../../data/media/2/new_name.exe': No such file or directory in D:\wampp13a\htdocs\gallary\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /new_name.exe
Skipping.....

12. Importing image newname.ini

Warning: Unable to create './../../data/media/2/newname.ini': No such file or directory in D:\wampp13a\htdocs\gallary\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /newname.ini
Skipping.....

13. Importing image tca.nfo

Warning: Unable to create './../../data/media/2/tca.nfo': No such file or directory in D:\wampp13a\htdocs\gallary\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /tca.nfo
Skipping.....

14. Importing image tn_DBZ_2 Image.jpg

Warning: Unable to create './../../data/media/2/tn_DBZ_2 Image.jpg': No such file or directory in D:\wampp13a\htdocs\gallary\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /tn_DBZ_2 Image.jpg
Skipping.....

15. Importing image whats_new.txt

Warning: Unable to create './../../data/media/2/whats_new.txt': No such file or directory in D:\wampp13a\htdocs\gallary\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /whats_new.txt
Skipping.....


Import finished!


Ich weis nicht mehr weiter :( Ich hab alles was hier steht ausprobiert hat scheinbar nichts gebracht :(
Title: Problem please help
Post by: Lucas on October 27, 2002, 11:26:25 AM
I am getting this little problem when trying to batch import
Quote
9 images in . Importing image 1 to 9

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 (1, '', '', , 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

1. Importing image AUTOEXEC.BAT

Warning: Unable to create './../../data/media/1/AUTOEXEC.BAT': No such file or directory in c:\internet\www.portaldaweb.com\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /AUTOEXEC.BAT
Skipping.....

2. Importing image Bootfont.bin

Warning: Unable to create './../../data/media/1/Bootfont.bin': No such file or directory in c:\internet\www.portaldaweb.com\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /Bootfont.bin
Skipping.....

3. Importing image CONFIG.SYS

Warning: Unable to create './../../data/media/1/CONFIG.SYS': No such file or directory in c:\internet\www.portaldaweb.com\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /CONFIG.SYS
Skipping.....

4. Importing image IO.SYS

Warning: Unable to create './../../data/media/1/IO.SYS': No such file or directory in c:\internet\www.portaldaweb.com\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /IO.SYS
Skipping.....

5. Importing image MSDOS.SYS

Warning: Unable to create './../../data/media/1/MSDOS.SYS': No such file or directory in c:\internet\www.portaldaweb.com\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /MSDOS.SYS
Skipping.....

6. Importing image NTDETECT.COM

Warning: Unable to create './../../data/media/1/NTDETECT.COM': No such file or directory in c:\internet\www.portaldaweb.com\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /NTDETECT.COM
Skipping.....

7. Importing image boot.ini

Warning: Unable to create './../../data/media/1/boot.ini': No such file or directory in c:\internet\www.portaldaweb.com\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /boot.ini
Skipping.....

8. Importing image ntldr

Warning: Unable to create './../../data/media/1/ntldr': No such file or directory in c:\internet\www.portaldaweb.com\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /ntldr
Skipping.....

9. Importing image pagefile.sys

Warning: Unable to open '/pagefile.sys' for reading: Permission denied in c:\internet\www.portaldaweb.com\admin\plugins\batch_import.php on line 122
Copy Image: Error while copying image /pagefile.sys
Skipping.....


Import finished!



used this path
Code: [Select]
$data_src_path = "c:/internet/www.portaldaweb.com/admin/plugins/fotos";
And a relative one and nothing changes.....
Can any one help me


Thanks in advance

Lucas Nishimura - hacker@lucnet.cjb.net
Title: [Plugin] Batch Import
Post by: camerino on November 01, 2002, 08:18:53 PM
Hallo Jan,

ich wollte einfach nur eins sagen:" Suuuuuuuuuuuuuper - Script"

Danke an Jan
Title: batch error
Post by: boxerbay on November 02, 2002, 01:36:03 AM
I get this error:

The data source path "/path/to/images/folder" seems to be incorrect!

what am i supposed to set this to?
Title: [Plugin] Batch Import
Post by: Poptard on November 07, 2002, 01:52:47 AM
set it to where your images or folders of images you want to add are located.
Title: Re: Fatal error:...on line 29
Post by: paulmc on November 07, 2002, 06:59:02 PM
Here is what I did to solve the:

"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"

Just add another directory level on the line

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

change to

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

Works fine now. BTW I'm running 4images on Mac OS X.

Paul
Title: BATCH IMPORT /Paths/ & Thumbnails On-The-Fly
Post by: vynum on November 14, 2002, 06:49:45 AM
I have a directory structure similar to this below:

x:\Galleries
x:\Galleries\Cars
x:\Galleries\Cars\Honda
x:\Galleries\Cars\Ford
x:\Galleries\Trucks
x:\Galleries\Trucks\Honda
x:\Galleries\Trucks\Ford

This is just an example. But I wish the 4images script could do something similar to, and I quote

Quote from: Jan
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.


But a little different. Can I make it recursively search through folders and subfolders and automatically create Catagories and Subcatagories but not import the images? I would like to leave the images exactly were they are. Which by the way is "out of Server_Root".  I would however like the script to continue on an automatically create thumbnails ON THE FLY. to the clients web browser. Example. Lets say I have 750 images in 7 diff catagories and tonight I add another 250 to various cats, Is it possible to make the script "on the fly" 1. read the directory tree and 2. report to the client how many 'new' images have been added, since such and such date and to what catagories received these images?

This does 2 things. First, An admin would never have to scan and do updates everytime he/she adds new images.  Since I add on a regular basis.  Second, when visitors enter the website they will notice instantly if 'new' images has been added, the count & date.

 :idea: ON THE FLY - Performance

 :arrow: Recursively search folders & subfolders
 :arrow: Update database
 :arrow: Send to client's Browser instantly changes & updates etc.
 :arrow: Send Email to Registered or Non-Registered thru Admin Selection any changes or addions to the gallery with the count of images and to what catagories etc. thru a Email_change_template.php module.
 

vynum

P.S. The most important thing I want to do right now is get ImageMagic or NetPBM to Auto thumbnail the images. Yep I've read the BBS and haven't been successfully yet. And Lastly perform what has been explained above. :lol:
Title: Batch Import Plugin - Sugggestion
Post by: vynum on November 14, 2002, 07:26:56 AM
// As default, the script will only copy the image files
// from your source folders to the 4images folders.
// After import you will have your image data twice on
// your server.
// If you have not enough server space set this to 1.
// Then the script will move the image files.
// Be carefully with this, your data could be lost!!!
$move_image_files = 0;

Is it possible to do something like this?

$leave_image_Files = 3;

Or

$image_src_files = "/path/to/image/gallery/folder/&/subfolders"


Another words I would like to leave my 10 GIGS of images in one spot.

Moving this much data on a alpha/beta script is too risky for me. 8O

Now all my images galleries are in one /main folder but are broken up
into subs and more subs etc..

It would be nice however, to have an option in the Admin section to
have multiple data source directories. You would might have to form
an array or somthing. Another words have more than one data source.

This way I could have images in:

C:\Gallery\gal_001
C:\Gallery\gal_002
D:\Gallery\junkpics
E:\Gallery\Familypics

Without moving or copied. Just leave them there and let the script read
there locations.

vynum





vynum
Title: [Plugin] Batch Import
Post by: Jan on November 14, 2002, 03:23:28 PM
No, at the moment thats not possible.

Jan
Title: [Plugin] Batch Import
Post by: mblond on November 14, 2002, 09:06:18 PM
Every time I try to import images I get these errors.  Has anyone else had this problem?  if so could you please provide some guidance.  Thank you.

My config:
$data_src_path = "/var/www/html/photo/album/admin/plugins";
everything else is default.

What I have tried:
changing the directory for batch import to several different locations
verification of path for batch import. Using external php file provided by Jan.
-changing permissions
-verfied database fields

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 (134, '', '', , 10, 3, 3, 3, 3, 3, 3, 3, 3, 9)
You have an error in your SQL syntax near ' 10, 3, 3, 3, 3, 3, 3, 3, 3, 9)' at line 4
FAILED

1. Importing image .autofsck

Warning: Unable to create './../../data/media/134/.autofsck': No such file or directory in /home/photo/photo/album/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image /.autofsck
Skipping.....

2. Importing image .memdump

Warning: Unable to create './../../data/media/134/.memdump': No such file or directory in /home/photo/photo/album/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image /.memdump
Skipping.....

3. Importing image core

Warning: Unable to open '/core' for reading: Permission denied in /home/photo/photo/album/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image /core
Skipping.....


Import finished!

Thanks again for any help.

Hmmm ..... Maybe I missed something.
In order for this to work you have to upload a full directory with the images contained within that directory.  -- Even better.
I was uploading just the images.

I will leave this post up in the event someone else has this same problem.
Title: [Plugin] Batch Import
Post by: mblond on November 14, 2002, 10:03:46 PM
I would like to be able to insert a user id from within the control panel rather than having a default_user_id in the php script this way I can change the userid for the each batch of images being uploaded.  Without having to edit the php file each time.

I have programming experience but am just getting familiar with php any help in getting this done would be greatly appreciated.

Thank you.
Title: [Plugin] Batch Import
Post by: mblond on November 14, 2002, 11:12:29 PM
Quote from: mblond
I would like to be able to insert a user id from within the control panel rather than having a default_user_id in the php script this way I can change the userid for the each batch of images being uploaded.  Without having to edit the php file each time.

I have programming experience but am just getting familiar with php any help in getting this done would be greatly appreciated.

Thank you.


I figured out how to do this let me know if you are interested, if there seems to be interest I will post it.
Title: Re: Fatal error:...on line 29
Post by: vynum on November 15, 2002, 05:54:56 AM
Quote from: paulmc
Here is what I did to solve the:

"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"

Just add another directory level on the line

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

change to

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

Works fine now. BTW I'm running 4images on Mac OS X.

Paul


Ok, I got only 2 problems so far. One is when I was in control panel and clicked on the batch thingy....nothin happened. Then I saw this about add another forwared slash "./" and I did and it worked, well kinda, the control panel now finds the script and I can run it and import images BUT, and this is a big BUT. Take a look at what happend:

CREATED A NEW IMAGE LOCATION FOR TESTING:

C:\IMAGES - simple huh?
Then I created a sub-folder
C:\IMAGES\GAL1

I have 7 images in both folders, thats it.

Heres were the scripts kinda screws up. When I click to import it goes straight to the subfolder "\GAL1" and imports those images while skipping what was in the Parent' folder.

Why? my data source path is like this:

$data_src_path = "C:\IMAGES";

 :idea:  Heres a good idea.. why not make it so when were in the control panel, have a blank text box so we can simply type in the path there instead of having to open up import_batch.php all the time.


--------------SNIPPET
I didn't put anything in the sub folder variable because I wanted it to scan all folders and subs:
// subfolder:  If you images are stored in a subfolder,
//             set the folder name here. Example: "thumbnails/"
//             Optional, can be left blank

"subfolder"  => "", <- LEFT IT LIKE THIS

If I have subs do I suppose to fill in the  "" with a path like
"C:\IMAGES\GAL1
?

Secon problem. I can't get Imagemagic or NetPBM to work.

I place the extra \convert.exe at the end of the path and contral panel
sees it now, but when I do an "autothumbnail, the script finds all my
images very well, but when I go to execute to autocreate thumbnail
I get:

Create thumbnail for: Big Ass (quake00.jpg) ....  
   Error creating thumbnail!


Create thumbnail for: stupid ass (quake00_2.jpg) ....  
   Error creating thumbnail!


Create thumbnail for: quake12 (quake12.gif) ....  
   Error creating thumbnail!


Create thumbnail for: quake11 (quake11.gif) ....  
   Error creating thumbnail!


Create thumbnail for: quake10 (quake10.gif) ....  
   Error creating thumbnail!


Create thumbnail for: quake09 (quake09.gif) ....  
   Error creating thumbnail!


Create thumbnail for: quake08 (quake08.gif) ....  
   Error creating thumbnail!


Create thumbnail for: quake07 (quake07.gif) ....  
   Error creating thumbnail!


Create thumbnail for: quake13 (quake13.gif) ....  
   Error creating thumbnail!


Create thumbnail for: quake07 (quake07.gif) ....  
   Error creating thumbnail!



Well those are the only two major problems I have other than the fact I can't send mail. I dont have SMTP selected, I just wanta use PHP to do it. I haven't got to the part yet but if anyone wants to indulge on telling me I need to go to my PHP.INI and do something that'll be great.

vynum
Title: [Plugin] Batch Import
Post by: Arura on November 16, 2002, 06:12:38 AM
mblond,
since many people encounter those error messages, including me, I hope you can post your solutions to them.

Best regards
Arura
Title: [Plugin] Batch Import
Post by: mblond on November 16, 2002, 08:00:16 PM
Quote from: Arura
mblond,
since many people encounter those error messages, including me, I hope you can post your solutions to them.

Best regards
Arura


Arura,
I assume you are talking about the error messages listed from my post
Posted: 14.11.2002, 21:06.

At the end of this post I say:
Quote
Hmmm ..... Maybe I missed something.
In order for this to work you have to upload a full directory with the images contained within that directory. -- Even better.
I was uploading just the images.

I will leave this post up in the event someone else has this same problem.

Recap:  
Lessons Learned: You must upload a full directory into your admin/plugins
directory, or the location designated by you in variable:  
Code: [Select]
$data_src_path if you just upload images into the admin/plugins directory then you will get the errors I recieved.
Hope this clarifies.

If this does not help, post your particular problem.
Title: Confusing
Post by: vynum on November 17, 2002, 01:33:57 AM
I know that this "batch_import" script that Jan released is "beta" and it is a 'quickfix' for people who want to batch. But I do think it would make things a lot simpler if we could place images in a certain directory, whether via upload or Local folders and have a place in the Control pane were we could type in a /path/to/images or {browse} to a local folder etc. It is my understanding so far is that all the script needs to really know is were the images reside so it can either 1.move or 2copy the images to its new location under the /4images/*/ folder. Its this /*/ folder I have questions about in the $data_src_path = "/path/to/images"

It would just be alot eaiser in a batch process to be able to:

1.select source files (weather via ftp,http://URL or /local/path)
2.select destination to store (weather via ftp,http://URL or /local/path)
3.select in control panel a.)look for new images b.) autothumbnail

Its this manual autothumbnail via ImageMagic or NetPBM thats kinda lame. I think, and I again I suggested this ealier, The script should be wrote so that you can simply have /your/images somewere and Never Ever have to create a single thumbnail and have the script autothumbnail directly to the clients browser. You never wouldhave to have a /thumbnail folder.

By far I'm impressed with 4images I just cant wait until it reaches the abilities of ImageFolio
http://www.imagefolio.com/
Title: [Plugin] Batch Import
Post by: Lucas on December 07, 2002, 10:05:53 AM
Quote from: mblond
Quote from: mblond
I would like to be able to insert a user id from within the control panel rather than having a default_user_id in the php script this way I can change the userid for the each batch of images being uploaded.  Without having to edit the php file each time.

I have programming experience but am just getting familiar with php any help in getting this done would be greatly appreciated.

Thank you.


I figured out how to do this let me know if you are interested, if there seems to be interest I will post it.

Please i am getting the same problem u did how can i fix it?
Title: import_php
Post by: sticky on December 20, 2002, 10:47:22 AM
hallo jan!
das script funktioniert super, aber ein problem hab ich noch mit den thumbnails.

ich habe zb ein verzeichnis mit den bildern und den thumbnails ... ABER die tumbnails beginnen mit TN_xxxxxx? wie kann ich das am besten lösen, damit ich das import script verwenden kann und er auch die thumbnails übernimmt?

danke
sticky
Title: [Plugin] Batch Import
Post by: Jan on December 20, 2002, 11:31:33 AM
Das kannst Du einstellen:
Code: [Select]
$thumbnail_options = array(
  "prefix"     => "",
  "suffix"     => "",  
  "subfolder"  => "",
  "extensions" => array("jpg", "JPG", "jpeg", "JPEG", "gif", "GIF", "png", "PNG")
);

Bei "prefix" kannst Du "TN_" eintragen.

Jan
Title: [Plugin] Batch Import
Post by: sticky on December 20, 2002, 01:16:54 PM
hi jan!
tnx .... hab ich echt übersehen ;)
danke... funktioniert nun wunderbar

muss sagen, echt geniales script!
Title: Re: Warning: open_basedir restriction in effect
Post by: TheOne on December 23, 2002, 08:04:30 PM
Quote from: Seatboy

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 ?


hmmm...i got this error as well. I tried moving the image folder inside the plugins folder and it still could not work. Can someone please help me. Thanx!!
Title: [Plugin] Batch Import
Post by: Jan on December 30, 2002, 09:05:55 AM
The folder structure should be:

Code: [Select]
import_folder
- category1_folder
  - image1.jpg
  - image2.jpg
- category2_folder
  - image1.jpg
  - image2.jpg

Be sure that there are no image files in the folder "import_folder".

Jan
Title: Re: Warning: open_basedir restriction in effect
Post by: bluegirls on January 03, 2003, 05:34:20 PM
Quote from: TheOne
Quote from: Seatboy

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 ?


hmmm...i got this error as well. I tried moving the image folder inside the plugins folder and it still could not work. Can someone please help me. Thanx!!

i got the same error.moved the folder to be imported to plugins folder but no diffrence.
where this folder import_folder be located
Title: [Plugin] Batch Import
Post by: Jan on January 03, 2003, 06:48:17 PM
Thats the folder you should create on your server and place the category folders in it.

Jan
Title: [Plugin] Batch Import
Post by: bluegirls on January 03, 2003, 07:24:55 PM
Quote from: Jan
Thats the folder you should create on your server and place the category folders in it.

Jan

oh thnkx got it working. but it do not automatically creat any thumbnails with the default setting. is it supposed to creat auto thumbs .or must make thumbs manually ?
Title: [Plugin] Batch Import
Post by: V@no on January 03, 2003, 07:59:50 PM
u can batch import images together with thumbnails (need correct batch import settings), or click on "auto thumbnails" after u import the images.
Title: great
Post by: bluegirls on January 04, 2003, 06:00:40 AM
great ,thnx a lot ,
Title: [Plugin] Batch Import
Post by: julien on January 08, 2003, 01:07:54 PM
Hey !

What file must I use for batch_import fixed ?????

Is the first file of the first post of thisthread is ok or not ????
Title: [Plugin] Batch Import
Post by: Jan on January 08, 2003, 02:29:19 PM
Yes, the file from the first post is the right one.

Jan
Title: [Plugin] Batch Import
Post by: julien on January 08, 2003, 05:31:41 PM
Ok Jan :)

Thank you very much!
Title: [Plugin] Batch Import
Post by: PaulC2K on February 07, 2003, 07:45:54 PM
Hi,

Can someone help me with this error please:

I've changed the path line to $data_src_path = "../../../../gallery";
which is the online folder where the images are stored.
That is the ONLY thing that i've edited in the whole of the batch_import.php file

The error im getting is:
Quote
5 images in 911gt1. Importing image 1 to 5

Import category 911gt1 ...
Warning: mkdir() failed (Permission denied) in /home/spazstix/public_html/php/gallery/admin/plugins/batch_import.php on line 367

Warning: mkdir() failed (Permission denied) in /home/spazstix/public_html/php/gallery/admin/plugins/batch_import.php on line 368
OK

1. Importing image frame.htm

Warning: Unable to create './../../data/media/66/frame.htm': No such file or directory in /home/spazstix/public_html/php/gallery/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image ../../../../gallery/911gt1/frame.htm
Skipping.....

2. Importing image left.htm

Warning: Unable to create './../../data/media/66/left.htm': No such file or directory in /home/spazstix/public_html/php/gallery/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image ../../../../gallery/911gt1/left.htm
Skipping.....

3. Importing image photos.html

Warning: Unable to create './../../data/media/66/photos.html': No such file or directory in /home/spazstix/public_html/php/gallery/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image ../../../../gallery/911gt1/photos.html
Skipping.....

4. Importing image right.htm

Warning: Unable to create './../../data/media/66/right.htm': No such file or directory in /home/spazstix/public_html/php/gallery/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image ../../../../gallery/911gt1/right.htm
Skipping.....

5. Importing image top.htm

Warning: Unable to create './../../data/media/66/top.htm': No such file or directory in /home/spazstix/public_html/php/gallery/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image ../../../../gallery/911gt1/top.htm
Skipping.....


All thats in that folder is html files

however, in the /pics folder to that one, i have a bunch of photos which i want in the gallery.
This errors:
Quote
Import category pics (Parent category: 911gt1) ...
Warning: mkdir() failed (Permission denied) in /home/spazstix/public_html/php/gallery/admin/plugins/batch_import.php on line 367

Warning: mkdir() failed (Permission denied) in /home/spazstix/public_html/php/gallery/admin/plugins/batch_import.php on line 368
OK

1. Importing image 1-133.jpg

Warning: Unable to create './../../data/media/67/1-133.jpg': No such file or directory in /home/spazstix/public_html/php/gallery/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image ../../../../gallery/911gt1/pics/1-133.jpg
Skipping.....

2. Importing image 1-320.jpg

Warning: Unable to create './../../data/media/67/1-320.jpg': No such file or directory in /home/spazstix/public_html/php/gallery/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image ../../../../gallery/911gt1/pics/1-320.jpg
Skipping.....

3. Importing image 1-800.jpg

Warning: Unable to create './../../data/media/67/1-800.jpg': No such file or directory in /home/spazstix/public_html/php/gallery/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image ../../../../gallery/911gt1/pics/1-800.jpg
Skipping.....

4. Importing image 2-133.jpg

Warning: Unable to create './../../data/media/67/2-133.jpg': No such file or directory in /home/spazstix/public_html/php/gallery/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image ../../../../gallery/911gt1/pics/2-133.jpg
Skipping.....

5. Importing image 2-320.jpg

Warning: Unable to create './../../data/media/67/2-320.jpg': No such file or directory in /home/spazstix/public_html/php/gallery/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image ../../../../gallery/911gt1/pics/2-320.jpg
Skipping.....


And its exactly the same for a dozen of these folders until it gets to the end.
It creates the folders, but obviously doesnt put the images in there.

Can anyone help me out on this?
Ive seen a few people with this 'line 122' error, but no english reply, so i've not been able to use the previous posts to this problem

Many thanks in advance

PaulC2K
Title: [Plugin] Batch Import
Post by: PaulC2K on February 07, 2003, 07:53:18 PM
if its any help, the folder i want to use is:
http://www.spazstix.com/gallery (it wont accept this address, why is that??)

and the addres for batch_import.php is:
http://www.spazstix.com/php/gallery/admin/plugins/batch_import.php

Any ideas?

Great plugin btw, i just wish it was working for me :(
Title: Batch Import ist super - aber download_url fehlt
Post by: hellraiser128 on February 13, 2003, 05:15:59 PM
Ich arbeite vorzugsweise mit dem batch_import script und bin sehr zufrieden.
Was mir fehlt ist der automatische Eintrag der download_url in die Datenbank. Z.B. ./data/media/cat-id/image_name.jpg , damit beim download das große Bild geladen wird und nicht das Thumbnail.
Das müßte doch mit batch_import zu bewerkstelligen sein - oder?
Title: [Plugin] Batch Import
Post by: Jan on February 13, 2003, 06:37:57 PM
Standardmässig wird doch beim Download das normale Bild genommen  :?:

Jan
Title: [Plugin] Batch Import
Post by: hellraiser128 on February 13, 2003, 06:51:57 PM
Oweia- jetzt hab ich mich aber blamiert :roll:
Habe das ganze mehrfach ausprobiert - und irgendwie wurden immer die thumbnails downgeloadet. Gerade habe ich es online getested und siehe da-es funktioniert.
Trotzdem danke
Reidar
Title: [Plugin] Batch Import
Post by: Philip L. on February 20, 2003, 07:06:16 PM
Hi,

I have tried the version 1.7 and I find it very good.

I am using it for my college where my class can post their pictures from different college trips.

I wanted to use the Batch import script but it doesn't work and it just chucks a lot of error messages out.
Also it is not reading the images the correct folder.

The folder which I am using where the images are stored for the script is in the plugins folder and is called "batch_upload_files".

Here are the errors the script prints out when I try and use it:

5 images in . Importing image 1 to 5

Import category ...
DB Error: Bad SQL Query: SELECT cat_order FROM paristrip_4i_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 paristrip_4i_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 (5, '', '', , 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

1. Importing image im.tgz

Warning: Unable to create './../../data/media/5/im.tgz': No such file or directory in /path/to/batch_import.php on line 122
Copy Image: Error while copying image /im.tgz
Skipping.....

2. Importing image libupdate.tgz

Warning: Unable to create './../../data/media/5/libupdate.tgz': No such file or directory in /path/to/batch_import.php on line 122
Copy Image: Error while copying image /libupdate.tgz
Skipping.....

3. Importing image php.neu

Warning: Unable to create './../../data/media/5/php.neu': No such file or directory in /path/to/batch_import.php on line 122
Copy Image: Error while copying image /php.neu
Skipping.....

4. Importing image phpup.tgz

Warning: Unable to create './../../data/media/5/phpup.tgz': No such file or directory in /path/to/batch_import.php on line 122
Copy Image: Error while copying image /phpup.tgz
Skipping.....

5. Importing image ruby.tgz

Warning: Unable to create './../../data/media/5/ruby.tgz': No such file or directory in /path/to/batch_import.php on line 122
Copy Image: Error while copying image /ruby.tgz
Skipping.....


Import finished!



Also the script is reading "5" images but there are only "2" images in the folder.

Can you please help me.
I need this to be working because I am not very happy on uploading 300 and more pictures manually.


Philip L.
Title: [Plugin] Batch Import
Post by: Jan on February 21, 2003, 09:42:40 AM
Use this script only if you want to import image AND categories. The structure inside 'batch_upload_files' should be for example:

categoryfolder1 (folder)
- image1 (file)
- image2 (file)
categoryfolder2
- image1 (file)
- image2 (file)

The script will first create two categories ("categoryfolder1" and "categoryfolder2") and will then import the images to this categories. If you have only image in 'batch_upload_files' the import will fail!

If you want to import images only, use "Check new images" inside the Control Panel.

Jan
Title: [Plugin] Batch Import
Post by: Kamui on March 13, 2003, 08:52:52 PM
hi this is nice but. i'm sick in getting this damn error

3 images in Covers. Importing image 1 to 3

Import category Covers ... OK

1. Importing image 1.jpg

Warning: file_exists() [function.file-exists]: SAFE MODE Restriction in effect. The script whose uid is 32024 is not allowed to access /home/saiyaz/public_html/animesessions/data/media/2 owned by uid 99 in /home/saiyaz/public_html/animesessions/admin/plugins/batch_import.php on line 118

Warning: copy() [function.copy]: SAFE MODE Restriction in effect. The script whose uid is 32024 is not allowed to access /home/saiyaz/public_html/animesessions/data/media/2 owned by uid 99 in /home/saiyaz/public_html/animesessions/admin/plugins/batch_import.php on line 122

Warning: copy(./../../data/media/2/1.jpg) [function.copy]: failed to create stream: No such file or directory in /home/saiyaz/public_html/animesessions/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image /home/saiyaz/public_html/animesessions/upload/Covers/1.jpg
Skipping.....

2. Importing image 2.jpg

Warning: file_exists() [function.file-exists]: SAFE MODE Restriction in effect. The script whose uid is 32024 is not allowed to access /home/saiyaz/public_html/animesessions/data/media/2 owned by uid 99 in /home/saiyaz/public_html/animesessions/admin/plugins/batch_import.php on line 118

Warning: copy() [function.copy]: SAFE MODE Restriction in effect. The script whose uid is 32024 is not allowed to access /home/saiyaz/public_html/animesessions/data/media/2 owned by uid 99 in /home/saiyaz/public_html/animesessions/admin/plugins/batch_import.php on line 122

Warning: copy(./../../data/media/2/2.jpg) [function.copy]: failed to create stream: No such file or directory in /home/saiyaz/public_html/animesessions/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image /home/saiyaz/public_html/animesessions/upload/Covers/2.jpg
Skipping.....

3. Importing image 3.jpg

Warning: file_exists() [function.file-exists]: SAFE MODE Restriction in effect. The script whose uid is 32024 is not allowed to access /home/saiyaz/public_html/animesessions/data/media/2 owned by uid 99 in /home/saiyaz/public_html/animesessions/admin/plugins/batch_import.php on line 118

Warning: copy() [function.copy]: SAFE MODE Restriction in effect. The script whose uid is 32024 is not allowed to access /home/saiyaz/public_html/animesessions/data/media/2 owned by uid 99 in /home/saiyaz/public_html/animesessions/admin/plugins/batch_import.php on line 122

Warning: copy(./../../data/media/2/3.jpg) [function.copy]: failed to create stream: No such file or directory in /home/saiyaz/public_html/animesessions/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image /home/saiyaz/public_html/animesessions/upload/Covers/3.jpg
Skipping.....


Import finished!

[Back]


The permissions are set right n i dunno why it`s not gonna work for me.
Title: [Plugin] Batch Import
Post by: V@no on March 13, 2003, 09:09:34 PM
the main key is SAFE MODE
search the forum for the solution.
Title: batch importing plus zip linking
Post by: batman on April 01, 2003, 09:45:24 AM
Ok.. I have mastered the Batch import . Great tool. I would like to know the following.

1. all my images are linked to a specific zip file of the same name, example. baby.gif is linked to baby.zip (in same folder)
is there anyway using batch import to make the programm batch import the gif with the link to the zip file? this would be great if i could get it working.

2. I have some images online, is there a way of batch-linking -importing them BUT leaving them in the original directory ( as I have that directory passworded, I dont want none members accessing them)

Cool programme thanks
Title: [Plugin] Batch Import
Post by: andersen on May 11, 2003, 01:36:56 PM
I had follow the instruction as above. I got some error as below

====================

3 images in . Importing image 1 to 3

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 (11, '', '', , 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

1. Importing image .autofsck

Warning: Unable to create './../../data/media/11/.autofsck': No such file or directory in /home/httpd/html/bullroad/gallery/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image /.autofsck
Skipping.....

2. Importing image 7.2scsi.V2.2byBRF-RW.tar

Warning: Unable to create './../../data/media/11/7.2scsi.V2.2byBRF-RW.tar': No such file or directory in /home/httpd/html/bullroad/gallery/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image /7.2scsi.V2.2byBRF-RW.tar
Skipping.....

3. Importing image aquota.user

Warning: Unable to open '/aquota.user' for reading: Permission denied in /home/httpd/html/bullroad/gallery/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image /aquota.user
Skipping.....


Import finished!
Title: [Plugin] Batch Import
Post by: andersen on May 11, 2003, 01:47:06 PM
Mm... Problem had been solve

When I change to

/home/httpd/html/xxxxx/gallery/admin/plugins

it works!
Title: [Plugin] Batch Import
Post by: noyou on May 14, 2003, 07:10:33 AM
To Jan or V@no, I setup everything on my local machine,
go to admin->batch import, nothing came up. Just blank wite paper there, so what's the problem? :cry:
Title: [Plugin] Batch Import
Post by: Jan on May 14, 2003, 09:37:48 AM
Try to change
Code: [Select]
$root_path = (eregi("\/plugins\/", $PHP_SELF)) ? "./../../" : "./../";
to
Code: [Select]
$root_path = (eregi("\/plugins\/", $_SERVER['PHP_SELF'])) ? "./../../" : "./../";
Jan
Title: [Plugin] Batch Import
Post by: noyou on May 14, 2003, 05:51:01 PM
So if I will run this mod in a remote server instead of my own machine, the following code doesn't need to be changed, is that right?


Quote from: Jan
Try to change
Code: [Select]
$root_path = (eregi("\/plugins\/", $PHP_SELF)) ? "./../../" : "./../";
to
Code: [Select]
$root_path = (eregi("\/plugins\/", $_SERVER['PHP_SELF'])) ? "./../../" : "./../";
Jan
Title: [Plugin] Batch Import
Post by: noyou on May 14, 2003, 06:20:30 PM
Just now I tried this mod again, the page came out and use the absolute path: "c:/import" and the following error appeared:
Quote
24 images in . Importing image 1 to 24

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. Check the manual that corresponds to your MySQL server version for the right syntax to use 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 (4, '', '', , 10, 0, 0, 2, 2, 9, 0, 0, 0, 2)
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ' 10, 0, 0, 2, 2, 9, 0, 0, 0, 2)' at line 4
FAILED

1. Importing image 0501_Harcelement Au Feminin CD1.avi
Copy Image: Error while copying image /0501_Harcelement Au Feminin CD1.avi
Skipping.....

2. Importing image 0501_Harcelement Au Feminin CD2.avi
Copy Image: Error while copying image /0501_Harcelement Au Feminin CD2.avi
Skipping.....

3. Importing image 0504_La Princesse et la Pute 1.avi
Copy Image: Error while copying image /0504_La Princesse et la Pute 1.avi
Skipping.....

4. Importing image 0504_La_princesse_et_la_pute_2.avi
Copy Image: Error while copying image /0504_La_princesse_et_la_pute_2.avi
Skipping.....

5. Importing image 0504_le contrat des anges #1.avi
Copy Image: Error while copying image /0504_le contrat des anges #1.avi
Skipping.....

6. Importing image AUTOEXEC.BAT
Copy Image: Error while copying image /AUTOEXEC.BAT
Skipping.....



this error is same as buddy WoodShedd encounted (third page of this post), then I followed your suggestion change the absolute path to relative,
Quote
The data source path "../../import" seems to be incorrect!
error came out.
When I finished reading this post, follow the V@no's hint: SAFE MODE,  check my own php.ini, found that SAFE MODE is off.
So I think safe mode is not the reason, why your batch-import.php read the data from the root dir of C disk, instead of from import dir I created?

Later I change the souce dir to other location: C:/4image/import, and modified the source path in the batch-import.php. The same error came out, it still read the data from the root dir of C disk other than the path I specified. I am frustrated, what am I supposed to do now? :?
Title: [Plugin] Batch Import
Post by: noyou on May 17, 2003, 02:54:16 AM
I stick with old method, give up this new mod :(
Title: [Plugin] Batch Import
Post by: LoOpP on May 29, 2003, 10:11:05 AM
Plötzlich bekomm ich diesen fehler wenn ich das batch import script anwende um mehrere bilder vom ftp einzufügen.


Quote
This is a restriction in the php.ini. Some server are configured in this (bad) way. Try to move the folder with your images inside the plugins folder.

Jan


Ich hatte vorher auch nie probleme und meine hochgeladenen Bilder sind in /images/ im plugins folder!


bitte um Hilfe!
tobi
Title: [Plugin] Batch Import
Post by: V@no on May 29, 2003, 12:38:57 PM
sry, LoOpP, always english responce from my side ;)
if your import folder is /images/ then u need upload images into sub-folders i.e.
/images/categoryname1/
/images/categoryname2/
Title: [Plugin] Batch Import
Post by: LoOpP on May 30, 2003, 11:36:11 AM
ahhhhh
I always did it before like this but i forget it

thxxxx!
Title: [Plugin] Batch Import
Post by: Smiley on June 03, 2003, 04:01:47 PM
Sorry, hab das ganze erst seit 2-3 Stunden installiert, und versuche mir nun alles anzupassen.

Hab aber kleine probleme bei dem Batch mit der Zeile

$data_src_path = "/path/to/images/folder";

also was genau ist denn der Image Ordner, der hier rein muß ?

wäre das bei mir dann :

/domain.det/4images/data/thumbnails/  ?

oder ist da ein anderer Ordner gemeint ?



Ist dieser Batch eigentlich die einzige Möglichkeit mehrere Bilder auf einmal in die Image Gallerie zu bekommen, oder gibt es da noch anderre mittel und wege, evtl. per BrowserUpload, daß man zum Beispiel mehrere Bilder anklicken kann für eine Kategorie oder so....
Danke für die Infos !

ciao
Title: [Plugin] Batch Import
Post by: Jan on June 03, 2003, 04:21:43 PM
Der Pfad muss auf den Ordner zeigen, in dem Deine Daten liegen die Du importieren willst.

Achtung, dieses Plugin ist nicht für den täglichen Gebrauch betimmt. Es soll dabei helfen einmalig eine Ordnerstruktur (Kategorien) und darin befindliche Bilder zu importieren. Ansonsten sollte die Funktion "Neue Bilder checken" im Control Panel benutzt werden (Bilder per FTP in den Kategrorie-Ordner laden und mit dieser Funktion importieren).

Jan
Title: [Plugin] Batch Import
Post by: Smiley on June 03, 2003, 04:30:58 PM
Quote from: Jan
Der Pfad muss auf den Ordner zeigen, in dem Deine Daten liegen die Du importieren willst.

Achtung, dieses Plugin ist nicht für den täglichen Gebrauch betimmt. Es soll dabei helfen einmalig eine Ordnerstruktur (Kategorien) und darin befindliche Bilder zu importieren. Ansonsten sollte die Funktion "Neue Bilder checken" im Control Panel benutzt werden (Bilder per FTP in den Kategrorie-Ordner laden und mit dieser Funktion importieren).

Jan


Danke für die Info, dann werde ich das Plugin auch nicht brauchen da ich schon eine menge Struckturen angelegt habe.

Mit der "Bilder Checken" Funktion, daß wusste ich nicht, danke für den Hinweiß.

Da kommt aber schon wieder direkt die nächste Frage.

Ich habe 6 Kategorieen, eine davon ist Privat (versteckt).

Wo sind denn die datzgehörigen Ordner ?
ist das der Inhalt hier:
data/media/

da sehe ich Ordner von 1-6.
Brauch ich dann nur zum Beispiel in den Ordner 3 meine Bilder rein zu laden, angenommen mal so ca. 50 Stück, und mach dann die Funktion "Bilder Checken" und dann werde die Bilder angezeigt in der Gallerie ?

das wäre ja dann auch relativ einfach und Simpel :)

Allerdings, wie bekomme ich heraus, welcher Ordner für Welche kategorie ist ? Also, woher weiß ich das ordner 1 auf dem FTP zum beispiel meine "Nature" Kategorie ist, oder Ordner 2 evtl. meine Private Kategorie, dazu bräuchte ich dann bitte nochmal nen Tip, wenn der Rest den ich geschrieben habe soweit Korrekt ist.

Danke !
Title: [Plugin] Batch Import
Post by: Jan on June 03, 2003, 04:42:41 PM
Siehe: http://www.4homepages.de/forum/viewtopic.php?t=3080
Ansonsten bitte Fragen zu diesem Thema in einem eigenen Thread stellen.

Jan
Title: Batch Import Plus adding attachment file
Post by: batman1057 on June 05, 2003, 09:15:06 AM
Hi, I have got your batch import working, now Ive put the uploads in the upload folder in admin. as I was getting funny errors,
What I would like to do and know if its possible is:
when using the batch import:-
example:- I import 20 images from a folder called cars,
now what I would normally do is go and edit each image and add a download to it, so when you clicked on the download it would download a file under the same name but zip, so a gif called focus.gif , would have a zip file called focus.zip, this zip file will have several images in this zip file, it will not be the same zip you get when you clcik the first download buton, which zips up the image in display, this is an extra zip file which has lots of images of the same main image..
SO... fucus.gif, first download button (automagicaly creates a zip file of the focus.gif) the second download button normaly has a manual link to a file called focus.zip (which has numerous images in it).
What I would like to do  it when I batch import a folder of images, can I make it so i automagically creates these extra links to the bigger zip files, or do I have to manully do each one?

Please help
Title: keywords error
Post by: ll8cjh on June 09, 2003, 07:20:46 PM
beach_import
I use upload folder as keywords
of i change it like this

folder root: F:\pic\home\me\morning
keywords:  pic home me morning

it's can runsuccessful, and i can browse images with right keywords.
But i use search keywords, i can't found anything.

but i found a strang problem,
I edit a image , but change nothing, save.
After do this, it's keywords can run well.
Title: [Plugin] Batch Import
Post by: Fuztug on June 22, 2003, 10:56:51 AM
Quote
Warning: opendir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/usr/local/apache/www/web128/) in /usr/local/apache/www/web128/html/gallery/admin/plugins/batch_import.php on line 315

Warning: opendir(/): failed to open dir: Die Operation ist nicht erlaubt in /usr/local/apache/www/web128/html/gallery/admin/plugins/batch_import.php on line 315

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 (8, '', '', , 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!
What's the meaning of this?
Title: [Plugin] Batch Import
Post by: Fuztug on June 22, 2003, 12:31:44 PM
This cann't be the safe mode, cause the BATCH IMPORT of this Gallery work flawless (http://www.chezgreg.net/coppermine/index.php).

What's the matter then?
Title: [Plugin] Batch Import
Post by: V@no on June 22, 2003, 03:32:33 PM
Quote from: Fuztug
What's the meaning of this?

I'm sorry, Fuztug, no offense but are u lazzy? :roll: do u read posts at all?
case exact same error was explained on THIS VERY PAGE!!!!
Title: [Plugin] Batch Import
Post by: Fuztug on June 22, 2003, 05:45:54 PM
Nope I am not lazzy. but they are writting that it is safe mode, but It cannt be, cause the Copermine Gallery can import via bath with NO errors!

Cya, Fuz
Title: [Plugin] Batch Import
Post by: Fuztug on June 22, 2003, 10:40:24 PM
*bump*

Please help me, I am really confused now! I tried out many gallerys and all of 'em works perfekt with batch import, but only 4images does'nt!

Help!!

Thx, Fuz
Title: [Plugin] Batch Import
Post by: V@no on June 22, 2003, 11:43:40 PM
Quote from: Fuztug
but they are writting that it is safe mode

WHAT? where? who? what are u talking about? it's on 7th page of this thread, second and third replys...:roll:
Title: [Plugin] Batch Import
Post by: Jan on June 23, 2003, 04:42:24 PM
Are you sure that the folder structure is correct like described a few posts above yours?
http://www.4homepages.de/forum/viewtopic.php?p=25667#25667

Jan
Title: [Plugin] Batch Import
Post by: Fuztug on June 23, 2003, 07:47:01 PM
Well I uploadet my pictures to:

www.mydomain.com/gallery/data/batch

asdasd/asdasdA/html/gallery/data/batch is the patch but still not work!
Title: [Plugin] Batch Import
Post by: Jan on June 24, 2003, 09:07:06 AM
Are you sure that this is the abolute path to the directory? Should start with a slash...

Jan
Title: $data_src text box.
Post by: flamer on June 24, 2003, 02:22:02 PM
Hi,

Sorry, if I've missed it but can someone please tell me how to make the $data_src a text box as the location I do the batch import from is never the same.

Each time I want to do a batch import I have to ssh to webserver to edit batch_import.php.
 
I've tried to modify it myself but it's better left to those who know what they are doing as I have completely messed it up.
Title: [Plugin] Batch Import
Post by: Fuztug on June 25, 2003, 08:53:51 PM
Quote from: Jan
Are you sure that this is the abolute path to the directory? Should start with a slash...

Jan
Yes I am sure!
Title: [Plugin] Batch Import
Post by: V@no on June 25, 2003, 09:29:06 PM
Quote from: Fuztug
Quote from: Jan
Are you sure that this is the abolute path to the directory? Should start with a slash...

Jan
Yes I am sure!
are u sure u uploaded your images in SUB-FOLDERS inside your /import/ folder? maybe u should spare 10 min of your time and read replys to this mod, it was explained few times already
Title: [Plugin] Batch Import
Post by: Fuztug on June 27, 2003, 06:13:25 PM
Quote from: V@no
Quote from: Fuztug
Quote from: Jan
Are you sure that this is the abolute path to the directory? Should start with a slash...

Jan
Yes I am sure!
are u sure u uploaded your images in SUB-FOLDERS inside your /import/ folder? maybe u should spare 10 min of your time and read replys to this mod, it was explained few times already
YES I DID IT!
Title: Re: [Plugin] Batch Import
Post by: aardid on May 27, 2005, 01:59:59 PM
can you helpme ?

when i do it ...

Quote
The data source path "/public_html/galeria/4images/admin/images" seems to be incorrect!



Title: Re: [Plugin] Batch Import
Post by: exxodus on May 30, 2005, 09:28:46 AM
Download link on 1st page is broken !

Where did i find this script ?
Title: Re: [Plugin] Batch Import
Post by: V@no on May 30, 2005, 09:38:42 AM
Download link on 1st page is broken !

Where did i find this script ?

its fixed now.

P.S. sometimes try look in the address bar, its not too difficult to guess what is wrong with the url ;)
Title: Re: [Plugin] Batch Import
Post by: KingRalph on July 14, 2005, 05:45:31 PM
Moin.
Ich bin ganz neu und verstehe es nicht! Hab nun das ganze Forum abgeklappert, ob ich eine Hilfe finde, meine Bilder nicht alle umständlich über das Template hochladen zu müssen (sind Bilder eines  Verbandes, sind viele geworden).
Gehts mit batch_import? wenn ja, was gebe ich als data_src_path an?? einen ort, wo die bilder auf meiner festplatte sind oder einen ort auf einem server???? ich raff es nicht und hoffe auf nachsichtige hilfe für einen anfänger....!

LG

KingRalph
Title: Re: [Plugin] Batch Import
Post by: Jan on July 15, 2005, 05:17:03 PM
FAQ: http://www.4homepages.de/forum/index.php?topic=3080.0
Title: Re: [Plugin] Batch Import
Post by: KingRalph on July 20, 2005, 03:01:37 PM
Hallo.
Das hatte ich auch schon gefunden. Per FTP klappt das auch alles ganz gut, ABER:

Ich habe in dem Verzeichnis, in das mehrere Personen die Bilder uploaden per FTP und möchte sie nun importieren in eine bestimmte Kategorie. Aber wie?

Was gebe ich denn bei batch_import für einen Pfad an, wenn der ordner unter funpics liegt und user_x heisst? oder geht das gar nicht?????

Gruß

KINGRALPH
Title: Re: [Plugin] Batch Import
Post by: JoergM on August 29, 2005, 12:26:23 PM
Quote
Warning: main(./../www/paparazzis/admin/admin_global.php): failed to open stream: No such file or directory in /is/htdocs/wp1013410_0O1U1MH7Y5/www/paparazzis/admin/plugins/batch_import.php on line 29

Warning: main(./../www/paparazzis/admin/admin_global.php): failed to open stream: No such file or directory in /is/htdocs/wp1013410_0O1U1MH7Y5/www/paparazzis/admin/plugins/batch_import.php on line 29

Fatal error: main(): Failed opening required './../www/paparazzis/admin/admin_global.php' (include_path='./:/usr/share/pear/php4/') in /is/htdocs/wp1013410_0O1U1MH7Y5/www/paparazzis/admin/plugins/batch_import.php on line 29

Diese fehlermeldung bekomme ich wen ich das Script über den admin bereich aufrufe!

An 29 Steht:

Code: [Select]
require(ROOT_PATH.'www/paparazzis/admin/admin_global.php');
Also das Selbe wie z.B. beim Clear Cache Plugin, trotzdem geht es nicht, woran kann das noch liegen?
Title: Re: [Plugin] Batch Import
Post by: Jan on August 29, 2005, 04:02:57 PM
Das ist falsch. Da müsste stehen:

Code: [Select]
require(ROOT_PATH.'admin/admin_global.php');
Title: Re: [Plugin] Batch Import
Post by: JoergM on August 29, 2005, 11:39:12 PM
Das ist falsch. Da müsste stehen:

Code: [Select]
require(ROOT_PATH.'admin/admin_global.php');

Habe ich gemacht, gleiche Fehlermeldung
Title: Re: [Plugin] Batch Import
Post by: Jan on August 31, 2005, 01:26:32 PM
Glaube ich nicht, dass Du die gleiche Fehlermeldung bekommst. :roll:

Ändere mal
Code: [Select]
$root_path = (eregi("\/plugins\/", $PHP_SELF)) ? "./../../" : "./../";zu
Code: [Select]
$root_path = (!eregi("\/plugins\/", $_SERVER['PHP_SELF'])) ? "./../" : "./../../";
Title: Re: [Plugin] Batch Import
Post by: iban on September 06, 2005, 11:57:15 PM
I have made a MOD to this plugin (I did not know if I had to post that here... sorry...)

In order to import the "DateTime" of the image (not the datetime of the file)....
May be you have to apply first this [Mod] EXIF 0.3(click on me) (http://www.4homepages.de/forum/index.php?topic=3274.0)

Open the ./admin/plugings/batch_import.php file and find:
Quote
$image_date = ($use_image_filemtime) ? filemtime($dir_array[$cat]['cat_path']."/".$file) : time();

And replace by:
Quote
      if ((exif_imagetype($dir_array[$cat]['cat_path']."/".$file))!=FALSE) {

        $exif = read_exif_data ($dir_array[$cat]['cat_path']."/".$file);

        $date="";

        if (isset($exif['DateTimeOriginal']))
           $date=$exif['DateTimeOriginal'];
        if (empty($date) && isset($exif['DateTime']))
           $date=$exif['DateTime'];

        if (!empty($date)) {
           $date=split(':',str_replace(' ',':',$date));
           $date="{$date[0]}-{$date[1]}-{$date[2]} {$date[3]}:{$date[4]}:{$date[5]}";
           $image_date=strtotime($date);
        } else {
           $image_date = ($use_image_filemtime) ? filemtime($dir_array[$cat]['cat_path']."/".$file) : time();
        }
      } else {
        $image_date = ($use_image_filemtime) ? filemtime($dir_array[$cat]['cat_path']."/".$file) : time();
      }
Title: Re: [Plugin] Batch Import
Post by: batman1056 on September 09, 2005, 06:14:58 PM
can anyone help.. just used this script on my gallery and its takeing ages to do it, i.e. 5000 images and hes been addign tehm slowly for over 9 hours, I contact my hosting provider who said:

Is this script your running in php? Last August 31st, 2005, our PHP
configuration has been changed to have register_globals off by default. we
are
changing the default register_globals setting for security reasons. Since
the
4.2.0 release of php the default value for register_globals has been "Off"

So my question is when running this script do I need register_globals ON?

HELP.. this batch add is taking ages... or is it just my host?
Title: Re: [Plugin] Batch Import
Post by: memet on November 14, 2005, 01:31:40 AM
ich habe auch eine problem mid diesem addon,

Warning: opendir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/srv/www/htdocs/web1/:/srv/www/htdocs/phpMyAdmin/:/srv/www/htdocs/confixx/html/gesperrt/) in /srv/www/htdocs/web1/html/e-kart/admin/plugins/batch_import.php on line 314

Warning: opendir(/): failed to open dir: Operation not permitted in /srv/www/htdocs/web1/html/e-kart/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. Check the manual that corresponds to your MySQL server version for the right syntax to use 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 (869, '', '', , 10, 2, 2, 2, 2, 9, 2, 2, 2, 2)
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ' 10, 2, 2, 2, 2, 9, 2, 2, 2, 2)' at line 4
Fehler!


Import beendet!

Hier steht :/srv/www/htdocs/confixx/html/gesperrt/)  ich habe einen root server,dises ordner hatte ich selber erstelt für meine gesperrte kunden.

Ich dache das hat mit dem ordner zu tuhn,Deshalb habe ich das ordnergelöscht,leider immer noch dieses problem

ich danke im vorraus.

mfg

Title: Re: [Plugin] Batch Import
Post by: memet on November 22, 2005, 10:18:10 AM
geiler support  8O wauwww
Title: Re: [Plugin] Batch Import
Post by: himu on February 06, 2006, 01:12:07 PM
Thanks! Jan,
Excellent Mod and the most easyest to implement.  :D

couple of things.
I can't import new images on to existing category or import a new sub-category under an existing category.
it would have been nice if we could integrate the auto-thumbnailer and batch annotate with this mod.

thanks again.  :D
Title: Re: [Plugin] Batch Import
Post by: short_up on February 08, 2006, 02:14:22 AM
Thanks Jan for an awesome plugin!
And thanks to Seatboy for the revised plugin.

However, I was wondering if someone could help me out and look at Seatboy's revised version.  I get the field for the Image Name, but when I actually go through the plugin and everything is uploaded, the Image Name is blank instead of what I wrote.

Thanks for your time!
Title: Re: [Plugin] Batch Import
Post by: ddejonghe on February 12, 2006, 08:32:10 PM
How did you solve your problem?  I get the same error:

Warning: opendir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/iutum/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/iutum/public_html/4images/admin/plugins/batch_import.php on line 314

Dominique
Title: Re: [Plugin] Batch Import
Post by: cpuswe on February 28, 2006, 09:24:30 PM
Just want to say THANK YOU for this great MOD.  ~1350 pictures in over 500 categories to create. I had the directory structure created on disk and with this mod it took about 20 minutes to import the whole lot. Just some minor sorting to do.

Thanks!

/Thomas

http://www.cpuphotolibrary.com
Title: Re: [Plugin] Batch Import
Post by: wallpapers on March 02, 2006, 08:25:11 PM
It's works perfect for me

Thx V@NO
Title: Re: [Plugin] Batch Import
Post by: V@no on March 03, 2006, 06:46:27 AM
*cough* Jan *cough*
Title: Re: [Plugin] Batch Import
Post by: blue22deep on April 05, 2006, 09:52:14 PM
Batch Import-Script (Beta)

---------------------------------------------------------------------------------
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.

Download: batch_import.zip (http://www.4homepages.de/plugins/batch_import.zip)

Great script

But having problems with large dir's, it stoppet at the 55th pic, and just telling me it's scanning, but nothing happens :(

Anyone have a qlue...??
Title: Re: [Plugin] Batch Import
Post by: IcEcReaM on April 05, 2006, 10:32:21 PM
maybe an timeout?

scripts can run only for a certain time, which depends of the server settings,
how long a script can be executed.
Title: Re: [Plugin] Batch Import
Post by: V@no on April 06, 2006, 02:20:47 AM
either that or memory limit reached and server stops. in either case, check php error logs (ask your host administrator if you dont know).
Title: Re: [Plugin] Batch Import
Post by: jackald on April 06, 2006, 02:57:47 AM
Hello

Is there a way for mod batch import to add to data base that each swf have got thumbnail with the same name only.jpg? That way i could just upload thumbnails by myself to  catalogs.

thx for help
Title: Re: [Plugin] Batch Import
Post by: V@no on April 06, 2006, 03:01:05 AM
Quote
// Thumbnail options
// suffix:     Optional, can be left blank
// prefix:     Optional, can be left blank
// subfolder:  If you images are stored in a subfolder,
//             set the folder name here. Example: "thumbnails/"
//             Optional, can be left blank
// extensions: Valid thumbnail extensions

P.S. its taken from the file itself, but thought it was explained in the original topic...
Title: Re: [Plugin] Batch Import
Post by: blue22deep on April 06, 2006, 08:14:23 AM
either that or memory limit reached and server stops. in either case, check php error logs (ask your host administrator if you dont know).

Hi V@no

I can't find the PHP error log, and have asked my hosting company about it, waiting for there answer

But i don't think it's a memory limit, it's not the same spot it stops, i tryed clearing the database and start over, but it hangs every time, but on different locations

Can it be some wierd safe mode problem...??

I have 2 settings for it, and another one...

1 : PHP Safe Mode
2 : PHP Safe Mode GID
3 : PHP Register Globals

The first one i turned of, ells i wont be able to run the script/plugin, no mather what, even the passing by safe mode trick don't work, i'm not alowed to do anything if th safe mode is turned on :(

But in this case, do i need to turn more off...??

If i assume correctly, i can turn them back on when don importing...??

Title: Re: [Plugin] Batch Import
Post by: blue22deep on April 06, 2006, 10:02:17 PM
Quote

1 : PHP Safe Mode
2 : PHP Safe Mode GID
3 : PHP Register Globals

Quote

Well, all 3 turned off, but nothing helps

I asked my hosting company, and they told me that they don't have individual PHP errorlogs :(

But as said, nothing helps, the problem also exist when deleting/clering the database, through the "edit categories", then it hangs too, and then the database got all messed up, and i had to reset it as described here http://www.4homepages.de/forum/index.php?topic=11226.0

Then i tryed to import again, but it hangs again

The most anoying thing is, that it's not at the same place, it's on different places every time...

What can it be...??
Title: Re: [Plugin] Batch Import
Post by: V@no on April 07, 2006, 01:11:29 AM
Sorry, I cant answer this untill you show what is in the error logs...
Title: Re: [Plugin] Batch Import
Post by: blue22deep on April 07, 2006, 08:29:27 AM
Sorry, I cant answer this untill you show what is in the error logs...

Yep, and that's the problem, i can't get an error log :(

Is there any way i can't generate my own log on the server, is there a script that can monitor what PHP does...??

I just tryed the batch import on another database, and it's the same, hangs randomly :(

My web hosting company is www.servage.net, don't know if anyone knows of problems running 4images script on their servers...??
Title: Re: [Plugin] Batch Import
Post by: V@no on April 07, 2006, 02:22:00 PM
hmmm...lets see...this never been asked before (wich is kind of wierd...)
you can try put this line into .htaccess (on top):[qcode]php_value error_log "/full/local/path/to/where/log/file/will/be/saved/phperrors.log"[/qcode]this is the best way.

if .htaccess is not acceptible you can try insert into global.php (just below <?php):[qcode]ini_set("error_log", "/full/local/path/to/where/log/file/will/be/saved/phperrors.log");[/qcode]
dont forget change the path where that error log will be saved, for security reason this file should not be accessible from the web, so place it somewhere outside of the web root..
Title: Re: [Plugin] Batch Import
Post by: blue22deep on April 09, 2006, 10:06:26 PM
hmmm...lets see...this never been asked before (wich is kind of wierd...)
you can try put this line into .htaccess (on top):[qcode]php_value error_log "/full/local/path/to/where/log/file/will/be/saved/phperrors.log"[/qcode]this is the best way.

if .htaccess is not acceptible you can try insert into global.php (just below <?php):[qcode]ini_set("error_log", "/full/local/path/to/where/log/file/will/be/saved/phperrors.log");[/qcode]
dont forget change the path where that error log will be saved, for security reason this file should not be accessible from the web, so place it somewhere outside of the web root..

Well, didn't get the opportunity to try these codes, cause 4images importet the gallery fair and square, must have bin a server problem then...

But now i got some other problems, there are no thumbs, and 4images tells me that there aren't missing any :(
Title: Re: [Plugin] Batch Import
Post by: darkwarlord on April 12, 2006, 05:12:21 AM
I downloaded this..and cannot get it working.

// Path to the directory the image data are stored.
// No trailing slash!
$data_src_path = "gallery/admin/plugins/importdata";

no matter WHERE I place the folder, it says

The data source path "\public_html\ds\gallery\admin\plugins\importdata" seems to be incorrect!
[Back] 

I'm on a subdomain. The fullpath I want i want the imported data to be on is

/Gallery/importdata

Even if I put
/www/ds/Gallery/importdata

it errors.

Title: Import/Merge 2 Galleries
Post by: Dewie on April 25, 2006, 05:26:36 PM
I am attempting to merge two 4images galleries together. Both galleries have the standard "/data/media" and "/data/thumbnails" folder structures.

What I am trying to do now is figure out how I can import using this directory structure. I can see that this batch import script is looking for thumbnail files from within the folder which contains all the images (ie. /data/media/###/thumbnails) however I want it to look for the thumbnails from the thumbnails folder where it currently is (rather than moving and re-naming 50 folders...)

I had a quick look at the code to see if I could find the variable name holds the value of the folder the script is pulling the images from - I was hoping to something like this:

Code: [Select]
$thumbnail_options = array(
  "prefix"     => "",
  "suffix"     => "",
  "subfolder"  => "../../thumbnails/$FolderVariableNameHere",

Anyone have any suggestions?
Title: Re: [Plugin] Batch Import
Post by: Pepster on May 18, 2006, 08:05:59 PM
I've been having this error:

Warning: opendir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/techie:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/techie/public_html/picgallery/admin/plugins/batch_import.php on line 314

Warning: opendir(/): failed to open dir: Operation not permitted in /home/techie/public_html/picgallery/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; check the manual that corresponds to your MySQL server version for the right syntax to use 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 (10, '', '', , 10, 0, 0, 2, 2, 9, 0, 0, 0, 2)
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 10, 0, 0, 2, 2, 9, 0, 0, 0, 2)' at line 4
FAILED


Import finished!


I can't figure this one out. I've checked the board and found no answer and (at least I think) I've followed all the directions. Any help would be greatly appreciated!

Thanks,

Pep
Title: Re: [Plugin] Batch Import
Post by: wildauer on May 19, 2006, 02:01:29 PM
Hi,

nun habe ich auch denselben Fehler beim Batch_import:

Import category ...
DB Error: Bad SQL Query: SELECT cat_order FROM 4i_categories WHERE cat_parent_id = ORDER BY cat_order DESC LIMIT 1
Fehler in der Syntax bei 'ORDER BY cat_order DESC LIMIT 1' in Zeile 4.

DB Error: Bad SQL Query: INSERT INTO 4i_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 (44, '', '', , 10, 0, 0, 2, 2, 9, 0, 0, 0, 2)
Fehler in der Syntax bei ' 10, 0, 0, 2, 2, 9, 0, 0, 0, 2)' in Zeile 4.
FAILED

1. Importing image AUTOEXEC.BAT.....

Ich dachte, es lag an der 4images-Version und habe jetzt 1.7.2 installiert. Dasselbe  :(

Den Batch_import würde ich schon gerne verwenden, weil es sehr viele Bilder mit gleiechen Keywords sind und ich in das Zusatzfeld Auto (photographer) nicht immer wieder den gleichen Autor hineinschreiben möchte.

Ich habe alles ausprobiert, was in diesem Topic beschrieben wurde, immer das gleiche...

Und dabei ging das alles vor einem halben Jahr noch wunderbar!?
Was ist bloß passiert?

ps. Ansonsten ein tolles Programm :D
Title: Re: [Plugin] Batch Import
Post by: motorhead85021 on May 19, 2006, 11:36:57 PM
This may be a dumb question, but:

Code: [Select]
// Path to the directory the image data are stored.
// No trailing slash!
$data_src_path = "path";

This is the path of images on your local machine, correct?

I assume it places images into the 4images data/media folder by default?


Title: Re: [Plugin] Batch Import
Post by: V@no on May 20, 2006, 03:21:35 AM
"local" as the server, not "local" as your computer ;) (unless ofcourse your computer is the server)

Yes, moves files into media directory
Title: Re: [Plugin] Batch Import
Post by: jcjp on June 05, 2006, 02:09:24 PM
Muy buenas:

Es posible que Batch_import compare la estructura de directorios y las imagenes existentes en el mismo con el contenido de la base de datos


Gracias
Title: Re: [Plugin] Batch Import
Post by: m4rci on June 11, 2006, 06:34:08 PM
Hi,
ich glaub des prob gabs schonma wurde aba nur in english beantwortet(kann english net sooo gut^^)
des wegen kann mir jemand hierbei helfen?

Warning: opendir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/vhosts/dj-m4rci.de/subdomains/signaturen/httpdocs:/tmp) in /var/www/vhosts/dj-m4rci.de/subdomains/signaturen/httpdocs/admin/plugins/batch_zip_import.php on line 452

Warning: opendir(/): failed to open dir: Operation not permitted in /var/www/vhosts/dj-m4rci.de/subdomains/signaturen/httpdocs/admin/plugins/batch_zip_import.php on line 452

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; check the manual that corresponds to your MySQL server version for the right syntax to use 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 (19, '', '5', , 10, 0, 0, 2, 2, 9, 0, 0, 0, 0)
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 10, 0, 0, 2, 2, 9, 0, 0, 0, 0)' at line 4
FAILED
Title: Re: [Plugin] Batch Import
Post by: idijotaz on June 11, 2006, 07:05:07 PM
when im copying images... everything ok, but dont make me thumbnails, and when im traying to make it with auto-thumbnailer, it makes thumbnails but dont show it  :evil:
Title: Re: [Plugin] Batch Import
Post by: idijotaz on June 12, 2006, 05:46:41 PM
anyone can help?  :?
Title: Re: [Plugin] Batch Import
Post by: babyjuker on June 17, 2006, 08:05:23 AM
can someone please help me with trying to  get this plugin to work properly.  i've tried all types of ways and nothing seems to be at all suscessful.

$data_src_path = "/public_html/hqgallery/admin/plugins";

results in me getting "The data source path "/public_html/hqgallery/admin/plugins" seems to be incorrect!" i've even tried on my computer but that doesn't work neither what am i doing wrong? i'd really  like to use this hack
Title: Re: [Plugin] Batch Import
Post by: dolphinpixie on August 04, 2006, 05:11:51 PM
Hi,

I have read all the post to try and figure out what is going wrong. Like a few people here I have the following error:

Warning: opendir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/tgmmarke/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/tgmmarke/public_html/gallery/admin/plugins/batch_import.php on line 315

Warning: opendir(/): failed to open dir: Operation not permitted in /home/tgmmarke/public_html/gallery/admin/plugins/batch_import.php on line 315

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; check the manual that corresponds to your MySQL server version for the right syntax to use 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 (5, '', '', , 10, 0, 0, 2, 2, 9, 0, 0, 0, 2)
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 10, 0, 0, 2, 2, 9, 0, 0, 0, 2)' at line 4
FAILED

Import finished!

I saw the response from Jan about putting the image folder inside the plugin folder. I did this but I am still getting this error. Any help would be greatly appreciated.

Thanks in advance.
Aimee

Title: Re: [Plugin] Batch Import
Post by: V@no on August 04, 2006, 08:45:35 PM
What is in your $data_src_path  ?
Title: Re: [Plugin] Batch Import
Post by: ocdotcom on September 29, 2006, 05:08:33 AM
What can I say - awesome! Saves me a lot of time. Worked for me right out of the box! Thanks!
Title: Re: [Plugin] Batch Import
Post by: blue22deep on October 19, 2006, 11:04:00 PM
hmmm...lets see...this never been asked before (wich is kind of wierd...)
you can try put this line into .htaccess (on top):[qcode]php_value error_log "/full/local/path/to/where/log/file/will/be/saved/phperrors.log"[/qcode]this is the best way.

if .htaccess is not acceptible you can try insert into global.php (just below <?php):[qcode]ini_set("error_log", "/full/local/path/to/where/log/file/will/be/saved/phperrors.log");[/qcode]
dont forget change the path where that error log will be saved, for security reason this file should not be accessible from the web, so place it somewhere outside of the web root..

Well, bin some time now since i last had the time to try figure this out...

Where do you want me to put the .htaccess file...??

Best Regards
Carsten, Denmark
Title: batch_import problem
Post by: MDMC on November 08, 2006, 10:15:18 PM
Hi,

hab ein Problem mit dem PlugIn, immer wenn ich es ausführe sacht es mir:

Quote
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; check the manual that corresponds to your MySQL server version for the right syntax to use 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 (41, '', '', , 10, 0, 0, 0, 9, 9, 0, 0, 0, 0)
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 10, 0, 0, 0, 9, 9, 0, 0, 0, 0)' at line 4
FAILED

Import finished!

Meine Gallery liegt auf Funpic...
Title: Re: [Plugin] Batch Import
Post by: WhoMe on December 29, 2006, 03:23:45 AM
I´m getting the following error when i try to import images.
Code: [Select]
1 images in . Importing image 1 to 1
Import category ...
DB Error: Bad SQL Query: SELECT cat_order FROM cov_categories WHERE cat_parent_id = ORDER BY cat_order DESC LIMIT 1
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY cat_order DESC LIMIT 1' at line 4

DB Error: Bad SQL Query: INSERT INTO cov_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 (10, '', '', , 10, 0, 0, 2, 2, 9, 0, 0, 0, 2)
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 10, 0, 0, 2, 2, 9, 0, 0, 0, 2)' at line 4
FAILED

1. Importing image .autofsck
Copy Image: Error while copying image /.autofsck
Skipping.....

Import finished!
[Back]
I have the "new" image-folder (test) with 5 images in the /plugin -folder.
The path is correct batch_import.php.

What´s wrong?  8O
Title: Re: [Plugin] Batch Import
Post by: WhoMe on December 30, 2006, 03:19:19 AM
I´m getting the following error when i try to import images.
Code: [Select]
1 images in . Importing image 1 to 1
Import category ...
DB Error: Bad SQL Query: SELECT cat_order FROM cov_categories WHERE cat_parent_id = ORDER BY cat_order DESC LIMIT 1
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY cat_order DESC LIMIT 1' at line 4

DB Error: Bad SQL Query: INSERT INTO cov_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 (10, '', '', , 10, 0, 0, 2, 2, 9, 0, 0, 0, 2)
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 10, 0, 0, 2, 2, 9, 0, 0, 0, 2)' at line 4
FAILED

1. Importing image .autofsck
Copy Image: Error while copying image /.autofsck
Skipping.....

Import finished!
[Back]
I have the "new" image-folder (test) with 5 images in the /plugin -folder.
The path is correct batch_import.php.

What´s wrong?  8O
Any help on this, please!?  :(
Or is there a better import/batch function/mod?
Title: Re: [Plugin] Batch Import
Post by: will on March 06, 2007, 10:49:06 PM
Hi guys

Hopefully this will be a great mod, now I have uploaded 40 files to my server to import and I get:

The data source path "home/content/w/i/l/willtaka05/html/Covers" seems to be incorrect!

Now do I have to put the files in my 4images folder for it to read it or doesn't it matter?

Thanks :lol:
Title: Re: [Plugin] Batch Import
Post by: skidpics on August 07, 2007, 04:40:24 PM
Love the plugin, but when I try to use it, nothing happens.  It simply refreshes my main gallery page within the ACP right frame..  Any suggestions on what could be causing that?  I was using the batch zip import yesterday, and it quit working also, with the same results..  Would this be  a cause of 'zip' being turned off somewhere?  I get no error messge, just a main gallery refresh within the acp right frame
Title: Re: [Plugin] Batch Import
Post by: riotz on October 02, 2007, 01:56:28 PM
Great plugin, just what I needed.

I have one problem though, I created the folder structure in the import directory to match existing categories, as I wanted to add the new images to the cats already setup on my site.  However, it didn't add the new images to the existing cats, it created identical categories & subcats for the new images.  Is it supposed to work this way, and if so, is there any simple fix to have it import new images to existing categories?
Title: Re: [Plugin] Batch Import
Post by: progresst on February 03, 2008, 08:34:14 PM
Hello,

I have an existing installation that was working fine with the batch import plugin.  For some reason it will now not copy the images into the program?  I have tried specifying the full path, changing permissions with no success.  The message shown after if fails is not very helpful:

Import category testit ... FAILED

1. Importing image Picture 145.jpg
Copy Image: Error while copying image batch/testit/Picture 145.jpg
Skipping.....

In does create the category in the program but does not create the folder or .jpg files in the actual data directory though.  I feel like I am missing something very simple...can you please offer some suggestions?
Title: Re: [Plugin] Batch Import
Post by: bob on April 22, 2008, 03:06:45 AM

Vielen Dank V@no, schönes script

frage mich ob ich mit diesem script Bilder in eine vorhandene Sub-kategorie Kopieren kann, also so das dieses Batch script keine neue Hauptkategorie erstellt sondern die bilder und thumbs in eine vorhandene sub-kat. kopiert oder nochbesser verlinkt :P
(...mal sehen ob ich das hinbekomme...aber falls Du zeit hast ;))


mfg
Bob
Title: Re: [Plugin] Batch Import
Post by: mawenzi on April 22, 2008, 03:34:51 AM
@bob

... wenn du schon Dankesworte richtest ... dann doch wenigstens an den richtigen ...
... dieser MOD ist von Jan ... !

btw.
... wenn du jedoch v@no mit der etwaigen Zeit meinst ...
... dann schau mal hier : http://www.4homepages.de/forum/index.php?action=profile;u=596 ...  :|
Title: Re: [Plugin] Batch Import
Post by: bob on April 22, 2008, 01:20:26 PM

Ups...

Ja denn mal Danke an Jan ...sorry hab ich mich vertan ;)
Title: Re: [Plugin] Batch Import
Post by: tamil2006 on May 18, 2008, 08:32:53 PM
getting the following error
2 images in . Importing image 1 to 2
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; check the manual that corresponds to your MySQL server version for the right syntax to use 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 (151, '', '', , 10, 0, 0, 2, 2, 9, 0, 0, 0, 0)
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 10, 0, 0, 2, 2, 9, 0, 0, 0, 0)' at line 4
FAILED

1. Importing image .autofsck
Copy Image: Error while copying image /.autofsck
Skipping.....

2. Importing image .autorelabel
Copy Image: Error while copying image /.autorelabel
Skipping.....

Import finished!
Title: Re: [Plugin] Batch Import
Post by: Lunique on November 07, 2008, 07:59:28 PM
Hallo, ich find das plugin echt klasse, aber gibts irgendeine Möglichkeit das es auch IPTC-Daten einbeziehen kann beim hochladen?
Ich brauch die Keywords aus den IPTC immer als Schlüsselwörter für die Kategorie.
Bei diesem MOD für die checkimages http://www.4homepages.de/forum/index.php?topic=4754.0 (http://www.4homepages.de/forum/index.php?topic=4754.0) gibt es ja die Option "auto insert IPTC info of name, description, keywords and date" und wenn die batchimport genau das gleiche mitmachen würde dann wärs echt perfekt!
Title: Re: [Plugin] Batch Import
Post by: zhono on December 31, 2008, 04:05:26 PM
I've been using this plugin for years now, and never had a problem with it until now.

I'm using a fresh install of 4Images 1.7.6 When I go to use the batch import plugin, I don't get any errors, but it's skipping images. My images are named:

Image 001.jpg
Image 002.jpg
Image 003.jpg

And so on. When I import with the plugin, it skips 26-50, 76-100, 126-150, 176-200, and so on. It does 25, then skips the next 25, then does 25 more, and skips the next 25. I don't get it. Has anyone heard of this problem before? Any help would be appreciated.
Title: Re: [Plugin] Batch Import
Post by: Nicky on December 31, 2008, 05:00:34 PM
hi.

i noticed that when it is using with the SEO..

adjust to use sessions.php without SEO.

but before you ask your next question read my private message.
Title: Re: [Plugin] Batch Import
Post by: zhono on December 31, 2008, 07:09:50 PM
Read your Pm. All taken care of.

And as for sessions.php, yes, I am going to ask what I need to do to fix it. Can I just add something like

Code: [Select]
RewriteRule ^(includes|sessions\.php) - [L]
to my .htaccess file? Or do I have to make changes to the sessions.php file itself?
Title: Re: [Plugin] Batch Import
Post by: Nicky on December 31, 2008, 09:59:59 PM
hi zhono,

1st at all, thank you for changes on your site!

i did it so on my site:

1.)
take the ORIGINAL sessions.php and rename it to sessions_noSEO.php
upload it to the /includes folder as sessions_noSEO.php

2.)
make a copy of admin/admin_global.php and rename it to admin_global_noSEO.php
in admin_global_noSEO.php replace
Code: [Select]
include_once(ROOT_PATH.'includes/sessions.php');with
Code: [Select]
include_once(ROOT_PATH.'includes/sessions_noSEO.php');
upload admin_global_noSEO.php to /admin folder

3.)
in batch_import.php
replace
Code: [Select]
require(ROOT_PATH.'admin/admin_global.php');with
Code: [Select]
require(ROOT_PATH.'admin/admin_global_noSEO.php');upload it to /admin/plugins folder

this solution works fine for me..
Title: Re: [Plugin] Batch Import
Post by: zhono on January 01, 2009, 12:04:19 AM
Just tried it out. It works perfectly. Thanks.
Title: Mass upload in tiered folders?
Post by: dreamerscove on June 28, 2009, 05:16:30 AM
Hiya!

I'm a newbie to 4images. 

I have some ?'s hopefully someone will help me with.

I am currently uploading over 100k images.  Mostly smilies, avatars etc...  They are in multiple tiered folders.  An example is:
 
data/img/smilies/emoticons-1/misc-1/1.gif

I do not want to insert all these by hand.  That would take forever! 

What is the best solution to handle this?  They will already be uploaded.  I just need to get them onsite.

Any ideas?

Peace,
Lee


Title: Re: Mass upload in tiered folders?
Post by: Nicky on June 28, 2009, 01:57:05 PM
Hello Lee and welcome to 4images forum.

the best way if you have already your pictures in different folders to use this [Plugin] Batch Import (http://www.4homepages.de/forum/index.php?topic=15429.0)

plugin will import your pictures and will create automatically categories as your folder names.
Title: Re: [Plugin] Batch Import
Post by: Sebas Bonito on June 28, 2009, 04:57:23 PM
I already changed my tmp-folder, where the new images are stored, to the admin/plugins folder and gave them all rights. But nothing happens (except the error-logs).

SERVER-ERROR-LOG
Code: [Select]
[Sun Jun 28 16:52:46 2009] [error] [client XYZ] PHP Warning: opendir() [<a href='function.opendir'>function.opendir</a>]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/srv/www/vhosts/XYZ.de/httpdocs:/tmp) in /srv/www/vhosts/XYZ.de/httpdocs/XYZ/admin/plugins/batch_import.php on line 314, referer: http://www.XYZ.de/XYZ/admin/plugins/batch_import.php
[Sun Jun 28 16:52:46 2009] [error] [client XYZ] PHP Warning: opendir(/) [<a href='function.opendir'>function.opendir</a>]: failed to open dir: Operation not permitted in /srv/www/vhosts/XYZ.de/httpdocs/XYZ/admin/plugins/batch_import.php on line 314, referer: http://www.XYZ.de/XYZ/admin/plugins/batch_import.php

and this appears in admin-panel "Batch Import":
Code: [Select]
0 images in .
Import category ...
DB Error Bad SQL Query: SELECT cat_order FROM XYZ_categories WHERE cat_parent_id = ORDER BY cat_order DESC LIMIT 1
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY cat_order DESC LIMIT 1' at line 4

DB Error Bad SQL Query: INSERT INTO XYZ_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 (13, '', '', , 10, 0, 0, 2, 2, 9, 0, 0, 0, 2)
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 10, 0, 0, 2, 2, 9, 0, 0, 0, 2)' at line 4
FAILED

Import finished!

Anybody could see the fault or which mistake I made? Thx guys!
Title: Re: Mass upload in tiered folders?
Post by: dreamerscove on June 29, 2009, 11:22:20 PM
Hiya!

Thanks Nicky!  Do I have to specify each folder?  Or can I just take it from the folder?

The data source path "/public_html/onlinesmilies/data/img  seems to be incorrect

Lost :(

Peace,
Lee
Title: Re: Mass upload in tiered folders?
Post by: Nicky on June 30, 2009, 12:03:13 AM
Hiya!

Thanks Nicky!  Do I have to specify each folder?  Or can I just take it from the folder?

The data source path "/public_html/onlinesmilies/data/img  seems to be incorrect

Lost :(

Peace,
Lee

hi Lee,

example 4images hirarchie

4images folder
- data
- - media
- - - category id

to use the import plugin you should have your pictures as example like this

your root folder of all subfolders
- smilies
- - emoticons-1
- - - misc-1
- - - - pictures inside

- avatars
- - subfolder
- - - subsubfolder
- - - - pictures inside

correct path in batch_import.php will be as example:
$data_src_path = "/home/user/public_html/your root folder of all subfolders";

remember...
category names, subcategory names and picture names will be taken from names of your folders and picture files.
Title: Re: [Plugin] Batch Import
Post by: Nicky on June 30, 2009, 12:14:30 AM
Schnick und Schnack,

nehmen wir an deine galerie ist so zum abrufen
http:// deineurl /deinegalerie

versuche einfach folgendes

erstelle verzeichnis
http:// deineurl /upload

hau alle deine folder rein...
in der batch_import.php setze folgendes ein
Code: [Select]
$data_src_path = "/srv/www/vhosts/XYZ.de/httpdocs/upload";
wie sieht es dann aus?
da
Title: Re: [Plugin] Batch Import
Post by: Sebas Bonito on June 30, 2009, 12:26:38 AM
Schnick und Schnack,

nehmen wir an deine galerie ist so zum abrufen
http:// deineurl /deinegalerie

versuche einfach folgendes

erstelle verzeichnis
http:// deineurl /upload

hau alle deine folder rein...
in der batch_import.php setze folgendes ein
Code: [Select]
$data_src_path = "/srv/www/vhosts/XYZ.de/httpdocs/upload";
wie sieht es dann aus?
da


...dann sieht es exakt genau so aus. ABER ich hab so ne Vermutung, irgendwas haut doch bei der Datenbank bzw. bei der categories-Tabelle nicht hin. Wenn ich mir die Fehlermeldung noch mal anschaue, fehlt eine "Spalte" und zwar die "cat_hits". Liegt es vielleicht daran?

(http://www.bilder-hochladen.net/files/bcha-2.jpg)
Title: Re: [Plugin] Batch Import
Post by: Nicky on June 30, 2009, 12:40:12 AM
cat_hits ist, wie auf deinem bild, in der 5-ten ;)

[edit]
wie sieht es so aus
Code: [Select]
$data_src_path = "../../../upload";falls die urls wie oben sind
Title: Re: [Plugin] Batch Import
Post by: Sebas Bonito on June 30, 2009, 12:43:08 AM
cat_hits ist, wie auf deinem bild, in der 5-ten ;)

Es geht um meinen gestrigen Beitrag (die Grafik von MySQL soll nur den Vergleich und die fehlende Spalte verdeutlichen):

I already changed my tmp-folder, where the new images are stored, to the admin/plugins folder and gave them all rights. But nothing happens (except the error-logs).

SERVER-ERROR-LOG
Code: [Select]
[Sun Jun 28 16:52:46 2009] [error] [client XYZ] PHP Warning: opendir() [<a href='function.opendir'>function.opendir</a>]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/srv/www/vhosts/XYZ.de/httpdocs:/tmp) in /srv/www/vhosts/XYZ.de/httpdocs/XYZ/admin/plugins/batch_import.php on line 314, referer: http://www.XYZ.de/XYZ/admin/plugins/batch_import.php
[Sun Jun 28 16:52:46 2009] [error] [client XYZ] PHP Warning: opendir(/) [<a href='function.opendir'>function.opendir</a>]: failed to open dir: Operation not permitted in /srv/www/vhosts/XYZ.de/httpdocs/XYZ/admin/plugins/batch_import.php on line 314, referer: http://www.XYZ.de/XYZ/admin/plugins/batch_import.php

and this appears in admin-panel "Batch Import":
Code: [Select]
0 images in .
Import category ...
DB Error Bad SQL Query: SELECT cat_order FROM XYZ_categories WHERE cat_parent_id = ORDER BY cat_order DESC LIMIT 1
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY cat_order DESC LIMIT 1' at line 4

DB Error Bad SQL Query: INSERT INTO XYZ_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 (13, '', '', , 10, 0, 0, 2, 2, 9, 0, 0, 0, 2)
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 10, 0, 0, 2, 2, 9, 0, 0, 0, 2)' at line 4
FAILED

Import finished!

Anybody could see the fault or which mistake I made? Thx guys!
Title: Re: [Plugin] Batch Import
Post by: Nicky on June 30, 2009, 12:46:36 AM
die insert into ist schon in ordnung

Code: [Select]
   $sql = "INSERT INTO ".CATEGORIES_TABLE."
            (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

cat_hits wird nicht benutzt, sondern wird der wert 0 automatisch zugefügt.

cat_parent_id ist das problem. weil die fehlermeldung oberhalb nicht ausgeführt wird..
Title: Re: [Plugin] Batch Import
Post by: Sebas Bonito on June 30, 2009, 12:49:39 AM
hmm... käcke!

"cat_parent_id ist das problem.."
Wieso?

Vielleicht doch ein safe_mode Problem?
Title: Re: [Plugin] Batch Import
Post by: Nicky on June 30, 2009, 12:52:33 AM
aufjeden fall ist es die obere fehlermeldung schuld daran.

ob du jetzt safe mode on oder off hast, musst du wissen ;)
Title: Re: [Plugin] Batch Import
Post by: Sebas Bonito on June 30, 2009, 01:02:36 AM
aufjeden fall ist es die obere fehlermeldung schuld daran.
ob du jetzt safe mode on oder off hast, musst du wissen ;)

1. Die Fehlermeldung ist bestimmt nicht schuld daran  :P
2. safe_mode on (Local Value), safe_mode off (Master Value),
Title: Re: [Plugin] Batch Import
Post by: Nicky on June 30, 2009, 01:06:59 AM
na dann, wennst meinst...

viel glück bei der fehlersuche  :P
Title: Re: [Plugin] Batch Import
Post by: Sebas Bonito on June 30, 2009, 01:09:32 AM
na dann, wennst meinst...

viel glück bei der fehlersuche  :P
Na eine Fehlermeldung gibt ja nur "aus" und informiert über einen Fehler, ist aber logischerweise nicht der Grund des Problems  :wink:
Title: Re: [Plugin] Batch Import
Post by: Rembrandt on June 30, 2009, 07:25:05 AM
Hi!
...Na eine Fehlermeldung gibt ja nur "aus" und informiert über einen Fehler, ist aber logischerweise nicht der Grund des Problems  :wink:
was mich etwas irritiert ist diese fehlermeldung:
Quote
DB Error Bad SQL Query: SELECT cat_order FROM XYZ_categories WHERE cat_parent_id = ORDER BY cat_order DESC LIMIT 1
ich meine eine "XYZ_categories" ,solch eine tabelle gibt es in 4I mit sicherheit nicht.

mfg Andi
Title: Re: [Plugin] Batch Import
Post by: Nicky on June 30, 2009, 12:34:54 PM
@Rembrandt,
wenn ich den prefix XYZ_ so angegeben habe, dann schon :)

Schnick und Schnack, bekommt das schon auf die reihe ;)
Title: Re: Mass upload in tiered folders?
Post by: dreamerscove on June 30, 2009, 09:06:05 PM
Hiya!

I've got the imgs on, but the thumbnails are all 404 img.  I made a folder for thumbnails, name tn/ but it's not finding it I assume :(

Ideas?

Peace,
Lee
Title: Re: [Plugin] Batch Import
Post by: Sebas Bonito on June 30, 2009, 10:04:26 PM
@Rembrandt, wenn ich den prefix XYZ_ so angegeben habe, dann schon :)
Japp, ist ja nur der Prefix, die Tabelle existiert standardmäßig bei allen.
Title: Re: [Plugin] Batch Import
Post by: TechnoRocker on July 05, 2009, 07:16:27 PM
Hallo allerseids,
Ich habe folgenes Problem:

Quote
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; check the manual that corresponds to your MySQL server version for the right syntax to use 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 (2, '', 'lol', , 10, 0, 0, 2, 9, 9, 0, 0, 0, 2)
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 10, 0, 0, 2, 9, 9, 0, 0, 0, 2)' at line 4
FAILED

Import finished!

Das ist der Pfad
(http://img3.imagebanana.com/img/13lt3fd9/ccv.jpg)

Die Config:
Code: [Select]
//-----------------------------------------------------
//--- Configuration -----------------------------------
//-----------------------------------------------------

// Path to the directory the image data are stored.
// No trailing slash!
$data_src_path = "/srv/www/vhosts/clay-class.net/httpdocs/2/data/Dancefloor";

// Thumbnail options
// suffix:     Optional, can be left blank
// prefix:     Optional, can be left blank
// subfolder:  If you images are stored in a subfolder,
//             set the folder name here. Example: "thumbnails/"
//             Optional, can be left blank
// extensions: Valid thumbnail extensions
$thumbnail_options = array(
  "prefix"     => "",
  "suffix"     => "",
  "subfolder"  => "",
  "extensions" => array("jpg", "JPG", "jpeg", "JPEG", "gif", "GIF", "png", "PNG")
);

// As default, the script will only copy the image files
// from your source folders to the 4images folders.
// After import you will have your image data twice on
// your server.
// If you have not enough server space set this to 1.
// Then the script will move the image files.
// Be carefully with this, your data could be lost!!!
$move_image_files = 0;

// Set this to 1 to use file modification time as date?
// Otherwise the current date will be used.
$use_image_filemtime = 1;

// Default description for each image, can be left blank
$default_image_description = "Dancefloor 2009";

// Default keywords for each image, can be left blank
// Separated by spaces. Example: "keyword1 keyword2 keyword3"
$default_image_keywords = "Dancefloor 2009 schule clay";

// Set this to the id of the user who should be the owner of each image.
// If 0, the user id of the current logged in user will be used. That's you ;)
$default_user_id = 0;

// Default description for each category, can be left blank
$default_cat_description = "lol";

// Default category permissions
// AUTH_ALL   = All
// AUTH_USER  = Registered Users
// AUTH_ACL   = Private
// AUTH_ADMIN = Administrators
$auth_viewcat      = AUTH_ALL;
$auth_viewimage    = AUTH_ALL;
$auth_download     = AUTH_USER;
$auth_upload       = AUTH_ADMIN;
$auth_directupload = AUTH_ADMIN;
$auth_vote         = AUTH_ALL;
$auth_sendpostcard = AUTH_ALL;
$auth_readcomment  = AUTH_ALL;
$auth_postcomment  = AUTH_USER;

//-----------------------------------------------------
//--- End Configuration -------------------------------
//-----------------------------------------------------

Wie bekomme ich das Problem weg ?

Mfg

[EDIT by V@no]please don't use [center][/center] in your posts[/EDIT]
Title: Re: [Plugin] Batch Import
Post by: Sebas Bonito on July 23, 2009, 04:07:12 PM
:flag-en: I get the same message like TechnoRocker (post above), additional to that, here is my server-error log to his.
:flag-de: Ich kriege die selbe Fehlermeldung wie TechnoRocker (Post drüber). Ergänzend dazu mein server-error log zu diesem Problem.

Quote
[Thu Jul 23 16:01:31 2009] [error] [client x] PHP Warning: opendir() [<a href='function.opendir'>function.opendir</a>]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/srv/www/vhosts/de/httpdocs:/tmp) in /srv/www/vhosts/de/httpdocs/daeof/admin/plugins/batch_import.php on line 314, referer: /admin/plugins/batch_import.php

[Thu Jul 23 16:01:31 2009] [error] [client x] PHP Warning: opendir(/) [<a href='function.opendir'>function.opendir</a>]: failed to open dir: Operation not permitted in /srv/www/vhosts/de/httpdocs/daeof/admin/plugins/batch_import.php on line 314, referer: /admin/plugins/batch_import.php

:flag-en: As "$data_src_path"  I've chosen the sub-folder "tmp" in admin/plugins (CHMOD 777)
:flag-de: Als "$data_src_path" habe ich den Unterordner "tmp" in Plugins ausgewählt (CHMOD 777).

:flag-en: Anyone an idea what this means, and how to fix it?
:flag-de: Hat jemand ne Idee, was das zu bedeuten hat, und wie man das Problem lösen kann?
Title: Re: [Plugin] Batch Import
Post by: Rembrandt on July 23, 2009, 06:04:09 PM
Hi!
...
Quote
[...open_basedir restriction in effect. File(/) is not within the allowed path(s):...
....

ob das nicht eine PHP restriction ist.

mfg Andi
Title: Re: [Plugin] Batch Import
Post by: Sebas Bonito on July 23, 2009, 06:49:47 PM
Hi!
...
Quote
[...open_basedir restriction in effect. File(/) is not within the allowed path(s):...
....

ob das nicht eine PHP restriction ist.
mfg Andi

Hi Andi, irgendwie läuft das... hab ein bissl rumgespielt.. hängt es vielleicht damit zusammen, dass die Fotos noch mal in einem Extra-Ordner sein müssen? *grübel*

Ne andere Geschichte: Die Fotos werden nicht verkleinert; besser gesagt, die MOD Auto image resizer (http://www.4homepages.de/forum/index.php?topic=7700) wird nicht verwendet. Kann man das irgendwie integrieren? Denn so werden die Fotos in voller Auflösung angezeigt, und das sprengt nicht nur den Rahmen, sondern auch den Bildschirm.
Title: Re: [Plugin] Batch Import
Post by: Rembrandt on July 23, 2009, 07:48:15 PM
Hi!
...
Ne andere Geschichte: Die Fotos werden nicht verkleinert; besser gesagt, die MOD Auto image resizer (http://www.4homepages.de/forum/index.php?topic=7700) wird nicht verwendet. Kann man das irgendwie integrieren? Denn so werden die Fotos in voller Auflösung angezeigt, und das sprengt nicht nur den Rahmen, sondern auch den Bildschirm.
ich verwende den big mod, ist aber etwas kompliziert weil die einbauanleitung und das debugging über mehrere seite geht.

du ladest ein großes bild hoch, das automatisch in einen extra ordner kommt, das verkleinerte z.b. 800x600 wird auf der detail angezeigt,
und zum download steht wieder das originale zur verfügung.
http://www.4homepages.de/forum/index.php?topic=7499.msg148451#msg148451

mfg Andi
Title: Re: [Plugin] Batch Import
Post by: Sebas Bonito on July 23, 2009, 08:32:14 PM
Hi!
...
Ne andere Geschichte: Die Fotos werden nicht verkleinert; besser gesagt, die MOD Auto image resizer (http://www.4homepages.de/forum/index.php?topic=7700) wird nicht verwendet. Kann man das irgendwie integrieren? Denn so werden die Fotos in voller Auflösung angezeigt, und das sprengt nicht nur den Rahmen, sondern auch den Bildschirm.
ich verwende den big mod, ist aber etwas kompliziert weil die einbauanleitung und das debugging über mehrere seite geht.

du ladest ein großes bild hoch, das automatisch in einen extra ordner kommt, das verkleinerte z.b. 800x600 wird auf der detail angezeigt,
und zum download steht wieder das originale zur verfügung.
http://www.4homepages.de/forum/index.php?topic=7499.msg33712#msg33712

mfg Andi

Hi Andi,

also es läuft doch (MOD Auto image resizer UND [Plugin] Batch Import)... aber danke für den Tipp!

Bei der ersten MOD gibt es im ACP unter "Bilder verwalten" den Punkt "Auto-Image-Resizer". Wenn man nun das (zu große) Foto (nach dem Batch Import) verkleinert, wird automatisch die Original-Datei in den Unterordner "big" kopiert. GENAU SO wollte ich das.



Vielleicht noch ein Tipp für alle, die dieses Plugin nutzen: Meist ist es ja so, dass man nach dem Upload/Batchen die Kategorie noch bearbeiten will. Wenn man nun den Users auf der Seite zunächst nicht den Zugang gewähren will, muss man die "auth_viewcat" dementsprechend anpassen. Ich habe das gleich in die batch_import.php gepackt, damit ich die Kategorie erstmal in Ruhe bearbeiten kann (ohne das nochmal manuell einzustellen). Suche

Code: [Select]
($cat, '".addslashes($cat_name)."', '".addslashes($default_cat_description)."', $cat_parent_id, ".($cat_order['cat_order'] + 10).", $auth_viewcat, $auth_viewimage, $auth_download, $auth_upload, $auth_directupload, $auth_vote, $auth_sendpostcard, $auth_readcomment, $auth_postcomment)";
und ersetze es mit

Code: [Select]
($cat, '".addslashes($cat_name)."', '".addslashes($default_cat_description)."', $cat_parent_id, ".($cat_order['cat_order'] + 10).", 9, $auth_viewimage, $auth_download, $auth_upload, $auth_directupload, $auth_vote, $auth_sendpostcard, $auth_readcomment, $auth_postcomment)";
...die 9 ist in meinem Fall der Admin (ggf. anpassen!).
Title: Re: [Plugin] Batch Import
Post by: thilina on January 14, 2010, 03:45:12 AM
hey,
it say`s

8 images in . Importing image 1 to 8
Import category ...
DB Error: Bad SQL Query: SELECT cat_order FROM ishare_categories WHERE cat_parent_id = ORDER BY cat_order
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY cat_order' at line 4

DB Error: Bad SQL Query: INSERT INTO ishare_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 (3, '', '', , 10, 0, 0, 2, 2, 9, 0, 0, 0, 2)
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 10, 0, 0, 2, 2, 9, 0, 0, 0, 2)' at line 4
FAILED

1. Importing image .autofsck

Warning: copy(./../../data/media/3/.autofsck) [function.copy]: failed to open stream: No such file or directory in /home/download/public_html/imageshare/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image /.autofsck
Skipping.....

2. Importing image .autorelabel

Warning: copy(./../../data/media/3/.autorelabel) [function.copy]: failed to open stream: No such file or directory in /home/download/public_html/imageshare/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image /.autorelabel
Skipping.....

3. Importing image .pearrc

Warning: copy(./../../data/media/3/.pearrc) [function.copy]: failed to open stream: No such file or directory in /home/download/public_html/imageshare/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image /.pearrc
Skipping.....

4. Importing image .rnd

Warning: copy(/.rnd) [function.copy]: failed to open stream: Permission denied in /home/download/public_html/imageshare/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image /.rnd
Skipping.....

5. Importing image cpmode.conf

Warning: copy(./../../data/media/3/cpmode.conf) [function.copy]: failed to open stream: No such file or directory in /home/download/public_html/imageshare/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image /cpmode.conf
Skipping.....

6. Importing image latest

Warning: copy(./../../data/media/3/latest) [function.copy]: failed to open stream: No such file or directory in /home/download/public_html/imageshare/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image /latest
Skipping.....

7. Importing image oldcrontab

Warning: copy(./../../data/media/3/oldcrontab) [function.copy]: failed to open stream: No such file or directory in /home/download/public_html/imageshare/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image /oldcrontab
Skipping.....

8. Importing image testdir

Warning: copy(./../../data/media/3/testdir) [function.copy]: failed to open stream: No such file or directory in /home/download/public_html/imageshare/admin/plugins/batch_import.php on line 122
Copy Image: Error while copying image /testdir
Skipping.....

thank you...
Title: Re: [Plugin] Batch Import
Post by: Hoang on September 16, 2010, 05:14:20 PM
Is it possible to support batch import to special cat (subcat not to root) ?
Title: Re: [Plugin] Batch Import
Post by: x23piracy on October 14, 2010, 03:53:35 AM
Hi,

this script is very nice but there is something i don't understand.

Why are successfully imported images and categories (folders) are not deleted?
So it is necessary to delete the contents of the import folder, if you forgot that
the categories are created again (same name) and the images re-imported.

I see no point in why files and folders are retaining, can someone explain this?

Someone has already adapted the script?

EDIT:

Ok i found that here ;)

Code: [Select]
// As default, the script will only copy the image files
// from your source folders to the 4images folders.
// After import you will have your image data twice on
// your server.
// If you have not enough server space set this to 1.
// Then the script will move the image files.
// Be carefully with this, your data could be lost!!!
$move_image_files = 0;

This is not clear for me:

Code: [Select]
// Then the script will move the image files.
Move to where? Do you mean deleted?

Code: [Select]
// Be carefully with this, your data could be lost!!!
Lost? You mean if the importt was unsuccessfully? but the script
should not delete anything if an error accours. Hmm

Why are categories that already exist duplicated?
Who uses two identical categories denominated?

The idea is to give users an ftp access for a
convenient upload of images.

If the categories are duplicated it's useless

Please clear this up.


Greeting X23
Title: Re: [Plugin] Batch Import
Post by: Hoang on October 22, 2010, 10:46:32 AM
No support from author!

Is it possible to support batch import to special cat (subcat not to root) ?

Title: Re: [Plugin] Batch Import
Post by: nameless on November 18, 2010, 11:38:44 PM
thanks for this mod and it works good with 4image 1.78

but if i have an exit category for example XXXX

and i want to Batch Import some category under XXXX category Not to the root

thanks
Title: Re: [Plugin] Batch Import
Post by: nameless on December 10, 2010, 01:18:33 PM
hi evry one
if i use this plug in and when it work it stoped for any reson how can i make it Continue batch
Title: Re: [Plugin] Batch Import
Post by: ca_20gti on December 18, 2010, 07:37:18 AM
Nevermind... I got it to work.. oi
Title: Re: [Plugin] Batch Import
Post by: chrissim on February 02, 2012, 11:28:17 AM
hi,

The batch import mod worked great on my side but i have some hiccups here when i imported my images.
The import process were fine and working well but the only thing the date were wrongly recorded for all images that i imported.

For eg: Today i imported images to my category it should showed today date but it was shown last year July 2011 instead.

Another issue here all the keywords were in hyperlinked in straight line. Can we have those keywords in comma instead

Could someone advise me how to fix these problems here?

Thanks
Title: Re: [Plugin] Batch Import
Post by: V@no on February 03, 2012, 03:13:48 AM
the date were wrongly recorded for all images that i imported.

For eg: Today i imported images to my category it should showed today date but it was shown last year July 2011 instead.

Replace:
$use_image_filemtime = 1;

with:
$use_image_filemtime = 0;


Another issue here all the keywords were in hyperlinked in straight line. Can we have those keywords in comma instead

The plugin was made for v1.7...quite outdated.
Replace:
$default_image_keywords = str_replace(",", " ", $default_image_keywords);
$default_image_keywords = ereg_replace("( ){2,}", " ", $default_image_keywords);

With:
if (version_compare(SCRIPT_VERSION, "1.7.8" "<"))
{
$default_image_keywords = str_replace(",", " ", $default_image_keywords);
$default_image_keywords = ereg_replace("( ){2,}", " ", $default_image_keywords);
}
else
{
  $default_image_keywords = preg_replace("/[\n\r]/is", ",", $default_image_keywords);
  $image_keywords_arr = explode(',', $default_image_keywords);
  array_walk($image_keywords_arr, 'trim_value');
  $default_image_keywords = implode(',', array_unique(array_filter($image_keywords_arr)));
}

Title: Re: [Plugin] Batch Import
Post by: funkruti on May 23, 2012, 10:35:26 AM
i am facing a strange issue..pls hlp

the batch import worked fine for first set of images.....uploaded images with thumbnail successfully.

Now i copied new "folder/thumbnails" ...but now batch import only process 25 Number of images per cycle instead of me specifying value of 50

and batch import only process first folder mentioned in "PATH" and does not automatic JavaScript redirect to next page also not working

pls help

i tried...downloading new batch_import.php but still same issue

i m using 4images 1.7.10

Title: Re: [Plugin] Batch Import
Post by: Nosferatu on May 24, 2012, 10:37:38 AM
Gibts eine Möglichkeit es regelmäßig zu verwenden?

Das Script erstellt ja immer NEUE Ordner... ich möchte die Bilder jedoch in bestehende Ordner kopieren...
Seit dem ich auf php 5 umgestellt wurde.... kann ich bei "neue Bilder checken" immer nur maximal 50-70...

Sobald ich 100 oder 200 angebe, werden mir diese zwar angezeigt, aber wenn ich dann auf "hinzufügen" klicke kommt "keine bilder hinzugefügt", wenn ich es dann reduziere auf 50 bis 70 dann geht es

Gruß
Nosferatu
Title: Re: [Plugin] Batch Import
Post by: alugilak on February 15, 2014, 11:52:25 AM
Ich musste dein Script etwas abändern, damit mein Webserver bei 1blu es angenommen hat.

Ich habe im Ordner admin einen Ordner import erstellt, in dem ich den Bildordner mit samt seinen Unterordnern mit Bildern per ftp hochlade.

Danach führe ich das Script aus und siehe da alle ordner werden angelegt. Wie du schon geschrieben hast, ist es für das einmalige einrichten der Ordner. Zukünfte uploads in die Ordner muss per ftp und neue Bilder checken erfolgen.

// Path to the directory the image data are stored.
// No trailing slash!
$data_src_path = (!eregi("\/import\/", $_SERVER['PHP_SELF'])) ? "./../import/" : "./../../../";
define('DATA_SRC_PATH', $data_src_path);