Plugin Directory

Changeset 664128


Ignore:
Timestamp:
02/06/2013 08:59:13 AM (13 years ago)
Author:
ssamture
Message:

1.2.7 ShortCode Bugfix

Location:
mh-board/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • mh-board/trunk/mh-board.php

    r664125 r664128  
    1616 * Author:      MinHyeong Lim
    1717 * Author URI:  http://ssamture.net
    18  * Version:     1.2.6
     18 * Version:     1.2.7
    1919 * Text Domain: mhboard
    2020 * Domain Path: /mhb-languages/
    2121 */
    22 define('MH_BOARD_VERSION','1.2.6');
     22define('MH_BOARD_VERSION','1.2.7');
    2323define('MH_BOARD_UPDATE_URL','http://ssamture.net/mh_board.xml');
    2424ini_set('memory_limit', -1);
  • mh-board/trunk/readme.txt

    r664125 r664128  
    4242
    4343== Changelog ==
     44
     45= 1.2.7 =
     46* Bugfix : ShortCode bugfix.
     47
    4448= 1.2.6 =
    4549* Update : Security patch
  • mh-board/trunk/shortcodes/templates/mh_board_edit.php

    r625099 r664128  
    11<?php
    22$msg = '';
    3     if(@$_REQUEST['action'] == 'update' && wp_verify_nonce($_REQUEST['_mh_board_nonce'],'mh_board_nonce')){
    4         $mh_board_update = new MH_Update_Post();
    5         $user_id        = get_current_user_id() ? get_current_user_id() : 0;
    6         $tags           = trim( $_POST['post_tag'] );
    7         $post_title     = empty($_POST['post_title']) ? '' : $_POST['post_title'];
    8         $post_content   = empty($_POST['post_content']) ? '' : $_POST['post_content'];
    9         $mh_board_update->post_data = array(
    10             'ID'            => $_POST['post_id'],
    11             'post_author'   => $user_id,
    12             'post_title'    => $post_title,
    13             'post_content'  => $post_content,
    14             'post_type'     => 'board',
    15             'tags_input'    => $tags,
    16             'post_status'   => 'publish'
    17         );
    18         $author = get_post_meta($_POST['post_id'],'guest_info',true);
    19         $update = false;
    20         if($author){
    21             if($_POST['guest_password'] && $_POST['guest_password'] == $author['guest_password']){
    22                 $update = true;
    23             }else{
    24                 $update = false;
    25                 $msg = "비밀번호를 확인해주세요.";
    26             }
    27         }else if(get_current_user_id()){
    28             $update = true;
    29         }else{
    30             $update = true;
    31         }
    32        
    33         if($_POST['post_open'] == 0 && $_POST['post_password']){
    34             $mh_board_update->post_data['post_password'] = $_POST['post_password'];
    35         }
    36         $mh_board_update->post_term = array(
    37             'terms' => array(intval($_POST['board_category'])),
    38             'taxonomy' => 'board_cat'
    39         );
    40         $term = get_term_by('id',$_POST['board_category'],'board_cat');
    41         if($update){
    42             if($mh_board_update->update_post()){
    43                 echo "<script type='text/javascript'>location.href='".get_mh_board_view_link($_POST['post_id'])."';</script>";
    44             }else{
    45                
    46             }
    47         }
    48     }else if(@$_REQUEST['action'] == 'delete' && wp_verify_nonce($_REQUEST['_mh_board_nonce'],'mh_board_nonce')){
    49         $post_id = $_POST['post_id'];
    50         $post = get_post($post_id);
    51         $guest_info = get_post_meta($post_id,'guest_info',true);
    52         if((get_current_user_id() == $post->post_author && get_current_user_id() > 0) || (isset($_POST['guest_password']) && $_POST['guest_password'] == $guest_info['guest_password'])){
    53             $args = array(
    54                 'ID' => $post_id,
    55                 'post_status'   => 'trash'
    56             );
    57             if(wp_update_post($args)){
    58                 echo "<script type='text/javascript'>location.href='".$mh_board_link."';</script>";
    59             }
    60         }else{
    61             $msg = "비밀번호를 확인해주세요.";
    62         }
    63     }
     3   
    644    $categories = get_terms('board_cat',array('orderby'=>'id','order'=>'ASC','hide_empty'=>0));
    655?>
  • mh-board/trunk/shortcodes/templates/mh_board_write.php

    r634732 r664128  
    77    return false;
    88}
    9 if(@$_REQUEST['mh_action'] == 'post' && wp_verify_nonce($_REQUEST['_mh_board_nonce'],'mh_board_nonce')){
    10         $mh_board_write = new MH_Register_Post();
    11         $user_id        = get_current_user_id() ? get_current_user_id() : 0;
    12         $tags           = trim( $_POST['board_tag'] );
    13         $post_title     = $_POST['board_title'];
    14         $post_content   = $_POST['board_content'];
    15         $mh_board_write->post_data = array(
    16             'post_author'   => $user_id,
    17             'post_title'    => $post_title,
    18             'post_content'  => $post_content,
    19             'post_type'     => 'board',
    20             'tags_input'    => $tags,
    21             'post_status'   => 'publish',
    22             'comment_status' => 'open',
    23         );
    24         if(isset($_POST['board_parent']) && $_POST['board_parent'] > 0){
    25             $mh_board_write->post_data['post_parent'] = $_POST['board_parent'];
    26         }
    279
    28         if(isset($_POST['board_tag'])){
    29             $mh_board_write->post_data['tags_input'] = $_POST['board_tag'];
    30         }
    31         if($_POST['board_open'] == 0 && $_POST['board_password']){
    32             $mh_board_write->post_data['post_password'] = $_POST['board_password'];
    33         }
    34         if($user_id == 0 && $_POST['guest_name'] && $_POST['guest_email'] && $_POST['guest_password']){
    35             $guest_info = array(
    36                 'guest_name' => $_POST['guest_name'],
    37                 'guest_email' => $_POST['guest_email'],
    38                 'guest_password' => $_POST['guest_password'],
    39                 'guest_site' => $_POST['guest_site']
    40             );
    41             $mh_board_write->post_meta = array(
    42                 'guest_info' => $guest_info
    43             );
    44         }
    45        
    46         $mh_board_write->post_term = array(
    47             'terms' => array(intval($_POST['board_category'])),
    48             'taxonomy' => 'board_cat'
    49         );
    50         $mh_board_write->post_meta['mh_board_notice'] = (int)0;
    51         $term = get_term_by('id',$_POST['board_category'],'board_cat');
    52         if($pid = $mh_board_write->register_post()){
    53             if($_FILES){
    54                 foreach($_FILES as $file => $array){
    55                     $newupload = mh_board_insert_attachment($file,$pid);
    56                 }
    57             }
    58             if(@$_POST['redirect_to']){
    59                 echo "<script type='text/javascript'>location.href='".$_POST['redirect_to']."';</script>";
    60             }else{
    61                 echo "<script type='text/javascript'>location.href='".get_post_type_archive_link('board')."';</script>";
    62             }
    63         }else{
    64            
    65         }
    66     }
    6710    $categories = get_terms('board_cat',array('orderby'=>'id','order'=>'ASC','hide_empty'=>0));
    6811?>
Note: See TracChangeset for help on using the changeset viewer.