1
|
|
|
<?php |
|
|
|
|
2
|
|
|
|
3
|
|
|
/* Exit if accessed directly. */ |
4
|
|
|
if ( ! defined( 'ABSPATH' ) ) { exit; } |
5
|
|
|
|
6
|
|
|
if ( ! class_exists( 'ZillowWidgets' ) ) { |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* ZillowWidgets class. |
10
|
|
|
*/ |
11
|
|
|
class ZillowWidgets { |
|
|
|
|
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* __construct function. |
15
|
|
|
* |
16
|
|
|
* @access public |
17
|
|
|
* @return void |
|
|
|
|
18
|
|
|
*/ |
19
|
|
|
public function __construct() { |
20
|
|
|
} |
21
|
|
|
|
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* zillow_iframe_css function. |
25
|
|
|
* |
26
|
|
|
* @access public |
27
|
|
|
* @return void |
28
|
|
|
*/ |
29
|
|
|
public function zillow_iframe_css() { |
30
|
|
|
|
31
|
|
|
?> |
32
|
|
|
|
33
|
|
|
<style> |
34
|
|
|
.zillow-iframe { |
35
|
|
|
display:block; |
36
|
|
|
max-width:100%; |
37
|
|
|
} |
38
|
|
|
</style> |
39
|
|
|
|
40
|
|
|
<?php |
41
|
|
|
|
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* Zillow Iframe ID Names. |
46
|
|
|
* |
47
|
|
|
* @access public |
48
|
|
|
* @param string $iframe_id (default: '') |
49
|
|
|
* @return void |
50
|
|
|
*/ |
51
|
|
|
public function zillow_iframe_id( $iframe_id = '' ) { |
52
|
|
|
|
53
|
|
|
if( '' !== $iframe_id ) { |
54
|
|
|
return sanitize_html_class( $iframe_id ) . '-iframe'; |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* Zillow Iframe Class Names. |
61
|
|
|
* |
62
|
|
|
* @access public |
63
|
|
|
* @param string $widget_name (default: '') |
64
|
|
|
* @return void |
65
|
|
|
*/ |
66
|
|
View Code Duplication |
public function zillow_iframe_class( $widget_name = '' ) { |
|
|
|
|
67
|
|
|
|
68
|
|
|
if( '' !== $widget_name ) { |
69
|
|
|
return 'zillow zillow-iframe zillow-' . sanitize_html_class( $widget_name ) . '-iframe'; |
70
|
|
|
} else { |
71
|
|
|
return 'zillow zillow-iframe'; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/* YOU ON ZILLOW WIDGETS. */ |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* Get My Zillow Listings Widget. |
80
|
|
|
* |
81
|
|
|
* @access public |
82
|
|
|
* @param string $iframe_id (default: '') |
83
|
|
|
* @param mixed $zuid |
84
|
|
|
* @param string $format (default: 'normalWidget') |
85
|
|
|
* @return void |
86
|
|
|
*/ |
87
|
|
|
public function get_listings_widget( $iframe_id = '', $zuid, $format = 'normalWidget' ) { |
88
|
|
|
|
89
|
|
|
echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'listings' ) .'" scrolling="no" title="'. __( 'My Listings on Zillow', 're-rpo' ) .'" src="https://www.zillow.com/widgets/profile/NewListingsWidget.htm?aid='. $zuid .'&newVersion=true&widgetFormat='. $format .'" width="500" height="300" frameborder="0" style="width:100%;"></iframe>'; |
90
|
|
|
|
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* Get Review Widget (https://www.zillow.com/webtools/widgets/review-widget/). |
95
|
|
|
* |
96
|
|
|
* @access public |
97
|
|
|
* @param string $iframe_id (default: '') |
98
|
|
|
* @param mixed $zuid |
99
|
|
|
* @param mixed $screenname |
100
|
|
|
* @param string $size (default: 'wide') |
101
|
|
|
* @param string $zmod (default: 'true') |
102
|
|
|
* @param mixed $width |
103
|
|
|
* @param mixed $height |
104
|
|
|
* @return void |
105
|
|
|
*/ |
106
|
|
|
public function get_review_widget( $iframe_id = '', $zuid, $screenname, $size = 'wide', $zmod = 'true', $width = '300', $height = '100' ) { |
107
|
|
|
|
108
|
|
|
echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'reviews' ) .'" scrolling="yes" title="'. __( 'My Reviews on Zillow', 're-pro' ) .'" src="https://www.zillow.com/widgets/reputation/Rating.htm?did=rw-widget-container&ezuid=' . $zuid .'&scrnname=' . $screenname . '&size=' .$size . '&type=iframe&zmod='. $zmod .'" width="'. $width . '" height="'. $height .'" frameborder="0"></iframe>'; |
109
|
|
|
|
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* Get My Past Sales Widget. |
114
|
|
|
* |
115
|
|
|
* @access public |
116
|
|
|
* @param string $iframe_id (default: '') |
117
|
|
|
* @param mixed $zuid |
118
|
|
|
* @param string $format (default: 'normalWidget') |
119
|
|
|
* @return void |
120
|
|
|
*/ |
121
|
|
|
public function get_past_listings_widget( $iframe_id = '', $zuid, $format = 'normalWidget' ) { |
122
|
|
|
|
123
|
|
|
echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'past-listings' ) .'" scrolling="no" title="'. __( 'My Sales on Zillow', 're-rpo' ) .'" src="https://www.zillow.com/widgets/profile/PastSalesListingWidget.htm?aid='. $zuid .'&newVersion=true&widgetFormat='. $format .'" width="500" height="250" frameborder="0" style="width:100%;"></iframe>'; |
124
|
|
|
|
125
|
|
|
} |
126
|
|
|
|
127
|
|
|
/** |
128
|
|
|
* Get Contact Form Widget. |
129
|
|
|
* |
130
|
|
|
* @access public |
131
|
|
|
* @param string $iframe_id (default: '') |
132
|
|
|
* @param mixed $email |
133
|
|
|
* @return void |
134
|
|
|
*/ |
135
|
|
|
public function get_contact_widget( $iframe_id = '', $email ) { |
136
|
|
|
|
137
|
|
|
echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'contact' ) .'" scrolling="no" title="'. __( 'Contact me on Zillow', 're-rpo' ) .'" src="https://www.zillow.com/widgets/contact/ContactFormWidget.htm?email='. antispambot( sanitize_email( $email ) ) .'&size=wide" width="350" height="250" frameborder="0" style="width:100%;"></iframe>'; |
138
|
|
|
|
139
|
|
|
} |
140
|
|
|
|
141
|
|
|
/* MORTGAGE WIDGETS */ |
142
|
|
|
|
143
|
|
|
/** |
144
|
|
|
* Get Affordability Calculator. |
145
|
|
|
* |
146
|
|
|
* @access public |
147
|
|
|
* @param string $iframe_id (default: '') |
148
|
|
|
* @return void |
149
|
|
|
*/ |
150
|
|
|
public function get_affordability_calc_widget( $iframe_id = '' ) { |
151
|
|
|
|
152
|
|
|
echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'affordability-calc' ) .'" scrolling="no" title="'. __( 'Zillow Affordability Calculator', 're-rpo' ) .'" src="https://www.zillow.com/mortgage/widgets/AffordabilityCalculatorWidget.htm" width="688" height="700" frameborder="0" style="width:100%;min-height:700px;"></iframe>'; |
153
|
|
|
|
154
|
|
|
} |
155
|
|
|
|
156
|
|
|
/** |
157
|
|
|
* Get Monthly Payment Calculator. |
158
|
|
|
* |
159
|
|
|
* @access public |
160
|
|
|
* @param string $iframe_id (default: '') |
161
|
|
|
* @return void |
162
|
|
|
*/ |
163
|
|
|
public function get_monthlypay_calc_widget( $iframe_id = '' ) { |
164
|
|
|
|
165
|
|
|
echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'listings' ) .'" scrolling="no" title="'. __( 'Monthly Payment Calculator', 're-rpo' ) .'" src="https://www.zillow.com/mortgage/MortgageCalculatorWidgetLarge.htm" width="688" height="700" frameborder="0" style="width:100%;min-height:700px;"></iframe>'; |
166
|
|
|
|
167
|
|
|
} |
168
|
|
|
|
169
|
|
|
/** |
170
|
|
|
* Get Mortgage Calculator Widget. |
171
|
|
|
* |
172
|
|
|
* @access public |
173
|
|
|
* @param string $iframe_id (default: '') |
174
|
|
|
* @param string $orientation (default: 'verticalWidget') |
175
|
|
|
* @return void |
176
|
|
|
*/ |
177
|
|
|
public function get_mortgage_calc_widget( $iframe_id = '', $orientation = 'verticalWidget' ) { |
178
|
|
|
|
179
|
|
View Code Duplication |
if ( 'verticalWidget' === $orientation ) { |
|
|
|
|
180
|
|
|
$height = '470'; |
181
|
|
|
$width = '200'; |
182
|
|
|
} else { |
183
|
|
|
$height = '235'; |
184
|
|
|
$width = '352'; |
185
|
|
|
} |
186
|
|
|
|
187
|
|
|
echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'mortgage-calc' ) .'" scrolling="no" title="'. __( 'Zillow Mortgage Calculator', 're-rpo' ) .'" src="https://www.zillow.com/mortgage/SmallMortgageLoanCalculatorWidget.htm?widgetOrientationType='. $orientation .'" width="'. $width .'" height="'. $height .'" frameborder="0" style="width:100%;"></iframe>'; |
188
|
|
|
|
189
|
|
|
} |
190
|
|
|
|
191
|
|
|
/** |
192
|
|
|
* Get Mortgage Rate Table Widget. |
193
|
|
|
* |
194
|
|
|
* @access public |
195
|
|
|
* @param string $iframe_id (default: '') |
196
|
|
|
* @param mixed $textcolor |
197
|
|
|
* @param mixed $screenname |
198
|
|
|
* @param mixed $region |
199
|
|
|
* @return void |
200
|
|
|
*/ |
201
|
|
|
public function get_mortgage_rate_table_widget( $iframe_id = '', $textcolor, $screenname, $region ) { |
202
|
|
|
|
203
|
|
|
?> |
204
|
|
|
<div id="" class="zillow-mortage-rate-table"> |
205
|
|
|
<div class="header-labels"> |
206
|
|
|
<span class="current-label" style="color:#<?php echo $textcolor ?>"> |
207
|
|
|
<?php _e( 'Current', 're-pro' ); ?> |
208
|
|
|
</span> |
209
|
|
|
<span class="lastweek-label" style="color:#<?php echo $textcolor ?>"> |
210
|
|
|
<?php _e( 'Last Week', 're-pro' ); ?> |
211
|
|
|
</span> |
212
|
|
|
</div> |
213
|
|
|
|
214
|
|
|
<div> |
215
|
|
|
<div class="rate-labels-wrapper"> |
216
|
|
|
<div id="30-year-label-row" class="rate-label-row"> |
217
|
|
|
<div id="30-year-label" class="rate-label"> |
218
|
|
|
<?php _e( '30 Year Fixed', 're-pro' ); ?> |
219
|
|
|
</div> |
220
|
|
|
</div> |
221
|
|
|
|
222
|
|
|
<div id="15-year-label-row" class="rate-label-row"> |
223
|
|
|
<div id="15-year-label" class="rate-label"> |
224
|
|
|
<?php _e( '15 Year Fixed', 're-pro' ); ?> |
225
|
|
|
</div> |
226
|
|
|
</div> |
227
|
|
|
|
228
|
|
|
<div id="5-1-adjustable-label-row" class="rate-label-row"> |
229
|
|
|
<div id="5-1-adjustable-label" class="rate-label"> |
230
|
|
|
<?php _e( '5/1 Adjustable', 're-pro' ); ?> |
231
|
|
|
</div> |
232
|
|
|
</div> |
233
|
|
|
</div> |
234
|
|
|
|
235
|
|
|
<?php |
236
|
|
|
|
237
|
|
|
echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'mortgage-rates-table' ) .'" scrolling="no" title="'. __( 'Zillow Mortgage Rate Table', 're-pro' ) .'" src="https://www.zillow.com/mortgage/MortgageRateTable.htm?wide=1&textcolor='. $textcolor .'&scrnname='. $screenname .'®ion='. $region .'&cobrand='. $screenname .'" width="130" height="100" frameborder="0" style="width:50%;"></iframe>'; |
238
|
|
|
|
239
|
|
|
} |
240
|
|
|
|
241
|
|
|
/** |
242
|
|
|
* Get Rate Table with Graph Widget. |
243
|
|
|
* |
244
|
|
|
* @access public |
245
|
|
|
* @param string $iframe_id (default: '') |
246
|
|
|
* @return void |
247
|
|
|
*/ |
248
|
|
|
public function get_rate_table_graph_widget( $iframe_id = '' ) { |
249
|
|
|
|
250
|
|
|
echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'mortgage-rates-graph' ) .'" title="'. __( 'Zillow Mortgage Rates Graph', 're-pro' ) .'" src="https://www.zillow.com/webtools/widgets/RateTableAndGraphDistributionWidget.htm" width="306" height="315" frameborder="0" scrolling="no" ></iframe>'; |
251
|
|
|
|
252
|
|
|
} |
253
|
|
|
|
254
|
|
|
/** |
255
|
|
|
* Get Large Rate Table Widget. |
256
|
|
|
* |
257
|
|
|
* @access public |
258
|
|
|
* @return void |
259
|
|
|
*/ |
260
|
|
|
public function get_mortage_rate_widget( $iframe_id = '' ) { |
261
|
|
|
|
262
|
|
|
echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'mortgage-rates' ) .'" scrolling="no" title="'. __( 'Zillow Mortgage Rate Table', 're-pro' ) .'" src="https://www.zillow.com/webtools/widgets/RateTableDistributionWidget.htm" width="306" height="215" frameborder="0" style="width:100%;min-height:215px;"></iframe>'; |
263
|
|
|
|
264
|
|
|
} |
265
|
|
|
|
266
|
|
|
/** |
267
|
|
|
* Get Payment Breakout Calculator Widget. |
268
|
|
|
* |
269
|
|
|
* @access public |
270
|
|
|
* @param string $iframe_id (default: '') |
271
|
|
|
* @param mixed $price |
272
|
|
|
* @param mixed $region_id |
273
|
|
|
* @param string $textcolor (default: '000000') |
274
|
|
|
* @return void |
275
|
|
|
*/ |
276
|
|
|
public function get_paymentbreakout_calc_widget( $iframe_id = '', $price, $region_id, $textcolor = '000000' ) { |
277
|
|
|
|
278
|
|
|
echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'mortgage-payment-breakout' ) .'" scrolling="no" title="'. __( 'Zillow Mortgage Payment Breakout Calculator', 're-pro' ) .'"src="https://www.zillow.com/mortgage/MortgageLoanCalculatorWidget.htm?skin=custom&price='. $price .'&rid='. $region_id .'&textcolor='. $textcolor .'" frameborder="0" title="'. __( 'Zillow Mortgage Calculator', 're-pro' ) .'" width="176" height="298px"></iframe>'; |
279
|
|
|
|
280
|
|
|
} |
281
|
|
|
|
282
|
|
|
/* DATA AND STATS. */ |
283
|
|
|
|
284
|
|
|
/** |
285
|
|
|
* Get Home Value Estimate Chart Widget. |
286
|
|
|
* |
287
|
|
|
* @access public |
288
|
|
|
* @param string $iframe_id (default: '') |
289
|
|
|
* @param string $type (default: 'iframe') |
290
|
|
|
* @param mixed $address |
291
|
|
|
* @param string $searchbox (default: 'yes') |
292
|
|
|
* @param mixed $region |
293
|
|
|
* @param string $skinny_widget (default: 'true') |
294
|
|
|
* @param string $textcolor (default: '000000') |
295
|
|
|
* @param string $bgcolor (default: 'FFFFFF') |
296
|
|
|
* @return void |
297
|
|
|
*/ |
298
|
|
|
public function get_home_value_estimate_widget( $iframe_id = '', $type = 'iframe', $address, $searchbox = 'yes', $region, $skinny_widget = 'true', $textcolor = '000000', $bgcolor = 'FFFFFF' ) { |
299
|
|
|
|
300
|
|
|
echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'home-value-estimate' ) .'" scrolling="no" title="'. __( 'Zillow Home Value Estimate', 're-pro' ) .'" src="https://www.zillow.com/widgets/zestimate/ZestimateLargeWidget.htm?did=zillow-shv-large-iframe-widget&type='.$type.'&address='.$address.'&searchbox='. $searchbox .'®ion='.$region.'&skinnyWidget='.$skinny_widget.'&tc='. $textcolor .'&bgc='. $bgcolor .'" width="296" frameborder="0" height="360"></iframe>'; |
301
|
|
|
} |
302
|
|
|
|
303
|
|
|
/** |
304
|
|
|
* get_realestate_stats_widget function. |
305
|
|
|
* |
306
|
|
|
* @access public |
307
|
|
|
* @param string $iframe_id (default: '') |
308
|
|
|
* @param mixed $cs |
309
|
|
|
* @param string $did (default: 'rsw-wide') |
310
|
|
|
* @param mixed $dys |
311
|
|
|
* @param mixed $mt |
312
|
|
|
* @param mixed $region_id |
313
|
|
|
* @param mixed $sid |
314
|
|
|
* @param string $type (default: 'iframe') |
315
|
|
|
* @param string $wtype (default: 'rhv') |
316
|
|
|
* @param string $skinny_widget (default: 'true') |
317
|
|
|
* @param string $textcolor (default: '000000') |
318
|
|
|
* @param string $bgcolor (default: 'FFFFFF') |
319
|
|
|
* @return void |
320
|
|
|
*/ |
321
|
|
|
public function get_realestate_stats_widget( $iframe_id = '', $cs, $did = 'rsw-wide', $dys, $mt, $region_id, $sid, $type = 'iframe', $wtype = 'rhv', $skinny_widget = 'true', $textcolor = '000000', $bgcolor = 'FFFFFF' ) { |
|
|
|
|
322
|
|
|
|
323
|
|
|
echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'realestate-stats' ) .'" title="'. __( 'Zillow Real Estate Stats', 're-pro' ) .'" scrolling="no" src="https://www.zillow.com/widgets/geo/RegionalStatsWidget.htm?cs='. $cs .'&did='. $did .'&dys='.$dys.'&mt='.$mt.'&rid='.$region_id.'&sid='.$sid.'&type='.$type.'&wtype='. $type .'&skinnyWidget='.$skinny_widget.'&textcolor='.$textcolor.'&backgroundColor='. $bgcolor .'" width="286" frameborder="0" height="280"></iframe>'; |
324
|
|
|
} |
325
|
|
|
|
326
|
|
|
/** |
327
|
|
|
* get_rent_validation_widget function. |
328
|
|
|
* |
329
|
|
|
* @access public |
330
|
|
|
* @param string $iframe_id (default: '') |
331
|
|
|
* @param string $type (default: 'iframe') |
332
|
|
|
* @param string $skinny_widget (default: 'true') |
333
|
|
|
* @param string $searchbox (default: 'yes') |
334
|
|
|
* @param string $for_rent (default: 'true') |
335
|
|
|
* @param mixed $address |
336
|
|
|
* @param mixed $region |
337
|
|
|
* @param string $textcolor (default: '000000') |
338
|
|
|
* @param string $bgcolor (default: 'FFFFF') |
339
|
|
|
* @return void |
340
|
|
|
*/ |
341
|
|
|
public function get_rent_validation_widget($iframe_id = '', $type = 'iframe', $skinny_widget = 'true', $searchbox = 'yes', $for_rent = 'true', $address, $region, $textcolor = '000000', $bgcolor = 'FFFFF' ) { |
342
|
|
|
|
343
|
|
|
echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'rent-validation' ) .'" title="'. __( 'Zillow Rent Validation', 're-pro' ) .'" scrolling="no" src="https://www.zillow.com/widgets/zestimate/ZestimateLargeWidget.htm?did=zillow-shv-large-iframe-widget&type='.$type.'&forRent='.$for_rent.'&tc='.$textcolor.'&bgc='.$bgcolor.'&address='. $address .'&searchbox='.$searchbox.'®ion='.$region.'&skinnyWidget='.$skinny_widget.'" frameborder="0" width="296" height="360"></iframe>'; |
344
|
|
|
} |
345
|
|
|
|
346
|
|
|
/* LISTINGS. */ |
347
|
|
|
|
348
|
|
|
/** |
349
|
|
|
* Get Most Expensive Homes Widget. |
350
|
|
|
* |
351
|
|
|
* @access public |
352
|
|
|
* @param string $iframe_id (default: '') |
353
|
|
|
* @param mixed $location |
354
|
|
|
* @param string $type (default: 'iframe') |
355
|
|
|
* @param string $size (default: ' wide') |
356
|
|
|
* @return void |
357
|
|
|
*/ |
358
|
|
View Code Duplication |
public function get_expensive_homes_widget( $iframe_id = '', $location, $type = 'iframe', $size = ' wide' ) { |
|
|
|
|
359
|
|
|
|
360
|
|
|
// TODO - Check for HTTPS, as this widget does not support it. |
361
|
|
|
// TODO - Support JS Version. |
362
|
|
|
|
363
|
|
|
echo '<div class="zillow-listings-widget-container zillow-meh-widget-container">'; |
364
|
|
|
echo '<h5>Most Expensive Homes in ' . $location . '</h5>'; |
365
|
|
|
echo '<div class="zillow-meh-outer">'; |
366
|
|
|
echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'expensive-homes' ) .'" title="'. __( 'Zillow Most Expensive Homes', 're-pro' ) .'" scrolling="no" src="https://www.zillow.com/widgets/fmr/FMRWidget.htm?did=meh-large-iframe-widget-container&type='. $type .'&size='.$size.'&rn='. $location .'&widgettype=meh" width="" height="121" frameborder="0" style="width:100%;"></iframe>'; |
367
|
|
|
echo '</div>'; |
368
|
|
|
echo '<img alt="Zillow Real Estate" style="border:0;" src="http://www.zillow.com/widgets/GetVersionedResource.htm?path=%2Fstatic%2Fimages%2Fpowered-by-zillow.gif" />'; |
369
|
|
|
echo '</div>'; |
370
|
|
|
} |
371
|
|
|
|
372
|
|
|
/** |
373
|
|
|
* Get Newest For Sale Homes Widget. |
374
|
|
|
* |
375
|
|
|
* @access public |
376
|
|
|
* @param string $iframe_id (default: '') |
377
|
|
|
* @param mixed $location |
378
|
|
|
* @param string $type (default: 'iframe') |
379
|
|
|
* @param string $size (default: ' wide') |
380
|
|
|
* @return void |
381
|
|
|
*/ |
382
|
|
View Code Duplication |
public function get_newest_forsale_homes_widget( $iframe_id = '', $location, $type = 'iframe', $size = ' wide' ) { |
|
|
|
|
383
|
|
|
|
384
|
|
|
// TODO - Check for HTTPS, as this widget does not support it. |
385
|
|
|
// TODO - Support JS Version. |
386
|
|
|
|
387
|
|
|
echo '<div class="zillow-listings-widget-container zillow-nfs-widget-container">'; |
388
|
|
|
echo '<h5>Newest For Sale Homes in ' . $location . '</h5>'; |
389
|
|
|
echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'newest-homes' ) .'" title="'. __( 'Zillow Newest For Sale Homes', 're-pro' ) .'" scrolling="no" src="https://www.zillow.com/widgets/fmr/FMRWidget.htm?did=nfs-large-iframe-widget-container&type='. $type .'&size='.$size.'&rn='. $location .'&widgettype=nfs" width="286" height="123" frameborder="0"></iframe>'; |
390
|
|
|
echo '<img alt="Zillow Real Estate" style="border:0;" src="http://www.zillow.com/widgets/GetVersionedResource.htm?path=%2Fstatic%2Fimages%2Fpowered-by-zillow.gif" />'; |
391
|
|
|
echo '</div>'; |
392
|
|
|
} |
393
|
|
|
|
394
|
|
|
/** |
395
|
|
|
* get_zillow_search_widget function. |
396
|
|
|
* |
397
|
|
|
* @access public |
398
|
|
|
* @param string $iframe_id (default: '') |
399
|
|
|
* @param string $use_user_location (default: 'false') |
400
|
|
|
* @param string $is_public (default: 'true') |
401
|
|
|
* @param string $bucket (default: 'map') |
402
|
|
|
* @param mixed $zillow_screenname |
403
|
|
|
* @param mixed $region_id |
404
|
|
|
* @return void |
405
|
|
|
*/ |
406
|
|
|
public function get_zillow_search_widget( $iframe_id = '', $use_user_location = 'false', $is_public = 'true', $bucket = 'map', $zillow_screenname, $region_id ) { |
407
|
|
|
|
408
|
|
|
echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'search' ) .'" title="'. __( 'Zillow Search', 're-pro' ) .'" src="https://www.zillow.com/widgets/search/PartnerAdWidget.htm?ulbm='.$use_user_location.'&isPublic='.$is_public.'&bucket='.$bucket.'&pn='.$zillow_screenname.'&rid='.$region_id.'&style=default" scrolling="no" frameborder="0" width="298" height="272"></iframe>'; |
409
|
|
|
|
410
|
|
|
} |
411
|
|
|
|
412
|
|
|
/** |
413
|
|
|
* get_lg_zillow_search_widget function. |
414
|
|
|
* |
415
|
|
|
* @access public |
416
|
|
|
* @param string $widget_type (default: 'iframe') |
|
|
|
|
417
|
|
|
* @param string $iframe_id (default: '') |
418
|
|
|
* @param mixed $zillow_screenname |
419
|
|
|
* @param string $type (default: 'iframe') |
420
|
|
|
* @param mixed $region_name |
421
|
|
|
* @param string $include_home_val_info (default: 'yes') |
422
|
|
|
* @return void |
423
|
|
|
*/ |
424
|
|
View Code Duplication |
public function get_lg_zillow_search_widget( $iframe_id = '', $zillow_screenname, $type = 'iframe', $region_name, $include_home_val_info = 'yes' ) { |
|
|
|
|
425
|
|
|
|
426
|
|
|
echo '<div class="zillow-large-search-box-widget-container">'; |
427
|
|
|
echo ' <h2>Find Homes</h2>'; |
428
|
|
|
echo ' <div style="float:right;">'; |
429
|
|
|
echo ' <img alt="Zillow Real Estate Information" style="border:0;" src="http://www.zillow.com/widgets/GetVersionedResource.htm?path=%2Fstatic%2Fimages%2Fpowered-by-zillow.gif" />'; |
430
|
|
|
echo ' </div>'; |
431
|
|
|
echo ' <iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'lg-search' ) .'" scrolling="no" title="'. __( 'Zillow Search', 're-pro' ) .'" src="https://www.zillow.com/widgets/search/LargeSearchBoxWidget.htm?did=zillow-large-search-box-iframe-widget&scrnname='.$zillow_screenname.'&type='.$type.'&rgname='.$region_name.'&shvi='.$include_home_val_info.'" width="430" frameborder="0" height="400"></iframe>'; |
432
|
|
|
echo '</div>'; |
433
|
|
|
} |
434
|
|
|
|
435
|
|
|
/* POLLS & QUIZZES. */ |
436
|
|
|
|
437
|
|
|
/** |
438
|
|
|
* get_refinance_quiz_widget function. |
439
|
|
|
* |
440
|
|
|
* @access public |
441
|
|
|
* @param string $widget_type (default: 'iframe') |
442
|
|
|
* @param string $iframe_id (default: '') |
443
|
|
|
* @param string $type (default: 'iframe') |
444
|
|
|
* @param string $widgetcode (default: 'refq') |
445
|
|
|
* @param mixed $zillow_screenname |
446
|
|
|
* @return void |
447
|
|
|
*/ |
448
|
|
|
public function get_refinance_quiz_widget( $widget_type = 'iframe', $iframe_id = '', $type = 'iframe', $widgetcode = 'refq', $zillow_screenname ) { |
|
|
|
|
449
|
|
|
|
450
|
|
|
echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'refinance-quiz' ) .'" title="'. __( 'Zillow Refinance Quiz', 're-pro' ) .'" scrolling="no" src="https://www.zillow.com/widgets/quiz/QuizWidget.htm?did=refinance-quiz-iframe-container&type=iframe&widgetcode=refq&scrnname='.$zillow_screenname.'" width="158" frameborder="0" height="317"></iframe>'; |
451
|
|
|
|
452
|
|
|
} |
453
|
|
|
|
454
|
|
|
/** |
455
|
|
|
* get_kindofneighbor_quiz_widget function. |
456
|
|
|
* |
457
|
|
|
* @access public |
458
|
|
|
* @param string $widget_type (default: 'iframe') |
459
|
|
|
* @param string $iframe_id (default: '') |
460
|
|
|
* @param string $type (default: 'iframe') |
461
|
|
|
* @param string $widgetcode (default: 'konq') |
462
|
|
|
* @param mixed $zillow_screenname |
463
|
|
|
* @return void |
464
|
|
|
*/ |
465
|
|
|
public function get_kindofneighbor_quiz_widget( $widget_type = 'iframe', $iframe_id = '', $type = 'iframe', $widgetcode = 'konq', $zillow_screenname ) { |
|
|
|
|
466
|
|
|
|
467
|
|
|
echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'kindofneighbor-quiz' ) .'" title="'. __( 'Zillow Kind of Neighbor Quiz', 're-pro' ) .'" scrolling="no" src="httsp://www.zillow.com/widgets/quiz/QuizWidget.htm?did=neighbor-quiz-iframe-container&type=iframe&widgetcode=konq&scrnname='.$zillow_screenname.'" width="158" frameborder="0" height="317"></iframe>'; |
468
|
|
|
|
469
|
|
|
} |
470
|
|
|
|
471
|
|
|
/** |
472
|
|
|
* get_mortgage_quiz function. |
473
|
|
|
* |
474
|
|
|
* @access public |
475
|
|
|
* @param string $widget_type (default: 'iframe') |
476
|
|
|
* @param string $iframe_id (default: '') |
477
|
|
|
* @param string $type (default: 'iframe') |
478
|
|
|
* @param string $widgetcode (default: 'mq') |
479
|
|
|
* @param mixed $zillow_screenname |
480
|
|
|
* @return void |
481
|
|
|
*/ |
482
|
|
|
public function get_mortgage_quiz( $widget_type = 'iframe', $iframe_id = '', $type = 'iframe', $widgetcode = 'mq', $zillow_screenname ) { |
|
|
|
|
483
|
|
|
|
484
|
|
|
echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'mortgage-quiz' ) .'" title="'. __( 'Zillow Mortgage Quiz', 're-pro' ) .'" scrolling="no" src="https://www.zillow.com/widgets/quiz/QuizWidget.htm?did=mortgage-iframe-container&type=iframe&widgetcode=mq&scrnname='.$zillow_screenname.'" width="158" frameborder="0" height="317"></iframe>'; |
485
|
|
|
|
486
|
|
|
} |
487
|
|
|
|
488
|
|
|
/** |
489
|
|
|
* get_mortgage_harp_quiz function. |
490
|
|
|
* |
491
|
|
|
* @access public |
492
|
|
|
* @param string $widget_type (default: 'iframe') |
493
|
|
|
* @param string $iframe_id (default: '') |
494
|
|
|
* @param string $type (default: 'iframe') |
495
|
|
|
* @param string $widgetcode (default: 'hec') |
496
|
|
|
* @param mixed $zillow_screenname |
497
|
|
|
* @return void |
498
|
|
|
*/ |
499
|
|
|
public function get_mortgage_harp_quiz( $widget_type = 'iframe', $iframe_id = '', $type = 'iframe', $widgetcode = 'hec', $zillow_screenname ) { |
|
|
|
|
500
|
|
|
|
501
|
|
|
echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'mortgage-harp-quiz' ) .'" title="'. __( 'Zillow Mortgage HARP Quiz', 're-pro' ) .'" scrolling="no" src="https://www.zillow.com/widgets/quiz/QuizWidget.htm?did=mortgage-iframe-container&type=iframe&widgetcode=hec&scrnname='.$zillow_screenname.'" width="158" frameborder="0" height="317"></iframe>'; |
502
|
|
|
|
503
|
|
|
} |
504
|
|
|
|
505
|
|
|
/** |
506
|
|
|
* get_buyeriq_quiz function. |
507
|
|
|
* |
508
|
|
|
* @access public |
509
|
|
|
* @param string $widget_type (default: 'iframe') |
510
|
|
|
* @param string $iframe_id (default: '') |
511
|
|
|
* @param string $type (default: 'iframe') |
512
|
|
|
* @param string $widgetcode (default: 'biq') |
513
|
|
|
* @param mixed $zillow_screenname |
514
|
|
|
* @return void |
515
|
|
|
*/ |
516
|
|
|
public function get_buyeriq_quiz( $widget_type = 'iframe', $iframe_id = '', $type = 'iframe', $widgetcode = 'biq', $zillow_screenname ) { |
|
|
|
|
517
|
|
|
|
518
|
|
|
echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'buyeriq-quiz' ) .'" title="'. __( 'Zillow Buyer IQ Quiz', 're-pro' ) .'" scrolling="no" src="https://www.zillow.com/widgets/quiz/QuizWidget.htm?did=buyer-iframe-container&type=iframe&widgetcode=biq&scrnname='.$zillow_screenname.'" width="158" frameborder="0" height="317"></iframe>'; |
519
|
|
|
|
520
|
|
|
} |
521
|
|
|
|
522
|
|
|
/* MISCELLANEOUS. */ |
523
|
|
|
|
524
|
|
|
/** |
525
|
|
|
* get_moving_boxes_widget function. |
526
|
|
|
* |
527
|
|
|
* @access public |
528
|
|
|
* @param string $iframe_id (default: '') |
529
|
|
|
* @param mixed $zillow_city_id |
530
|
|
|
* @param mixed $button_text |
531
|
|
|
* @param mixed $custom_text |
532
|
|
|
* @param mixed $button_link |
533
|
|
|
* @return void |
534
|
|
|
*/ |
535
|
|
|
public function get_moving_boxes_widget( $widget_type = 'iframe', $iframe_id = '', $zillow_city_id, $button_text, $custom_text, $button_link ) { |
|
|
|
|
536
|
|
|
|
537
|
|
|
echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'moving-boxes' ) .'" title="'. __( 'Zillow Moving Box Calculator', 're-pro' ) .'" scrolling="no" src="https://www.zillow.com/widgets/misc/MovingBoxEstimatorWidget.htm?bc='.$zillow_city_id.'&bt='.$button_text.'&cap='.$custom_text.'&bl='.$button_link.'" width="168" frameborder="0" height="315"></iframe>'; |
538
|
|
|
|
539
|
|
|
} |
540
|
|
|
|
541
|
|
|
} |
542
|
|
|
} |
543
|
|
|
|
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.