Changeset 664128
- Timestamp:
- 02/06/2013 08:59:13 AM (13 years ago)
- Location:
- mh-board/trunk
- Files:
-
- 4 edited
-
mh-board.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
-
shortcodes/templates/mh_board_edit.php (modified) (1 diff)
-
shortcodes/templates/mh_board_write.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
mh-board/trunk/mh-board.php
r664125 r664128 16 16 * Author: MinHyeong Lim 17 17 * Author URI: http://ssamture.net 18 * Version: 1.2. 618 * Version: 1.2.7 19 19 * Text Domain: mhboard 20 20 * Domain Path: /mhb-languages/ 21 21 */ 22 define('MH_BOARD_VERSION','1.2. 6');22 define('MH_BOARD_VERSION','1.2.7'); 23 23 define('MH_BOARD_UPDATE_URL','http://ssamture.net/mh_board.xml'); 24 24 ini_set('memory_limit', -1); -
mh-board/trunk/readme.txt
r664125 r664128 42 42 43 43 == Changelog == 44 45 = 1.2.7 = 46 * Bugfix : ShortCode bugfix. 47 44 48 = 1.2.6 = 45 49 * Update : Security patch -
mh-board/trunk/shortcodes/templates/mh_board_edit.php
r625099 r664128 1 1 <?php 2 2 $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 64 4 $categories = get_terms('board_cat',array('orderby'=>'id','order'=>'ASC','hide_empty'=>0)); 65 5 ?> -
mh-board/trunk/shortcodes/templates/mh_board_write.php
r634732 r664128 7 7 return false; 8 8 } 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 }27 9 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_info43 );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 }67 10 $categories = get_terms('board_cat',array('orderby'=>'id','order'=>'ASC','hide_empty'=>0)); 68 11 ?>
Note: See TracChangeset
for help on using the changeset viewer.