Changeset 3328313
- Timestamp:
- 07/15/2025 02:25:21 PM (7 months ago)
- Location:
- ribbon-maker/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (3 diffs)
-
ribbon-maker.php (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ribbon-maker/trunk/readme.txt
r624415 r3328313 1 1 === Ribbon Maker === 2 2 Contributors: itscoolreally 3 Donate link: http ://www.cafepress.com/SupportHypershock3 Donate link: https://patreon.com/kreezxil 4 4 Tags: ribbon,maker,creator,designer,decoration,corner 5 5 Requires at Least: 3.0.0 … … 11 11 == Description == 12 12 13 A ribbon creation/corner decorator plugin that will allow you to generate your own ribbons for each of the 4 corners or you can upload your own graphics. 13 A ribbon creation/corner decorator plugin that will allow you to generate your own ribbons for each of the 4 corners or you can upload your own graphics. 14 14 15 15 = Features = … … 49 49 Tweaked our use of jscolor to not conflict with other plugins that use jscolor to fix compatibility issues with "colored vote polls". 50 50 Added banner link toggle. 51 51 52 52 = 1.6.1 = 53 53 removed check for image type. -
ribbon-maker/trunk/ribbon-maker.php
r624415 r3328313 2 2 /* 3 3 Plugin Name: Ribbon Maker 4 Plugin URI: http:// wordpress.org/extend/plugins/ribbon-maker4 Plugin URI: http://kreezcraft.com/wpdev/extend/plugins/ribbon-maker 5 5 Description: When activated, this plugin will put a ribbon of your design, message and custom link on the top right corner of your website. 6 Author: Al Lamb7 Version: 1.6.2 6 Author: Kreezxil (Kree Zuhl) 7 Version: 1.6.2a 8 8 License: GPLv2 9 Author URI: http ://bowie-tx.com9 Author URI: https://kreezcraft.com 10 10 */ 11 11 12 12 function ribbon_maker_getVersion() { 13 return "1.6.2 ";13 return "1.6.2a"; 14 14 } 15 15 16 16 //Wordpress will call the following function and pass 2 variables to it. 17 17 function ribbon_maker_my_plugin_links($links, $file) { 18 $plugin = plugin_basename(__FILE__); 18 $plugin = plugin_basename(__FILE__); 19 19 if ($file == $plugin) // only for this plugin 20 20 return array_merge( $links, … … 24 24 return $links; 25 25 } 26 26 27 27 //The following is basically a hook into a function in Wordpress called "plugin_row_meta" 28 28 add_filter( 'plugin_row_meta', 'ribbon_maker_my_plugin_links', 10, 2 ); 29 29 30 30 function ribbon_maker_getDownload() { 31 31 return "http://wordpress.org/extend/plugins/ribbon-maker"; … … 61 61 '); 62 62 if (get_option('ribbon_maker_url')) { //convert the database entries 63 63 64 64 $ribbon_maker = ribbon_maker_convert_db( 'ribbon_maker_url1', 'ribbon_maker_url' ); 65 65 $ribbon_maker .= ribbon_maker_convert_db( 'ribbon_maker_title1', 'ribbon_maker_title'); … … 73 73 ribbon_maker_was_it_saved($ribbon_maker); 74 74 } 75 75 76 76 if ( isset( $_POST['regenerate'] ) ) { 77 77 for($i=1;$i<=4;$i++) { 78 if(get_option("ribbon_maker_do_custom$i")=="inactive" && get_option("ribbon_maker_active$i")=="active") { 78 if(get_option("ribbon_maker_do_custom$i")=="inactive" && get_option("ribbon_maker_active$i")=="active") { 79 79 ribbon_maker_create_ribbon($i); 80 80 } … … 89 89 //if(exif_imagetype($_FILES["custom_image"]["tmp_name"])==IMAGETYPE_PNG) { 90 90 $new_name = plugin_dir_path(__FILE__) . "ribbon_maker_ribbon".$_POST['ribbon_maker_slot'].".png"; 91 move_uploaded_file($_FILES["custom_image"]["tmp_name"],$new_name); 91 move_uploaded_file($_FILES["custom_image"]["tmp_name"],$new_name); 92 92 update_option('ribbon_maker_do_custom'.$_POST['ribbon_maker_slot'],'active'); 93 93 /*} else { … … 98 98 } 99 99 if ( isset( $_POST['saving'] ) ) { 100 100 101 101 $slot=$_POST['ribbon_maker_slot']; 102 102 if($slot<1 || $slot>4) $slot=1; //slot sanity check! 103 103 $str = strtr( $_POST["ribbon_maker_url$slot"], array( '"' => '"', '\\' => '', '\'' => ''' ) ); 104 104 $ribbon_maker = update_option( "ribbon_maker_url$slot", $str ); 105 105 106 106 $str = strtr( $_POST["ribbon_maker_title$slot"], array( '"' => '"', '\\' => '', '\'' => ''' ) ); 107 107 $ribbon_maker .= update_option( "ribbon_maker_title$slot", $str); 108 108 109 109 $str = strtr( $_POST["ribbon_maker_z_position$slot"], array( '"' => '"', '\\' => '', '\'' => ''' ) ); 110 110 $ribbon_maker .= update_option( "ribbon_maker_z_position$slot", $str ); 111 111 112 112 $str = strtr( $_POST["ribbon_maker_admin_offset$slot"], array( '"' => '"', '\\' => '', '\'' => ''' ) ); 113 113 $ribbon_maker .= update_option( "ribbon_maker_admin_offset$slot", $str ); 114 114 115 115 $str = strtr( $_POST["ribbon_maker_user_offset$slot"], array( '"' => '"', '\\' => '', '\'' => ''' ) ); 116 116 $ribbon_maker .= update_option( "ribbon_maker_user_offset$slot", $str ); 117 117 118 118 $str = strtr( $_POST["ribbon_maker_user_h_offset$slot"], array( '"' => '"', '\\' => '', '\'' => ''' ) ); 119 119 $ribbon_maker .= update_option( "ribbon_maker_user_h_offset$slot", $str ); … … 124 124 //$str = strtr( $_POST['ribbon_maker_message'], array( '"' => '"', '\\' => '', '\'' => ''' ) ); 125 125 $ribbon_maker .= update_option( "ribbon_maker_message$slot", $_POST["ribbon_maker_message$slot"] ); 126 126 127 127 $str = strtr( $_POST["ribbon_maker_bgcolor$slot"], array( '"' => '"', '\\' => '', '\'' => ''' ) ); 128 128 $ribbon_maker .= update_option( "ribbon_maker_bgcolor$slot", $str ); 129 129 130 130 $str = strtr( $_POST["ribbon_maker_fgcolor$slot"], array( '"' => '"', '\\' => '', '\'' => ''' ) ); 131 131 $ribbon_maker .= update_option( "ribbon_maker_fgcolor$slot", $str ); 132 132 133 133 $str = strtr( $_POST["ribbon_maker_do_custom$slot"], array( '"' => '"', '\\' => '', '\'' => ''' ) ); 134 134 $ribbon_maker .= update_option( "ribbon_maker_do_custom$slot", $str ); 135 135 136 136 $str = strtr( $_POST["ribbon_maker_active$slot"], array( '"' => '"', '\\' => '', '\'' => ''' ) ); 137 137 $ribbon_maker .= update_option( "ribbon_maker_active$slot", $str ); 138 138 139 139 //ribbon_maker_slot is transient so we don't save it 140 140 ribbon_maker_was_it_saved ( $ribbon_maker ); 141 141 //echo "preparing to create new image for slot $i<br>"; 142 if(get_option("ribbon_maker_do_custom$slot")=="inactive" && get_option("ribbon_maker_active$slot")=="active") { 142 if(get_option("ribbon_maker_do_custom$slot")=="inactive" && get_option("ribbon_maker_active$slot")=="active") { 143 143 //echo "flags are go for creation for slot $i<br>"; 144 144 ribbon_maker_create_ribbon($slot); … … 146 146 147 147 } 148 148 149 149 //display the 4 corner shots 150 150 echo ("<table><tr><th colspan=4 align='center'>Ribbon Preview</th><tr><th>Upper Right</th><th>Lower Right</th><th>Lower Left</th><th>Upper Left</th></tr>"); … … 198 198 break; 199 199 } 200 200 201 201 echo ("<ht><b><h3>Now editing the $announce corner.</h3></b><br>"); 202 202 echo(' … … 241 241 <td><input type="radio" name="ribbon_maker_do_custom'.$slot.'" value="active" '.ribbon_maker_isChecked('active',get_option("ribbon_maker_do_custom$slot")).'></td> 242 242 </tr> 243 243 244 244 <tr><td>Custom Ribbon Off<br/><span class="ribbon_maker_hint">Don\'t use the custom uploaded ribbon.</span></td> 245 245 <td><input type="radio" name="ribbon_maker_do_custom'.$slot.'" value="inactive" '.ribbon_maker_isChecked('inactive',get_option("ribbon_maker_do_custom$slot")).'></td> 246 246 </tr> 247 247 248 248 <tr><td>Make Ribbon Active<br/><span class="ribbon_maker_hint">If checked, the Ribbon will be visible on your blog.</span></td> 249 249 <td><input type="radio" name="ribbon_maker_active'.$slot.'" value="active" '.ribbon_maker_isChecked('active',get_option("ribbon_maker_active$slot")).'></td> 250 250 </tr> 251 251 252 252 <tr><td>Make Ribbon In-Active<br/><span class="ribbon_maker_hint">If checked, the Ribbon will NOT be visible on your blog.</span></td> 253 253 <td><input type="radio" name="ribbon_maker_active'.$slot.'" value="inactive" '.ribbon_maker_isChecked('inactive',get_option("ribbon_maker_active$slot")).'></td> 254 254 </tr> 255 255 256 256 <hr /> 257 257 <tr><td colspan="2"><hr /></td></tr> … … 320 320 $height = ImageFontHeight($font)+8; 321 321 $im = imagecreatetruecolor ($width,$height); 322 322 323 323 $back = imagecolorallocate($im, 0,0,0); 324 324 $draw_color = imagecolorallocate ($im, (int)ribbon_maker_get_color($bgcolor,"red"), (int)ribbon_maker_get_color($bgcolor,"green"), (int)ribbon_maker_get_color($bgcolor,"blue")); 325 325 $text_color = imagecolorallocate ($im, (int)ribbon_maker_get_color($fgcolor,"red"), (int)ribbon_maker_get_color($fgcolor,"green"), (int)ribbon_maker_get_color($fgcolor,"blue")); 326 326 327 327 //well since we are building a ribbon, let's nuke it! 328 328 unlink(plugin_dir_path(__FILE__)."ribbon_maker_ribbon$slot.png"); 329 329 330 330 //imagefill($im,0,0,$back); 331 331 332 332 imageline($im, 0,2,$width,2,$draw_color); 333 333 imageline($im, 0,3,$width,3,$draw_color); … … 362 362 $newHeight=imagesy($new_img)-ImageFontHeight($font); 363 363 $im = imagecreatetruecolor($newWidth,$newHeight); 364 364 365 365 /* 366 366 bool imagecopyresampled ( resource $dst_image , resource $src_image , int $dst_x , int $dst_y , int $src_x , int $src_y , int $dst_w , int $dst_h , int $src_w , int $src_h ) … … 402 402 plugins_url('ourJquery.js', __FILE__) 403 403 ); 404 } 405 404 } 405 406 406 function ribbon_maker_add_cookie_mgr() { 407 407 wp_enqueue_script( … … 417 417 for ($i=1;$i<=4;$i++) 418 418 if(get_option("ribbon_maker_active$i")=="active") { 419 if(is_admin_bar_showing()) 419 if(is_admin_bar_showing()) 420 420 $offset = get_option("ribbon_maker_admin_offset$i"); 421 421 else 422 422 $offset = get_option("ribbon_maker_user_offset$i"); 423 423 424 424 $h_offset = get_option("ribbon_maker_user_h_offset$i",'0'); 425 425 $z_position = get_option("ribbon_maker_z_position$i",'0'); 426 426 427 427 $img = plugins_url("ribbon_maker_ribbon$i.png",__FILE__); 428 428 429 429 $link_url = get_option("ribbon_maker_url$i"); 430 430 $link_title = get_option("ribbon_maker_title$i"); 431 431 432 432 $link_head = ""; 433 433 if($link_url!="") … … 437 437 if($link_url!="" && $link_title!="") 438 438 $link_head = "<a target='_blank' class='ribbon-maker' href='$link_url' title='$link_title'>"; 439 439 440 440 if($link_head!="") 441 441 $link_tail="</a>"; 442 442 else 443 443 $link_tail=""; 444 444 445 445 //now that we have fading, i'm adding cookie management so we can have skipping too! 446 446 … … 475 475 ourJquery(\"div.$mydiv\").remove(); 476 476 }); 477 477 478 478 }, $timeout); 479 479 });
Note: See TracChangeset
for help on using the changeset viewer.