plugins/gallery/upload.php
changeset 32 9803dde5df5f
parent 17 ecb96b051d08
child 40 2607b83e986d
equal deleted inserted replaced
31:3e8d2acd7388 32:9803dde5df5f
   817             $local_t = RenderMan::preprocess_text($local_t, true, false);
   817             $local_t = RenderMan::preprocess_text($local_t, true, false);
   818             
   818             
   819             $local_d = $desc->run();
   819             $local_d = $desc->run();
   820             $local_d = RenderMan::preprocess_text($local_d, true, false);
   820             $local_d = RenderMan::preprocess_text($local_d, true, false);
   821             
   821             
   822             $subq = '(\'' . $stored_name . '\', \'' . $db->escape($local_t) . '\', \'' . $db->escape($local_d) . '\',\'a:0:{}\', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), ' . $folder . ')';
   822             $subq = '(\'' . $stored_name . '\', \'' . $db->escape($local_t) . '\', \'' . $db->escape($local_d) . '\',\'a:0:{}\', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), ' . $folder . ', \'[]\')';
   823             $sql = "INSERT INTO ".table_prefix."gallery(img_filename,img_title,img_desc,print_sizes,img_time_upload,img_time_mod,folder_parent) VALUES{$subq};";
   823             $sql = "INSERT INTO ".table_prefix."gallery(img_filename,img_title,img_desc,print_sizes,img_time_upload,img_time_mod,folder_parent,img_tags) VALUES{$subq};";
   824             
   824             
   825             if ( !$db->sql_query($sql) )
   825             if ( !$db->sql_query($sql) )
   826               $db->_die();
   826               $db->_die();
   827             
   827             
   828             $idlist[] = $db->insert_id();
   828             $idlist[] = $db->insert_id();
   905         $local_t = RenderMan::preprocess_text($local_t, true, false);
   905         $local_t = RenderMan::preprocess_text($local_t, true, false);
   906         
   906         
   907         $local_d = $desc->run();
   907         $local_d = $desc->run();
   908         $local_d = RenderMan::preprocess_text($local_d, true, false);
   908         $local_d = RenderMan::preprocess_text($local_d, true, false);
   909         
   909         
   910         $subq = '(\'' . $file['stored_name'] . '\', \'' . $db->escape($local_t) . '\', \'' . $db->escape($local_d) . '\',\'a:0:{}\', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), ' . $folder . ')';
   910         $subq = '(\'' . $file['stored_name'] . '\', \'' . $db->escape($local_t) . '\', \'' . $db->escape($local_d) . '\',\'a:0:{}\', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), ' . $folder . ', \'[]\')';
   911         $sql = "INSERT INTO ".table_prefix."gallery(img_filename,img_title,img_desc,print_sizes,img_time_upload,img_time_mod,folder_parent) VALUES{$subq};";
   911         $sql = "INSERT INTO ".table_prefix."gallery(img_filename,img_title,img_desc,print_sizes,img_time_upload,img_time_mod,folder_parent,img_tags) VALUES{$subq};";
   912         
   912         
   913         if ( !$db->sql_query($sql) )
   913         if ( !$db->sql_query($sql) )
   914           $db->_die();
   914           $db->_die();
   915         
   915         
   916         $idlist[] = $db->insert_id();
   916         $idlist[] = $db->insert_id();
   985       }
   985       }
   986     }
   986     }
   987   </script>
   987   </script>
   988   <?php
   988   <?php
   989   
   989   
   990   echo '<form action="' . makeUrlNS('Special', 'GalleryUpload') . '" enctype="multipart/form-data" method="post">';
   990   echo '<form action="' . makeUrlNS('Special', 'GalleryUpload') . '" enctype="multipart/form-data" method="post" onsubmit="if ( window.whiteOutForm ) window.whiteOutForm(this);">';
   991   echo $max_size_field;
   991   echo $max_size_field;
   992   if ( count($errors) > 0 )
   992   if ( count($errors) > 0 )
   993   {
   993   {
   994     echo '<div class="error-box">
   994     echo '<div class="error-box">
   995             <b>The following errors were encountered during the upload:</b><br />
   995             <b>The following errors were encountered during the upload:</b><br />