July 2011

  • strict warning: Non-static method view::load() should not be called statically in /home1/nate01/public_html/sites/all/modules/views/views.module on line 1113.
  • strict warning: Declaration of views_handler_argument::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /home1/nate01/public_html/sites/all/modules/views/handlers/views_handler_argument.inc on line 917.
  • strict warning: Declaration of views_handler_argument::query() should be compatible with views_handler::query($group_by = false) in /home1/nate01/public_html/sites/all/modules/views/handlers/views_handler_argument.inc on line 917.
  • strict warning: Declaration of views_handler_sort::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /home1/nate01/public_html/sites/all/modules/views/handlers/views_handler_sort.inc on line 165.
  • strict warning: Declaration of views_handler_sort::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /home1/nate01/public_html/sites/all/modules/views/handlers/views_handler_sort.inc on line 165.
  • strict warning: Declaration of views_handler_sort::query() should be compatible with views_handler::query($group_by = false) in /home1/nate01/public_html/sites/all/modules/views/handlers/views_handler_sort.inc on line 165.
  • strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /home1/nate01/public_html/sites/all/modules/views/handlers/views_handler_filter.inc on line 587.
  • strict warning: Declaration of views_handler_filter::query() should be compatible with views_handler::query($group_by = false) in /home1/nate01/public_html/sites/all/modules/views/handlers/views_handler_filter.inc on line 587.
  • strict warning: Declaration of views_plugin_pager_none::post_execute() should be compatible with views_plugin_pager::post_execute(&$result) in /home1/nate01/public_html/sites/all/modules/views/plugins/views_plugin_pager_none.inc on line 69.
  • strict warning: Declaration of views_plugin_query::options_submit() should be compatible with views_plugin::options_submit($form, &$form_state) in /home1/nate01/public_html/sites/all/modules/views/plugins/views_plugin_query.inc on line 169.
  • strict warning: Declaration of views_plugin_style_default::options() should be compatible with views_object::options() in /home1/nate01/public_html/sites/all/modules/views/plugins/views_plugin_style_default.inc on line 24.
  • strict warning: Declaration of views_plugin_row::options_validate() should be compatible with views_plugin::options_validate(&$form, &$form_state) in /home1/nate01/public_html/sites/all/modules/views/plugins/views_plugin_row.inc on line 136.
  • strict warning: Non-static method view::load() should not be called statically in /home1/nate01/public_html/sites/all/modules/views/views.module on line 1113.
  • strict warning: Declaration of views_handler_field::query() should be compatible with views_handler::query($group_by = false) in /home1/nate01/public_html/sites/all/modules/views/handlers/views_handler_field.inc on line 1147.
  • strict warning: Non-static method view::load() should not be called statically in /home1/nate01/public_html/sites/all/modules/views/views.module on line 1113.

Get the Current URL in Drupal

$path = isset($_GET['q']) ? $_GET['q'] : '<front>';
$link = url($path, array('absolute' => TRUE));

Tooltip Plugin - Cross Browser and Image Map Compatible

I tried several tooltip plugins for use with an image map. The only one that placed the tooltip where it should be placed when hover an area on the map was qTip

qTip is an advanced tooltip plugin for the ever popular jQuery JavaScript framework.

Built from the ground up to be user friendly, yet feature rich, qTip provides you with tonnes of features like rounded corners and speech bubble tips, and best of all... it's completely free under the MIT license!

Content Archive with Previous / Next Article Links for Any Content Type

<?php     
    $type = "news";
    $foundArticle = 0;
	$nextNewsArticleTitle = '';
	$prevNewsArticleTitle = '';
	$nextNewsReleaseLink = '';
	$prevNewsReleaseLink = '';
	$prevNewsReleasePath = '';
	$nid = '';
	$nodeLink = '';
    $result = db_query("SELECT type,created,title,nid FROM {node} WHERE type = '%s' ORDER BY created ASC", $type);
        while ($data = db_fetch_array($result)) 
        {
            if($foundArticle == 1)	
            {
                $nextNewsArticleTitle =  $data['title'];
				$nid = $data['nid'];
				$nodeLink = 'node/'.$nid;
				$foundAr

Drupal 6 - Create a page.tpl for a View

Just found a cool trick . . .
You can create a template file to theme almost any aspect of views output. In your case you want to create a custom template for your page display.

On the view designer, click the Theme link in Basic Settings. You'll see some template file naming options depending on if you want to theme the whole view (e.g., views-view--example--page.tpl.php), each row (e.g., views-view-fields--example--page.tpl.php) and so on.

Copy the appropriate template you want to customize from /sites/all/modules/views/theme to your theme and customize as you wish.

Database Query the Drupal 6 Way

function referral_get_user($uid) {
  $referral_uid = FALSE;
  $result = db_query('SELECT referral_uid FROM {referral} WHERE uid = %d', $uid);
  while ($data = db_fetch_object($result)) {
    $referral_uid = $data->referral_uid;
  }
  return $referral_uid;
}

 
 
$nodeSrc = 'node/45';
  $result = db_query("SELECT dst FROM {url_alias} u WHERE src = '%s'", $nodeSrc);
 
  while ($data = db_fetch_object($result)) {
    echo $data->dst;
 
}
Placeholder | Meaning
%s | String
%d | Integer
%b | Binary

Read a CSV in PHP line by line and access each field

<?PHP
 
$file_handle = fopen("widgets.csv", "r");
 
while (!feof($file_handle) ) {
 
$line_of_text = fgetcsv($file_handle, 1024);
 
print $line_of_text[0] . $line_of_text[1]. $line_of_text[2] . "<BR>";
 
}
 
fclose($file_handle);
 
?>

Of course, you would increase the index of $line_of_text[i] if you had more than 3 columns.

Javascript Cookies Using jQuery Cookie Plugin

I chose to use the improved version of the jQuery Cookie Plugin with more functions as well as short/easy examples on how to use these functions.
(jQuery Cookie Project Page)