Changeset 700610
- Timestamp:
- 04/20/2013 07:06:16 AM (13 years ago)
- Location:
- soldpress/branches/0.9.5A
- Files:
-
- 3 edited
-
adapter.php (modified) (7 diffs)
-
custom_field_types.php (modified) (1 diff)
-
soldpress.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
soldpress/branches/0.9.5A/adapter.php
r700512 r700610 90 90 $this->displaylog(var_dump($this->service->GetAllLookupValues("Property"))); 91 91 $this->displaylog(var_dump($this->service->GetAllLookupValues("Office"))); 92 $this->displaylog(var_dump($this->service->GetAllLookupValues("Agent")));92 $this->displaylog(var_dump($this->service->GetAllLookupValues("Agent"))); 93 93 94 94 $this->displaylog(var_dump($this->service->GetMetadataObjects("Property"))); … … 100 100 public function sync_residentialproperty($crit, $culture) 101 101 { 102 echo $crit; 103 102 104 if($culture =='') 103 105 { … … 105 107 } 106 108 107 $results = $this->service->SearchQuery("Property","Property",$crit,array("Limit" => 1,"Culture" => $culture));109 $results = $this->service->SearchQuery("Property","Property",$crit,array("Limit" => 'None',"Culture" => $culture)); 108 110 109 111 while ($rets = $this->service->FetchRow($results)) { 112 113 $ListingKey = $rets['ListingKey']; 114 echo 'TheKeyIs' . $ListingKey .'<br>'; 115 110 116 //Check And See If We Have A Post Mathing The Listing Key 111 117 $args = array( … … 114 120 array( 115 121 'key' => 'ListingKey', 116 'value' => '11937198',)122 'value' => $ListingKey,) 117 123 ) 118 124 ); … … 120 126 $posts_array = get_posts( $args ); 121 127 122 $title = $rets['ListingId']; 123 $content = $rets['PublicRemarks']; 124 125 // $post_id = '-1'; 126 128 $title = $rets['UnparsedAddress'] .' (' . $rets['ListingId'] .')'; 129 $content = time(); 130 127 131 if( $posts_array ) { 132 128 133 $post = $posts_array[0]; 129 134 $post->post_title = $title; 130 $post->post_content = $content ;135 $post->post_content = $content . 'Updated'; 131 136 wp_update_post($post); 132 137 $post_id = $post->ID; 133 138 } 134 else 135 {139 else{ 140 136 141 $post = array( 137 142 'post_title' => $title , … … 145 150 } 146 151 147 echo 'file1';148 //Let's Property Image149 //$this->getpropertyobject($rets['ListingKey'], 'ThumbnailPhoto',$post_id);150 152 $this->sync_propertyobject($rets['ListingKey'], 'Photo',$post_id); 151 153 152 //If No Tempalte This Begins The Import Phase 153 // echo 'theid' . $post_id; 154 155 foreach($rets as $key => &$val) { 156 157 update_post_meta($post_id,$key, $val); 158 159 if($val != NULL) { 160 $template .= $key . ":" . $val . "<br>" ; 161 } 162 } 163 } 154 foreach($rets as $key => &$val) { 155 update_post_meta($post_id,$key, $val); 156 } 157 } 164 158 165 159 $this->service->FreeResult($results); … … 213 207 //If attachement is already attached do nothing with the meta data just update the file. 214 208 215 echo "Attachmet" . $filePath;209 // echo "Attachmet" . $filePath; 216 210 217 211 $wp_filetype = wp_check_filetype(basename($filename), null ); -
soldpress/branches/0.9.5A/custom_field_types.php
r700593 r700610 23 23 'description' => __( 'Property information pages', 'text_domain' ), 24 24 'labels' => $labels, 25 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', ' revisions', 'custom-fields', 'page-attributes', 'post-formats', ),26 'taxonomies' => false ;25 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'custom-fields', ), 26 'taxonomies' => false, 27 27 'hierarchical' => false, 28 28 'public' => true, -
soldpress/branches/0.9.5A/soldpress.php
r700512 r700610 46 46 // do something every hour 47 47 update_option( 'sc-lastupdate', time() ); 48 49 $adapter= new soldpress_adapter(); 50 if($adapter->connect()) 51 { 52 return $adapter-> sync_residentialproperty("LastUpdated=2011-05-08T22:00:17Z",""); //HardCode Time For Testing 53 } 54 55 } 56 57 add_filter( 'template_include', 'include_template_function', 1 ); 58 59 function include_template_function( $template_path ) { 60 if ( get_post_type() == 'property' ) { 61 if ( is_single() ) { 62 // checks if the file exists in the theme first, 63 // otherwise serve the file from the plugin 64 if ( $theme_file = locate_template( array ( 'single-property.php' ) ) ) { 65 $template_path = $theme_file; 66 } else { 67 $template_path = plugin_dir_path( __FILE__ ) . '/single-property.php'; 68 } 69 } 70 } 71 return $template_path; 48 72 } 49 73
Note: See TracChangeset
for help on using the changeset viewer.