try another color:

 
try another fontsize: tiny small normal big huge
netsperience 2.x
Drupal web development and other stuff

I Was Mentored in Drupal by "dumbluck"

The Drupal community web site has a profile field to list "My mentors"

For example, on my profile I say I was mentored by:
  • robbiethegeek - how to appreciate Drupal awesomeness and its limitations
  • Alex UA - how to run a business providing Drupal services
  • forestmars - how to be involved in the Drupal community
  • smerrill - how to be an engineer with platform tools like Jenkins, Vagrant, Redis
  • snugug - how to make web sites responsive
  • ericduran - how to experiment with new doodads like HTML5, Android
  • zroger - how to use Drupal hooks and APIs in code

I started thinking about my dumb luck picking Drupal as a tool about 9 years ago. I was looking for a Content Management System that made sense.

I was awfully interested in a project called PAWS (PHP Automatic Web Site) -- and it's a good thing I didn't ride that horse, which was long ago put out to pasture.

A client asked me to convert his static PHP site so that he could manage the content in the include files without editing code. I built my first Drupal 4.x site, with the crazy hack of creating a node for every include, and then printing the includes/nodes inside a main node (Panels, sort of, which did not exist in Drupal then). I also customized the front end of the TinyMCE wysiwyg editor to add buttons to apply his brand's pink and blue colors. The client smoked a lot of pot, drifted away, came back a year or two later for more work -- without a database. Oh well, not the first - or last - time the db was lost by a client.

That experience convinced me that a lot could be done with Drupal that I had not been able to do without a lot of custom coding just to build the base web application. Other projects with early versions of WordPress and Mambo (predecessor to Joomla) left me unimpressed with their extensibility. I have often said since then that "WordPress is like the smaller sibling of Drupal, but Joomla is the evil cousin."

Then Earl Miles conjured up his merlinofchaos wizardry for Sony Music, creating Views and Panels and Ctools, and that was around the time that a lot of developers took notice of Drupal. I was profoundly convinced that Drupal had outgrown being a CMS enabling writers to (more or less) easily edit content without (much) coding, and had become a Content Management Framework that could perform elegant and dynamic manipulations of the content in its database.

So I had to add dumbluck to my mentors - not just for my early experiment hacking the node system, but for each solution that I was able to implement afterwards, because my choice of Drupal provided me with an extensible framework allowing complex algorithms for presentation of content, and the Drupal project improves with every contributor's enhancements.

I think I'm dumb, maybe just happy

I noticed in preparing this post that some Drupal user profiles are accessible by username, eg. https://www.drupal.org/u/decibel.places and https://www.drupal.org/u/robbiethegeek, while others, like merlinofchaos and smerrill, are only accessible by their UIDs https://www.drupal.org/user/26979 and https://www.drupal.org/user/77539 respectively.

Site Launch: FINclusion Lab Beta

We have launched FINclusion Lab Beta

a new Drupal 7 site by MIX (Microfinance Information Exchange)

FINclusion Lab provides visual analytic tools to interpret the "proliferation of data in the field of financial inclusion" by aggregating data in Tableau dashboards and Mapbox maps.

The platform "provides financial service providers, policy makers, regulators, and other development professionals the opportunity to identify problems and devise solutions for increasing financial inclusion in their countries through interactive data tools and visualizations."

The FINclusion Lab team has worked over the past two years to gather data on supply and demand for financial services at the sub-national level for a growing number of countries in Africa, Asia, and Latin America.

FINclusion Lab Beta

We are using the Drupal Tableau module, sponsored by MIX, to display Tableau data visualization dashboards via Drupal Views.

Other MIX sites with free and premium data about microfinance:

MIX Market and MIX Market Reports

coming soon: translations in French, Spanish and Russian using the Drupal i18n  module for localization.

When Comments Go Unmoderated...

I came across this web page, looking for something else, that has an insane list of 51 unmoderated comments. The first one is relevant to the original post, and the following 50 are spam. After gay men with gay men it went downhill from there.

A Selection from the Beginning:                                       1st 10% of page:            

The page was so huge - about 6K px wide (because of text overflow) by > 250K px tall - that online screen capture apps choked.

I tried DuckLink (a Windows app) to capture the full page, but it choked at about 8%.

The 10% capture was provided by http://web-capture.net - although it is beyond the normal capability of the free online service, the owner tried to grab it for me. But he must have misread the height: I said the page is over 250K px tall, and he only captured the first 25K px.

 

Connect Drupal to Multiple Remote Databases via SSH Tunnel

I'm working on a Drupal application that stores data in separate mysql databases, and syncs some of the data to CouchDB with node.js scripts.

The extra mysql dbs are 16+ GB and it's not practical nor necessary to keep them locally since I only want to read the latest data in local development.

Wouldn't it be cool if my local development Drupal sites can read from the remote database servers?

In some cases you can just use the connection you find in the remote site's settings.php:

'otherdb' => 'mysqli://username:password@hostname/dbname'

(note: it's a Drupal 6 site so that's why you don't see an array - I will give a Drupal 7 example below)

However, there's often a twist: I must create a SSH tunnel to connect to this particular db server.

First, you need to have configured and installed SSH keys on your local and remote machines.

Then fire up your terminal and create the SSH tunnel to forward the remote mysql port to a local port. This technique is based on information clearly presented by RevSys (quick example) and noah.org (more details).

ssh -L [local port]:[db host]:[remote port] [ssh-username]@[remote host] -N
 
NOTES:
  1. -N tells ssh that you don't want to run a remote command; you only want to forward ports.
  2. use a different port for your tunnel [local port] than the one you normally use for mysql; for example, if you connect to mysql locally on the default port 3306, use 3307 (or any other unused port) for your tunnel. You should use the correct [remote port] which is typically 3306, and you can see if it is different by looking at settings.php in the remote site.
  3. Keep this connection alive as long as you need to connect to the remote database.
 
ssh -L 3307:[db host]:3306 [ssh-username]@[remote host] -N
 
Then you can test your connection (in a different terminal instance):
 
mysql -u[dbuser] -p -P 3307 -h 127.0.0.1
 
Here is the connection in settings.php for Drupal 6:
 
'otherdb' => 'mysqli://username:[email protected]:3307/dbname'
 
What's cool is that you can mix local and remote databases. For example, I want to use a local copy of the Drupal database, which is smaller and easier to sync, and read the data from the second (and third, in my case) remote dbs.
 
$db_url = array(
  'default' => 'mysqli://local-dbuser:password@localhost/local-dbname',
  'otherdb' => 'mysqli://username:[email protected]:3307/dbname',
  'otherdb2' => 'mysqli://username:[email protected]:3307/dbname2'
);
 
You can also connect Drupal to the default remote database, but it makes sense to use a local instance for development.
 
And in Drupal 7:
 
$databases['default']['default'] = array(
  'driver' => 'mysql',
  'database' => 'local-dbname',
  'username' => 'local-dbuser',
  'password' => 'password',
  'host' => 'localhost',
  'prefix' => '',
);
$databases['otherdb']['default'] = array(
  'driver' => 'mysql',
  'database' => 'dbname',
  'username' => 'username',
  'password' => 'password',
  'host' => '127.0.0.1',
  'port' => '3307',
  'prefix' => '',
);
 

WARNING: 

If the db user for the remote db has all privileges, your application may alter the remote database.
 
Therefore, you should create a "read-only" user for the remote database which will prevent you from altering it.
 
THINK
 

Drupal 7 Migrate V2 and Addressfield: SOLVED!

I had to migrate site members from a legacy site with an Oracle db to a relaunch on Drupal 7. Instead of connecting directly to Oracle, I was provided with an Excel dump which I converted to csv. Also the old site does not require members to be authenticated, so I did not have to deal with old passwords.

There are a lot of stale posts in Google results about migrating Addressfield that do not work on the latest Migrate V2 for Drupal 7. For one thing arguments in the field mapping are deprecated.

Using the Migrate module I was able to create migration classes for the users, and some other information; but I got stuck at importing the address data into the Drupal Addressfield table, because it uses subfields and requires building an array in Migrate.

I used colon notation for subfield mapping, but it was not working.

<?php
    $this
->addFieldMapping('body', 'body');
   
$this->addFieldMapping('body:summary', 'excerpt');
?>

Migrate kept throwing an error: Call to a member function import() on a non-object

But when I put drush_print_r on the line throwing the error, I could see the stdClass object arrays were there and populated with the correct data.

I decided to abandon the Addressfield migrate class and use db_insert in an existing class (class SchoolMigration) where I was already running db queries.

It worked, and although I was worried a direct db_insert would not roll back, since I registered the inserts in the process() function for class SchoolMigration, they also rolled back.

Building a Video Playlist for JW Player 6 with Drupal 7 Views

I took over a Drupal 7 project building a web application for college students to upload original videos about their school, and for schools to manage, group, and share the videos.

It's a startup privately funded by the principal, and we are literally working on a shoestring. My previous experience with media in Drupal led the principal to contact me via LinkedIn.

When it came time to build a video playlist in Drupal Views for JW Player version="6.7.4071" (formerly known as Longtail Video), I found very little useful documentation. In fact, someone suggested that those who know how are not interested in sharing their knowlege. -- but not me smiley

There are a couple of videos on YouTube by Bryan Ollendyke for Drupal 6. But a lot has changed in Drupal since then.

The Goal:

Back to the playlist: Site admins can mark a video featured by ticking a checkbox on the custom video content type. Now I want to display those featured videos as a playlist.

 

JW Player provides clear documentation about how to embed the player, and how to construct and load the playlist via a RSS feed.

The structure of the RSS file:

<rss version="2.0" xmlns:jwplayer="http://rss.jwpcdn.com/">
<channel>

  <item>
    <title>Sintel Trailer</title>
    <description>Sintel is a fantasy CGI from the Blender Open Movie Project.</description>
    <jwplayer:image>/assets/sintel.jpg</jwplayer:image>
    <jwplayer:source file="/assets/sintel.mp4" />
  </item>

</channel>
</rss>

There are various threads on drupal.org discussing video playlists for JW Player. None of them were particularly useful for me.

Syndicate content
Register