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

'date' form element and node preview

In my node form I have a 'date' form element. Its value is converted to a unix timestamp in hook_submit and saved to the database. In hook_view the date is displayed with format_date().

Up to this point everything is fine.

But if I want to preview the node I get an 'Unsupported operand types' error, because my $node->mydate field is still an array containing day, month and year as separate elements which format_date() does not like.

Is there an equivalent of image.module for Flash?

Very quick question (I think searching the forum has answered this, but just in case I missed something...)

At the moment I am coding script in to my pages by hand to display flash material, but I wondered if there was anything along the lines of the image module that would allow a file to be uploaded. That way I can let Drupal's file handling keep track of files that are in use, rather than FTP'ing them by hand.

I can't find anything on these lines from a search.

Thanks!

Is paypal_framework working in 4.6?

I see a number of posts and requests for help ending about March 2, 2006
nodes 46736 51181 16199 and several others

FYI: I am adding a simplified version of it to a 4.7 site I am building. I will be automagically charging pre-existing accounts in the background, without any administration forms, and without (much) user input, though i could update the admin forms to 4.7 style later.

Any help, suggestions, info would be welcome. I'll share my code if anyone wants it when it works.

Thanks, John

Using Drupal for web application

I’m evaluating Drupal for web application development. The tool I currently use is CodeCharge Studio, so I’m actually comparing the two.

For example, with CodeCharge I can write a page that creates, edits, lists and deletes items. All this without writing a single line of code, with every possible validation, without writing single SQL query, by using WYSIWYG editor and all that within 5 minutes. And I would get a fully skinable output, because everything is rendered through one template file. And all the HTML code is in this template file.

On the other hand, today I tried to do that with Drupal. I had to write $form array by hand, write 3 functions that handle form processing (theme_*, *_validate, *_submit), write several SQL statements, and write my logic of processing the functionality of page. I ended up with 2 template files: for form and for page. And at the end I came to the conclusion that I cant make a HTML template just for my table that list the items, cause it’s rendered by using theme(‘table’), which is used for every table on the site, and contains heavy logic. Which is also problem for form elements like buttons etc. Even if I write it again it will take me at least 20 minutes of heavy coding, I will end up with 150 lines of code and I will not be able to skin everything the way I want.

I think that it is crucial that CRUD operations are trivial in order to be productive web app developer.

What is the ImageFrame module?

Gallery2 module's readme.txt says

Requirements
----------------
* Gallery 2.1 CVS HEAD (with ImageBlock and ImageFrame modules installed and activated)
* Drupal 4.7 CVS HEAD (preferably after 4.7beta5 was released)

I installed Node Image Block, but I can's find an ImageFrame module? What can that be?

Posting pictures via phone using mailhandler and image module

I have been playing around with the mailhandler module as I wanted to be able to post pictures to my site via email (my wife is expecting so it seemed like a good idea for the big day!)

I couldn't seem to find a ready made solution so I've been working on my own version by modifying mailhandler so it interacts with image. What happens now is that if I post a picture with my email / phone then the post is turned in to an image node, with thumbnails etc

You can see an example post that I've generated here.

I'm fairly new to Drupal so was wondering if I've used the "right" approach...

I have modified mailhandler itself so that during mailhandler_retrieve it looks for a jpeg, and if it finds one it extracts it.

During mailhandler_node_submit if a jpeg is there then it calls a processing routine just before doing node_validate.

The bit I'm not sure about, but is getting the job done, is that processing. The routine constructs an object, as if the file had come from an upload. It then calls image_validate but instead of passing a string it hands over the object. That seems to keep all the other modules happy, and they parse the object as a valid upload.

As a result image happily constructs thumbnails. If the processing routine was successful then the node type is left as an image. If validation failed the type is reverted to whatever was originally assumed. Control passes back to mailhandler_node_submit and the job is done.

Pages

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