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

changing name of storylinks module

Hello

I recently launched a site and am using the storylinks module for most of my content.

I want storylinks to be called downloads. I tried editing the module myself, and managed to change some references, but couldn't get it all working properly (it links in with my voting modules).

Is anyone able to do this for me?

Thanks

Type Date: Changing default from 0000-00-00 to 00-00-0000

I'm attempting to change the default form of the Type date in one of my tables. By default it is 0000-00-00, however, I want it to be 00-00-0000. The problem is, when I change it to 00-00-0000 and click save, it simply reverts back to 0000-00-00. Why is this and/or how do I make it stick?

Thanks.

How hard is it to build/edit a module?

For my charity social network site (http://drupal.org/node/69729 for more info, or check the project blog www.makingthesite.com) I'm thinking about editting or perhaps even making my own module. I have some basic skills in PHP, but never built a big robust site or something with php. I'm also just figuring out Drupal. I'm wondering how hard it is to build and/or edit a module.

echo $username;

After a user logs in I want to display their username, how do I do this in php?
$username = ??????;
echo $username;

$user->uid from popup

I want to get $user->uid (if authenticated user popped it up) from the
window, popped up by drupal site (not drupal window) *without*
transferring uid as parameter. Is it possible, and if it is, so how?

Thank you

Cookies unusable when cache is enabled?

Dear friends, I need to provide "remember me" checkbox for anonymous users so that they don't need to fill in their contact information again and again. I quickly developed the following module:


/**
 * Implementation of hook_comment().
 */
function remember_me_comment($comment, $op) {
  if (($op == 'update') || ($op == 'insert')) {
    if ($comment['remember_me']) {
      // store user information into SESSION array
    }
    else {
      unset($_SESSION['comment_anon']);
    }
  }
}

/**
 * Implementation of hook_form_alter().
 */
function remember_me_form_alter($form_id, &$form) {
  if ($form_id == 'comment_form') {
    if (!$GLOBALS['user']->uid) {
      $form['remember_me'] = array(
        '#type' => 'checkbox',
        '#title' => t('Remember me'),
        '#default_value' => 1,
        '#weight' => -20
      );
    }

    if (isset($_SESSION['comment_anon'])) {
        $form['name']['#default_value'] = $_SESSION['comment_anon']['name'];
	//etc.
    }
  }
}

Should work but when the cache is enabled, even completely another anonymous user can see these saved settings because they will be brought from cache rather from SESSION array. This is very unpleasant and even dangerous because e-mail can be considered confidential information.

Don't you know how to solve this issue? "Remember me" is very important usability feature...

Pages

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