Top posters with total number of members

Displays Top posters with total number of members like on

<?php $users = db_query("SELECT COUNT(nid) AS count, {users}.uid, {users}.name FROM {node} LEFT JOIN {users} ON {node}.uid = {users}.uid WHERE {node}.uid != 0 GROUP BY uid ORDER BY count DESC LIMIT 5");
while ($user = db_fetch_object($users)) {
print "uid."\">".$user->name."";

<?php $users1 = db_query("SELECT Count(uid) as count1 from users");
while ($user1 = db_fetch_object($users1)) {
print "Total members: ".$user1->count1;


Display joining date on Who's new block.

You will have to hack the user.module for this. So be careful while you upgrade.

Find this place at around line 570 in user.module (in function user_block):

case 2:
if (user_access('access content')) {
// Retrieve a list of new users who have subsequently accessed the site successfully.
$result = db_query_range('SELECT uid, name FROM {users} WHERE status != 0 AND access != 0 ORDER BY created DESC', 0, 5);
while ($account = db_fetch_object($result)) {
$items[] = $account;
$output = theme('user_list', $items);


Display useful site statistics - Combine Site summary and Site statistics

xstatistics is a contributed drupal module that provides useful statistics to user. There are two block that give the site statistics.

I found it useful to combine those two blocks into one and provide all the Site Statistics in one place.

Create a new block and paste the code below, select input format as "php"


$res = db_query('SELECT totalcount, daycount FROM {node_counter}');
while($count = db_fetch_object($res)) {
$count_nodes_view_tot = $count_nodes_view_tot + $count->totalcount;
$count_nodes_view_day = $count_nodes_view_day + $count->daycount;

Make the node links prominent or change appearance.

Node links are the links that usually appear on footer of each node, namely - "Read More", "Add Comment" etc.

It is usually a good practice to make it prominent to improve the look of the website.

You will have to modify the

1. Style sheet
2. node.tpl.php.

To make the node links appear like on ( light green ) add the following to your .css file

.links2 {
border-bottom: 1px solid #bbb;
padding-bottom: 0.75em;
margin-bottom: 1.5em;
background-color: #E9FFCA;
color: #235F6B;
border-top: 1px solid #bbb;
padding-top: 0.5em;

Attach Secondary menu under Primary or Move it around

This explains how to attach Secondary menu under Primary like on

You just need to know a bit HTML here. Find this code in your page.tpl.php

<?php if (isset($secondary_links)) { ?>
<?php print theme('links', $secondary_links) ?>
<?php } ?>

Move it below the code for primary menu. Below is the snippet from bluemarine theme.

<?php if (isset($primary_links)) { ?><?php print theme('links', $primary_links) ?><?php } ?>

Highlight Selected Primary Menu item

Selected Primary menu items are not highlighted in default themes. If you wish to have this feature as on then

You will have to

1. Modify Style sheet
2. Modify page.tpl.php
3. Need attached images.

1. Add the following to your .css file. I am using bluemarine theme

#primary {
float: left;
width: 100%;
/*background: url("bg.gif") repeat-x bottom;*/
font-size: 118%;
line-height: normal;
background-color: transparent;

#primary ul {
margin: 0;
padding: 8px 8px 0;
list-style: none;

#primary a, #primary strong, #primary span {

About us

My Drupal is an attempt to help beginners and intermidate drupal developers, with common issues , solutions, Tips, Site Recipes etc.

The content on this site is derived from past learnings and experiences and we believe it will be a great resource for all Drupaliers.

This site is totally FREE to use, Everyone is welcome to post their articles, participate in forums.

This site is not affiliated with Drupal or anyone, it is an indepent resource site, with sole intention to help jumpstart your drupal site or enhance it to attract users.

Comments, Suggestions appreciated. - Site recipe

Want to know how was created ? Here's the recipe. Contributed Modules Used: codefilter emailpage feedback front_page gsitemap image invite links links_related links_weblink notify pathauto profile_pages quicktags sitemenu taxonomy_block taxonomy_dhtml taxonomy_filter upload urlfilter user voteupdown votingapi xstatistics Theme Used: MyDrupal01 Theme was used, with slight modification. Front page The front page was created using the "Front page" contributed module. Very simple HTML table was created with 2 colmns and 2 rows. Next: - Using the "Place blocks anywhere" technique mentioned on this site, the php code was added to these table. The blocks are created when you install taxonomy_dhtml module. One block is created per taxonomy vocabulary. You can find the block name and delta from admin-> Blocks and put that block on front page.


Subscribe to My Drupal RSS