This site is going bye bye.

the site is being migrated to another domain. here

Sorry spammers that site doesn't accept your shit. live with it. lulz.

All good content will be ref'd there.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
If you are if fact human, you may post comments.
Image CAPTCHA
Enter the characters shown in the image.
The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
If you are if fact human, you may post comments.
Image CAPTCHA
Enter the characters shown in the image.

Going Mobile With Drupal and Jquery Mobile

One of the fastest growing trends in the online space has been the use of mobile devices for viewing online content.

Since the introduction of the iPhone in 2007, the number of devices and users viewing content on the web has increased exponentially and drastically. With such an increase, the demand for sites that are mobile friendly has increased at the same rate. Even to match the demand for the devices themselves!

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
If you are if fact human, you may post comments.
Image CAPTCHA
Enter the characters shown in the image.
The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
If you are if fact human, you may post comments.
Image CAPTCHA
Enter the characters shown in the image.

Presenting At Drupalcamp-ATL. CCK For Code Junkies

The votes are in and the organizers for Drupalcamp ATL have presented me with the opportunity to be able to present at the coming camp/conference on October 2nd. Out of the sessions that I proposed, my personal favorite of the bunch, "CCK for Code Junkies," was selected. w00t!

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
If you are if fact human, you may post comments.
Image CAPTCHA
Enter the characters shown in the image.
The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
If you are if fact human, you may post comments.
Image CAPTCHA
Enter the characters shown in the image.

Command Line Progress Bar w/ PHP

Ever have those times when you have to run a process and you have no clue how long it's taking and all you can do is just sit there waiting for the prompt to return?

Well, having had to sit through the same thing, I decided to get a little creative and build a function that will add a progress bar in the prompt while the script runs.

<?php
function status_bar($total, $iter) {
  $size = 50;
  $perc = round(($iter/$total) * 100, 2);
  for ($i=strlen($perc); $i<=4; $i++) {
    $perc = ' '.$perc;
	}
  $total_size = $size + $iter + 3;

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
If you are if fact human, you may post comments.
Image CAPTCHA
Enter the characters shown in the image.
The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
If you are if fact human, you may post comments.
Image CAPTCHA
Enter the characters shown in the image.

Dynamically Building Links With Comment Anchors When Comments Are Paginated

(All code examples pertain to a version of the Abuse module for Drupal that has not been released yet, as it is still being tested. A release version is in the works post testing by the community.)

Having links to comments via the anchor fragment of a url can be a great asset for users to share their content and for admins to quickly access questionable content needing to be moderated as I have found in my work revamping and improving the current Abuse module for Drupal.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
If you are if fact human, you may post comments.
Image CAPTCHA
Enter the characters shown in the image.
The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
If you are if fact human, you may post comments.
Image CAPTCHA
Enter the characters shown in the image.

Strengthening Content-Based Online Communities With Mobile Applications.

I have just started researching and learning how to program apps for the Apple mobile devices, mainly, the iPhone. Why? Mostly for two main reasons. One, for my own need to learn and grow as a programmer and two, in response to a new initiative at Morris to develop apps as an extension of our larger Drupal-based websites.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
If you are if fact human, you may post comments.
Image CAPTCHA
Enter the characters shown in the image.
The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
If you are if fact human, you may post comments.
Image CAPTCHA
Enter the characters shown in the image.

Drupal AHAH: Issues with drupal_render()

While integrating AHAH functionality into a compound CCK field that I'm currently working on, I ran into an issue to where my "checkboxes" FAPI type were not rendering when the form was rebuilt via AHAH.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
If you are if fact human, you may post comments.
Image CAPTCHA
Enter the characters shown in the image.
The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
If you are if fact human, you may post comments.
Image CAPTCHA
Enter the characters shown in the image.

Building Custom Compound Fields/Widgets for CCK Drupal 6.x

For the lack of documentation available focused on building custom compound widgets/fields for CCK, I've decided to write some based on personal work on building one such for use in my current project.

The widget that i'm building is a field to generate and select search results via user provided keywords. The end result given to the user in the node edit form is a field containing three elements:

  • Textfield for Keywords.
  • Submit Buttom to generate/refresh search results.
  • Table of checkboxes for choosing individual search results.

trying to get something similar working

Thanks for the post. I'm trying to get something similar working on a module I'm building. Basically, I want a submit button the bring up some form fields. Then when a button is submitted in the new form (similar to your submit search terms button) I want the entry to be stored in a string and displayed as entered above the form.

I have the ahah bit working to generate the new form entry fields but they don't seem to do anything. This is the bits in hook_form for this functionality:

$value = variable_get($form['created']['#value'], NULL);
	var_dump($form['created']['#value']);
	if ($value) {
		$options = $value;
	}
	else if (isset($form_state['results_options']['value'])) {
		$options = $form_state['results_options']['value'];
	}
	else {
		$options = array('none' => t('N/A'));
	}
/* Test feature for ahah 
	 * This feature will replace the expandable descriptions and add dynamic additions of project relationship descriptions.
	*/
    $form['textfields'] = array(
      '#title' => t("Add a project"),
      '#prefix' => '<div id="textfields">',
      '#suffix' => '</div>',
      '#type' => 'fieldset',
      '#weight' => -16,
      '#description' => t('This is where to enter new relationship project descriptions'),
    );
 
    $default_add_project = !empty($form_state['values']['add_project']) ? $form_state['values']['add_project'] : FALSE;
    $form['textfields']['add_project'] = array(
      '#type' => 'submit',
      '#value' => t('Add a project'),
      '#default_value' => $default_add_project,
      '#weight' => -16,
      '#ahah' => array(
        'path' => 'jiscpmproject/autotextfields/callback',
        'wrapper' => 'textfields',
        'effect' => 'fade',
        'method' => 'replace',
      )
    );  
 /*end ahah test feature */

This is the function for jiscpmproject/autotextfields/callback (which I've created a menu item for):

function jiscpmproject_autotextfields_callback() {
 
  // The form is generated in an include file which we need to include manually.
  include_once 'modules/node/node.pages.inc';
  $form_state = array('storage' => NULL, 'submitted' => FALSE);
  $form_build_id = $_POST['form_build_id'];
  // Step #4.
  $form = form_get_cache($form_build_id, $form_state);
  $args = $form['#parameters'];
  $form_id = array_shift($args);
  $form_id = $args;
  $form_state['post'] = $form['#post'] = $_POST;
  $form['#programmed'] = $form['#redirect'] = FALSE;
  /*if (arg(2) == 'edit')
  {
   $currentnid = arg(1);
   //get all projects //
   $result = db_query("SELECT n.nid, n.title FROM {node} n WHERE type = 'jiscpmproject' && n.nid != $currentnid");	
  }*/
  /*if (arg(1) == 'add')
  {*/
   $result = db_query("SELECT n.nid, n.title FROM {node} n WHERE type = 'jiscpmproject'");
  //}
  $current_nid = arg(1);
  while ($project = db_fetch_object($result)) {
    if ($current_nid != $project->nid)
    {
      $projects[$project->nid] = $project->title;
    }
  }
  //changed form elements
    $form['textfields']['add_a_project']['name'] = array(
      '#type' => 'select',
      '#options' => $projects,
      '#title' => t('Project name'),
    );
    $form['textfields']['add_a_project']['description'] = array(
      '#type' => 'textarea',
      '#title' => t('Relationship to this project'),
    );
    $form['textfields']['add_a_project']['submit'] = array(
      '#type' => 'submit',
      '#value' => t('Add this relationship'),
      '#name' => 'add-' . $project-nid,
      '#submit' => array('jiscpmproject_add_project_relationship'),
      '#executes_submit_callback' => FALSE,              
    );
    $form['#attributes'] = array('onsubmit' => 'return false');
  form_set_cache($form_build_id, $form, $form_state);
 
  $form += array(
    '#post' => $_POST,
    '#programmed' => FALSE,
  );
 
  $form = form_builder('node_form', $form, $form_state);
  $subform = $form['textfields'];
  $output = theme('status_messages') . drupal_render($subform);
 
  // Final rendering callback.
  drupal_json(array('status' => TRUE, 'data' => $output));
  exit();
}

This is the function I hoped would add the description:

/*
 * This function adds the relationship to the display
*/
function jiscpmproject_add_project_relationship($form, &$form_state)
{
 
  if ($form_state['values']['op'] == 'Add this relationship') {
   $output .= $form_state['values']['textfields']['add_a_project']['description'];
   variable_set($form_state['values']['created'], $output);
   $form_state['results_options']['value'] = $output;
 
   $form_state['rebuild'] = TRUE;
  }
 
 
}

Any help would be greatly appreciated.

Thanks!

Try using single level arrays for your new form elements.

When you rebuild new form elements, use only single level arrays for the rebuild elements.

for example:
instead of

<?php $form['level_1']['level_2']['level_3'] = array(...);?>

use

<?php $form['level_3'] = array(...);?>

where level_3 is the field name that you want pulled back.

Also, make sure that these elements are defined in the hook_field and hook_widget functions that way that are properly defined for CCK to be able to store the data.

Awsome tutorial

I was surprised about the hook_elements implementation inside the hook_widget. Thanks alot for posting this. :)
BTW have you finished the hook_theme implementation yet?
Alex

almost...

I've finished a good bit of work with the cck_hook_theme function I just haven't had the time to put up a post on what i did.

but, since you asked... I'll get one up for you.

thanks! :)

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
If you are if fact human, you may post comments.
Image CAPTCHA
Enter the characters shown in the image.
The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
If you are if fact human, you may post comments.
Image CAPTCHA
Enter the characters shown in the image.

Updated Documentation For The CASAA Module

Ever since the release of the CASAA module it seems that I've fallen behind on updating the documentation on this site. Well, in a sense, I have but, at the same time I've been more focused on keeping the code itself for the framework module and the plug-ins as up-to-date as I possibly can.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
If you are if fact human, you may post comments.
Image CAPTCHA
Enter the characters shown in the image.
The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
If you are if fact human, you may post comments.
Image CAPTCHA
Enter the characters shown in the image.

First Official Upgrades of CMF to CASAA Successful!

Throughout this week I have been upgrading some of our currently site projects from the CMF module to the CASAA module. Although it was ahead of my scheduled release date, I decided that this would be a great opportunity to one, test the upgrade path that I built which takes the data model build by the CMF module and alter it to the data model for the CASAA module; and two, take advantage of being able to place the new software where it can be pummeled in a production environment wherein many usage and system bugs can be exposed.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
If you are if fact human, you may post comments.
Image CAPTCHA
Enter the characters shown in the image.
The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
If you are if fact human, you may post comments.
Image CAPTCHA
Enter the characters shown in the image.
I'm attending DrupalCon Chicago, March 7-10, 2011

User login

Login Using Faceback
Sign in using Facebook
Drupalcamp Atlanta Individual Sponsor

Navigation