DrupalBin
Submit Code
About
Recent Posts
Code
Fix for Fix for Code
Fix for Code
Code
Node type whitelist
an axe coach accessories
coach purses married
Fix for de las ghd alturas
de las ghd alturas
Code
more
User login
Log in using OpenID:
What is OpenID?
Username:
*
Password:
*
Log in using OpenID
Cancel OpenID login
Create new account
Request new password
Tags
CCK
drupal
fapi
jquery
menu
module
php
simpletest
taxonomy
test
theme
views
more tags
Home
filter
jQuery Disaster
August 16, 2011 - 4:41pm — Anonymous
/* This bit of code is inside a filter's processing function:
$mod_path = drupal_get_path('module', 'counter');
drupal_add_js($mod_path .
filter
jquery
Read more
Fix for Filter hook implementation
April 11, 2010 - 10:04am —
Aran
# Problem caused by line 750 in form.inc
if
(
!
isset
(
$form
[
'#validate'
]
)
)
{
if
(
function_exists
(
$form_id
.
'_validate'
)
)
{
$form
[
'#validate'
]
=
array
(
$form_id
.
bbcode
filter
Read more
Filter hook implementation
April 11, 2010 - 10:00am —
Aran
# DRUPAL 7
/**
* Implements hook_filter_info().
*/
function
xbbcode_filter_info
(
)
{
$filters
[
'xbbcode'
]
=
array
(
'title'
=
>
t
(
'Extensible BBCode'
)
,
'description'
=
>
t
(
'Renders sta
bbcode
filter
Read more
Custom Filter to remove HTML Comments
January 19, 2010 - 4:46pm — Anonymous
/**
* Implementation hook_filter().
*/
function
custom_filter
(
$op
,
$delta
= 0,
$format
= -1,
$text
=
''
)
{
switch
(
$op
)
{
case
'list'
:
return
array
(
0
=
>
'HTML Comment Removal Filte
filter
html
Read more
Example Block Filter
October 25, 2009 - 11:45pm — Anonymous
<?php
$match
=
FALSE
;
$url
=
request_uri
(
)
;
$types
=
array
(
'mycontenttype'
=
>
1
)
;
if
(
arg
(
0
)
==
'node'
&&
is_numeric
(
arg
(
1
)
)
)
{
$nid
=
arg
(
1
)
;
$node
=
node_load
(
array
(
'nid'
=
>
$nid
)
)
;
$ty
block
filter
php
Read more
Find a taxonomy term in a specific vocabulary
February 11, 2009 - 9:18am — Anonymous
foreach
(
$node
-
>
taxonomy
as
$term
)
{
if
(
$term
-
>
vid
= 1337
)
{
return
$term
-
>
tid
;
}
}
filter
taxonomy
vocabulary
Get terms in a specific vocabulary
February 9, 2009 - 11:58am — Anonymous
/**
* Given a node's taxonomy terms, filters out the terms in the specified
* vocabulary.
*
* @param object $terms The node's taxonomy terms
filter
taxonomy
term
vocabulary
Read more
add input format to body
January 29, 2009 - 6:09pm —
David Thomas
<?php
// add input format to custom node form
// this goes in hook_form
//Get metadata for this node type defined in hook_node_info()
$type
=
node_get_types
(
'type'
,
$node
)
;
filter
input filter
input format
Read more
views export code
November 22, 2008 - 12:32pm — Anonymous
$view
=
new
view;
$view
-
>
name
=
'Rulings'
;
$view
-
>
description
=
''
;
$view
-
>
tag
=
''
;
$view
-
>
view_php
=
''
;
$view
-
>
base_table
=
'node'
;
$view
-
>
is_cacheable
=
FALSE
;
$view
-
>
api_version
=
2
;
export
filter
views
Read more
turn multiple selectbox into checkboxes
October 8, 2008 - 6:45pm — Anonymous
function
hook_form_alter
(
$form_id
,
&
$form
)
{
if
(
isset
(
$form
[
'view'
]
[
'#value'
]
-
>
exposed_filter
)
)
{
$view
=
$form
[
'view'
]
[
'#value'
]
;
expose
filter
views
Read more