Once users log in I'd like to show a welcome page which includes editable content, a few modules listing things such as who's online and who the newest registered user is, latest forum topics, popular content et c. It would also be nice to either list nodes the user is tracking or have a link to the tracking page. Is there already a module for this and would it be hard to make?

Comments

suydam’s picture

Did you ever figure this out? I posted the same question today after noticing you never got an answer.

suydam’s picture

KLUDGE ALERT:
I added a field "seen_welcome" to the users table.
The field is tinyint, not null, default '0'

If they're logged in, we check for the "seen_welcome" field. If that's set to 0, then the block re-directs to my pre-defined welcome page (and sets seen_welcome = 1).

My custom block:

<?php
// I added this block to every page....
// it has three states:
// 1. If they've already seen the welcome page, do nothing at all
// 2. if they haven't seen the welcome page, send them there  (for me it's /?q=node/83)
// 3. If they haven't seen the welcome page and we're ON the welcome page, show the content


if ( _has_seen_welcome( $user->uid ) ) {
	// do nothing...this block is on every page, so it'll either display content, redirect to the welcome page, or do nothing
}
elseif ( !_has_seen_welcome( $user->uid) && arg(1) == 83 ) {

	// YOUR CONTENT GOES HERE
	
}
else {
	// we're not where we wanna be...send them to node 83
	drupal_set_header("Location:/?q=node/83");
}

function _has_seen_welcome( $uid ) {

	global $user;

	if ( isset( $user->seen_welcome ) && ( $user->seen_welcome == '1' ) ) {
		return 1;
	}
	else {
		return 0;
	}
}

?>

The block only displays for logged in users (because anons don't need the "welcome page"):

<?php
global $user;
if ( $user->uid ) {
   return TRUE;
}
else {
   return FALSE;
}
?>
mike.hobo’s picture

Hey, I tried this, but I guess the field never gets updated in the user table.

Here's the code... swapped and chopped a little.


function _has_seen_welcome( $uid ) {

    global $user;

    if ( isset( $user->seen_welcome ) && ( $user->seen_welcome == '1' ) ) {
        return 1;
    }
    else {
        return 0;
    }
}

if ( _has_seen_welcome( $user->uid ) ) {}
else {
    drupal_set_header("Location:/node/143");
}

What code changes it to 1?

solipsist’s picture

Due to the major improvements in Drupal since I wrote this, two years ago, there's a plethora of ways to do this now. I recommend using LoginToboggan to handle the redirect, Panels to build the page with information and Views with arguments to display content that is relevant to the user.

--
Jakob Persson
Webbredaktoren - www.webbredaktoren.se

--
Jakob Persson - blog
Leancept – Digital effect and innovation agency