WordPress.org

Plugin Directory

Changeset 538439


Ignore:
Timestamp:
05/01/12 06:17:53 (5 years ago)
Author:
nmrdxt
Message:
 
Location:
boxify/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • boxify/trunk/boxify.master.php

    r534379 r538439  
    44Plugin URI: http://dev.nimrodtsabari.net/wp/boxify-a-wordpress-plugin/  
    55Description: Boxify Lets you organize your post/page content in highly modular boxes. 
    6 Version: 0.35 
     6Version: 0.6 
    77Author: Nimrod Tsabari 
    88Author URI: http://www.nimrodtsabari.net 
     
    2525<?php 
    2626 
    27 define('BOXIFY_VER', '0.35'); 
     27define('BOXIFY_VER', '0.6'); 
    2828define('BOXIFY_DIR', plugin_dir_url( __FILE__ )); 
    2929 
     
    149149    return $output; 
    150150} 
     151 
     152function remove_p($content) { 
     153    if (strpos($content,'</p>') === 0) $content = substr($content, 4); 
     154    return $content; 
     155} 
     156 
     157function save_custom_field($pid,$cfname,$content) { 
     158    update_post_meta($pid, $cfname, $content); 
     159} 
     160 
    151161//shortcode   
    152162function set_boxify($atts,$content=null) { 
     
    169179      'icon'        => '', 
    170180      'icon_position'   => '0 0', 
     181      'import'      => '', // 'full', 'content' 
     182      'import_post' => '', 
     183      'import_name' => '', 
     184      'export_name' => '' 
    171185      ), $atts)); 
    172186 
    173  
     187    global $post;  
     188    $pid = $post->ID; 
     189     
    174190    $code = ''; 
    175191 
     
    241257    $title = trim($title); 
    242258     
    243     $code .= do_shortcode($content); 
     259    $pless = remove_p($content); 
     260     
     261    $content_wrap = $code; 
     262     
     263    $code .= do_shortcode($pless); 
    244264 
    245265    /* Closing Code */ 
    246266    $code .= '</div></div>'; 
    247267 
    248     return $code;      
     268    /* exporting a box */ 
     269    $export_name = sanitize_title(trim(strtolower($export_name))); 
     270     
     271    if ($export_name !== '') { 
     272        $cfname_content = '_boxify_export_content_' . $export_name; 
     273        $cfname_full = '_boxify_export_full_' . $export_name; 
     274        save_custom_field($pid, $cfname_full, $code); 
     275        save_custom_field($pid, $cfname_content, do_shortcode($pless)); 
     276    } 
     277 
     278    /* importing a box */ 
     279    $import = trim(strtolower($import)); 
     280    $import_post = trim(strtolower($import_post)); 
     281    $import_name = sanitize_title(trim(strtolower($import_name))); 
     282     
     283    if ($import === 'full') { 
     284        $cfname = '_boxify_export_full_' . $import_name; 
     285        $box_import = get_post_meta($import_post, $cfname); 
     286        return $box_import[0]; 
     287    } else if ($import === 'content') { 
     288        $cfname = '_boxify_export_content_' . $import_name; 
     289        $box_import = get_post_meta($import_post, $cfname); 
     290        return $content_wrap . $box_import[0] . do_shortcode($content) . '</div></div>'; 
     291    } else { 
     292        return $code;      
     293    }  
     294 
    249295} 
    250296 
  • boxify/trunk/css/boxify.css

    r528351 r538439  
    66.boxify { 
    77    position: relative; 
     8    z-index: 9999; 
    89} 
    910.boxify-container { 
  • boxify/trunk/readme.txt

    r534379 r538439  
    55Requires at least: 2.8 
    66Tested up to: 3.3.1 
    7 Stable tag: 0.35 
     7Stable tag: 0.6 
    88 
    99Send Your Content to Boxes For Better Presentation. 
     
    1515You don't need to know any code but a simple [Boxify] shortcode.  
    1616 
     17**New Feature on 0.6 -** Share boxes between posts and pages! 
     18 
    1719**On the current version :** 
    1820  
     
    2224* Assign classes for detailed styling. 
    2325* Control border, opacity and background with shortcode. 
     26* Cross posts boxification. 
    2427 
    2528**Coming Soon :** 
     
    4851== Changelog == 
    4952 
     53= 0.6 =  
     54* Share Boxes between Posts & Pages. 
     55* Remove extra /p's. 
     56 
    5057= 0.35 = 
    5158* Support for multi class structures. 
Note: See TracChangeset for help on using the changeset viewer.