Changeset 2238411
- Timestamp:
- 02/04/2020 02:57:58 PM (6 years ago)
- Location:
- currently-reading/trunk
- Files:
-
- 2 edited
-
CurrentlyReading.php (modified) (9 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
currently-reading/trunk/CurrentlyReading.php
r2155735 r2238411 5 5 Description: Display a Currently Reading widget using the Google Books API 6 6 Author: Eugéne Roux 7 Version: 4.0. 77 Version: 4.0.8 8 8 Author URI: https://damn.org.za/ 9 9 */ … … 17 17 $this->WP_Widget('reading', __('Reading', 'reading_widget'), $widget_ops); 18 18 $this->widget_defaults = array( 19 'newtab' => true, 19 20 'internalcss' => true, 20 21 'centercover' => false, … … 36 37 37 38 $title = apply_filters('widget_title', $instance[ 'title' ]); 39 $newtab = $instance[ "newtab" ] ? true : false; 38 40 $internalcss = $instance[ "internalcss" ] ? true : false; 39 41 $centercover = $instance[ "centercover" ] ? true : false; … … 95 97 print(" class='currentlyreading' id='currenlyreading-ISBN" . $myisbn . "'>\n"); 96 98 99 $tabextra=''; 100 if ($newtab) 101 $tabextra = ' target="_blank"'; 102 97 103 $shadow = ''; 98 104 if ($boxshadow) … … 104 110 $googlelink = $isbnjson[ 'items' ][0][ 'volumeInfo' ][ 'canonicalVolumeLink' ]; 105 111 106 print("\t\t\t<a href='" . str_replace("google.com", $localdomain, $googlelink) . "' >");112 print("\t\t\t<a href='" . str_replace("google.com", $localdomain, $googlelink) . "'" . $tabextra . ">"); 107 113 print("<img class='currentlyreading' id='currenlyreading-ISBN" . $myisbn . "-img' "); 108 114 print($shadow); … … 126 132 $uri = 'http'; 127 133 } 128 print("\t\t\t<a href='" . $uri . "://books." . $localdomain . "/books?vid=ISBN$myisbn' >");134 print("\t\t\t<a href='" . $uri . "://books." . $localdomain . "/books?vid=ISBN$myisbn'" . $tabextra . ">"); 129 135 print("<img class='currentlyreading' id='currenlyreading-ISBN" . $myisbn . "-img' "); 130 136 print($shadow); … … 148 154 $instance[ 'title' ] = strip_tags($new_instance[ 'title' ]); 149 155 $instance[ 'isbn' ] = strip_tags($new_instance[ 'isbn' ]); 156 $instance[ 'newtab' ] = $new_instance[ 'newtab' ] ? 1 : 0; 150 157 $instance[ 'internalcss' ] = $new_instance[ 'internalcss' ] ? 1 : 0; 151 158 $instance[ "centercover" ] = $new_instance[ "centercover" ] ? 1 : 0; … … 172 179 $title = esc_attr($instance[ 'title' ]); 173 180 $isbn = esc_attr(strip_tags($instance[ 'isbn' ])); 181 $newtab = $instance[ 'newtab' ] ? "checked='checked'" : ""; 174 182 $internalcss = $instance[ 'internalcss' ] ? "checked='checked'" : ""; 175 183 $centercover = $instance[ 'centercover' ] ? "checked='checked'" : ""; … … 201 209 print("\t\t<label for='" . $this->get_field_id("usetls") . "'>"); _e("Force all calls to use 'https'"); 202 210 print("<title>Use 'https'. Deselecting this will connect using 'http' and will not force 'https' links when using the API.</title></label>\n\t<br />"); 211 212 print("\t\t<input class='checkbox' type='checkbox' " . $newtab); 213 print(" id='" . $this->get_field_id("newtab") . "' name='" . $this->get_field_name("newtab") . "'/>\n"); 214 print("\t\t<label for='" . $this->get_field_id("newtab") . "'>"); _e("Open Link in a New Tab/Window"); 215 print("</label>\n\t<br />\n"); 203 216 204 217 print("\t\t<input class='checkbox' type='checkbox' " . $centercover); -
currently-reading/trunk/readme.txt
r2155753 r2238411 4 4 Tags: books, read, reading, admin, administration, jadb 5 5 Requires at least: 3 6 Tested up to: 5. 2.36 Tested up to: 5.3.2 7 7 Stable tag: trunk 8 8 … … 88 88 == Changelog == 89 89 90 = 4.0.8 = 91 92 * Add option to open Google Books link in a new Tab/Window 93 90 94 = 4.0.7 = 91 95
Note: See TracChangeset
for help on using the changeset viewer.