Changeset 152364
- Timestamp:
- 09/05/2009 11:05:20 PM (17 years ago)
- Location:
- openx-wordpress-widget/trunk
- Files:
-
- 2 edited
- 1 moved
-
Changelog.txt (modified) (1 diff)
-
INSTALL.txt (moved) (moved from openx-wordpress-widget/trunk/README.txt)
-
openx-wp-widget.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
openx-wordpress-widget/trunk/Changelog.txt
r151808 r152364 1 1 $Id$ 2 3 2009-09-06: 4 5 When using the widget in a sidebar, allow to 6 specify the alignment for the ads. 2 7 3 8 2009-09-02: -
openx-wordpress-widget/trunk/openx-wp-widget.php
r151808 r152364 4 4 Plugin URI: http://xclose.de/wordpress/wordpress-widget-for-openx 5 5 Description: Sidebar-Widget, display a banner in a sidebar and replace magics {openx:zoneid} with calls to a openx adserver 6 Version: 1.2 6 Version: 1.2.1 7 7 Author: Heiko Weber, heiko@wecos.de 8 8 Author URI: http://www.wecos.de … … 76 76 // get title 77 77 $title = empty($values['title']) ? '' : $values['title']; 78 // get alignment, defaults to nothing 79 $align = (empty($values['align']) || $values['align'] == 'none') ? false : $values['align']; 78 80 // how many banners/zones should we show 79 81 $zoneCount = empty($values['zonecount']) ? 0 : $values['zonecount']; … … 91 93 echo $title; 92 94 echo $after_title; 95 if ($align !== false) { echo "<DIV align='{$align}'>"; } 93 96 echo $bannercode; 97 if ($align !== false) { echo "</DIV>"; } 94 98 echo $after_widget; 95 99 } … … 333 337 continue;print_r($widget_instance); 334 338 $newoptions['title'] = strip_tags(stripslashes($widget_instance['title'])); 339 $newoptions['align'] = strip_tags(stripslashes($widget_instance['align'])); 335 340 $newoptions['zonecount'] = strip_tags(stripslashes($widget_instance['zonecount'])); 336 341 for ($n = 0; $n < intval($newoptions['zonecount']); $n++) … … 348 353 if ($number == -1) { 349 354 $number = '%i%'; 350 $values = array('title' => '', ' zonecount' => 0);355 $values = array('title' => '', 'align' => false, 'zonecount' => 0); 351 356 } 352 357 else { … … 361 366 362 367 $title = htmlspecialchars($values['title'], ENT_QUOTES); 368 $alignments = array('left', 'center', 'right', 'none'); 369 $align = htmlspecialchars($values['align'], ENT_QUOTES); 370 if (!in_array($align, $alignments)) { 371 $align = 'none'; 372 } 363 373 $zonecount = htmlspecialchars($values['zonecount'], ENT_QUOTES); 364 374 for ($n = 0; $n < intval($zonecount); $n++) … … 372 382 id="widget_openxwpwidget-title-<?php echo $number; ?>" 373 383 value="<?php echo $title; ?>" /> 384 </label><br /> 385 <label for="widget_openxwpwidget-align-<?php echo $number; ?>"> 386 Alignment:<br /> 387 <select name="widget-widget_openxwpwidget[<?php echo $number; ?>][align]" 388 id="widget_openxwpwidget-align-<?php echo $number; ?>"> 389 <?php 390 foreach($alignments as $n) { 391 $sel = ($n == $align) ? 'selected' : ''; 392 echo "<option value='$n' $sel>$n</option>\n"; 393 } 394 ?> 395 </select> 374 396 </label><br /> 375 397 <label for="widget_openxwpwidget-zonecount-<?php echo $number; ?>"> … … 408 430 409 431 return array('version' => $widget_openxwpwidget_version, 410 'options' => array(1 => array('title' => '', ' zonecount' => 0)));432 'options' => array(1 => array('title' => '', 'align' => false, 'zonecount' => 0))); 411 433 } 412 434 /** upgrade our options from single instance
Note: See TracChangeset
for help on using the changeset viewer.