removing output for year ranges if the value is 0 and making them blank in the
authorAnthony Talarico <talarico@gaslightmedia.com>
Wed, 15 Mar 2017 15:13:45 +0000 (11:13 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Wed, 15 Mar 2017 15:13:45 +0000 (11:13 -0400)
search results view

models/admin/management/obitImport.php
views/admin/management/obitImport.html
views/front/obits/searchResults.html

index c0ab933..19e2e35 100644 (file)
@@ -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 '<pre>', print_r($insert), '</pre>';
-//                $wpdb->insert($table, $insert);
+                $wpdb->insert($table, $insert);
             }
 
 //            echo '<pre>', print_r($insert), '</pre>';
index f5a0c1e..eee0439 100644 (file)
@@ -26,7 +26,7 @@ jQuery(document).ready(function($){
         }
 
         function clickNext(){
-            if(start && start < 40000){
+            if(start && start < 13000){
               $('.next-import-btn')[0].click();
             }
         }
index 08cb64c..d1e2864 100644 (file)
               
                 {foreach from=$obits item=i}
                     <tr>
-                        <td>{$i.b_yr_range}</td>
-                        <td>{$i.d_yr_range}</td> 
+                        <td>
+                            {if $i.b_yr_range == 0}
+                                
+                            {else}
+                                {$i.b_yr_range}
+                            {/if}
+                        </td>
+                        <td> 
+                            {if $i.d_yr_range == 0}
+                                
+                            {else}
+                                {$i.d_yr_range}
+                            {/if}
+                        </td> 
                         <td> <a class="detail-link"  href="{$thisUrl}/obits-detail/?obit={$i.id}" >{$i.last_name}</a> </td>
                         <td>{$i.first_mid}</td>
-                        <td>{$i.b_year}</td>
-                        <td>{$i.d_year}</td>
+                        <td>
+                            {if $i.b_year == 0}
+                                
+                            {else}
+                                {$i.b_year}
+                            {/if}
+                        </td>
+                        <td>
+                            {if $i.d_year == 0}
+                                
+                            {else}
+                                {$i.d_year}
+                            {/if}
+                        </td>
                         <td>{$i.spouse_partner}</td>
                         <td>{$i.maiden_other}</td>
                     </tr>