Vertically aligning text using CSS

To vertically align text-based elements, use the line-height property, which specifies the amount of vertical space between lines of text. Simply match the line-height with the height of the element.

h1 {
font-size: 12px
height: 100px;
line-height: 100px;
}

Bluehost sub-directory to main domain

How to make a sub directory (or sub folder) act as the public_html for your main domain on a Bluehost server?

Below is the code for the .htaccess file on the root level above the subfolder:

Also… Drupal settings file needs to indicate the URL name as well.

# Bluehost.com
# .htaccess main domain to subdirectory redirect
# Copy and paste the following code into the .htaccess file
# in the public_html folder of your hosting account
# make the changes to the file according to the instructions.
# Do not change this line.
RewriteEngine on
# Change yourdomain.com to be your main domain.
RewriteCond %{HTTP_HOST} ^(www.)?yourmaindomain.com$
# Change 'subdirectory' to be the directory you will use for your main domain.
RewriteCond %{REQUEST_URI} !^/subdirectory/
# Don't change this line.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Change 'subdirectory' to be the directory you will use for your main domain.
RewriteRule ^(.*)$ /subdirectory/$1
# Change yourdomain.com to be your main domain again.
# Change 'subdirectory' to be the directory you will use for your main domain
# followed by / then the main file for your site, index.php, index.html, etc.
RewriteCond %{HTTP_HOST} ^(www.)?yourmaindomain.com$
RewriteRule ^(/)?$ subdirectory/index.php [L]
 

Format the "submitted by" text in Drupal

I initially used the "submitted by" Drupal module but had a problem with the date appearing correctly using that module. So... placing this function in the template.php did the trick...

The theme name just get's replaced by whatever your theme name is:

This is for posts:

function themename_node_submitted($node) {
  return t('Posted by !username on @date',
    array(
      '!username' => theme('username', $node),
      '@date' => format_date($node->created, 'custom', 'd M Y')
    ));
}

and this for the comments...

function themename_comment_submitted($comment) {
  return t('Posted by !username on @date at about @time.',
    array(
      '!username' => theme('username', $comment),
      '@date' => format_date($comment->timestamp, 'custom', 'd M Y'),
      '@time' => format_date($comment->timestamp, 'custom', 'H:s')
    ));
}

1and1 web hosting and Drupal

I dislike 1and1 web hosting when it comes to Drupal sites, but several of my clients use 1and1 so I make it work. The problem is needing to do additional configuration such as:

adding the following to the .htaccess file ro force PHP 5 rather than the default v4.:

AddType x-mapp-php5 .php
AddHandler x-mapp-php5 .php

Another problem is a memory limitation…. so you need to include a php.ini file:

Here is the code in my PHP.ini, which is placed in the same directory that Drupal runs.

register_globals=off
upload_max_filesize=20 M
max_execution_time=300
memory_limit=40 M
post_max_size=20 M
SMTP:localhost

centering a div horiz/vert in css

.className{
	width:270px;
	height:150px;
	position:absolute;
	left:50%;
	top:50%;
	margin:-75px 0 0 -135px;
}