Plugin Directory

Changeset 358169


Ignore:
Timestamp:
03/10/2011 11:41:21 AM (15 years ago)
Author:
johannesfosseus
Message:

just a small fix

Location:
drop-zone/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • drop-zone/trunk/drop-zone.class.php

    r358149 r358169  
    1515        $thumbnail_max_height = $instance['thumbnail_max_height'];
    1616
    17         $postID = get_option($args['id']);
     17        $postID = get_option($args['widget_id']);
    1818
    1919        // check if we have a thumb and the height/width is set
     
    2929            $the_widgets_pos_id = substr($args['widget_id'], strpos($args['widget_id'], "-") + 1); // we need the id
    3030
    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."\">";
     31            echo "<div class=\"widget-container\" data-url=\"".$link."\" data-index=\"0\" data-removable=\"true\" data-droppable=\"true\" data-position=\"".$args['id'].":".$args['widget_id']."\">";
    3232
    3333            if($post_thumbnail_id){
     
    4444            echo "</div>";
    4545        } else {
    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."\">";
     46            echo "<div class=\"droppable widget-container\" data-url=\"".$post->guid."\" data-index=\"0\" data-droppable=\"true\" data-position=\"".$args['id'].":".$args['widget_id']."\">";
    4747            echo "</div>";
    4848        }
  • drop-zone/trunk/drop-zone.php

    r358149 r358169  
    55Description: Drag drop frontend widget
    66Author: Johannes Fosseus
    7 Version: 1.2
     7Version: 1.2.1
    88*/
    99
     
    4949    }
    5050
     51    // split the position string
     52    list ($widgetarea, $position) = explode(':', $_GET['infoBlock']['position']);
     53
    5154    // find the "widgets id"
    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']);
     55    $widget_id = substr($position, strpos($position, "-") + 1);
    5656
    5757    // use it to get the specific widget options
     
    7979        }
    8080
    81         echo $wp_registered_sidebars[$position]['before_title']."<a href=\"".$_GET['infoBlock']['url']."\">".$post->post_title."</a>".$wp_registered_sidebars[$position]['after_title'];
     81        echo $wp_registered_sidebars[$widgetarea]['before_title']."<a href=\"".$_GET['infoBlock']['url']."\">".$post->post_title."</a>".$wp_registered_sidebars[$widgetarea]['after_title'];
    8282
    8383        if($show_excerpt){
     
    105105        die();
    106106    }
    107     list ($position, $after) = explode(':', $_POST['position']);
     107    list ($widgetarea, $position) = explode(':', $_POST['position']);
    108108    $postID = url_to_postid($_POST['url']);
    109109    $DropZone->remove($position,$postID);
Note: See TracChangeset for help on using the changeset viewer.