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.

Manipulating the $query object

http://drupal.org/node/310075

took me forever to find this.

sending mail with Perl and sendmail

#!/usr/bin/perl
print "Content-type: text/html\n\n";

$title='Perl Mail demo';
$to='MAIL ADDRESS TO SEND TO';
$from= 'webmaster@YOURDOMAIN.COM';
$subject='YOUR SUBJECT';

open(MAIL, "|/usr/sbin/sendmail -t");

## Mail Header
print MAIL "To: $to\n";
print MAIL "From: $from\n";
print MAIL "Subject: $subject\n\n";
## Mail Body
print MAIL "This is a test message from Cyberciti.biz! You can write your
mail body text here\n";

close(MAIL);

print "<html><head><title>$title</title></head>\n<body>\n\n";

## HTML content sent, let use know we sent an email
print "
<h1>$title</h1>

A message has been sent from $from to $to

</body></html>";

To send mail from a Unix/Linux shell script

echo "This is mail body" | mail -s "This is subject" mail_ID@somedomain.com

Getting a security token from your salesforce instance

To access Salesforce via a desktop application or other API-based application, you must replace your current password with a combination of your password and a security token:

1 Log in to Salesforce via the browser to request your security token.

2 Go to Setup -> My Personal Information -> Reset Security Token.

3 Click the Reset Security Token button to trigger an email which will contain your security token.

4 Select and copy the token from the email.

5 In the application, replace your password with combination of the password and the security token. For example, if your password is "MyPassword" and your security token is "XXXXXX", you would enter "MyPasswordXXXXXX" into the password field.

The security token will be sent to your email address (assuming you're the admin).

db_query in drupal .... creating sql queries the drupal way

good drupal.org documentation is here: http://drupal.org/node/101496

db_query(' SELECT * FROM {table_name} WHERE vid = %d' , $node- >vid);

%s String
%d Integer
%f Float
%b Binary data; do not enclose in ' '
%% Inserts a literal % sign (e.g., SELECT * FROM {users} WHERE name LIKE ' %%%s%%' )

And if the values are in an array that you are retrieving. You'll receive just this useless message if you don't use db_fetch array: Resource id #82 where 82 will change depending on the query.

$check_event_id = db_fetch_array(db_query('SELECT field_id_value from {content_type_event_calendar} where field_id_value = %d', $event->id));
print 'check_event_id is '.$check_event_id['field_id_value'];

Where is my cck data in the database stored.

The data is here for example for content type event_calendar:
So just look for your content type using the same naming convention.

mysql> describe content_type_event_calendar;
+------------------------------+------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------------------------+------------------+------+-----+---------+-------+
| vid | int(10) unsigned | NO | PRI | 0 | |
| nid | int(10) unsigned | NO | MUL | 0 | |
| field_id_value | int(11) | YES | | NULL | |
| field_link_to_calendar_value | longtext | YES | | NULL | |
| field_creator_value | longtext | YES | | NULL | |
| field_subject_value | longtext | YES | | NULL | |
+------------------------------+------------------+------+-----+---------+-------+
6 rows in set (0.00 sec)

Install alternative version of php on a mac with mac ports

Note I've found all these directions on making it work even when installing port php52 it simply does not work. I'm still trying to get this to work. ack.

http://2tbsp.com/content/install_apache_2_and_php_5_macports
http://typofree.org/article/archive/2009/august/title/macports-give-me-b...
http://guide.macports.org/#development.local-repositories

If you need to uninstall MacPorts, and your port command is functioning, have it uninstall all the installed ports by typing this in the Terminal:

install php mysql with: sudo port install php52 +apache2 +php5-mysql +pear +php5-soap
uninstall with:  sudo port -f uninstall installed

-f is to force the install or uninstall.

to uninstall mac ports (this was the only way I could uninstall php 5.3)

sudo rm -rf \
    /opt/local \
    /Applications/DarwinPorts \
    /Applications/MacPorts \
    /Library/LaunchDaemons/org.macports.* \
    /Library/Receipts/DarwinPorts*.pkg \
    /Library/Receipts/MacPorts*.pkg \
    /Library/StartupItems/DarwinPortsStartup \
    /Library/Tcl/darwinports1.0 \
    /Library/Tcl/macports1.0 \
    ~/.macports

Setting up SEO friendly urls in Drupal

Great post on a site that is eerily exactly like this one!
http://stevepurkiss.com/blog/steve-purkiss/2009/04/15/setting-seo-friend...

Using the jquery library thickbox to have lightboxes

After opening a lightbox with thickbox: see http://jquery.com/demo/thickbox/

You can close the lightbox and have an href link open a url in the parent window:

<a href=\"javascript:parent.location.href='https://alum.mit.edu/register.vm';javascript:top.tb_remove();\">Register for an Infinite Connection account.</a>

Also to have a form and click submit but close the lightbox and have the form submit to the parent page use this code.

<?php
$output .= "<form action=\"https://alum.mit.edu/AlumVerifier.dyn\" target=\"_parent\" accept-charset=\"UTF-8\" method=\"post\" id=\"user-login-form\">
?>
</pre>
this took me an hour or two to figure out, so you're welcome :)

conditionally run code on page.tpl.php

I use the following code to conditionally show pieces of the page depending on which page the user is on:

$curr_uri = check_plain(request_uri());
//print $curr_uri;
<?php if ((!preg_match("/contact/i", $curr_uri))&&(!preg_match("/authentication-options/i", $curr_uri))&&(!preg_match("/node\/305/i", $curr_uri))) : ?>
<h1>conditional html code here</h1>
<?php or php code here to be conditionally shown?>
<?php endif; ?>