[support] get parent taxonomy tree?
vrao
vrao at misteam.net
Thu Nov 24 15:32:49 UTC 2005
nevermind..silly me , didnt even look at term_data
----- Original Message -----
From: vrao
To: support at drupal.org
Sent: Wednesday, November 23, 2005 4:29 PM
Subject: Re: [support] get parent taxonomy tree?
I dont think I gave enough info, the hierarchy tree is particularly important for people who use taxonomy_menu.module
For eg, this is what I do..but am wondering if there is an existing solution which also provides the vocab ID (my function doesnt)
function taxonomy_menu_returntree($tid)
{
$tree=$tid;
$query=mysql_query("select parent from term_hierarchy where tid=$tid");
$result=mysql_result($query,0);
while ($result !=0)
{
$tree = $result . "/" . $tree ;
$query=mysql_query("select parent from term_hierarchy where tid=$result");
$result=mysql_result($query,0);
}
return $tree;
}
----- Original Message -----
From: vrao
To: support at drupal.org
Sent: Wednesday, November 23, 2005 3:10 PM
Subject: [support] get parent taxonomy tree?
Hi,
Is there a function to get the parent tree? for example, the full path for term '15' is website.com/taxonomy_menu/3/10/15 .
Right now, I use taxonomy_get_parents(15) and get to 10..then call it again until I find '0'. Is there a function that either returns the full path of the term or returns the hierarchy tree?
taxonomy_get_parents_all seems to do something completely different...
Thanks,
V
----------------------------------------------------------------------------
--
[ Drupal support list | http://lists.drupal.org/ ]
------------------------------------------------------------------------------
--
[ Drupal support list | http://lists.drupal.org/ ]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20051124/a91c991c/attachment.htm
More information about the support
mailing list