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

Tell-a-friend vs. Referrer vs. multiple modules

So I've run into rather an interesting quandry, and would like to toss it out for advice.

For a site I'm building, we want users to have the ability to refer their friends to a specific page. There was no such module on the project/Modules page for 4.6.x, so I figured I'd write one. The result (largely a combination of the print and feedback modules) is this simple module:

http://www.garfieldtech.com/tellafriend.tar.gz

We were planning on contributing it back to Drupal.org as a contributed module, but then I noticed this module in CVS:

http://drupal.org/node/16499

Same name, but actually does something different. (Mine refers pages, that one refers the whole site only.) The author also has his account set to not let me contact him. The discussion thread http://drupal.org/node/15732) on that, however, revealed these other, apparently out-dated and not-recently-updated modules:

http://drupal.org/project/refer
http://drupal.org/node/7827

So between the lot of them, including the module I just wrote, it looks like there's 3 refer-friend-to-this-page modules and one refer-friend-to-whole-site module, but that module has a namespace collision with one of the page-specific modules (mine, of course :-) ). And none of them, it seems, offer invite-to-join-site functionality.

So, I'll throw it out to the community. What do we do with all of this code? :-) It seems sensible to me to be able to refer individual pages, not the whole site, but to invite to join the site. Any of the authors of those modules interested in a merger of some kind? Should I just submit my module to CVS and let someone else figure out the namespace issue? Should I rename it and then do the same? Something else?

Display search result in main page

Hi all,

I am trying to build a module that queries the site using Google, and displays the search result within the main page. I have tried to

fopen($url,'r') // Store query result in $result
...
print theme('page',$result)

but it the entire "Google search" block disappears, and the results get displayed twice (once above the theme, but also inside the main page, as desired).

Thanks in advance,
Olivier

Local task item path misbehaving

For a group of local task items I have a default item with a path as 'whalemail/addressbook/index' and yet when drupal renders the page it just uses a path of 'whalemail/addressbook'... WHY?!!! This is driving me nuts.

A module installed in 'sites/example.com/modules' should override the same module installed in the main 'modules' directory.

With multi-site set ups, it is possible to add a module to a single site by installing it in 'sites/example.com/modules'. This works as expected. By this same logic, I shouldn't I be able to override existing system-wide(shared) modules in the same way?

AJAX form_autocomplete problem

Hi,

I was trying to use the form_autocomplete functionality, however I got some problems. I have downloaded the latest drupal HEAD version.

When I for example user the already included user/autocomplete everything works fine:

function _messenger_addressbook() {
$output = '

Messenger! Addressbook

';

$author = form_autocomplete(t('Username'), 'user', '', 30, 60, 'user/autocomplete', NULL, NULL, TRUE);
$form = form($author);
$output .= $form;

print theme("page", $output);
}

But when I try to do this myself there is something wrong:

function messenger_menu($may_cache) {
global $user;

$items = array();
$view_access = user_access('access messenger');

if (!$may_cache) {
$items[] = array('path' => 'messenger/user_autocomplete',
'title' => t('messenger user autocomplete'),
'callback' => 'messenger_user_autocomplete',
'access' => $view_access,
'type' => MENU_CALLBACK);
$items[] = array('path' => 'messenger/compose',
'title' => t('compose message'),
'callback' => '_messenger_compose',
'access' => $view_access,
'type' => MENU_NORMAL_ITEM,
'weight' => 4);
...
}
return $items;
}

function _messenger_compose() {
$output = '

Messenger! Compose message

recursive functions

could anyone point me in the right direction for a way to find the number of nodes in a taxonomy term, as well as all of the child nodes underneath it?

recursive functions aren't a strong point of mine, so any resources, pseudo code, etc would greatly help

thanks

Pages

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