Plugin Directory

Changeset 944228


Ignore:
Timestamp:
07/07/2014 09:05:48 AM (12 years ago)
Author:
pondol
Message:

Version: 1.1.3

Location:
pondol-bbs/trunk
Files:
2 added
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • pondol-bbs/trunk/assets/css/gallery/pondol-bbs.css

    r943236 r944228  
    44#pondol-bbs-list div.desc {text-align: center;font-weight: normal;width: 120px;margin: 5px;}
    55#pondol-bbs-list:after {content:""; display:block; clear:both;}
    6 .button_group {content:""; display:block; clear:both; padding:10px;}
    7 
     6.tablenav {content:""; display:block; clear:both; padding:10px;}
    87#pondol-bbs-view table{width:100%;}
    98#pondol-bbs-view th {background-color:#CCCCCC; padding:10px;}
  • pondol-bbs/trunk/includes/class.pondol.bbs.admin.php

    r943236 r944228  
    1414        add_action(PONDOL_BBS_TAXO.'_edit_form_fields', array($this, 'pondol_bbs_taxonomy_edit_meta_field'));
    1515       
    16         add_action( 'edited_'.PONDOL_BBS_TAXO, array( $this, 'save_tax_meta' ), 10, 2 );
    17         add_action( 'create_'.PONDOL_BBS_TAXO, array( $this, 'save_tax_meta' ), 10, 2 );
     16        add_action('edited_'.PONDOL_BBS_TAXO, array( $this, 'save_tax_meta' ), 10, 2 );
     17        add_action('create_'.PONDOL_BBS_TAXO, array( $this, 'save_tax_meta' ), 10, 2 );
     18        add_filter('plugin_row_meta', array($this, 'add_pondol_links'), 10, 2);
     19        //save bbs post at back_end
     20        add_action('save_post',  array($this->ctrl->bbs, 'update_bbs_meta'), 20, 1);//actually open new post
    1821       
    19         add_filter('plugin_row_meta', array($this, 'add_pondol_links'), 10, 2);
     22        //add_action('add_meta_boxes', array($this, 'pondol_bbs_add_post_meta_boxes') );
     23        //add_action('wp_enqueue_scripts', array($this, 'pondol_bbs_admin_scripts'));
     24        //wp_enqueue_script( 'pondolbbs-core-script', plugins_url('../assets/js/pondol-bbs.js', __FILE__ ), false, '1.1.0', true);
     25        wp_enqueue_script( 'pondolbbs-admin-script', plugins_url('../assets/js/admin.pondol.bbs.js', __FILE__ ), false, '1.0.0', true);
     26    }
     27    /*
     28    function pondol_bbs_add_post_meta_boxes() {
     29        add_meta_box(
     30            'pondol_bbs_image_box',                         // Unique ID
     31            esc_html__( 'Gallery Image', 'pondol_bbs' ),    // Title
     32            array( $this, 'pondol_bbs_image_meta_box'),     // Callback function
     33            PONDOL_BBS,                                     // Admin page (or post type)
     34            'side',                                         // Context
     35            'default'                                       // Priority
     36        );
    2037    }
    2138
    22    
     39    function pondol_bbs_image_meta_box( $object, $box ) {
     40        global $post;
     41        //print_r($post);
     42        wp_nonce_field( basename( __FILE__ ), 'class.pondol.bbs.admin.php' );
     43    echo '<div id="product_images_container">
     44            <ul class="pondolbbs_gallery_images ui-sortable">
     45            </ul>
     46
     47            <input type="hidden" id="product_image_gallery" name="product_image_gallery" value="">
     48
     49        </div>';
     50    echo '<p class="add_pondolbbs_gallery_images hide-if-no-js">
     51            <a href="#" data-choose="Add Images to Pondol BBS Gallery" data-update="Add to gallery" data-delete="Delete image" data-text="Delete">Add gallery images</a>
     52        </p>';
     53    }
     54*/
     55
    2356    function pondol_bbs_taxonomy_add_new_meta_field() {
    2457        @include_once PONDOL_BBS_PATH.'pages/admin.taxonomy.edit.php';
     
    3871
    3972        if ( isset( $_POST['pondol_taxo'] ) ) {
    40             $pondol_taxo = array();
     73            $pondol_taxo                    = array();
    4174            $pondol_taxo["skin"]            = isset ( $_POST["pondol_taxo"]["skin"] ) ? $_POST["pondol_taxo"]["skin"] : "";
    4275            $pondol_taxo["copyright"]       = isset ( $_POST["pondol_taxo"]["copyright"] ) ? $_POST["pondol_taxo"]["copyright"] : "";
     
    6497        return $links;
    6598    }
     99   
     100   
     101    function pondol_bbs_admin_scripts()
     102    {
     103        wp_enqueue_script( 'pondolbbs-admin-script', plugins_url('../assets/js/admin.pondol.bbs.js', __FILE__ ), false, '1.0.0', true);
     104        //wp_enqueue_script( 'pondolbbs-user_ajax-script', plugins_url('../assets/js/dummy_ajax.js', __FILE__ ), false, '1.1.0', true);
     105    }
     106   
     107   
    66108}
  • pondol-bbs/trunk/includes/class.pondol.bbs.php

    r943236 r944228  
    168168                    //echo count($fileData['name']);
    169169                    //exit;
     170                    $thumImage = true;//as image is attached, the first image set to thumimages
    170171                    for ($i = 0; $i < count($fileData['name']); $i++) {
    171172                        $imageInfo = @getimagesize($fileData['tmp_name'][$i]);
     
    175176                        $key = "public-submission-attachment-{$i}";
    176177           
    177                         $_FILES[$key] = array();
    178                         $_FILES[$key]['name']     = $fileData['name'][$i];
    179                         $_FILES[$key]['tmp_name'] = $fileData['tmp_name'][$i];
    180                         $_FILES[$key]['type']     = $fileData['type'][$i];
    181                         $_FILES[$key]['error']    = $fileData['error'][$i];
    182                         $_FILES[$key]['size']     = $fileData['size'][$i];
     178                        $_FILES[$key]               = array();
     179                        $_FILES[$key]['name']       = $fileData['name'][$i];
     180                        $_FILES[$key]['tmp_name']   = $fileData['tmp_name'][$i];
     181                        $_FILES[$key]['type']       = $fileData['type'][$i];
     182                        $_FILES[$key]['error']      = $fileData['error'][$i];
     183                        $_FILES[$key]['size']       = $fileData['size'][$i];
    183184           
    184185                        $attachmentId = media_handle_upload($key, $POST_ID);
     
    186187                        if (!is_wp_error($attachmentId)) {// && wp_attachment_is_image($attachmentId) 모든 파일을 첨부
    187188                            $attachmentIds[] = $attachmentId;
    188                             add_post_meta($POST_ID, PONDOL_BBS_IMAGES, wp_get_attachment_url($attachmentId));
    189                             //echo "pass here";
    190                             //echo "post_id:", $POST_ID, ", PONDOL_BBS_IMAGES:", PONDOL_BBS_IMAGES, ", wp_get_attachment_url:", wp_get_attachment_url($attachmentId);
     189                            if(wp_attachment_is_image($attachmentId) && $thumImage){
     190                                update_post_meta($POST_ID, '_thumbnail_id', $attachmentId);
     191                                delete_post_meta($post_ID, PONDOL_BBS_IMAGES);
     192                                $thumImage = false;
     193                            }else{
     194                                add_post_meta($POST_ID, PONDOL_BBS_IMAGES, wp_get_attachment_url($attachmentId));
     195                            }
     196                           
     197                           
     198
     199                           
     200                           
    191201                            $imageCounter++;
    192202                        } else {
  • pondol-bbs/trunk/pondolbbs.php

    r943236 r944228  
    55Description: General BBS Program
    66Author: Pondol
    7 Version: 1.1.2
     7Version: 1.1.3
    88Author URI: http://www.shop-wiz.com/wp/plugins/pondol_bbs
    99License: GPL2
     
    4949
    5050        //save bbs post at back_end
    51         add_action('save_post',  array($this->ctrl->bbs, 'update_bbs_meta'), 20, 1);//actually open new post
     51        //add_action('save_post',  array($this->ctrl->bbs, 'update_bbs_meta'), 20, 1);//actually open new post
    5252       
    5353        //save bbs post at front_end
     
    5757        {
    5858            add_action("admin_init", array($this->ctrl->admin, 'admin_init'));
     59           
    5960                   
    6061        } else {//! is_admin()
  • pondol-bbs/trunk/readme.txt

    r943236 r944228  
    44Requires at least: 3.0
    55Tested up to: 3.8.1
    6 Stable tag: 1.1.2
     6Stable tag: 1.1.3
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    31312. Activate the plugin through the 'Plugins' menu in WordPress
    32323. GoTo Pondol BBS > BBS Category and create Category.
     334. As use this bbs as image gallery, add Image "Featured Images" on admin
    3334
    3435
  • pondol-bbs/trunk/templates/gallery/archive-list.php

    r943236 r944228  
    3434<?php
    3535if(is_array($rows)) foreach($rows as $key => $val){
    36 $meta_values = get_post_meta( $val->ID);
     36//$meta_values = get_post_meta( $val->ID);
     37//print_r(get_post_thumbnail_id($val->ID));
     38$feat_image = wp_get_attachment_url( get_post_thumbnail_id($val->ID) );
     39 
    3740?>
    3841<div id="pondol-bbs-list">
    3942  <a href="<?php echo $val->guid?>">
    40     <img src="<?php echo $meta_values["pondol_bbs_file"][0];?>" alt="<?php echo $val->post_title;?>" width="110" height="90">
     43    <!--<img src="<?php echo $meta_values["pondol_bbs_file"][0];?>" alt="<?php echo $val->post_title;?>" width="110" height="90">-->
     44    <img src="<?php echo $feat_image;?>" alt="<?php echo $val->post_title;?>" width="110" height="90">
     45   
     46
    4147  </a>
    4248  <div class="desc"><?php echo $val->post_title;?></div>
  • pondol-bbs/trunk/templates/gallery/archive-view.php

    r943236 r944228  
    3131                <?php
    3232                    if ( has_post_thumbnail() ) {
    33                         the_post_thumbnail( thumbnail );//the_post_thumbnail( )
     33                        the_post_thumbnail(  );//the_post_thumbnail(thumbnail )
    3434                    }
    3535                ?>
    36                
    3736                <?php if ( have_posts() ) { the_post(); the_content(); }?>
    3837               
     
    4746            </td>
    4847        </tr>
    49        
    5048    </table>
    5149
Note: See TracChangeset for help on using the changeset viewer.