Changeset 1156874
- Timestamp:
- 05/09/2015 01:35:04 PM (11 years ago)
- Location:
- currently-reading/trunk
- Files:
-
- 1 added
- 2 edited
-
CurrentlyReading.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
-
screenshot-5.png (added)
Legend:
- Unmodified
- Added
- Removed
-
currently-reading/trunk/CurrentlyReading.php
r1156538 r1156874 5 5 Description: Display a Currently Reading widget using the Google Books API 6 6 Author: Eugéne Roux 7 Version: 4.0 7 Version: 4.0.1 8 8 Author URI: http://damn.org.za/ 9 9 */ … … 42 42 $isbnjson = json_decode( file_get_contents( "https://www.googleapis.com/books/v1/volumes?q=isbn:" . $myisbn ), true ); 43 43 44 echo $before_widget; 45 46 if ( $title ) 47 echo $before_title . $title . $after_title; // This way we get to choose a "No Title" scenario... 48 44 49 if ( $isbnjson[ "totalItems" ] > 0 ) { 45 50 46 echo $before_widget;47 48 if ( $title )49 echo $before_title . $title . $after_title; // This way we get to choose a "No Title" scenario...50 51 52 51 print("\n\t<!-- ISBN: " . $myisbn . " / Title: " . $isbnjson[ 'items' ][0][ 'volumeInfo' ][ 'title' ] . " -->\n"); 53 52 54 53 print( "\t\t<div" ); 55 if ( $internalcss ) { 56 print( " style='margin: 1em; padding: 2ex;'" ); 57 } 54 55 if ( $internalcss ) 56 print( " style='padding: 1em 1em 0;'" ); // print( " style='margin: 1em; padding: 2ex;'" ); 57 58 58 print( " class='currentlyreading' id='currenlyreading-ISBN" . $myisbn . "'>\n"); 59 59 60 60 $googlelink = $isbnjson[ 'items' ][0][ 'volumeInfo' ][ 'canonicalVolumeLink' ]; 61 print("\n\t<!-- Google Link: " . $googlelink . " -->\n");61 print("\n\t<!-- Google Canonical Volume Link: " . $googlelink . " -->\n"); 62 62 63 63 print( "\t\t\t<a href='" . str_replace( "google.com", $localdomain, $googlelink ) . "'>"); 64 64 print( "<img class='currentlyreading' id='currenlyreading-ISBN" . $myisbn . "-img' " ); 65 65 66 if ( $boxshadow ) { 66 67 print( "style='-moz-box-shadow: #CCC 5px 5px 5px; -webkit-box-shadow: #CCC 5px 5px 5px; " ); 67 68 print( "-khtml-box-shadow: #CCC 5px 5px 5px; box-shadow: #CCC 5px 5px 5px;' " ); 68 69 } 70 69 71 print( "src='" . $isbnjson[ 'items' ][0][ 'volumeInfo' ][ 'imageLinks' ][ 'thumbnail' ] . "' " ); 70 72 print( "alt='" . $isbnjson[ 'items' ][0][ 'volumeInfo' ][ 'title' ] . "' "); … … 72 74 print( "\t\t</div>\n"); 73 75 74 echo $after_widget; 76 } else { 77 78 print( "\n\t<!-- ISBN: " . $myisbn . " / No Google Books Entry Found -->\n"); 79 print( "\n\t<div class='currentlyreading' id='currenlyreading-ISBN" . $myisbn . "'" ); 80 if ( $internalcss ) 81 print( " style='padding: 1em 1em 0 1em;'" ); 82 print( ">No Google Books Entry Found for ISBN: <em>" . $myisbn . "</em></div>\n"); 75 83 } 84 85 echo $after_widget; 76 86 } 77 87 } -
currently-reading/trunk/readme.txt
r1156538 r1156874 63 63 == Screenshots == 64 64 65 1. The Configuration of a "Currently Reading" section, with the "UL" marker suppressed.65 1. The Configuration of a "Currently Reading" section, with Padding enabled. 66 66 2. Multiple Widgets, the first marking them as "Finished Reading". 67 67 3. The previous configuration as rendered by Safari. 68 68 4. The difference between Padding and Box-Shadow Enabled and Disabled. 69 5. Widget Configuration location in the Dashboard's sidebar. 69 70 70 71 == Changelog == 72 73 = 4.0.1 = 74 75 * Display a message (No Google Books Entry Found for ISBN) when Google has no entry for the book in question 76 * Reduce the width of margins so that the book entries fit better into the sidebar 77 * Added a screenshot of the Widget Configuration location in the Sidebar (mostly since I keep forgetting where it is) 71 78 72 79 = 4.0 =
Note: See TracChangeset
for help on using the changeset viewer.