What does SelectQuery::execute return?

What does the returned structure of SelectQuery::execute() look like?
A simple code example would be greate. Something like:

$result = db_select('fp_subarea')->fields('fp_subarea')->execute();
foreach (row)
  foreach (column value)
    drupal_set_message(value)

Br, freefox

Best WYSIWYG Editor for Drupal Sites?

In the opinion of you experienced developers out there, what is the best WYSIWYG editor for use with managing the content of Drupal sites? I'm currently using NicEdit 0.9, and have found it to be buggy and functionally limited. Specifically, loading up images has been a problem, and formatting text is fairly primitive. Any suggestions?

Login link on home page

Greetings,

1. I am designing my site so that most of the content can be accessed by anonymous users. I would like each page to have a "log in/register" menu tab somewhat like drupal.org that leads to a log in page.
2. Also, I am developing on a local server setup and want to make sure that I can log in as administrator to work on the site after I make the changes in item #1 above.

Setting author of a new node in a custom submit handler D7

I'm creating a new node and a new user at same time and I want to set the newly created user as author of the node. Here is what I do:

I call the node_form_alter
adds user fields to the form
adds a custom submit handler
in the submit handler i create the user
collect the new uid and try to add it to the form and formstate
load the new user

But the author is still -> Anonymous (not verified)

Im at a dead end, please help...

Here is the code


<?php

function add_user_fields(&$form)
{
$form['new_user_name'] = array(
'#title' => 'Navn',
'#description' => 'Your name',
'#type' => 'textfield',
'#required' => TRUE,
);
$form['mail'] = array(
'#title' => 'Email',
'#description' => t('Mail.'),
'#type' => 'textfield',
'#required' => TRUE,
);

// Custom submithandler for creating a user
$form['#submit'][] = 'create_task_form_player_submit_handler';
}

/*
* Implements hook_form_FORM_ID_alter()
*/

function create_task_form_player_task_node_form_alter(&$form, &$formstate)
{
if(!user_is_logged_in())
{
add_user_fields($form);
}

}

/*
* Custom submit handler
*/

function create_task_form_player_submit_handler($form, &$form_state){
$edit = array(
'name' => $form_state['values']['new_user_name'],
'pass' => user_password(4),

Re: Question - Creating Multiple Profile types

Hi there,
With my home learning and ongoing D7 study, I'm working on a demo project, I'm curious as to what the best approach is to creating multiple profiles for users types (ie buyers, sellers, level#1, level#2, level#3 types etc) all based on say, different subscription types as an idea. I would like to be able to create membership type paid subs sites for multitutes of external reasons.

I've seen Profile2 and have a general appreciation of DB structures, but I don't want to waste my learning time going down the wrong route, get side tracked so I can focus on D7.

taxononmy node_load fields

I am working with drupal 7 and am having a lot of trouble finding a php snippet for showing node titles and other fields based on taxonomy terms. Does anyone have a php snippet I could work with?

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x