This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

First Module: This was too easy. I must've screwed something up....

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);

Location.module problem - Urgent help needed

I was trying to install the location.module, after doing as instructed in the install file wanted to activate it. Went to the control panel > administer > modules ...and everything is gone, I mean al installed modules have desapeared....

I'm running drupal 4.6 and php 5.0.3. Can you please tell me what am I doing wrong and how can I fix the damage.

I appreciate any help.

Thanks

Preview of Property Listing Module

I am in the middle of writing a module for displaying Real Estate property listings for Drupal. The scheduled release date for this is November 15, which, not coincedentally, is the launch date for a client's site that will be using the module.

Where is the documentation on the meaning/relationship of database fields?

I'm looking for documentation on the meaning/relationship of database fields in Drupal, but my searches aren't finding anything. It's not in in the database.mysql file, not in drupaldocs.org, and I don't see it any of the handbooks.

For example, what is the meaning of the "status" field in the node module? Specifically, if a person registers, but doesn't answer his/her confirmation email, is there a specific value for this?

development of a module that interacts with template

Hi,

Is there any special hook which allows to interact with template? Also, I'd like to know how can I use hooks which are located not in core.php(for example, hook_view, which is located in node.php)?

Thanks in advance.

role_theme module

Hi there

Taxonomy_theme didn't do quite what I wanted, so I hacked/cut and pasted together a module which will change the theme based upon the role of the current user. To my amazement, I got it working in 2 days. (up to this, my experience with php was limited to redesigning some php-based templates, and I haven't done any real programming since high school) Once I get this to a nice, releaseable state I have no intention of maintaining it. There's not much to it and most anyone should be able to figure it out.

    handy features:
  • can select a different theme for each role, including a "user select" theme which gives user selected theme precedence
  • you can "weight" roles, so that a certain role will take precedence over another when the theme is determined
    things to do:
  • make sure it's compatible with all other theme-selecting systems
  • figure out how hard it would be to remove theme selection section from profile pages of users whose roles have predetermined themes, and do it if it's not too hard.
  • clean up/comment code. oh man is it ugly.
  • optimize code
  • figure out which parts of the code is actually completely unnecessary (e.g. the parts of code that are left over from modules I cannibalized and don't really understand but haven't tested the module without yet) and get rid of them

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions