This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

image.module mass upload of images

Hi,

I am using the image.module for displaying my photo galleries. What is the best option available for mass uploading of images into a gallery ?

Image Publishing modules seems to offer support similar to the ones available in gallery2 but there is no clear 'howto' describing embedding the gallery applet ?

At photobar seems to be the best bet ?

Is there any other easy way ?

Thanks in advance

regards

Karthik

how does upload module create new input field each time?

I'm looking at this and can't figure it out, it's obviously some kind of javascript thing, but what? any help would be greatly appreciated, I need this kind of behavior for a module I'm developing, even a hint! please! :)

function _upload_form($node) {

$form['#theme'] = 'upload_form_new';

if (is_array($node->files) && count($node->files)) {
$form['files']['#theme'] = 'upload_form_current';
$form['files']['#tree'] = TRUE;
foreach ($node->files as $key => $file) {
$description = file_create_url((strpos($file->fid, 'upload') === false ? $file->filepath : file_create_filename($file->filename, file_create_path())));
$description = "". check_plain($description) ."";
$form['files'][$key]['description'] = array('#type' => 'textfield', '#default_value' => (strlen($file->description)) ? $file->description : $file->filename, '#maxlength' => 256, '#description' => $description );

$form['files'][$key]['size'] = array('#type' => 'markup', '#value' => format_size($file->filesize));
$form['files'][$key]['remove'] = array('#type' => 'checkbox', '#default_value' => $file->remove);
$form['files'][$key]['list'] = array('#type' => 'checkbox', '#default_value' => $file->list);
// if the file was uploaded this page request, set value. this fixes the problem
// formapi has recognizing new checkboxes. see comments in _upload_prepare.

Help with logotool module - hook_init behaviour?

First off, here's my newest module:

http://cvs.drupal.org/viewcvs/drupal/contributions/modules/logotool/logo...

It works fine under the 'normal' and 'random' modes, but when you select 'specifed' mode although it sort of works, I'm having trouble with setting a default logo when a match ISN'T made. Yeah that's right... You'd think that'd be the easiest part? Well that's the part I'm having trouble with...

Here's the code for hook_init:

/**
 * Implementation of hook_init
 */
function logotool_init() {
  switch (variable_get('logotool_display', 0)) {
    case '0':
      variable_set('logotool_logo', variable_get('logotool_path', ''));
      break;
    case '1':
      $logos = file_scan_directory(variable_get('logotool_folder', LT_CWD), '.*');
      variable_set('logotool_logo', array_rand($logos));
      break;
    case '2':
      $temp = explode("\n", variable_get('logotool_pages', ''));
      foreach ($temp as $a) {
        $logo[substr($a, 0, strpos($a, '|'))] = trim(variable_get('logotool_folder', LT_CWD).'/'.substr($a, strpos($a, '|')+1));
      }
      if (array_key_exists($_GET['q'], $logo)) {
        variable_set('logotool_logo', $logo[$_GET['q']]);
      }
      break;
  } // end switch
} // logotool_init

Now case '2' is what I need help with and as you can see it currently has no provisions if a match ISN'T made but in this state... it works... Only it displays the same logo as was specified previously when no match is made (obviously). So common programming sense tells me that all I need to do is add an 'else' to the code like this:

problems with do_search and advanced search

I'm still having a terrible time implementing an advaced search. I've created an advanced search form and I can add these values to the query_string. But I can't seem to get my do_search function to work in hook_search. It's really frustrating....

How can I pass the value from the basic form to do_search and still have an advanced search? Here's my hook_search function

<?php>
function image_search($op = 'search', $keys = null) {
# print 3 1's
#$dump = print_r($keys);
#error_log($dump,0);
switch ($op) {
case 'name':
return t('image');
case 'reset':
variable_del('image_cron_last');
return;
case 'search':
$reader_name = search_query_extract($keys, 'reader_name');
$reader_home_town = search_query_extract($keys, 'reader_home_town');
$gallery_name = search_query_extract($keys, 'gallery_name');
$gallery_description = search_query_extract($keys, 'gallery_description');
$photo_description = search_query_extract($keys, 'photo_description');
$published_date = search_query_extract($keys, 'published_date');
#print "

$keys

";
$find = do_search($keys,'node');
// Load results
$results = array();
foreach ($find as $item)
{
$node = node_load($item->sid);

// Get node output (filtered and with module-specific fields).
if (node_hook($node, 'view')) {

array_filter() and array_keys()

Hi,

Anyone able to tell me,please, how I might debug this code , to find out what $element is not an Array. My attempt just returned ArrayArrayArrayArray etc etc

array_filter(): The first argument should be an array in /home/web/multisite/modules/contrib/catres.module on line 880.
array_keys(): The first argument should be an array in /home/web/multisite/modules/contrib/catres.module on line 880.

hook_exit problem/question

I finally wrote my first module, and of course it couldn't be something simple, but had to poke around in the internals of the drupal system itself.

My problem is that I want to add some HTML to the generated page after all is said and done, so I looked at hook_exit and read in the http://api.drupal.org/api/4.7/function/hook_exit page that

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions