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

Ajax image uploader

Hi everyone,

i'm looking to add the the new ajax upload facility [in upload.module i think] to the image.module to give users some indication of how long their upload will take.

I've not had chance to look at the code in upload.module so i was wondering if anyone else had had a go at this??

cheers
Tom

form_submit not updating the database

I'm in the process of learning how to create a custom Drupal module, and have hit a snag with a database update.

My issue is in the form_submit hook. This is getting fired for the Insert, and my inserts are working fine. However, something is going wrong with the updates, but my troubleshooting code is not firing so I'm really having a hard time tracking this down. Here's the function in question:


function issues_project_submit($form_id, $form_values) {
global $user;
$start = NULL;
$end = NULL;

//preprocess the dates if needed
if (!empty($form_values['startdate'])) {
$start = strtotime($form_values['startdate']);
}
if (!empty($form_values['enddate'])) {
$end = strtotime($form_values['enddate']);
}

//For troubleshooting
watchdog('debugging', 'in submit');

if ($form_values['projectid'] == 0) {
$id = db_next_id('issues_projects');

$sql = 'insert issues_projects (';
$sql .= 'project_id, project_name, start_date, end_date, created_by, created_on) values (';
$sql .= $id .', ';
$sql .= "'". check_plain($form_values['projectname']) ."', ";

if ($start) {
$sql .= "'". date('Y-m-d', $start) ."', ";
}
else {
$sql .= "null, ";
}

if ($end) {
$sql .= "'". date('Y-m-d', $end) ."', ";
}
else {
$sql .= "null, ";
}

$sql .= $user->uid .", ";
$sql .= "'". date('Y-m-d') ."' ";
$sql .= ');';

Place Simplenews Block on Page

I have Drupal 4.7 with Simplenews. Module seems to be working fine. I would like to place the Simplenews block on a regular page (node) so I can point users directly to the page to signup.

I did a search of forums and found this code used to place a block within a page:

Drupal + MyThreads Searching

I got drupal 4.7.x (by itself) and MyThreads (by itself) for my links solution.
"MyThreads" is a yahoo styled search engine. I want to synchronize the two! Yes. Yes I do.

I already started a reply/comment thread on accident so this is the TOPIC.
Kill me I can't delete the reply/comment!! Or I'd repost the whole thing.
(I am probably off topic even, but the IDEA hit me when I was reading the forum)

Q: MENU_LOCAL_TASK goes to blank page with Flexinode

I have this in my menu hook:

  if (arg(0) == 'node' && is_numeric(arg(1))) {
    $items[] = array('path' => 'node/'. arg(1) .'/parts', 'title' => t($test),
      'callback' => 'parts_page', 'access' => user_access('access content'),
      'type' => MENU_LOCAL_TASK, 'weight' => 2);
  }

and then this function that it should be calling:

Language switcher doesn't change content

when i translate /en/node/12 into hungarian, it creats an en/node/13 article instead of making a /hu/node/12 as a pair...
the problem with this is that I can only change content according to the language preferences on the main page but not inside a node. so when I click on a blog entry in english at e.g. /en/node/12 and change the language, then it goes to hu/node/12 where the same english entry appears, only with hungarian menu items. a multilinguar site makes no sense like this... it should change the content with the language every time. The only way to switch is to put a link to translations on every page.
is it supposed to be like this??

another problem with this is that I cant use translated categories. when I translate taxonomy terms within one container (I cannot translate one term in container A to term in container B), then translated categories doesnt show up on the translation page at all. So I can only add different categories to a translated post if I made a separate container with a different language. So I cannot switch language through categories either. In fact this whole lang. switching thing ONLY works on the main page. :(((
translated categories have different node numbers too.

Multilingular taxonomy blocks dont work either, they dont appear on site and its also impossible to delete them.
I just reinstalled everything yesterday, I really dont want to do that again..

Pages

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