Ultimate website launch checklist
Posted on June 17, 2009 | Categories: Technology
http://www.boxuk.com/blog/the-ultimate-website-launch-checklist
A curious technologist enjoying a fun, busy life in NYC
Posted on June 17, 2009 | Categories: Technology
http://www.boxuk.com/blog/the-ultimate-website-launch-checklist
Posted on June 9, 2009 | Categories: Technology
I am using nusoap library to connect to Kintera API. It worked fine on my other sites, but this one was giving me the following error message:
Fatal error: Uncaught SoapFault exception: [Client] SoapClient::SoapClient() [<a href='soapclient.soapclient'>soapclient.soapclient</a>]: Invalid parameters in /test.php:147 Stack trace: #0 /test.php(147): SoapClient->SoapClient(‘KinteraConnect….’, true) #1 {main} thrown in /test.php on line 147
Line 147 has the following code:
$client = new soapclient($wsdl,true);
After reading up online a bit, it seems this error appears on PHP 5 servers because of class name conflicts. So I opened up nusoap.php file and figured that you could just use nusoap_client as a class name. Code piece from nusoap.php
if (!extension_loaded('soap')) {
/*** For backwards compatiblity, define soapclient unless the PHP SOAP extension is loaded.*/
class soapclient extends nusoap_client {
}
}
So I just went ahead and changed
$client = new soapclient($wsdl,true);
to
$client = new nusoap_client($wsdl,true);
and it fixed it.
Posted on June 5, 2009 | Categories: Technology
http://www.smashingmagazine.com/2007/07/12/time-savers-code-beautifier-and-formatter/
Posted on June 5, 2009 | Categories: Technology
Task:
The download_count module is great for #1 and #2. However, it doesn’t save any information about users.
Here’s some modifications I’ve added to it to accomplish #3.
In the download_count.module file, find download_count_file_download() function. It saves the information about downloaded files into “file_downloads” table.
db_query(“INSERT INTO {file_downloads_users} (filename, user_id, timestamp) VALUES (‘%s’, %d,%d)”, $filename, $user->uid, time());
Now I write my own hook_user function:
<?php/** * Implementation of hook_user() */ function download_count_user($op, &$edit, &$account, $caterory = NULL) { if ($op == 'view') { $result = db_query("SELECT filename FROM file_downloads_users WHERE user_id = %d", $account->uid); while ($file_array = db_fetch_object($result)) { $file_str .= $file_array->filename . '<br/>'; } $account->content['summary']['file_downloads'] = array( '#type' => 'user_profile_item', '#title' => t('File Downloads'), '#value' => $file_str, '#weight' => 1 ); } } ?>
The above is Drupal 6 version. First I wrote one for Drupal 5 and it just didn’t work for me, until some nice fellow from StackOverflow pointed out the difference between 5 and 6 when it comes to handling user hooks.
Here’s the Drupal 5 version:
<?php function download_count_user($op, &$edit, &$account, $caterory = NULL) { if ($op == 'view') { $result = db_query("SELECT filename FROM file_downloads_users WHERE user_id = %d", $account->uid); while ($file = db_fetch_object($result)) { $file_str .= $file->filename . '<br/>'; } $items['downloads'] = array( 'title' => t('Files'), 'value' => $file_str, 'class' => 'member' ); return array(t('Downloads')=>$items); } } ?>
Now when you login into your user account after downloading some files, you’ll see that info displayed as a part of your user profile:
