User login

Complete

To be used with care. Pages are complete only when they meet the posting guidelines.

Customize Drupal page if user logged in or not

The trick here is that you have to use PHP code as your input format and then get the user id (0 means an anonymous user).

$user = load_user(); // should get it

but it's not necessary. It's already in the global variables:

$GLOBALS['user']->uid

So...

Make sure you select PHP for the content filter for your page, and before you use full HTML when writing the page because the default PHP filter doesn't do line breaks.

Then put something like this in your page:

The trick here is that you have to use PHP code as your input format and then get the user id (0 means an anonymous user).

$user = load_user(); // should get it

but it's not necessary. It's already in the global variables:

$GLOBALS['user']->uid

So...

Make sure you select PHP for the content filter for your page, and before you use full HTML when writing the page because the default PHP filter doesn't do line breaks.

Then put something like this in your page:

Node Relativity Access Control description

This module enables access control based on (and requires) the Node Relativity module.

Node Relativity "allows parent-child relationships between nodes to be established, managed and searched" and makes it very easy to create child nodes with a click. Node Relativity Access Control, then, restricts access to nodes in relativity relationships.

Node Relativity Access Control is unique as a user access module in that it gives a user granted access to a node relativity node access to all that node's progeny as well.

This module enables access control based on (and requires) the Node Relativity module.

Node Relativity "allows parent-child relationships between nodes to be established, managed and searched" and makes it very easy to create child nodes with a click. Node Relativity Access Control, then, restricts access to nodes in relativity relationships.

Node Relativity Access Control is unique as a user access module in that it gives a user granted access to a node relativity node access to all that node's progeny as well.

Agaric guide to Drupal image gallery sites

  • Image_import works even though the project page says it doesn't: it is now a contributed module packaged with image.
  • You should create your image gallery category before doing a big import.
  • And if you're going to be importing lots of pictures, you probably want "promote to front page" turned off by default for images.

Don't promote images to front page:
/admin/content/types/image

...

So to fix this after the fact, get all those pictures off your front page:

  • Image_import works even though the project page says it doesn't: it is now a contributed module packaged with image.
  • You should create your image gallery category before doing a big import.
  • And if you're going to be importing lots of pictures, you probably want "promote to front page" turned off by default for images.

Don't promote images to front page:
/admin/content/types/image

...

So to fix this after the fact, get all those pictures off your front page:

Ask Agaric: Turning off display of errors

Question: I've given up trying to solve the problem. I just want to hide the error messages. Where do I turn error reporting off?

Agaric Answer:

In Drupal 5:

Administer » Site configuration » Error reporting
admin/settings/error-reporting

Another day saved by Agaric Design Collective, sweep-it-under-the-rug division.

Question: I've given up trying to solve the problem. I just want to hide the error messages. Where do I turn error reporting off?

Agaric Answer:

In Drupal 5:

Administer » Site configuration » Error reporting
admin/settings/error-reporting

Another day saved by Agaric Design Collective, sweep-it-under-the-rug division.

CSS Trouble in Safari? Check your comments

If you're having CSS display problems in the Apple Macintosh Safari browser, for an otherwise great-looking web site, your issue may be incorrect commenting etiquette.

/*  Comment   */

is cool.

//  Comment

could cause issues.

If you're having CSS display problems in the Apple Macintosh Safari browser, for an otherwise great-looking web site, your issue may be incorrect commenting etiquette.

/*  Comment   */

is cool.

//  Comment

could cause issues.

The former is simply proper cascading style sheet comment markup, and the latter is wrong, but it seems other browsers are more forgiving than Safari. We had people saying how much they liked the site, how good it looked, and I kept testing it in Safari and getting into a really bad mood.

Changing the order of pages in the menu

First thing: we're talking pages here, for changing the order of links you have fewer options with get_links_list or more with a plugin.

Strangely, the default sort order of pages is alphabetical, not the order you set with the page order ranking. To fix that, and &sort_column=menu_order to your wp_list_pages command.

First thing: we're talking pages here, for changing the order of links you have fewer options with get_links_list or more with a plugin.

Strangely, the default sort order of pages is alphabetical, not the order you set with the page order ranking. To fix that, and &sort_column=menu_order to your wp_list_pages command.

<?php wp_list_pages('title_li=<h1><a href="http://example.com/" title="Example Site Home">Example.com</a></h1>&sort_column=menu_order'); ?>

Drupal's weird occasional need to login twice

It's actually a persistent need to login twice, on occasional installs.

Of all our servers, including a number with this host (shared hosting), this is the only one with the problem.

PHP version 4.4.4
MySQL version 4.1.21-standard

Something that seems to fix this:

Comment out the URL path.

// $base_url = 'http://www.example.com/drupal'; // NO trailing slash!

This worked for one site on a multi-site install, testing now on a separate Drupal installation on the same account.

It's actually a persistent need to login twice, on occasional installs.

Of all our servers, including a number with this host (shared hosting), this is the only one with the problem.

PHP version 4.4.4
MySQL version 4.1.21-standard

Something that seems to fix this:

Comment out the URL path.

// $base_url = 'http://www.example.com/drupal'; // NO trailing slash!

This worked for one site on a multi-site install, testing now on a separate Drupal installation on the same account.

Theming CCK the Agaric Way

CCK is in constant development, so by the time I finish writing this, this advice will be obsolete.

Seriously, if you've been searching the internet for information on how to theme Drupal CCK nodes, you should probably stop, because at the time of this writing the best documentation with invaluable example files is in the module download itself: cck/theme

CCK is in constant development, so by the time I finish writing this, this advice will be obsolete.

Seriously, if you've been searching the internet for information on how to theme Drupal CCK nodes, you should probably stop, because at the time of this writing the best documentation with invaluable example files is in the module download itself: cck/theme

Wrapping text into columns: no reasonable automatic method

So over at Driscoll Associates "Where We Operate" modular home pages we wanted that long list of local Massachusetts counties and towns to wrap into columns.

It turns out there's not reasonable way to make them wrap:

http://alistapart.com/articles/multicolumnlists

Maybe CSS will get there soon.

So over at Driscoll Associates "Where We Operate" modular home pages we wanted that long list of local Massachusetts counties and towns to wrap into columns.

It turns out there's not reasonable way to make them wrap:

http://alistapart.com/articles/multicolumnlists

Maybe CSS will get there soon.

Why is this stupid grey line in my theme?

Is there an annoying grey line in your Drupal theme, #ccc in color and 1px thick? Just a little gray border of completely unknown origin, seemingly caused by your header table or your body content table?

Would you like it to go away? Are you trying to remove it from a bluemarine theme you want to customize?

Is the line beginning to drive you insane trying to get rid of it?

Have you run out of HTML elements and CSS selectors to override?

If you searched for "die #cccccc one pixel border line, die" then we can't imagine why else you're here.

Is there an annoying grey line in your Drupal theme, #ccc in color and 1px thick? Just a little gray border of completely unknown origin, seemingly caused by your header table or your body content table?

Would you like it to go away? Are you trying to remove it from a bluemarine theme you want to customize?

Is the line beginning to drive you insane trying to get rid of it?

Have you run out of HTML elements and CSS selectors to override?

If you searched for "die #cccccc one pixel border line, die" then we can't imagine why else you're here.

Syndicate content