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.

Restart apache

/usr/sbin/apachectl configtest
and then if that's ok
/usr/sbin/apachectl restart

code filter module for displaying code in a drupal post

This site uses code filter module to diplay code correctly in posts.

use <pre> and <code> tags to wrap your code.

<p>this is a p tag</p>
<h1>this is an h1 tag </h1>

I also put this in my style.css file in this drupal installation:

pre {
	overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */
	white-space: pre-wrap; /* css-3 */
	white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
	white-space: -pre-wrap; /* Opera 4-6 */
	white-space: -o-pre-wrap; /* Opera 7 */ /*
	width: 99%; */
	word-wrap: break-word; /* Internet Explorer 5.5+ */
}

making <pre> tags make code snippets show up in a browser nicely

I found this here and use it on this site: http://www.sohtanaka.com/web-design/styling-pre-tags-with-css-code-block/

I put this in my style.css file in this drupal installation:

pre {
	overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */
	white-space: pre-wrap; /* css-3 */
	white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
	white-space: -pre-wrap; /* Opera 4-6 */
	white-space: -o-pre-wrap; /* Opera 7 */ /*
	width: 99%; */
	word-wrap: break-word; /* Internet Explorer 5.5+ */
}

jquery, javascript and drupal

hello

This is an example of an effect which is built into the core jQuery library. This text should fade in after the DOM is loaded. drupal_add_js() was used to add the fadeIn effect to any paragraph with the class jtest.

This jquery code works: to affect page.tpl.php put it in template.php instead!

//drupal_add_js ('$(document).ready(function(){$("p").hide().fadeIn("slow").slideUp("slow").slideDown(" slow") ;}); ','inline');drupal_add_js ('$(document).ready(function(){$(\'a[href$="authentication-options"]\').html("Log In");}); ','inline');


IMPORTANT NOTE Drupal currently uses a different way to access external drupal scripts
drupal_set_html_head('');
and I read it is drupal_add_html_head() for Drupal 7

Creating a Drupal Node programmatically

http://acquia.com/blog/migrating-drupal-way-part-i-creating-node
* also note that node_delete(nid) will delete a node.

<?php
// Construct the new node object.
$node = new stdClass();

// Your script will probably pull this information from a database.
$node->title = "My imported node";
$node->body = "The body of my imported node.\n\nAdditional Information";
$node->type = 'story';   // Your specified content type
$node->created = time();
$node->changed = $node->created;
$node->status = 1;
$node->promote = 1;
$node->sticky = 0;
$node->format = 1;       // Filtered HTML
$node->uid = 1;          // UID of content owner
$node->language = 'en';
// If known, the taxonomy TID values can be added as an array.
$node->taxonomy = array(2,3,1,);

node_save($node);
?>

(from the url listed above, article provided by Acquia)
Using the Devel module
The Devel module is a great way to see, among other things, the structure of the node object which is invaluable in this case. After installing the module and viewing a node you will see new tabs: Dev load and Dev render. Click the Dev load tab, then click the "... (Object) stdClass" header to expand the node object definition. Here you will find some familiar data like nid, type, etc. Near the bottom, you will see some other definitions that begin with "field_". These should resemble the CCK fields that you created for your node type.

Depending on your CCK definitions, the assignments in your import script might look like one of the following:

Here you can see some examples of how CCK has added fields to the node object

<?php
$node->field_text_field[0]['value'] = "value 1";
$node->field_text_field[1]['value'] = "2nd value";
$node->field_nodereference[0]['nid'] = 58;
?>

Add these assignments to your import script and you will start to see the power of the Drupal API. Let's say you are migrating from another CMS with a number of related fields, categories, images, etc. You could expand this script to iterate through your old database and map all of the related elements to a corresponding node object. Execute your script, and all of your old data will now become Drupal data! The best part about using the API is that it takes care of all of everything from search indexing to path aliases and all of the other little things we might overlook.

Migrating to Drupal can seem like a daunting task, but when doing things the Drupal way it's quite straight forward. Whether you are planning a migration of 100 nodes or 100,000 nodes, proper scripting can make it seem like a breeze!

put a block of html or php code in an if clause in PHP

<?php if ($footer_message): ?>
            <?php print $footer_message; ?>
            <h1>hello, html can go here too</h1>
            <h2>very nice :) </h2>
        <?php endif; ?>

themeable functions in drupal -- a list

http://api.drupal.org/api/group/themeable/6

see page 181 in the book Pro Drupal Development for details on how to override themeable functions. Make sure any html in your modules is withing a themable function so others can override the html look an feel.

On theming a view in Drupal

text from http://stackoverflow.com/questions/77694/drupal-6-how-to-quickly-theme-a...

Here are my findings: (Edited)

In fact there are two ways to theme a view : the "field" way and the "node" way. In "edit View", you can choose "Row style: Node", or "Row style: Fields".

with the "Node" way, you can create a node-contentname.tpl.php wich will be called for each node in the view. You'll have access to your cck field values with $field_name[0]['value']. (edit2) You can use node-view-viewname.tpl.php wich will be only called for each node displayed from this view.
with the "Field" way, you add a views-view-field--viewname--field-name-value.tpl.php for each field you want to theme individually.
Thanks to previous responses, I've used the following tools :

In the 'Basic Settings' block, the 'Theme: Information' to see all the different templates you can modify.
The Devel module's "Theme developer" to quickly find the field variable names.
View 2 documentation, especially the "Using Theme" page.

Configuring cron job for Drupal

http://drupal.org/cron

"In the following example, the crontab command shown below will activate the cron tasks automatically on the hour:

0 * * * * wget -O - -q -t 1 http://www.example.com/cron.php

"