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

Login to Drupal via URL parameters

Hi,

I was wondering if someone form the community already has experience with logging in users via a couple of parameters in the url. (I didn't quite find what I was looking for yet by searching around here.)

Jeopardy Module

I have two problems, one of which is relevant minor, and one of which is critical to my module working.

I have defined a new node type, called a 'Jeopardy Game' which allows users to submit questions and then from those questions create a game of Jeopardy (themed with CSS and using Javascript to hide/unhide the questions). I've got most of the code working, but I'm having trouble with the actual saving of the information.

I've created a table in the database, and it is mostly being updated correctly except for the question/category fields. Since the number of fields is set in a settings callback, I need to be able to adjust what is inserted into the database each time. Can anyone help me with the proper syntax for this?

Also the minor problem is that the form fields aren't being presented in the order I've created them, so I need to figure out how to fix that as well.

Here is my relevant code so far:

<?php

/**
* Implementation of hook_form().
*/
function jeopardy_form(&$node) {
$rows = variable_get('number_of_questions', 5);
$cols = variable_get('number_of_categories', 5);

$form['title'] = array(
'#type' => 'textfield',
'#title' => t('Name of game - should be unique!'),
'#required' => TRUE,
'#default_value' => $node->title,
'#weight' => -5);
$n = 0;
for ($j=1;$j<=$rows;$j++) {
$n++;
$form['category'][$j] = array(

Selecting the first element with jQuery while avoiding errors.

I have noticed that when people write a selector and want only the first element they often write something like $('#someid')[0].somefunction(), the problem is if there are no elements returned by the selector this returns and error since the subscripting '[0]' fails. By re-writing this as $('#someid').eq(0).somefunction() the code works the same and avoids the javascript error if nothing matches the selector.

Voting actions for 5.0

I see in the Contrib Module status sticky that Voting Actions is supposedly set up for 5.0 but it doesn't give any indication that it is on the module itself. So the question is, is it set up for 5.0 at all? If it is where can we download it or is it part of the HEAD or does it even exist at all? Basically what I'm trying to figure out is...

Is there a version for 5.0 and if there is where is it?

Thanks

ecommerce question

I'm thinking of using ecommerce to allow users of a particular role. Now we would have just one merchant account. Customers of course can buy products from different vendors in the same transaction. Now what I am confused about is how I reconcile the books later. Is each vendor notified that their product has been sold? How would I disburse the funds? Am I going to have to do all this manually? I guess I would manually have to disburse the funds somehow which seems like a pain. Thoughts?

How can I have a menu item link to a specific page?

Is there a way I can make a module menu item link to a specific php page/script? I got it all working but it will only let me use internal links otherwise it won't show up at all :(

Thanks in advance,
Jordan

Pages

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