Drupal is up and running but how do I ...?

Retrieve the Vocabulary Tree

How do I retrieve a vocabulary tree of a certain phrase? For instance, I want to get all the terms associated with 'fruit'? If I have the $vid, I can just use taxonomy_get_tree(). However, how do I get the specific $vid (if it exists) for the vocab => 'fruit'?

Thanks,
Aaron

Culture Fix Web Identity & Design
Digital Folk Art (my blog)

Template Hacking :^)

I've been playing with my template, just getting it to look just the way I want (bar the colours - but I'll get the shape right first). But one thing I cant stand is the page numbering down the bottom of certain pages.

I am using the box_grey theme and it just has standard textual type links at the bottom of the page (and not usually very well organised.) I want to modify them, place them in a nice box of sorts and include disabled links to the pages that are invalid. To me, I prefer to always see something like:

when is hook_user called when listing categories?

I am writing a function (in CVS HEAD) to create custom profile categories & fields for specific roles. In particular, certain user profile categories will only be available to certain user roles.

I'm creating a hook_user call to a custom category lister. However, it seems that when hook_user is called with $op == "categories", you don't have access to the current $user. Is this correct? If so, is there another way I can send certain categories for certain user roles?

Here's my code:

function profile_custom_user($type, &$edit, &$user, $category = NULL) {
	switch ($type)
	{
		case 'form':
			return profile_custom_form($edit, $user, $category);
		case 'categories':
      			return profile_custom_categories($user); 
	}
}
function profile_custom_categories($user) {
	// The following works correctly
	$data[] = array('name' => 'Test Profile', 'title' => 'Test Profile', 'weight' => 4);
	// The following doesn't get called
	if ($user->uid == 1)
	{
		$data[] = array('name' => 'Admin Test Profile', 'title' => 'Admin Test Profile', 'weight' => 4);
	}
	return $data;
} 

function profile_custom_buyer_form(&$edit, &$user, $category)
{
	// This works properly, to test that $user is sent properly with other $ops in hook_user
	if ($user->uid == 1)
	{
		$form[test] = array('#type' => 'fieldset', '#description' => 'Administrator Account');
	}
	return $form;
}

Thanks for any feedback.

- Aaron

Culture Fix Web Identity & Design
Digital Folk Art (my blog)

Facilitate a banner exchange...

My current cms site offers a banner exchange (people sign up with me, I serve the exchange, but not the images). I've been reading the excellent banner module, but I'm not sure I can get that to work as an exchange. The main problems I'm seeing are a) how to call the exchange from another site and b) how to credit that account when they display a banner. Does anyone know if that's possible and how to go about it? Am I missing something that's right in front of my face? Thanks in advance.

Drop down type pages

I couldn't think of any other way to try and describe it, but if you look at the drupal projects page ( http://drupal.org/project ) how does one create something like that? I'm figuring it must be possible because there are a lot of areas within your own drupal site that has this effect (especially in theme mods or even those just at the top of a page you created - ie, where it has VIEW | EDIT | etc etc)

Recent Posts

Ok, recent posts, this is a very efficient menu item (it could be better, but this is not a complaint...)

I have two main questions:

  1. How can I make it so that only I have access to the recent posts page? and
  2. How can I make it so that only forum posts (and maybe pages) show up for the users if I choose to leave it on?

It's a handy tool, but sometimes I think it shows too much information.

Pages

Subscribe with RSS Subscribe to RSS - Post installation