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
›
seanr
›
Recent Posts
seanr
View
Posts
Empty $node->type
December 14, 2011 - 3:24pm —
seanr
//load existing node, if any
$series_nid
=
db_result
(
db_query
(
'SELECT cts.nid FROM {content_type_series} cts WHERE cts.field_series_code_value = %d'
,
$fields
[
2
]
)
)
;
if
(
!
empty
(
$series_nid
Read more
Code
December 6, 2011 - 5:54pm —
seanr
<?php
/**
* use hook_apachesolr_query_prepare to add the fuzzy operator (~) to the query
*/
function
aavid_search_apachesolr_query_prepare
(
$query
)
{
$param
=
$query
-
>
getParam
(
'q'
)
;
if
(
(
st
Read more
Malfunctioning batch API - outputs homepage HTML in error message
November 23, 2011 - 6:04pm —
seanr
<?php
function
brproductimport_upload_form_submit
(
$form
,
&
$form_state
)
{
$dir
=
file_directory_path
(
)
.
batch api
Drupal 6
error
unexpected output
Read more
Can't get sustainability/report/download/%hash to load it's callback, returns sustainability/report/download's instead
November 8, 2011 - 1:10pm —
seanr
/**
* All below is for the secure report download.
*/
function
crown_sustainability_menu
(
)
{
$items
[
'admin/settings/sustainability'
]
=
array
(
'title'
=
>
'Sustainability Report'
,
'des
debug menu
hook_menu
Read more
Code
October 27, 2011 - 9:39pm —
seanr
$view
=
new
view;
$view
-
>
name
=
'books'
;
$view
-
>
description
=
''
;
$view
-
>
tag
=
'default'
;
$view
-
>
base_table
=
'node'
;
$view
-
>
human_name
=
'Books'
;
$view
-
>
core
=
7
;
$view
-
>
api_version
=
'3.0-alp
Read more
Code
August 22, 2011 - 5:51pm —
seanr
function
gillan_node_submitted
(
$node
)
{
$format
=
'F j, Y'
;
$date
=
format_date
(
$node
-
>
created
,
'custom'
,
$format
)
;
return
$date
;
}
Fix for Print full menu tree in page.tpl.php
August 10, 2011 - 2:42pm —
seanr
In page.tpl.php:
<?php
if
(
isset
(
$primary_links
)
)
print
menu_tree
(
'primary-links'
)
;
?>
CSS for menu and dropdowns:
#navigation {margin-top:0; height:36px;}
#navigation ul {position:relative;
Read more
Print full menu tree in page.tpl.php
August 10, 2011 - 2:40pm —
seanr
<?php
if
(
isset
(
$primary_links
)
)
print
menu_tree
(
'primary-links'
)
;
?>
Code
February 1, 2011 - 4:54pm —
seanr
foreach
(
$codes
as
$code_name
=
>
$code_value
)
{
if
(
$code_value
!
=
'0'
)
{
$volunteer_id
= crmngp_crm_volunteer_save
(
$contact_id
,
$code_value
,
$notes
)
;
//$notes = '
Read more
Code
February 1, 2011 - 4:52pm —
seanr
$transforms
=
array
(
'contact_id'
=
>
'contactID'
,
'first_name'
=
>
'firstName'
,
'last_name'
=
>
'lastName'
,
'middle_name'
=
>
'middleName'
,
'prefix'
=
>
Read more
Code
February 1, 2011 - 4:40pm —
seanr
if
(
module_exists
(
'crmapi'
)
&&
!
empty
(
$form_state
[
'values'
]
[
'first_name'
]
)
)
{
$contact
[
'first_name'
]
=
$form_state
[
'values'
]
[
'first_name'
]
;
$contact
[
'last_name'
]
=
$form_state
[
'values'
]
[
'l
Read more
validate and submit handlers don't get called
December 29, 2010 - 4:56pm —
seanr
<?php
// $Id$
function
connecticut_form_crmapi_contact_form_alter
(
&
$form
,
$form_state
)
{
if
(
$form
[
'section'
]
[
'#value'
]
==
'contribute'
)
{
$form
[
'employment'
]
[
'ct_status'
]
=
array
(
Read more
Fix for Code
December 3, 2010 - 5:09pm —
seanr
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^decirlaverdad\.org
RewriteCond %{HTTP_HOST} ^www\.decirlaverdad\.org
RewriteCond %{HTTP_HOST} ^speaktruth\.org
Re
Read more
Code
December 3, 2010 - 4:06pm —
seanr
RewriteCond %{HTTP_HOST} ^decirlaverdad\.org
RewriteCond %{HTTP_HOST} ^www\.decirlaverdad\.org
RewriteCond %{HTTP_HOST} ^speaktruth\.org
RewriteCond %{HTTP_HOST} ^www\.speaktruth\.org
Re
Read more
Code
October 18, 2010 - 3:00pm —
seanr
$view
=
new
view;
$view
-
>
name
=
'grants_ope_trio_state_view'
;
$view
-
>
description
=
''
;
$view
-
>
tag
=
'trio'
;
$view
-
>
view_php
=
''
;
$view
-
>
base_table
=
'node'
;
$view
-
>
is_cacheable
=
FALSE
;
$view
-
Read more
Attempting to change search button to an image
September 16, 2010 - 11:44am —
seanr
function
ngp_preprocess_search_block_form
(
&
$variables
)
{
$variables
[
'form'
]
[
'search_block_form'
]
[
'#title'
]
=
NULL
;
$variables
[
'form'
]
[
'search_block_form'
]
[
'#value'
]
=
'Search this site'
;
$var
Read more
Code
September 7, 2010 - 11:32am —
seanr
[ngpadmin@ewhserver393 html]$ php index.php
PHP Notice: Undefined index: REMOTE_ADDR in /var/www/html/drupal7.com/html/inc
ludes/bootstrap.inc on line 2535
Notice: Undefined index: REMOTE_ADDR
Read more
Code
September 7, 2010 - 11:30am —
seanr
[ngpadmin@ewhserver393 html]$ php index.php
PHP Notice: Undefined index: REMOTE_ADDR in /var/www/html/drupal7.com/html/inc
ludes/bootstrap.inc on line 2535
Notice: Undefined index: REMOTE_ADDR
Read more
Code
August 26, 2010 - 4:59pm —
seanr
/**
* Implementation of hook_theme_registry_alter().
*/
function
crmapi_endorse_theme_registry_alter
(
&
$theme_registry
)
{
// Shove our own node template in here to flip the title and body aroun
Read more
Complex query to be ported to D7
August 13, 2010 - 3:58pm —
seanr
db_query
(
"INSERT INTO {forward_statistics} (nid, last_forward_timestamp, forward_count, clickthrough_count) SELECT n.nid, 0, 0, 0 FROM {node} n"
)
;
1
2
next ›
last »