From: Anthony Talarico Date: Wed, 15 Mar 2017 15:13:45 +0000 (-0400) Subject: removing output for year ranges if the value is 0 and making them blank in the X-Git-Tag: v1.0.0^2~24 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=0a458ef784b0554c44c9c8e1538c72c72a719be6;p=WP-Plugins%2Fglm-member-db-obits.git removing output for year ranges if the value is 0 and making them blank in the search results view --- diff --git a/models/admin/management/obitImport.php b/models/admin/management/obitImport.php index c0ab933..19e2e35 100644 --- a/models/admin/management/obitImport.php +++ b/models/admin/management/obitImport.php @@ -163,35 +163,18 @@ class GlmMembersAdmin_management_obitImport $key = 'last_name'; } if( $key === 'd_yr_range' || $key === 'b_yr_range' ){ + $value = substr($value, 0, 4); + } if( $key === 'courier_date' ){ $key = 'newspaper_date'; } - if( $key === 'obit_article' ){ - if ( !empty($value) ){ - $imageFullUrl = $img_src . $value; - -// $fp = fopen( GLM_MEMBERS_PLUGIN_IMAGES_PATH . '/' . $value, 'w+' ); -// $ch = curl_init( $imageFullUrl ); -// curl_setopt($ch, CURLOPT_TIMEOUT, 50); -// curl_setopt($ch, CURLOPT_FILE, $fp); -// curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); -// $fileData = curl_exec($ch); -// $httpCode = curl_getinfo($ch); -// curl_close($ch); -// fclose($fp); -// // Set correct file permissions -// $oldUmask = umask(0); -// chmod( GLM_MEMBERS_PLUGIN_IMAGES_PATH_PATH . '/' . $value, 0660 ); -// umask($oldUmask); -// sleep(1); - } - } -// $insert[$key] = $value; + + $insert[$key] = $value; } // echo '
', print_r($insert), '
'; -// $wpdb->insert($table, $insert); + $wpdb->insert($table, $insert); } // echo '
', print_r($insert), '
'; diff --git a/views/admin/management/obitImport.html b/views/admin/management/obitImport.html index f5a0c1e..eee0439 100644 --- a/views/admin/management/obitImport.html +++ b/views/admin/management/obitImport.html @@ -26,7 +26,7 @@ jQuery(document).ready(function($){ } function clickNext(){ - if(start && start < 40000){ + if(start && start < 13000){ $('.next-import-btn')[0].click(); } } diff --git a/views/front/obits/searchResults.html b/views/front/obits/searchResults.html index 08cb64c..d1e2864 100644 --- a/views/front/obits/searchResults.html +++ b/views/front/obits/searchResults.html @@ -254,12 +254,36 @@ {foreach from=$obits item=i} - {$i.b_yr_range} - {$i.d_yr_range} + + {if $i.b_yr_range == 0} + + {else} + {$i.b_yr_range} + {/if} + + + {if $i.d_yr_range == 0} + + {else} + {$i.d_yr_range} + {/if} + {$i.last_name} {$i.first_mid} - {$i.b_year} - {$i.d_year} + + {if $i.b_year == 0} + + {else} + {$i.b_year} + {/if} + + + {if $i.d_year == 0} + + {else} + {$i.d_year} + {/if} + {$i.spouse_partner} {$i.maiden_other}