Submitting Forms and the Variable table [Solved]

Hello All,

I am working on a module that has a 'Settings' page, and uses the values later when displaying content. My question is, when I use variable_get to retrieve the settings, it returns 'Array' instead of the array's value.

I've been reading "Pro Drupal 7 Development", and my form is pretty simple and based off that. I also read in this thread that Drupal creates the variable in the variable table when the form is submitted, so I don't actually call set_variable anywhere.


/**
* Define the settings page form.
*/
function advertisement_settings_nameform($form_state)
{
$form['advertisement_speed'] = array
(
'#type' => 'textfield',
'#title' => t('Speed at which the carousel rotates'),
'#default_value' => '3',
'#maxlength' => 5,
'#description' => t("The speed at which the carousel rotates."),
);

$form['advertisement_content'] = array
(
'#type' => 'radios',
'#title' => t('Advertisement Content Options'),
'#default_value' => variable_get( 'advertisement_content', 0 ),
'#options' => array
(
t('Images'),
t('Text'),
t('Images and Text'),
),
'#description' => t('Choose what content you would like displayed in your advertisement.'),
);

$form['advertisement_display'] = array
(
'#type' => 'radios',
'#title' => t('Advertisement Display Options'),

Link to first unread reply or comment in forum

Hello,

Once upon a time I noticed that my D7.x forum had such a link, which was amazing, but suddenly it was gone and I'm not sure what module or code which was responsible for it. I have advanced forums installed and in use, does anyone know anything about this forum feature?

Only being able to jump to the last post, does not easily let you find the first unread one.

I'm using D7.4 and advanced forum 7.x-2.0-alpha2.

I would be very happy to receive some insight.

Best regards,
Ao

dynamically adding fields while adding content

I will be creating an event content type that will have multiple sections.

Part of it will be sponsors, so I will create a sponsor content type and build up a series of nodes to be used across many events.

The question I have is how to let the user add these sponsors to the event page. Some events may have 2 sponsors and some events may have 10 or possibly even more...

picture styles

Hello, i have a curios problem with my d7 install and i need help.

theme a specific node

Hi - Am trying to use a tpl file to theme a specific node - let's say nid node/123

In my theme's template directory I am trying to use node-123.tpl.php. I also try node__123.tpl.php and node-123-page.tpl.php. For a test I simply include in the files print "hi";

Am I crazy? Aren't one of these supposed to work? None of these seem to "take" even after I clear cache and rebuild registry. They simply want to use the node.tpl.php file in the same directory and ignore any attempts.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x