Hello drupal folks.
I wrote my first module last night. And it seemed too easy like I probably missed something critical. It works as intended. But beings this is my first module, I would appreciate some wiser eyeballs giving it the once over.
The module is to basically provide author specific pages/feeds via ?q=author/uid or ?q=author/uid/feed
I took code from the taxonomy module and tweaked as necessary. don't know why the spacing isn't sticking oh well.
Feedback is much appreciated.
<?php
// $Id: author_page.module,v 1.0 2005/11/02 20:41:00 Thomas G. Willis thomas.g.willis at pobox.com Exp $
/**
* @file
* Provides a page for nodes by author such as ?q=author/1 or ?q=author/1/feed.
*/
/**
* Implementation of hook_help().
*/
function author_page_help($section) {
switch ($section) {
case 'admin/modules#description':
return t('Provides a page for nodes by author');
}
}
/**
* Implementation of hook_perm().
*/
/*
*don't think this is needed
function author_page_perm() {
return array('access author page');
}
*/
/**
* Implementation of hook_menu().
*/
function author_page_menu($may_cache) {
$items = array();
if ($may_cache) {
$items[] = array('path' => 'author', 'title' => t('author page'),
'callback' => 'author_view_page',
'access' => user_access('access content'),
'type' => MENU_CALLBACK);