DrupalBin
Submit Code
About
Recent Posts
message i get when running openssl s_client -connect 150.203.86.21:443
Fix for Code
Code
add_to_cart_by_sku_contents()
Fix for page.tpl.php
Page.tpl
foreach is beeing disregarded dispite variable is array. Please help. Outside Drupal it works as standalone.php file
foreach is beeing disregarded dispite variable is array inside drupal. Please help. Outside Drupal it works as standalone.php
Fix for filefield implementation in an admin page. "An HTTP error 0 occurred. /drupal/?q=filefield/ahah///"
PHP Code custom.module
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
›
David Thomas
›
Recent Posts
David Thomas
View
Posts
Drush commands
October 26, 2011 - 3:37am —
David Thomas
Execute a drush command. Run `drush help [command]` to view command-specific help.
drush
Read more
Fix for Add more options to weight form element
March 2, 2010 - 6:12am —
David Thomas
/**
* Implementation of hook_elements().
*/
function
example_elements
(
)
{
// add our process function to weight type element
$type
=
array
(
)
;
$type
[
'weight'
]
[
'#process'
]
=
array
(
'example
D5
drupal 5
Read more
Add more options to weight form element
March 2, 2010 - 6:11am —
David Thomas
/**
* Implementation of hook_elements().
*/
function
example_elements
(
)
{
// add our process function to weight type element
$type
=
array
(
)
;
$type
[
'weight'
]
[
'#process'
]
=
array
(
'resourc
D5
drupal 5
Read more
Supress E_NOTICE errors
February 24, 2010 - 11:34pm —
David Thomas
<?php
/* The following patch goes in includes/common.inc
* drupal_error_handler
* around line 620 in D6
* to switch off E_NOTICE errors
* add $conf['e_notice_suppress']
* to settings.php
Read more
Image link to user profile node
February 7, 2010 - 11:06pm —
David Thomas
<?php
if
(
user_is_logged_in
(
)
)
{
global
$user
;
$image
=
theme
(
'image'
,
path_to_theme
(
)
.
'/images/image.png'
,
t
(
'My profile'
)
)
;
$nid
=
db_result
(
db_query
(
"SELECT nid FROM {node} WHERE type =
Read more
Link to user profile node
February 7, 2010 - 9:03pm —
David Thomas
<?php
if
(
user_is_logged_in
(
)
)
{
global
$user
;
$nid
=
db_result
(
db_query
(
"SELECT nid FROM {node} WHERE type = '%s' AND uid = %d"
,
'photographer_profile'
,
$user
-
>
uid
)
)
;
echo
l
(
t
(
'Profile'
)
Read more
Adding to user profile
February 6, 2010 - 12:24am —
David Thomas
function
sample_user
(
$op
,
&
$edit
,
&
$account
,
$category
=
NULL
)
{
if
(
$op
==
'view'
)
{
drupal5
Read more
drupal_goto escape issue
October 13, 2009 - 9:52pm —
David Thomas
// in a submit handler
$q
=
array
(
)
;
$q
[
'firstname'
]
=
$form_state
[
'values'
]
[
'firstname'
]
;
$q
[
'lastname'
]
=
$form_state
[
'values'
]
[
'lastname'
]
;
$q
[
'org_name'
]
=
$form_state
[
'values'
]
[
'o
Read more
drupal.org access issue
September 22, 2009 - 9:43pm —
David Thomas
Sep 23 10:10:43 <pipes> ben: yeah we have seen this before
Sep 23 10:10:59 <pipes> something something either varnish or nginx (or both) hashing based on geoip location stuff
Sep 23 10:11:09 <pipes>
Read more
drupal.org access issue
September 22, 2009 - 9:43pm —
David Thomas
Sep
23
10
:
10
:
43
<
pipes
>
ben: yeah we have seen this before
Sep
23
10
:
10
:
59
<
pipes
>
something something either varnish or nginx
(
or both
)
hashing based on geoip location stuff
Sep
23
10
:
11
:09
<
pipes
>
Read more
Fix for Debug cron by logging each module
August 9, 2009 - 5:53am —
David Thomas
/* Replace drupal_cron_run in includes/common.inc with the following version
* Adds logging each module cron run time.
*/
function
drupal_cron_run
(
)
{
// If not in 'safe mode', increase the m
Read more
Debug cron by logging each module
August 9, 2009 - 5:40am —
David Thomas
/* Replace drupal_cron_run in includes/common.inc with the following version
* Adds logging each module cron run time.
*/
/**
* Executes a cron run when called
* @return
Read more
Debug cron by logging each module
August 9, 2009 - 5:38am —
David Thomas
// Iterate through the modules calling their cron handlers (if any):
// module_invoke_all('cron');
/* DT 20081217 Applied patch for verbose cron logging */
Read more
make node cck fields into a table
July 24, 2009 - 7:07am —
David Thomas
/**
* return cck fields formatted as table
*/
function
phptemplate_content_format_table
(
$node
)
{
// get fields
$fields
= content_fields
(
NULL
,
$node
-
>
type
)
;
$header
=
array
(
''
,
''
)
;
$ro
CCK
Read more
make node cck fields into a table
July 24, 2009 - 7:06am —
David Thomas
/**
* return cck fields formatted as table
*/
function
phptemplate_content_format_table
(
$node
)
{
// get fields
$fields
= content_fields
(
NULL
,
$node
-
>
type
)
;
$header
=
array
(
''
,
''
)
;
$ro
CCK
Read more
make node cck fields into a table
July 24, 2009 - 7:05am —
David Thomas
/**
* return cck fields formatted as table
*/
function
energynews_get_cck_table
(
$node
)
{
// get fields
$fields
= content_fields
(
NULL
,
$node
-
>
type
)
;
$header
=
array
(
''
,
''
)
;
$rows
= arr
CCK
Read more
hide changelog.txt
May 30, 2009 - 9:26pm —
David Thomas
# Protect files and directories from prying eyes.
security
Read more
put drupal into maintenance mode with SQL
May 19, 2009 - 4:42am —
David Thomas
# The following SQL can be used to set Drupal into maintenance mode
# It's necessary to clear the variables cache to refresh the new setting.
# SET MAINTENANCE MODE
maintenance mode
Read more
virtualhost php ini conf - increase max upload size
April 30, 2009 - 6:24am —
David Thomas
# increase php settings per-site in the virtualhost conf file
php_value memory_limit 64M
php_value max_execution_time
"180"
php_value upload_max_filesize 32M
php_value post_max_size 32M
default node_access entry
March 8, 2009 - 3:39am —
David Thomas
drupaldb
=>
SELECT
*
FROM
node_access;
nid
|
gid
|
realm
|
grant_view
|
grant_update
|
grant_delete
-----+-----+-------+------------+--------------+--------------
default
node_access
Read more
1
2
next ›
last »