WordPress.org

Plugin Directory

Changeset 230558


Ignore:
Timestamp:
04/18/10 19:31:06 (4 years ago)
Author:
vhauri
Message:

updated admin UI to move add section to top

Location:
tagline-rotator/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tagline-rotator/trunk/readme.txt

    r188456 r230558  
    5757Version 1.0 - 3-15-2009 - Allows compatibility with themes which use either the bloginfo() or get bloginfo() function to display the tagline. Has been tested good. 
    5858Version 1.1 - 12-31-2009 - Plugin database table is now compliant with WordPress database prefix (i.e. it will use the database prefix set by WP, not the previous wp_tagline_rotator). This should make it WPMU compatible as well, although this is still untested. Upgrading automatically through WordPress from a previous version will also rename the database table to use the correct prefix. 
     59Version 1.2 - 4-18-2010 - Updated UI in Admin Settings to put Save button and add functionality at the top. 
  • tagline-rotator/trunk/tagline-rotator.php

    r188456 r230558  
    55Plugin URI: http://neverblog.net/tagline-rotator-plugin-for-wordpress 
    66Description: Displays a random tagline from a database list. You can manage taglines through Settings->Tagline Rotator. 
    7 Version: 1.1 
     7Version: 1.2 
    88Author: Vasken Hauri 
    99Author URI: http://neverblog.net 
     
    1111 
    1212/*   
    13 Copyright 2010  Vasken Hauri  (email : vhauri (at) gmail dot com) 
     13Copyright 2008  Vasken Hauri  (email : vhauri (at) gmail dot com) 
    1414 
    1515    This program is free software; you can redistribute it and/or modify 
     
    111111<h2>Tagline Rotator Options</h2> 
    112112<p><strong>PLEASE NOTE:</strong> You must click 'Save Changes' in order to permanently add or delete a tagline.</p> 
    113 <hr> 
    114113<form method="post"> 
    115 <h3>Delete Taglines</h3> 
    116 <table class="form-table"> 
    117 <?php wp_nonce_field('update-options'); ?> 
    118  
    119 <?php 
    120     //new in version 1.1. sets the database value to the wordpress database prefix 
    121     global $wpdb; 
    122     $table_name = $wpdb->prefix . "tagline_rotator"; 
    123  
    124 // delete any empty rows in the form 
    125 $query = "DELETE FROM " . $table_name . " WHERE random_tagline = ''"; 
    126 mysql_query($query); 
    127  
    128 // and select the non-empty ones to populate our checkboxes 
    129 $query = "SELECT random_tagline,id FROM " . $table_name . " WHERE random_tagline!=''"; 
    130 $result = mysql_query($query); 
    131 while($row = mysql_fetch_array($result, MYSQL_ASSOC)) 
    132 { 
    133 ?> 
    134  
    135 <tr valign="top"> 
    136 <th scope="row">Delete this tagline</th> 
    137 <?php $sanitized_tagline = preg_replace('/"/','&quot;',$row['random_tagline']); ?> 
    138 <td><input type="checkbox" name="box[]" value="<?php echo $row['id'];?>" /><input type="text" size="80" name="text[]" value="<?php echo $sanitized_tagline;?>" /><input type="hidden" name="vhtr_ids[]" value="<?php echo $row['id'];?>" /></td></tr> 
    139  
    140 <?php 
    141 } 
    142 ?> 
    143 </table> 
    144 <br> 
    145114<hr> 
    146115<h3>Add New Taglines</h3> 
     
    151120</table> 
    152121 
     122<p class="submit"> 
     123<input type="submit" name="Submit" value="<?php _e('Save Changes') ?>" /> 
     124</p> 
     125<hr> 
     126<h3>Delete Taglines</h3> 
     127<table class="form-table"> 
     128<?php wp_nonce_field('update-options'); ?> 
     129 
     130<?php 
     131    //new in version 1.1. sets the database value to the wordpress database prefix 
     132    global $wpdb; 
     133    $table_name = $wpdb->prefix . "tagline_rotator"; 
     134 
     135// delete any empty rows in the form 
     136$query = "DELETE FROM " . $table_name . " WHERE random_tagline = ''"; 
     137mysql_query($query); 
     138 
     139// and select the non-empty ones to populate our checkboxes 
     140$query = "SELECT random_tagline,id FROM " . $table_name . " WHERE random_tagline!=''"; 
     141$result = mysql_query($query); 
     142while($row = mysql_fetch_array($result, MYSQL_ASSOC)) 
     143{ 
     144?> 
     145 
     146<tr valign="top"> 
     147<th scope="row">Delete this tagline</th> 
     148<?php $sanitized_tagline = preg_replace('/"/','&quot;',$row['random_tagline']); ?> 
     149<td><input type="checkbox" name="box[]" value="<?php echo $row['id'];?>" /><input type="text" size="80" name="text[]" value="<?php echo $sanitized_tagline;?>" /><input type="hidden" name="vhtr_ids[]" value="<?php echo $row['id'];?>" /></td></tr> 
     150 
     151<?php 
     152} 
     153?> 
     154</table> 
     155<br> 
    153156<p class="submit"> 
    154157<input type="submit" name="Submit" value="<?php _e('Save Changes') ?>" /> 
Note: See TracChangeset for help on using the changeset viewer.