WordPress.org

Plugin Directory

Changeset 634732


Ignore:
Timestamp:
12/06/12 07:33:49 (17 months ago)
Author:
ssamture
Message:

1.2.4 Released.

Location:
mh-board/trunk
Files:
9 edited

Legend:

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

    r631105 r634732  
    2525        $input[$key]['write'] = isset($input[$key]['write']) ? 'on' : 'off'; 
    2626    } 
     27    $input['guest']['read'] = isset($input['guest']['read']) ? 'on' : 'off'; 
     28    $input['guest']['write'] = isset($input['guest']['write']) ? 'on' : 'off'; 
    2729    return $input; 
    2830} 
  • mh-board/trunk/includes/mh-functions.php

    r631105 r634732  
    197197    } else { 
    198198        // curl library is not installed so we better use something else 
    199         $xml = wp_remote_get(MH_BOARD_UPDATE_URL); 
    200         $data = simplexml_load_string($xml['body']); 
    201     } 
     199        $xml = @wp_remote_get(MH_BOARD_UPDATE_URL); 
     200        $data = @simplexml_load_string($xml['body']); 
     201    } 
     202    if(is_object($data)){ 
    202203    $is_update = false; 
    203204    if($data->version != MH_BOARD_VERSION){ 
     
    211212    echo "<div class=\"updated\"><p>현재 설치되어 있는 워드프레스 게시판 \"MH Board\"의 버전은 ".MH_BOARD_VERSION."이며 버전 {$data->version} 가 새로 배포되었습니다.</p>"; 
    212213    echo "<p>다운로드 받으러 가기: <a href='{$data->download}'>$data->download</a></p></div>"; 
     214    } 
    213215 
    214216} 
     
    350352function mh_board_read_permission(){ 
    351353    global $post,$mh_board_options; 
    352     $category =@ wp_get_object_terms($post->ID,'board_cat'); 
     354    if(isset($_GET['ID'])){ 
     355        $post_id = $_GET['ID']; 
     356    }else{ 
     357        $post_id = $post->ID; 
     358    } 
     359    $category =@ wp_get_object_terms($post_id,'board_cat'); 
    353360 
    354361    $mh_board_per_o = get_option('mh_board_permission_'.$category[0]->term_id); 
     
    360367add_action('mh_board_write_permission','mh_board_write_permission'); 
    361368function mh_board_write_permission(){ 
    362     global $post,$mh_board_options; 
     369    global $post,$mh_board_options,$board_cat; 
    363370     
    364371    if(isset($_GET['board_cat'])){ 
    365         $category =@ get_term_by('slug',$_GET['board_cat'],'board_cat'); 
    366      
     372        $board_cat = $_GET['board_cat']; 
     373    } 
     374    if(isset($_GET['board_cat']) || isset($board_cat)){ 
     375         
     376        $category =@ get_term_by('slug',$board_cat,'board_cat'); 
     377 
    367378        $mh_board_per_o = get_option('mh_board_permission_'.$category->term_id); 
    368379        $mh_board_options['permission'] = true; 
  • mh-board/trunk/mh-board.php

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

    r631105 r634732  
    4343== Changelog == 
    4444 
     45= 1.2.4= 
     46* Bugfix : Shortcode 
    4547= 1.2.3 = 
    4648* Upgrade : Permission improvement. 
  • mh-board/trunk/shortcodes/mh_board.php

    r625099 r634732  
    11<?php 
    2 function mh_board(){ 
    3     global $mh_board,$paged,$mh_query,$post,$mh_board_link; 
    4  
     2function mh_board($atts){ 
     3    global $mh_board,$paged,$mh_query,$post,$mh_board_link,$board_cat; 
     4    global $mh_board_options; 
     5    $mh_board_options = get_option('mh_board_options'); 
    56    $mh_board_link = get_permalink(); 
    67    if(isset($_GET['page_id'])){ 
     
    910        $mh_board_link .= '?'; 
    1011    } 
     12    extract(shortcode_atts(array( 
     13      'board_cat' => '', 
     14     ), $atts)); 
     15    $category = get_term_by('name',$board_cat,'board_cat'); 
     16    if(!$category){ 
     17        $category = get_term_by('slug',$board_cat,'board_cat'); 
     18    } 
     19    if(is_object($category)){ 
     20        $board_cat = $category->slug; 
     21    } 
     22 
    1123    $ID = empty($_GET['ID']) ? '' : $_GET['ID']; 
    1224    $type = empty($_GET['type']) ? 'list' : $_GET['type']; 
     
    1426        $paged = empty($_GET['page']) ? '1' : $_GET['page']; 
    1527    } 
    16     $board_cat = empty($_GET['board_cat']) ? '' : $_GET['board_cat']; 
    17     return require_once(dirname(__FILE__).'/templates/mh_board_'.$type.'.php'); 
     28    $board_cat = empty($_GET['board_cat']) ? $board_cat : $_GET['board_cat']; 
     29    require_once(dirname(__FILE__).'/templates/mh_board_'.$type.'.php'); 
    1830} 
    1931?> 
  • mh-board/trunk/shortcodes/templates/mh_board_list.php

    r625099 r634732  
    33 * 숏코드용 게시판 리스트 템플릿 
    44 */ 
     5global $board_cat; 
    56$s = empty($_GET['s']) ? '' : $_GET['s']; 
     7$file = ''; 
    68?> 
    79<div id="mh-board" class="content" class="clearfix"> 
     
    189191    $guestwrite = $mh_board_options['mh_guestwrite']; 
    190192    $redirect_to = @$_SERVER['REQUEST_URI']; 
    191      
    192  
    193193    ?> 
    194194    <?php if($guestwrite == '1' || is_user_logged_in()):?> 
  • mh-board/trunk/shortcodes/templates/mh_board_view.php

    r625099 r634732  
    33 * 숏코드용 게시판 리스트 템플릿 
    44 */ 
     5do_action('mh_board_read_permission'); 
     6if(!$mh_board_options['permission']){ 
     7    echo __('Access Denied','mhboard'); 
     8    return false; 
     9} 
    510?> 
     11 
    612<?php $mh_board_options = get_option('mh_board_options');?> 
    713    <div id="mh-board"> 
  • mh-board/trunk/shortcodes/templates/mh_board_write.php

    r625099 r634732  
    11<?php 
     2global $mh_board,$mh_board_options,$board_cat; 
     3do_action('mh_board_write_permission'); 
     4 
     5if(!$mh_board_options['permission']){ 
     6    echo __('Access Denied','mhboard'); 
     7    return false; 
     8} 
    29if(@$_REQUEST['mh_action'] == 'post' && wp_verify_nonce($_REQUEST['_mh_board_nonce'],'mh_board_nonce')){ 
    310        $mh_board_write = new MH_Register_Post(); 
     
    100107            ?> 
    101108            <input type="hidden" name="board_category" value="<?php echo $category[0]->term_id;?>"> 
     109            <?php elseif(isset($board_cat)):?> 
     110            <?php 
     111            $category = get_term_by('slug',$board_cat,'board_cat'); 
     112            ?> 
     113            <input type="hidden" name="board_category" value="<?php echo $category->term_id;?>"> 
    102114            <?php else:?> 
    103115            <?php if(sizeof($categories) > 0):?> 
     
    106118                <?php 
    107119                foreach($categories as $category){ 
     120                    $mh_board_per_o = get_option('mh_board_permission_'.$category->term_id); 
     121                     
     122                    if($mh_board_per_o[mh_get_user_role()]['write'] == 'on'): 
    108123                    ?> 
    109                     <option value="<?php echo $category->term_id;?>"><?php echo $category->name;?></option> 
    110                     <?php 
     124                    <option value="<?php echo $category->term_id;?>"<?php if($mh_default_category == $category->term_id){echo " selected";}?>><?php echo $category->name;?></option> 
     125                    <?php endif; 
    111126                }  
    112127                ?> 
  • mh-board/trunk/templates/comments.php

    r628426 r634732  
    7777                        <?php echo get_avatar( $comment, 55 ); ?> 
    7878                        <strong><?php echo $comment->comment_author;?> </strong> 
    79                         <span><?php echo coment_reply_link(array('',$comment->ID,get_the_ID()));?></span> 
     79                        <span><?php echo comment_reply_link(array('',$comment->comment_ID,get_the_ID()));?></span> 
    8080                    </div> 
    8181                    <p><?php echo nl2br($comment->comment_content);?></p> 
Note: See TracChangeset for help on using the changeset viewer.