DrupalBin
Submit Code
About
Recent Posts
Fix for Allow HTML in <i> node titles</i> for Drupal 6.x
Template Pre-proccessing
Testing Ubercart donation product
dave's menu screenshot
Code
Modify user profile page theme
Modify user profile page
Fix for Fix for Code
Fix for Code
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
test
theme
user
views
more tags
Home
filefield
Fix for This code will extract files form a zip file uploaded via a specific FileField
May 31, 2010 - 2:02am — Anonymous
<?php
function
my_unzip_nodeapi
(
&
$node
,
$op
,
$a3
=
NULL
,
$a4
=
NULL
)
{
if
(
$node
-
>
type
==
'test'
)
{
dsm
(
$node
)
;
switch
(
$op
)
{
case
'update'
:
if
(
!
is_null
(
$node
-
>
field_zi
filefield
unzip
Read more
This code will extract files form a zip file uploaded via a specific FileField
May 31, 2010 - 1:38am — Anonymous
<?php
function
my_unzip_nodeapi
(
&
$node
,
$op
,
$a3
=
NULL
,
$a4
=
NULL
)
{
if
(
$node
-
>
type
==
'test'
)
{
dsm
(
$node
)
;
switch
(
$op
)
{
case
'update'
:
if
(
!
is_null
(
$node
-
>
field_zi
filefield
unzip
Read more
imagefield.install does not work with filefield.install update ID's
October 15, 2009 - 2:20pm — Anonymous
<?php
# imagefield.install
/**
* Convert image field type to filefield.
*/
function
imagefield_update_6003
(
)
{
$ret
=
array
(
)
;
if
(
drupal_get_installed_schema_version
(
'filefield'
, TRU
CCK
filefield
imagefield
Read more
Creating a node with a FileField from file
July 22, 2009 - 8:41am —
mongolito404
/**
* The following code create a node with a fieldfield attached file.
CCK
filefield
Read more
Creating a node with a FileField from file
July 22, 2009 - 8:33am —
mongolito404
/**
* FileField creation code from http://drupal.org/node/292904#comment-956155
*/
function
import_document
(
&
$document
)
{
$node
=
new
stdClass
(
)
;
$node
-
>
type
=
'folder'
;
node_object_prepa
CCK
filefield
Read more
4.6 custom table -> 5.x filefield migration code
May 29, 2008 - 12:43pm — Anonymous
$result
=
db_query
(
"SELECT * FROM {cv_files} WHERE uid = %d"
,
$user46
-
>
uid
)
;
$i
=
0
;
while
(
$row
=
db_fetch_object
(
$result
)
)
{
$old_filepath
= PK_46_PATH .
'/'
.
$row
-
>
filepath
;
filefield
hack
migration
Read more