Changeset 476627
- Timestamp:
- 12/17/2011 12:53:05 AM (14 years ago)
- Location:
- featured-posts-grid/branches/dev
- Files:
-
- 1 added
- 3 edited
-
featured-posts-grid-admin.php (modified) (1 diff)
-
featured-posts-grid.php (modified) (7 diffs)
-
fpg-generate-output.php (added)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
featured-posts-grid/branches/dev/featured-posts-grid-admin.php
r476473 r476627 1 1 <?php 2 if ( isset($_POST['fpg_opt_hidden']) && $_POST['fpg_opt_hidden'] == 'Y' ) { 3 /* Numeric Variables */ 4 $variables = array ( 5 'fpg_rows', 6 'fpg_columns', 7 'fpg_padding_topbottom', 8 'fpg_padding_leftright', 9 'fpg_spacing_horizontal', 10 'fpg_pages_max', 11 'fpg_item_height', 12 'fpg_item_width', 13 'fpg_item_dropshadow_x', 14 'fpg_item_dropshadow_y', 15 'fpg_item_dropshadow_blur', 16 'fpg_item_dropshadow_spread', 17 'fpg_item_dropshadow_hover_x', 18 'fpg_item_dropshadow_hover_y', 19 'fpg_item_dropshadow_hover_blur', 20 'fpg_item_dropshadow_hover_spread', 21 'fpg_text_dropshadow_x', 22 'fpg_text_dropshadow_y', 23 'fpg_text_dropshadow_blur', 24 'fpg_text_dropshadow_spread', 25 'fpg_text_inset_dropshadow_x', 26 'fpg_text_inset_dropshadow_y', 27 'fpg_text_inset_dropshadow_blur', 28 'fpg_text_inset_dropshadow_spread', 29 //'fpg_pages_pips_spacing', 30 'fpg_item_text_bg_alpha', 31 'fpg_item_dropshadow_alpha', 32 'fpg_item_dropshadow_hover_alpha', 33 'fpg_text_dropshadow_alpha', 34 'fpg_text_inset_dropshadow_alpha', 35 'fpg_inner_border_width', 36 'fpg_item_border_top_width', 37 'fpg_item_border_bottom_width', 38 'fpg_item_border_left_width', 39 'fpg_item_border_right_width', 40 'fpg_text_border_top_width', 41 'fpg_text_border_bottom_width', 42 'fpg_text_border_left_width', 43 'fpg_text_border_right_width', 44 'fpg_page_speed', 45 'fpg_scroll_interval' 46 47 ); 48 49 foreach ($variables as $var) { 50 $var_value = $_POST[$var]; 51 if ( is_numeric($var_value) ) 52 update_option($var, $var_value); 53 else 54 $error[] = "ERROR: ".$var." - Must be a number."; 55 } 56 57 58 59 60 /* Text Variables */ 61 $variables = array ( 62 'fpg_width', 63 'fpg_hover_x_offset', 64 'fpg_hover_y_offset', 65 'fpg_item_dropshadow_color', 66 'fpg_item_dropshadow_hover_color', 67 'fpg_text_dropshadow_color', 68 'fpg_text_inset_dropshadow_color', 69 'fpg_item_border_top_style', 70 'fpg_item_border_top_color', 71 'fpg_item_border_bottom_style', 72 'fpg_item_border_bottom_color', 73 'fpg_item_border_left_style', 74 'fpg_item_border_left_color', 75 'fpg_item_border_right_style', 76 'fpg_item_border_right_color', 77 'fpg_item_text_bg_color', 78 'fpg_item_text_color', 79 'fpg_item_text_fontfamily', 80 'fpg_item_text_fontstyle', 81 'fpg_item_text_fontvariant', 82 'fpg_item_text_fontweight', 83 'fpg_item_text_fontsize', 84 'fpg_item_text_lineheight', 85 'fpg_item_excerpt_color', 86 'fpg_item_excerpt_fontfamily', 87 'fpg_item_excerpt_fontstyle', 88 'fpg_item_excerpt_fontvariant', 89 'fpg_item_excerpt_fontweight', 90 'fpg_item_excerpt_fontsize', 91 'fpg_item_excerpt_lineheight', 92 'fpg_item_author_color', 93 'fpg_item_author_fontfamily', 94 'fpg_item_author_fontstyle', 95 'fpg_item_author_fontvariant', 96 'fpg_item_author_fontweight', 97 'fpg_item_author_fontsize', 98 'fpg_item_author_lineheight', 99 'fpg_item_date_color', 100 'fpg_item_date_fontfamily', 101 'fpg_item_date_fontstyle', 102 'fpg_item_date_fontvariant', 103 'fpg_item_date_fontweight', 104 'fpg_item_date_fontsize', 105 'fpg_item_date_lineheight', 106 'fpg_text_border_top_style', 107 'fpg_text_border_top_color', 108 'fpg_text_border_bottom_style', 109 'fpg_text_border_bottom_color', 110 'fpg_text_border_left_style', 111 'fpg_text_border_left_color', 112 'fpg_text_border_right_style', 113 'fpg_text_border_right_color', 114 'fpg_arrow_position', 115 'fpg_arrow_image', 116 'fpg_pages_pips_image', 117 'fpg_images_bg_color', 118 'fpg_arrow_image_custom_url', 119 'fpg_pages_pips_custom_url', 120 'fpg_inner_border_color' 121 ); 122 123 foreach ($variables as $var) { 124 $var_value = $_POST[$var]; 125 update_option($var, $var_value); 126 } 127 128 129 130 /* Boolean Variables */ 131 $variables = array ( 132 'fpg_excerpt_display', 133 'fpg_author_display', 134 'fpg_date_display', 135 'fpg_item_dropshadow_enable', 136 'fpg_text_dropshadow_enable', 137 'fpg_text_inset_dropshadow_enable', 138 'fpg_images_crop', 139 'fpg_images_height_noscale', 140 'fpg_images_width_noscale', 141 'fpg_images_height_fit', 142 'fpg_images_width_fit', 143 'fpg_autoscroll' 144 ); 145 146 foreach ($variables as $var) { 147 $var_value = isset($_POST[$var]) ? 1:0; 148 update_option($var, $var_value); 149 } 150 151 152 153 154 if( empty($error) ){ ?> 155 <div class="updated"><p><strong><?php _e('Settings Saved.', 'wp-rp' ); ?></strong></p></div> 156 <?php }else{ ?> 157 <div class="error"><p><strong><?php 158 foreach ( $error as $key=>$val ) { 159 _e($val); 160 echo "<br/>"; 161 } 162 ?></strong></p></div> 163 <?php } 164 } 2 include(WP_PLUGIN_DIR.'/featured-posts-grid/fpg-generate-output.php'); 165 3 166 4 $fpg_rows = get_option('fpg_rows'); -
featured-posts-grid/branches/dev/featured-posts-grid.php
r476473 r476627 172 172 'fpg_images_width_noscale' => '0', 173 173 'fpg_images_height_fit' => '1', 174 'fpg_images_width_fit' => '1' 174 'fpg_images_width_fit' => '1', 175 175 176 176 … … 180 180 181 181 'fpg_autoscroll' => '1', 182 'fpg_scroll_interval' => '7000' 182 'fpg_scroll_interval' => '7000', 183 'fpg_rollover' => '0' 183 184 ); 184 185 … … 228 229 { 229 230 wp_enqueue_style('fpg-style', WP_PLUGIN_URL.'/featured-posts-grid/css/featured-posts-grid.css'); 230 wp_enqueue_style('fpg-style-dynamic', WP_PLUGIN_URL.'/featured-posts-grid/css/featured-posts-grid-style.css.php'); 231 232 $file_path = WP_PLUGIN_DIR.'/featured-posts-grid/css/fpg.css'; 233 if (file_exists($file_path)) 234 { 235 wp_enqueue_style('fpg-style-dynamic', $file_path); 236 } 237 else 238 { 239 wp_enqueue_style('fpg-style-dynamic', WP_PLUGIN_URL.'/featured-posts-grid/css/fpg.css.php'); 240 } 231 241 } 232 242 … … 236 246 if (!is_admin()) { 237 247 wp_enqueue_script('jquery'); 238 wp_enqueue_script('featuredpostsgrid-js', WP_PLUGIN_URL.'/featured-posts-grid/js/featuredpostsgrid.js.php'); 248 249 $file_path = WP_PLUGIN_DIR.'/featured-posts-grid/js/fpg.js'; 250 if(file_exists($file_path)) 251 { 252 wp_enqueue_script('fpg-js-dynamic', $file_path); 253 } 254 else 255 { 256 wp_enqueue_script('fpg-js-dynamic', WP_PLUGIN_URL.'/featured-posts-grid/js/fpg.js.php'); 257 } 239 258 } 240 259 else { … … 299 318 300 319 // Calculate max number of posts to retrieve in query 301 $max_posts = ($fpg_rows * $fpg_columns * $fpg_pages_max); 320 $max_posts = ($fpg_rows * $fpg_columns * $fpg_pages_max); 302 321 303 322 // Generate arguments for query … … 342 361 $output .= '<div class="fpg-arrow-right"></div>'."\n"; 343 362 $output .= '</div>'."\n"; 344 345 } 363 } 364 365 // Save currently selected post if one exists 366 global $post; 367 $temp_post = $post; 346 368 347 369 // Get details for each article retrieved in query … … 362 384 $post_details[$key]['post_img_src'][0] = ''; 363 385 } 386 } 387 388 // Restore previous post data if there was any. 389 if ($temp_post != NULL) 390 { 391 $post = $temp_post; 364 392 } 365 393 -
featured-posts-grid/branches/dev/readme.txt
r476473 r476627 112 112 = 1.5 = 113 113 * Refactored activate/deactivate functions. 114 * Corrected issue where plugin could interfere with post/page templates causing the wrong post data to be displayed. 114 115 * TODO: Added auto-scroll options. 115 116 * TODO: Added roll-over option (user can scroll past last page back to first and vice-versa)
Note: See TracChangeset
for help on using the changeset viewer.