DrupalBin
Submit Code
About
Recent Posts
Code
1 hour 56 min
ago
Fix for my user handler
2 hours 19 min
ago
Fix for my user handler
2 hours 23 min
ago
my user handler
4 hours 11 min
ago
more
Tags
CCK
fapi
javascript
jquery
menu
module
Panels
simpletest
template.php
test
theme
views
more tags
User login
Log in using OpenID:
What is OpenID?
Username:
*
Password:
*
Create new account
Request new password
Log in using OpenID
Cancel OpenID login
Home
taxonomy
how to access [name] of first object?
August 3, 2008 - 9:44pm — Anonymous
Array
(
[
3
]
=> stdClass Object
(
[
tid
]
=>
3
[
vid
]
=>
1
[
name
]
=> puppy
[
description
]
=>
[
weight
]
=>
0
)
taxonomy
Read more
Fix for Argument handling code for a view taking in TID as argument, trying to get the parent TID to be returned (if it has)
June 27, 2008 - 11:40am — Anonymous
// note that this only gets the immediate parent
if
(
$args
[
0
]
)
{
$parents
=
taxonomy_get_parents
(
$args
[
0
]
)
;
if
(
$parents
)
{
foreach
(
$parents
as
$parent
)
{
$parentID
=
$parent
->
tid
;
arguments
taxonomy
views
Read more
Argument handling code for a view taking in TID as argument, trying to get the parent TID to be returned (if it has)
June 27, 2008 - 10:14am — Anonymous
if
(
taxonomy_get_parents
(
$args
[
0
]
)
)
{
$args
[
0
]
=
taxonomy_get_parents
(
$args
[
0
]
)
;
}
return
$args
;
arguments
taxonomy
views
Function to retrieve a certain level from a vocabulary
June 25, 2008 - 7:27am —
Wim Leers
function
taxonomy_get_level
(
$vid
,
$level
)
{
static
$levels
;
if
(
!
isset
(
$levels
[
$vid
]
[
$level
]
)
)
{
$tree
=
taxonomy_get_tree
(
$vid
)
;
foreach
(
$tree
as
$term
)
{
taxonomy
Read more
get vocab depth
May 10, 2008 - 10:47am —
Wim Leers
function
taxonomy_vocabulary_get_depth
(
$vid
)
{
$tree
=
taxonomy_get_tree
(
$vid
)
;
foreach
(
$tree
as
$term
)
{
if
(
$term
->
depth
>
$depth
)
{
$depth
=
$term
->
depth
;
}
}
taxonomy
Read more
taxonomy_select_nodes doesn't work for me! :(
April 18, 2008 - 10:56am — Anonymous
$result
=
taxonomy_select_nodes
(
Array
(
$termkey
)
,
'or'
,
0
,
FALSE
,
'n.sticky DESC, n.created DESC'
)
;
drupal_set_message
(
'fetchimages_getnodelist(): got result'
)
;
taxonomy
Read more
Show node parent terms
March 15, 2008 - 8:28pm — Anonymous
<?php
// split out taxonomy terms by parent
function
bowwowtheme_liquid_print_terms
(
$nid
)
{
$terms
= taxonomy_node_get_terms
(
$nid
)
;
$links
=
array
(
)
;
$processed
=
array
(
)
;
if
(
$terms
)
{
parent
taxonomy
terms
Read more
Argument handler for terms restricted to vocabulary
November 20, 2007 - 12:21am — Anonymous
function
taxonomy_combination_views_arguments
(
)
{
$arguments
=
array
(
)
;
foreach
(
taxonomy_get_vocabularies
(
)
as
$vocabulary
)
{
if
(
$vocabulary
->
taxonomy_combination_show
)
{
taxonomy
views
vocabulary
Read more
Fix for Turn a flat taxonomy-tree into a real tree
November 2, 2007 - 7:31am — Anonymous
$terms
=
taxonomy_get_tree
(
9
)
;
// build a map tid->term
$tree
=
array
(
)
;
foreach
(
$terms
as
&
$term
)
{
$tree
[
$term
->
tid
]
= &
$term
;
}
// add child links to every node
taxonomy
tree
Read more
Turn a flat taxonomy-tree into a real tree
November 2, 2007 - 7:22am — Anonymous
$terms
=
taxonomy_get_tree
(
9
)
;
// build a map tid->term
$tree
=
array
(
)
;
foreach
(
$terms
as
&
$term
)
{
$tree
[
$term
->
tid
]
= &
$term
;
}
// add child links to every node
taxonomy
tree
Read more