Act 4, Scene 1: Review the Code
<?php //… function exif_custom_get_mapping(){ //First try and get users default $mid = exif_custom_get_user_default(); //Else use site default or item 0 if($mid === FALSE){ $mid = exif_custom_get_mid(variable_get(‘exif_custom_default’, ”)); } $sql = “SELECT * FROM {exif_custom_mapped_fields} WHERE mid = :mid AND img_field != $return = db_query($sql, array( ‘:mid’ => $mid ))->fetchAllAssoc(‘img_field’); return $return; } function exif_custom_mappings(){ $output = ”; $mappings = _exif_custom_get_maps(); if($mappings == false){ $output .= ‘<p>You have not yet created any mappings.<p></p>’; } else { $site_default_mid = exif_custom_get_mid(variable_get(‘exif_custom_default’ Drupalist notes that code follows standards. He can read and understand what functions he’d need to use to build in Features support.