We provide expertise in Teamsite and OpenDeploy services, perl, ruby on rails, php, Drupal, MYSQL, Oracle, XML, XSLT, LINUX, UNIX and services in most other current technologies. Your satisfaction is our sole objective, we know that referrals are our life blood. Successful business means addressing our customer's needs and pain points. Addressing your business pain points and critical needs is our number one priority. Service offerings include: creating websites, automating painful processes, data migrations, data parsing, web services, system administration.

Who says Drupal doesn't scale, Acquia provided 3 million pages an hour without problems

http://acquia.com/blog/acquia-hosting-customer-hits-700-pagessecond-or-w...

Here's a list of many famous Drupal sites: http://buytaert.net/tag/drupal-sites

list includes:

Nike
Yahoo
Intel
AT&T
Reuters
CNN
Mattel
Sony
Playboy
MTV
NATO
Warner Brothers
NASA
Even the United States White House!

Drush Commands

I'll add notes to this at a later time.

To download a module (masquerade in this case) using drush type in:

drush dl masquerade

search content of files using grep and find

On solaris boxes I need to use this command to search through the content of files recursively through all directories:

find . -exec grep -l "text to find" '{}' \;

on linux this works

grep -r "text to find" '{}' \;

Print out a page without the template header, footer, blocks, etc.

http://www.drupalcoder.com/story/718-how-to-define-page-callbacks-that-d...

I haven't tried it yet, but this was a good post on Drupal Planet. I haven't needed to do this yet, but I know I will :)


/**
 * Implementation of hook_menu().
 */
function my_module_menu() {
  $items['hello'] = array(
    'title' => 'Hello world',
    'page callback' => 'my_module_page',
    'access callback' => TRUE,
  );
}

function my_module_page() {
  return t('Hello world');
  return null;
}



Writing secure Drupal code link/reference

http://drupal.org/writing-secure-code

Just a link for a refresher on making sure you're writing secure code.

Theming blocks in drupal

Create a custom block for Drupal with a module using hook_block

<?php

// $Id$

/**
* A module to create a basic block to be available from the drupal blocks menu page
*
*
*
*
*/




function latest_block($op='list',$delta=array(),$edit=array())
{
      switch ($op)
     {

        case 'list':
                       $blocks[0]['info'] = t('Latest CTL Content');
                       return $blocks;
                       break;
         case 'view':
  

          $content = 'hello world';
          $blocks['subject'] = t('Latest CTL Content');
          $blocks['content'] = $content;
       return $blocks;
       break;
      }
}

Replace the corresponding function above with whats below to get recent posts in your drupal block

function latest_block($op='list',$delta=array(),$edit=array())
{
      switch ($op)
     {

        case 'list':
                       $blocks[0]['info'] = t('Latest CTL Content');
                       return $blocks;
                       break;
         case 'view':
           ob_start();
         $num_nodes = 5;

$result = db_query_range(db_rewrite_sql('SELECT n.nid, n.title, n.type FROM {node} n WHERE n.status = 1 AND n.type <> "forum" ORDER BY n.changed DESC'), 0, $num_nodes);

$output = node_title_list($result);
$output .= l('More...', 'tracker');
          //$content = 'hello world';
          $content = $output;
          $blocks['subject'] = t('Latest CTL Content');
          $blocks['content'] = $content;
       return $blocks;
       break;
      }
}

And here is an example with multiple blocks in the same module:

function latest_block($op='list',$delta=array(),$edit=array())
{
      switch ($op)
     {

        case 'list':
                       $blocks[0]['info'] = t('Latest CTL Content Block');
                       $blocks[1]['info'] = t('Partner Block');
                       return $blocks;
                       break;
         case 'view':
           switch ($delta) {
           case 0:
              //ob_start();
              $num_nodes = 2;

              $result = db_query_range(db_rewrite_sql('SELECT n.nid, n.title, n.type FROM {node} n WHERE n.status = 1 AND n.type = "Biography" ORDER B
Y n.changed DESC'), 0, $num_nodes);
              $result2 = db_query_range(db_rewrite_sql('SELECT n.nid, n.title, n.type FROM {node} n WHERE n.status = 1 AND n.type = "page" ORDER BY n.
changed DESC'), 0, $num_nodes);
              $result3 = db_query_range(db_rewrite_sql('SELECT n.nid, n.title, n.type FROM {node} n WHERE n.status = 1 AND n.type = "news" ORDER BY n.
changed DESC'), 0, $num_nodes);

              $output = node_title_list($result);
              $output .= node_title_list($result2);
              $output .= node_title_list($result3);
//$output .= l('More...', 'tracker');
              //$content = 'hello world';
              $content = $output;
              $blocks['subject'] = t('Latest CTL Content');
              $blocks['content'] = $content;
              //return $blocks;
              break;
           case 1:
              $blocks['subject']=t('Parnter Block');
              $blocks['content']="put the link to the content here";
              break;

         }
         return $blocks;


}
}

also check out http://drupal.org/node/60528

Write your own sql to override the sql in your Drupal view

Here's a module that may do it http://drupal.org/project/views_modify_query, or use the code below:

Here is the module I wrote:
removedups_view.module is listed below

the query for the view news_events_rss is re-written prior to being executed. There were duplicate titles being listed so I used GROUP BY aggregator_item
_title to remove duplicates. The sql generated by the views module wasn't what was expected, so it had to go. I may make this into a module to submit to drupal.org. It is a module for developers like myself who found writing their own sql simpler, back during simpler times. This is a sql nostagia module. Retro.

<?php
function removedups_view_views_pre_execute(&$view) {
  watchdog('alert','tried to use views_pre_execute');
  if ($view->name \=\= 'news_events_rss') {
  //echo '<pre>'; print_r($view->build_info['query']); echo '</pre>'; 
$view->build_info['query'] = "SELECT aggregator_item.iid AS iid, aggregator_item.title AS aggregator_item_title, aggregator_item.link AS aggregator_item_link, aggregator_item.description AS aggregator_item_description, aggregator_item.timestamp AS aggregator_item_timestamp FROM aggregator_item aggregator_item  LEFT JOIN aggregator_category_feed aggregator_category_feed ON aggregator_item.fid = aggregator_category_feed.fid LEFT JOIN aggregator_category aggregator_category ON aggregator_category_feed.cid = aggregator_category.cid WHERE aggregator_category.cid in ('%s') GROUP BY aggregator_item
_title ORDER BY aggregator_item_timestamp DESC";
  //watchdog('alert','got here tried to use views_pre_execute');
}}

Note the ('%s') .... even though I ignore the views query builder in drupal, I still can use the variable set via the query builder! Very useful.

I just read a drupal planet article and the consultants did this differently: http://www.dynamiteheads.com/blog/jakub-suchy/optimizing-views-queries-m...

Manipulating the $query object

http://drupal.org/node/310075

took me forever to find this.