Changeset 1109898
- Timestamp:
- 03/10/2015 10:57:55 PM (11 years ago)
- Location:
- qrcodes
- Files:
-
- 16 added
- 3 deleted
- 4 edited
-
assets/screenshot-1.png (added)
-
assets/screenshot-2.png (added)
-
assets/screenshot-3.png (added)
-
assets/screenshot-4.png (added)
-
assets/screenshot-5.png (added)
-
assets/screenshot-6.png (added)
-
assets/screenshot-7.png (added)
-
trunk/admin (added)
-
trunk/admin.php (deleted)
-
trunk/admin/admin.php (added)
-
trunk/admin/admin_library.php (added)
-
trunk/admin/admin_media_query.php (added)
-
trunk/admin/admin_network.php (added)
-
trunk/admin/media_query_list_table.php (added)
-
trunk/admin_library.php (deleted)
-
trunk/admin_network.php (deleted)
-
trunk/index.php (modified) (4 diffs)
-
trunk/qrcodes.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (6 diffs)
-
trunk/script (added)
-
trunk/script/admin.js (added)
-
trunk/script/admin_network.js (added)
-
trunk/styles/admin.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
qrcodes/trunk/index.php
r1102798 r1109898 4 4 Description: Add qrcodes to pages 5 5 Author: Pierre Péronnet 6 Version: 2.06 Version: 1.2 7 7 */ 8 8 … … 20 20 ) ); 21 21 } 22 define( 'QRCODES_INDEX_FILE', __FILE__ ); 23 22 24 unset( $uploads ); 23 24 require_once __DIR__ . '/qrcodes.php';25 include_once __DIR__ . '/admin.php';26 25 27 26 function wp_qrcodes_activation() { … … 32 31 ) ); 33 32 } 33 34 add_option( 'qrcodes-network-media-query', array( 35 'print' => __( 'displayed on printed pages', 'qrcodes' ), 36 ), '', 'yes' ); 37 qrcodes_media_query_add_default_options( 'print' ); 34 38 } 35 register_activation_hook( __FILE__, 'wp_qrcodes_activation' ); 39 register_activation_hook( QRCODES_INDEX_FILE, 'wp_qrcodes_activation' ); 40 41 42 function qrcodes_media_query_remove_options( $medium ) { 43 $blog_id = get_current_blog_id(); 44 delete_blog_option( 45 $blog_id, 46 "qrcodes-media-query-{$medium}-horizontal-direction" 47 ); 48 delete_blog_option( 49 $blog_id, 50 "qrcodes-media-query-{$medium}-horizontal-value" 51 ); 52 delete_blog_option( 53 $blog_id, 54 "qrcodes-media-query-{$medium}-vertical-direction" 55 ); 56 delete_blog_option( 57 $blog_id, 58 "qrcodes-media-query-{$medium}-vertical-value" 59 ); 60 delete_blog_option( 61 $blog_id, 62 "qrcodes-media-query-{$medium}-size" 63 ); 64 } 65 66 function qrcodes_media_query_add_default_options( $medium ) { 67 $blog_id = get_current_blog_id(); 68 add_blog_option( 69 $blog_id, 70 "qrcodes-media-query-{$medium}-horizontal-direction", 71 'right', 72 true 73 ); 74 add_blog_option( 75 $blog_id, 76 "qrcodes-media-query-{$medium}-horizontal-value", 77 0, 78 true 79 ); 80 add_blog_option( 81 $blog_id, 82 "qrcodes-media-query-{$medium}-vertical-direction", 83 'top', 84 true 85 ); 86 add_blog_option( 87 $blog_id, 88 "qrcodes-media-query-{$medium}-vertical-value", 89 0, 90 true 91 ); 92 add_blog_option( 93 $blog_id, 94 "qrcodes-media-query-{$medium}-size", 95 false, 96 true 97 ); 98 } 36 99 37 100 function full_remove_folder( $dir ) { … … 57 120 full_remove_folder( QRCODES_BASEDIR ); 58 121 } 59 register_deactivation_hook( __FILE__, 'wp_qrcodes_deactivation' ); 122 register_deactivation_hook( QRCODES_INDEX_FILE, 'wp_qrcodes_deactivation' ); 123 124 require_once path_join( __DIR__, 'qrcodes.php' ); 125 include_once path_join( __DIR__, 'admin/admin.php' ); -
qrcodes/trunk/qrcodes.php
r1102797 r1109898 30 30 function qrcodes_get_basedir() { 31 31 return QRCODES_BASEDIR; 32 }33 34 function qrcodes_get_cached_url( $post_id ) {35 //TODO36 return path_join(37 qrcodes_get_baseurl(),38 'post-' . $post_id . '.png'39 );40 }41 42 function qrcodes_get_cached_dir( $blog_id, $post_id ) {43 //TODO44 return path_join(45 qrcodes_get_basedir( $blog_id ),46 'post-' . $post_id . '.png'47 );48 32 } 49 33 … … 225 209 226 210 function qrcodes_enqueue_style() { 227 $media_query = get_option( 'qrcodes-network-media-query', array( 'print') );211 $media_query = get_option( QRCODES_MEDIA_QUERY_OPTION_NAME, array() ); 228 212 wp_enqueue_style( 229 213 'qrcodes', … … 233 217 'all' 234 218 ); 235 foreach ( $media_query as $medium ) { 219 foreach ( $media_query as $medium => $desc ) { 220 $style = 221 'display:block;' . 222 get_blog_option( 223 get_current_blog_id(), 224 "qrcodes-media-query-{$medium}-horizontal-direction" 225 ) . ':' . 226 get_blog_option( 227 get_current_blog_id(), 228 "qrcodes-media-query-{$medium}-horizontal-value" 229 ) . ';' . 230 get_blog_option( 231 get_current_blog_id(), 232 "qrcodes-media-query-{$medium}-vertical-direction" 233 ) . ':' . 234 get_blog_option( 235 get_current_blog_id(), 236 "qrcodes-media-query-{$medium}-vertical-value" 237 ) . ';'; 238 $size = get_blog_option( 239 get_current_blog_id(), 240 "qrcodes-media-query-{$medium}-size" 241 ); 242 if ( $auto_size ) { 243 $style .= 244 'width:' . 245 get_blog_option( 246 get_current_blog_id(), 247 "qrcodes-media-query-{$medium}-size" 248 ) . ';' . 249 'height:' . 250 get_blog_option( 251 get_current_blog_id(), 252 "qrcodes-media-query-{$medium}-size" 253 ) . ';'; 254 } 236 255 wp_add_inline_style( 237 256 'qrcodes', 238 257 '@media ' . esc_attr( $medium ) . '{' . 239 258 'body .qrcode {' . 240 'display:block;' . 241 get_blog_option( 242 get_current_blog_id(), 243 "qrcodes-media-query-{$medium}-horizontal-direction", 244 'right' 245 ) . ':' . 246 get_blog_option( 247 get_current_blog_id(), 248 "qrcodes-media-query-{$medium}-horizontal-position", 249 0 250 ) . 251 get_blog_option( 252 get_current_blog_id(), 253 "qrcodes-media-query-{$medium}-horizontal-unit", 254 '%' 255 ) . ';' . 256 get_blog_option( 257 get_current_blog_id(), 258 "qrcodes-media-query-{$medium}-vertical-direction", 259 'bottom' 260 ) . ':' . 261 get_blog_option( 262 get_current_blog_id(), 263 "qrcodes-media-query-{$medium}-vertical-position", 264 100 265 ) . 266 get_blog_option( 267 get_current_blog_id(), 268 "qrcodes-media-query-{$medium}-vertical-unit", 269 '%' 270 ) . ';' . 259 $style . 271 260 '}' . 272 261 '}' … … 300 289 function qrcodes_network_data_force( $data ) { 301 290 return do_shortcode( 302 get_option( 'qrcodes-network-override-data-value', $data ) 291 get_option( 292 'qrcodes-network-override-data-value', 293 network_home_url() 294 ) 303 295 ); 304 296 } … … 312 304 ); 313 305 } 314 if ( ! get_option( 'qrcodes-network- allow-override-data', true ) ) {306 if ( ! get_option( 'qrcodes-network-override-data-allow', true ) ) { 315 307 add_filter( 'qrcodes-data', 'qrcodes_network_data_force', 30 ); 316 308 } else { -
qrcodes/trunk/readme.txt
r1102797 r1109898 1 1 === QRCodes === 2 3 2 Contributors: holyhope 4 3 Donate link: … … 6 5 Requires at least: 4.1 7 6 Tested up to: 4.1 8 Stable tag: 4.37 Stable tag: trunk 9 8 License: GPLv2 or later. 10 9 License URI: http://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses 11 10 12 11 QRCode add images that visitor can flash with their favorites applications. 13 Choose where to display and when (ex: only on printed page , at the top right corner).12 Choose where to display and when (ex: only on printed page). 14 13 15 14 == Description == … … 26 25 QRCodes requires : 27 26 28 * [PHP version 5+](http://php.net)27 * A valid [*QRCode PHP library*](http://sourceforge.net/projects/phpqrcode/ 'SourceForge Project') installation. 29 28 30 29 == Installation == … … 52 51 == Screenshots == 53 52 54 1. This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from 55 the /assets directory or the directory that contains the stable readme.txt (tags or trunk). Screenshots in the /assets 56 directory take precedence. For example, `/assets/screenshot-1.png` would win over `/tags/4.3/screenshot-1.png` 57 (or jpg, jpeg, gif). 58 2. This is the second screen shot 53 1. General plugin settings. 54 2. Settings of the library (resolution and correction level). 55 3. Set positions and size of qrcodes in different media query. 56 4. Manage your website in a multisite installation so QRcodes ref to a specific url (with shortcodes) or let administrators set it by themself. 57 5. Manage media query in the network admin panel for multisite installation or in normal admin for normal one. 58 7. Exemple of qrcode in classique navigation. 59 6. Exemple of qrcode in printed page (same page of 6th screenshot, different position). 59 60 60 61 == Changelog == 61 62 63 = 1.2 = 64 65 * Fix qrcodes generation. 66 * Use now correctly [Settings API](http://codex.wordpress.org/Settings_API 'wordpress.org'). 67 * Upgrade media query management interface. 68 * Use *postbox* and *nav-tab* style for admin pages. 69 * Move admin files to */admin* folder 70 * Add a default value for media query at plugin activation: 71 * add print medium placed at the top right of pages. 72 * Set option autoload to true (decrease load time) for few options. 73 62 74 = 1.1 = 63 75 64 * Fix save settings 65 * Add *requirement* section in readme.txt 66 * add options: 76 * Fix save settings. 77 * Add *requirement* section in readme.txt. 78 * Add ``[user-id]``, ``[blog-id]``, ``[current-url]`` shortcodes so you can use in qrcodes url (ex: *http//domain.com/qrcodes?redirect=[current-url]*). 79 * add many options: 67 80 * Generate all qrcodes for all blog. 68 81 * Add and manage media query (active or not and qrcodes position). … … 79 92 * Generate QRCode on the go during [`get_header` hook](http://codex.wordpress.org/Plugin_API/Action_Reference/get_header) for other page. 80 93 * Create QRCode folder in `QRCODES_BASEDIR` if defined, or by default `/uploads/qrcodes`. 81 * Delete all QRCodes on plugin deactivation ( [`register_deactivation_hook`](http://codex.wordpress.org/Function_Reference/register_deactivation_hook)).94 * Delete all QRCodes on plugin deactivation ([`register_deactivation_hook`](http://codex.wordpress.org/Function_Reference/register_deactivation_hook)). 82 95 * It is actually displayed on the top right corner, but more options will come. 96 97 == Frequently Asked Questions == 98 99 No questions yet. It will coming soon. 100 Please tell me what's wrong with that plugin and what would you have in future version. 83 101 84 102 == Upgrade Notice == … … 88 106 == Planned works == 89 107 90 * Embed [ QRCode PHP library](http://sourceforge.net/projects/phpqrcode/ 'SourceForge Project').108 * Embed [*QRCode PHP library*](http://sourceforge.net/projects/phpqrcode/ 'SourceForge Project'). 91 109 * Add options to set a cache timeout. 110 * Presentation of plugin through *wp-pointer*. 111 * Add *screen meta* to show constantes informations and library version. 112 * Fix *#wpadminbar* element over *.qrcodes* images. 113 * Set *FAQ* in *readme.txt*. 114 * Make an index of all qrcodes generated per site, so we can remove them when the site is deleted. -
qrcodes/trunk/styles/admin.css
r1102797 r1109898 1 . more-options {1 .wrap .more-options { 2 2 display: none; 3 3 margin-left: 10px; 4 4 } 5 5 6 input:checked ~ .more-options {6 .wrap input:checked ~ .more-options { 7 7 display: block; 8 8 } 9 10 .wrap .more-options-inverted { 11 display: block; 12 margin-left: 10px; 13 } 14 15 .wrap input:checked ~ .more-options-inverted { 16 display: none; 17 } 18 19 .wrap .button.align-left { 20 float: left; 21 margin-right: 10px; 22 } 23 24 .wrap .description { 25 clear: both; 26 margin-bottom: 15px; 27 margin-left: 10px; 28 }
Note: See TracChangeset
for help on using the changeset viewer.