Changeset 358149
- Timestamp:
- 03/10/2011 10:40:33 AM (15 years ago)
- Location:
- drop-zone
- Files:
-
- 6 added
- 3 edited
-
tags/1.2 (added)
-
tags/1.2/drop-zone.class.php (added)
-
tags/1.2/drop-zone.css (added)
-
tags/1.2/drop-zone.js (added)
-
tags/1.2/drop-zone.php (added)
-
tags/1.2/readme.txt (added)
-
trunk/drop-zone.class.php (modified) (4 diffs)
-
trunk/drop-zone.php (modified) (8 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
drop-zone/trunk/drop-zone.class.php
r354491 r358149 15 15 $thumbnail_max_height = $instance['thumbnail_max_height']; 16 16 17 $postID = get_option($args[' widget_id']);17 $postID = get_option($args['id']); 18 18 19 19 // check if we have a thumb and the height/width is set … … 23 23 24 24 if($postID){ 25 25 26 $post = get_post($postID); // get the post, post_excerpt 26 27 $link = get_permalink($postID); 27 28 $drop_zone_excerpt = $this->trim_excerpt($post->post_content,20); // the drop-zone excerpt 29 $the_widgets_pos_id = substr($args['widget_id'], strpos($args['widget_id'], "-") + 1); // we need the id 28 30 29 echo "<div class=\"widget-container\" data-url=\"".$link."\" data-index=\"0\" data-removable=\"true\" data-droppable=\"true\" data-position=\"".$args[' widget_id']."\">";31 echo "<div class=\"widget-container\" data-url=\"".$link."\" data-index=\"0\" data-removable=\"true\" data-droppable=\"true\" data-position=\"".$args['id'].":".$the_widgets_pos_id."\">"; 30 32 31 33 if($post_thumbnail_id){ … … 34 36 } 35 37 36 echo "<h3 class=\"widget-title\"><a href=\"".$link."\">".$post->post_title."</a></h3>";38 echo $args['before_title']."<a href=\"".$link."\">".$post->post_title."</a>".$args['after_title']; 37 39 38 40 if($show_excerpt){ … … 42 44 echo "</div>"; 43 45 } else { 44 echo "<div class=\"droppable widget-container\" data-url=\"".$post->guid."\" data-index=\"0\" data- removable=\"true\" data-droppable=\"true\" data-position=\"".$args['widget_id']."\">";46 echo "<div class=\"droppable widget-container\" data-url=\"".$post->guid."\" data-index=\"0\" data-droppable=\"true\" data-position=\"".$args['id'].":".$the_widgets_pos_id."\">"; 45 47 echo "</div>"; 46 48 } -
drop-zone/trunk/drop-zone.php
r357616 r358149 5 5 Description: Drag drop frontend widget 6 6 Author: Johannes Fosseus 7 Version: 1. 17 Version: 1.2 8 8 */ 9 9 … … 41 41 // ajax callback 42 42 function drop_zone_drop() { 43 global $wpdb,$DropZone; 43 global $wpdb,$DropZone,$wp_registered_sidebars; 44 44 45 45 46 // secutity … … 49 50 50 51 // find the "widgets id" 51 $widget_id = substr($_GET['infoBlock']['position'], strpos($_GET['infoBlock']['position'], "-") + 1); 52 $widget_id = substr($_GET['infoBlock']['position'], strpos($_GET['infoBlock']['position'], ":") + 1); 53 54 // Find the widgets "position" 55 list ($position, $after) = explode(':', $_GET['infoBlock']['position']); 52 56 53 57 // use it to get the specific widget options … … 57 61 $thumbnail_max_width = $instance[$widget_id]['thumbnail_max_width']; 58 62 $thumbnail_max_height = $instance[$widget_id]['thumbnail_max_height']; 59 60 63 $postID = url_to_postid($_GET['infoBlock']['url']); // get the postID 61 64 … … 69 72 $drop_zone_excerpt = $DropZone->trim_excerpt($post->post_content,20); // the drop-zone excerpt 70 73 71 echo "<div class=\"widget-container\" data- edited=\"true\" data-url=\"".$_GET['infoBlock']['url']."\" data-index=\"0\" data-removable=\"true\" data-droppable=\"true\" data-position=\"".$_GET['infoBlock']['position']."\">";74 echo "<div class=\"widget-container\" data-url=\"".$_GET['infoBlock']['url']."\" data-index=\"0\" data-removable=\"true\" data-droppable=\"true\" data-position=\"".$_GET['infoBlock']['position']."\">"; 72 75 73 76 if($post_thumbnail_id){ … … 76 79 } 77 80 78 echo "<h3 class=\"widget-title\"><a href=\"".$_GET['infoBlock']['url']."\">".$post->post_title."</a></h3>";81 echo $wp_registered_sidebars[$position]['before_title']."<a href=\"".$_GET['infoBlock']['url']."\">".$post->post_title."</a>".$wp_registered_sidebars[$position]['after_title']; 79 82 80 83 if($show_excerpt){ … … 85 88 86 89 // and svave 87 $DropZone->save_on_drop($_GET['infoBlock']['position'],$postID); 90 $DropZone->save_on_drop($position,$postID); 91 } 92 93 // clear the supercache, if supercache is installed 94 if(function_exists('wp_cache_clear_cache')){ 95 wp_cache_clear_cache(); 88 96 } 89 97 … … 97 105 die(); 98 106 } 107 list ($position, $after) = explode(':', $_POST['position']); 99 108 $postID = url_to_postid($_POST['url']); 100 $DropZone->remove($ _POST['position'],$postID);109 $DropZone->remove($position,$postID); 101 110 die; 102 111 } -
drop-zone/trunk/readme.txt
r357543 r358149 22 22 == Changelog == 23 23 24 = 1.2 = 25 * Added support for wp super cache wp_cache_clear_cache() on drop/save 26 * Bugfixing in the after/before widget settings 27 24 28 = 1.1 = 25 29 * Added before and after title to the widget
Note: See TracChangeset
for help on using the changeset viewer.