Plugin Directory

Changeset 946704


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

Version: 1.1.5

Location:
pondol-bbs/trunk
Files:
9 added
21 edited

Legend:

Unmodified
Added
Removed
  • pondol-bbs/trunk/assets/js/pondol-bbs.js

    r934030 r946704  
    22 * Copyright 2014 pondol All Rights Reserved
    33 * Website: http://www.shop-wiz.com
    4  * Version 1.0
     4 * Version 1.0.1
     5 *
    56 */
    67(function ($) {
     8   
     9    _target_url = "";
     10   
    711    $(document).ready(function () {
     12        //modify btn where view page
    813        $(".pondolbbs_btn_modify").click(function(e){
    914            e.preventDefault();
    10             $("#hidden_auth_type").val("modify_login");
    1115            var data = {
    1216                action: 'pondol_bbs_auth_check',
     
    1519                bbs_id: $("#pondol_bbs_hidden_post_id").val()
    1620              };
    17             //check if current user have autho to modify or not
    1821            get_auth(data);
    1922
    2023        });
    2124       
    22        
    23         $(".pondolbbs_btn_getAuth").click(function(e){
    24             e.preventDefault();
    25             var data = {
    26                 action: 'pondol_bbs_auth_check',
    27                 auth_type:$("#hidden_auth_type").val(),
    28                 security : PondolBBSAjax.security,
    29                 bbs_id: $("#pondol_bbs_hidden_post_id").val(),
    30                 user_password:$("#pondolbbs_auth_passwd").val()
    31               };
    32             get_auth(data);
    33 
    34         });
    35        
     25      //delete btn where view page
    3626        $(".pondolbbs_btn_delete").click(function(e){
    3727            e.preventDefault();
    38             $("#hidden_auth_type").val("delete_login");
    3928            var data = {
    4029                action: 'pondol_bbs_auth_check',
     
    4635            get_auth(data);
    4736        });
     37       
     38        //goto view page from list
     39        goto_bbs_view = function(url, id){//from List to View
     40            var data = {
     41                    action: 'pondol_bbs_auth_check',
     42                    auth_type:'secret_auth',
     43                    security : PondolBBSAjax.security,
     44                    bbs_id: id,
     45                    rtn_url : url
     46                  };
     47                //check if current user have autho to modify or not
     48                get_auth(data);
     49        }
     50       
     51        //$(".pondolbbs_btn_getAuth").click(function(e){
     52        $(document).on("click", ".pondolbbs_btn_getAuth", function(e){
     53            e.preventDefault();
     54            var data = {
     55                action: 'pondol_bbs_auth_check',
     56                auth_type:$("#hidden_auth_type").val(),
     57                security : PondolBBSAjax.security,
     58                bbs_id: $("#pondol_bbs_hidden_post_id").val(),
     59                user_password:$("#pondolbbs_auth_passwd").val()
     60              };
     61           
     62            //console.log(data);
     63            get_auth(data);
    4864
     65        });
    4966       
    5067        var get_auth = function(data){
     
    5572                case "modify_auth":
    5673                    if(obj.auth == true){
    57                         console.log(response);
     74                        //console.log(response);
    5875                        location.href = '?bbstype=modify&bbsid='+obj.bbs_id;
    5976                    }else{
    60                         var bbsid = $(this).parent().attr("user-attr-bbsid")           
    61                         $("#pondolbbs_auth_form").show();
     77                        var bbsid = $(this).parent().attr("user-attr-bbsid");
     78                        var url = PondolBBSGlobalVar.PONDOL_BBS_URL+"templates/default/form_auth.php";
     79                        $("body").popup({url:url, duplicate:false, callbackFnc:"setAuthType", callbackFncParams:"modify_login"});
     80                        //$("#pondolbbs_auth_form").show();
    6281                    }                   
    6382                    break;
     
    6786                    }else{
    6887                        alert("password is incorrect.")
    69                         $("#pondolbbs_auth_form").hide();
     88                        $(".dynamicPop").remove();
    7089                    }                   
    7190                    break;
     
    7796                    }else{
    7897                        var bbsid = $(this).parent().attr("user-attr-bbsid")           
    79                         $("#pondolbbs_auth_form").show();
     98                        var url = PondolBBSGlobalVar.PONDOL_BBS_URL+"templates/default/form_auth.php";
     99                        $("body").popup({url:url, duplicate:false, callbackFnc:"setAuthType", callbackFncParams:"delete_login"});
    80100                    } 
    81101                    break;
     
    87107                    }else{
    88108                        alert("password is incorrect.")
    89                         $("#pondolbbs_auth_form").hide();
     109                        $(".dynamicPop").remove();
    90110                    }   
    91111                    break;
     112                case "secret_auth":
     113                    if(obj.auth == true){
     114                        location.href = obj.rtn_url;
     115                    }else{
     116                        _target_url = obj.rtn_url;
     117                        var bbsid = obj.bbs_id;
     118                        $("#pondol_bbs_hidden_post_id").val(bbsid);
     119                        var url = PondolBBSGlobalVar.PONDOL_BBS_URL+"templates/default/form_auth.php";
     120                        $("body").popup({url:url, duplicate:false, callbackFnc:"setAuthType", callbackFncParams:"secret_login"});
     121                    }
     122                    break;
     123                case "secret_login":
     124                    if(obj.auth == true){
     125                        location.href = _target_url;
     126                    }else{
     127                        alert("password is incorrect.")
     128                        $(".dynamicPop").remove();
     129                    }                   
     130                    break;
    92131                }
     132               
    93133                //alert('Got this from the server: ' + response);
    94134            });
     135        }
     136       
     137        setAuthType = function(auth_type){
     138            $("#hidden_auth_type").val(auth_type);
    95139        }
    96140       
     
    102146                  };
    103147            $.post(PondolBBSAjax.ajaxurl, data, function(response) {
    104                 console.log(response)
     148                //console.log(response)
    105149                eval("var obj="+response);
    106150                location.href = obj.list_link;
    107151            });
    108152        }
     153       
     154
     155       
    109156    })
     157   
     158   
    110159})(jQuery);
  • pondol-bbs/trunk/includes/class.pondol.bbs.admin.php

    r945283 r946704  
    1919        //save bbs post at back_end
    2020        add_action('save_post',  array($this->ctrl->bbs, 'update_bbs_meta'), 20, 1);//actually open new post
    21        
    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);
    2521        wp_enqueue_script( 'pondolbbs-admin-script', plugins_url('../assets/js/admin.pondol.bbs.js', __FILE__ ), false, '1.0.0', true);
    2622    }
    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         );
    37     }
    38 
    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 */
    5523
    5624    function pondol_bbs_taxonomy_add_new_meta_field() {
  • pondol-bbs/trunk/includes/class.pondol.bbs.controller.php

    r945283 r946704  
    7171    function create_db_table(){
    7272        $this->model->create_db_table("board");//create main board table
    73         //$this->model->create_db_table("reply");//create reply table
     73        $this->model->update_table("board");//create main board table
    7474    }
    7575   
  • pondol-bbs/trunk/includes/class.pondol.bbs.model.php

    r934030 r946704  
    1313        global $wpdb;
    1414        switch($flag){
    15             case "main":
    16                 return $wpdb->prefix . "pondolplugin_board_main";
    17                 break;
     15            //case "main":
     16            //  return $wpdb->prefix . "pondolplugin_board_main";
     17            //  break;
    1818            case "board":
    1919                return $wpdb->prefix . "pondol_bbs";
    2020                break;
    21             case "reply":
    22                 return $wpdb->prefix . "pondolplugin_board_reply";
    23                 break;
     21            //case "reply":
     22            //  return $wpdb->prefix . "pondolplugin_board_reply";
     23            //  break;
    2424        }
    2525       
     
    3838        require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
    3939       
    40         //echo $flag;
    41         //exit;
    4240        switch($flag){
    4341            case "board":
     
    6058        return;
    6159    }
     60   
     61    function update_table($flag){
     62        global $wpdb;
     63        require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
     64        $table_name = $this->get_table_name($flag);
     65       
     66        switch($flag){
     67            case "board":
     68                $wpdb->query ("alter table `".$table_name."` add column OP_FIELD varchar(255) DEFAULT NULL");
     69                $wpdb->query ("alter table `".$table_name."` add column NOTICE tinyint(1) DEFAULT 0");
     70            break;
     71        }
     72    }
    6273}
  • pondol-bbs/trunk/includes/class.pondol.bbs.php

    r944228 r946704  
    1414        global $wpdb, $wp_query, $current_user;
    1515       
    16 //echo "bbs_save start..";
    1716        if (isset($_POST['pondol_bbs_submit_form']) && !empty($_POST['pondol_bbs_submit_form'])) {
    1817            ## TITLE
     
    5655                $fileData = '';
    5756            }
    58    
     57           
     58            ## OP_FIELD
     59            $op_field["html"]       = $_POST["bbs_write_op"]["html"] ? $_POST["bbs_write_op"]["html"] : 0;
     60            $op_field["secret"]     = $_POST["bbs_write_op"]["secret"] ? $_POST["bbs_write_op"]["secret"] : 0;
     61            $op_field["notice"]     = $_POST["bbs_write_op"]["notice"] ? $_POST["bbs_write_op"]["notice"] : 0;
     62            $OP_FIELD               = serialize($op_field);
     63           
     64            ## OP_FIELD
     65            $notice_flag            = $op_field["notice"];
     66           
     67           
    5968            ## AUTHORIP
    6069            if (isset($_SERVER['REMOTE_ADDR']))          $authorIp = stripslashes(trim($_SERVER['REMOTE_ADDR']));
     
    6877       
    6978
    70             if($_POST['bbs-id'] && $_POST['bbs-type'] == "modify"){//update
     79            if($_POST['bbs-id'] && $_POST['bbs-type'] == "modify"){//update current item
    7180            //check user auth
    7281                $this->ctrl->bbs->has_access_auth("modify");
     
    7685                   
    7786                    $POST_ID    = $postData["ID"]   = $_POST['bbs-id'];
     87                   
    7888                    wp_update_post($postData);
     89                   
     90                    $bbs_name   = $_POST['bbs-name']?$_POST['bbs-name']:$current_user->display_name;
     91                    $arr = array(
     92                                "POST_ID"       => $POST_ID,
     93                                "NOTICE"        => $notice_flag,
     94                                "USER_NAME"     => $bbs_name,
     95                                "OP_FIELD"      => $OP_FIELD
     96                            );
     97                    $this->update_into_board($arr);
    7998                }else{
    8099                    $this->ctrl->func->js_alert(array("cmd"=>"back", "msg"=>__('you have not auth', 'pondol_bbs')));
    81100                }
    82             }else{
     101            }else{//save new item or reply
    83102               
    84103                $bbs_name   = $_POST['bbs-name']?$_POST['bbs-name']:$current_user->display_name;
     
    111130                    $arr = array(
    112131                                "POST_ID"       => $POST_ID,
     132                                "NOTICE"        => $notice_flag,
    113133                                "THREAD"        => $FUTURE_THREAD,
    114134                                "FID"           => $CURRENT_FID,
    115135                                "USER_ID"       => $current_user->user_login,
    116136                                "USER_NAME"     => $bbs_name,
     137                                "OP_FIELD"      => $OP_FIELD,
    117138                                "USER_PASSWD"   => md5($_POST['bbs-password']),
    118139                                "COUNT"         => 0
     
    127148                    $arr = array(
    128149                                "POST_ID"       => $POST_ID,
     150                                "NOTICE"        => $notice_flag,
    129151                                "THREAD"        => "A",
    130152                                "FID"           => $POST_ID,
    131153                                "USER_ID"       => $current_user->user_login,
    132154                                "USER_NAME"     => $bbs_name,
     155                                "OP_FIELD"      => $OP_FIELD,
    133156                                "USER_PASSWD"   => md5($_POST['bbs-password']),
    134157                                "COUNT"         => 0
     
    165188       
    166189                if ($fileData !== '') {
    167                     //print_r($fileData);
    168                     //echo count($fileData['name']);
    169                     //exit;
    170190                    $thumImage = true;//as image is attached, the first image set to thumimages
    171191                    for ($i = 0; $i < count($fileData['name']); $i++) {
    172192                        $imageInfo = @getimagesize($fileData['tmp_name'][$i]);
    173                         //if (false === $imageInfo || !usp_imageIsRightSize($imageInfo[0], $imageInfo[1])) {
    174                         //  continue;
    175                         //}
    176                         $key = "public-submission-attachment-{$i}";
     193                        $key = "public-submission-attachment-".$i;
    177194           
    178195                        $_FILES[$key]               = array();
     
    194211                                add_post_meta($POST_ID, PONDOL_BBS_IMAGES, wp_get_attachment_url($attachmentId));
    195212                            }
    196                            
    197                            
    198 
    199                            
    200                            
    201213                            $imageCounter++;
    202214                        } else {
    203215                            wp_delete_attachment($attachmentId);
    204216                        }
    205 
    206217                    }
    207218                    update_post_meta($POST_ID, "is_submission", true);
     
    217228    public function insert_into_board($arr){
    218229        global $wpdb;
    219        
     230        //"OP_FIELD"        => $OP_FIELD,
    220231        return $wpdb->query( $wpdb->prepare(
    221232                            "
    222                             INSERT INTO ".$this->ctrl->model->get_table_name("board")." (POST_ID, THREAD, FID, USER_ID, USER_NAME, USER_PASSWD, COUNT)
    223                             VALUES (%s, %s, %s, %s, %s, %s, %d)
     233                            INSERT INTO
     234                                ".$this->ctrl->model->get_table_name("board")."
     235                                (POST_ID, NOTICE, THREAD, FID, USER_ID, USER_NAME, USER_PASSWD, OP_FIELD, COUNT)
     236                            VALUES
     237                                (%s, %d, %s, %s, %s, %s, %s, %s, %d)
    224238                            ",
    225                             $arr["POST_ID"], $arr["THREAD"], $arr["FID"], $arr["USER_ID"], $arr["USER_NAME"], $arr["USER_PASSWD"], $arr["COUNT"]
     239                            $arr["POST_ID"], $arr["NOTICE"], $arr["THREAD"], $arr["FID"], $arr["USER_ID"], $arr["USER_NAME"], $arr["USER_PASSWD"], $arr["OP_FIELD"], $arr["COUNT"]
    226240                    ) );
    227241    }//end of insert_into_board
     
    233247                UPDATE ".$this->ctrl->model->get_table_name("board")."
    234248                SET
    235                     POST_ID     = %d,
    236                     THREAD      = %s
    237                     USER_NAME   = %s
     249                    NOTICE      = %d,
     250                    USER_NAME   = %s,
     251                    OP_FIELD    = %s
    238252                WHERE
    239253                    POST_ID     = %d
    240254                ",
    241                 $arr["POST_ID"], $arr["THREAD"], $arr["USER_NAME"], $arr["POST_ID"]
     255                $arr["NOTICE"], $arr["USER_NAME"], $arr["OP_FIELD"], $arr["POST_ID"]
    242256            ) );
    243257    }//end of update_into_board
    244258
     259    //update bbs meta as item is saved from back-end
    245260    public function update_bbs_meta($post_id){
    246261        global $wpdb, $current_user;
    247262        if($_POST["post_type"] == PONDOL_BBS){
    248             $count = $wpdb->get_var("SELECT COUNT(TID) FROM ".$this->ctrl->model->get_table_name("board")." where POST_ID = ".$post_id);
     263            $count = $wpdb->get_var($wpdb->prepare(
     264                    "SELECT
     265                        COUNT(TID)
     266                    FROM
     267                        ".$this->ctrl->model->get_table_name("board")."
     268                    WHERE
     269                        POST_ID = %d",
     270                    $post_id));
     271           
     272            $op_field["html"]       = 1;
     273            $op_field["secret"]     = 0;
     274            $op_field["notice"]     = 0;
     275            $OP_FIELD               = serialize($op_field);
     276           
     277           
    249278            if(!$count && isset($post_id)){
    250                 $arr = array("POST_ID"=>$post_id, "THREAD"=>"A", "FID"=>$post_id, "COUNT"=>0, "USER_ID"=>$current_user->user_login, "USER_NAME"=>$current_user->display_nam);
     279                $arr = array("POST_ID"=>$post_id, "NOTICE"=>$op_field["notice"], "THREAD"=>"A", "FID"=>$post_id
     280                                , "COUNT"=>0, "USER_ID"=>$current_user->user_login
     281                                , "USER_NAME"=>$current_user->display_nam, "OP_FIELD"=>$OP_FIELD);
    251282                return $this->insert_into_board($arr);
    252283            }
    253284        }
    254 
    255285        return;
    256286    }
    257287   
    258     //update view count
     288    //update view count when someone read this
    259289    public function update_view_count($post_id){
    260290        global $wpdb;
     
    273303    //as click modify btn at viewform, check if have auth or not
    274304    public function bbs_auth_check(){
    275         global $wpdb; // this is how you get access to the database
     305        //global $wpdb; // this is how you get access to the database
    276306        check_ajax_referer( 'my-special-string', 'security' );
    277307       
     
    281311                $author_info = wp_get_current_user();
    282312                if($author_info->caps["administrator"] == 1){
    283                     $rtn["auth"]    = true;
    284                 }else{
    285                     $user_id= $wpdb->get_var("SELECT USER_ID FROM ".$this->ctrl->model->get_table_name("board")." where POST_ID = ".$_POST["bbs_id"]);
    286                     if($user_id == $author_info->data->user_login){
     313                    $rtn["auth"]        = true;
     314                }else{
     315                    $row            = $this->get_bbs_auth_item($_POST["bbs_id"]);
     316                    if($row->USER_ID && $row->USER_ID == $author_info->data->user_login){
    287317                        $rtn["auth"]    = true;
    288318                    }else{
     
    293323                break;
    294324            case "modify_login"://second auth check for modify
    295                 $user_password= $wpdb->get_var("SELECT USER_PASSWD FROM ".$this->ctrl->model->get_table_name("board")." where POST_ID = ".$_POST["bbs_id"]);
    296                 $rtn["db_userpasss"]            = $user_password;
    297                 $hashed_password                = md5($_POST['user_password']);
     325                $row            = $this->get_bbs_auth_item($_POST["bbs_id"]);
     326                $user_password  = $row->USER_PASSWD;
     327                   
     328                $rtn["db_userpasss"]    = $user_password;
     329                $hashed_password        = md5($_POST['user_password']);
    298330   
    299331                if($user_password == $hashed_password){
    300                     $rtn["auth"]    = true;
    301                 }else{
    302                     $rtn["auth"]    = false;
     332                    $rtn["auth"]        = true;
     333                }else{
     334                    $rtn["auth"]        = false;
    303335                }
    304336           
     
    307339                $author_info = wp_get_current_user();
    308340                if($author_info->caps["administrator"] == 1){
    309                     $rtn["auth"]    = true;
    310                 }else{
    311                     $user_id= $wpdb->get_var("SELECT USER_ID FROM ".$this->ctrl->model->get_table_name("board")." where POST_ID = ".$_POST["bbs_id"]);
    312                     if($user_id == $author_info->data->user_login){
     341                    $rtn["auth"]        = true;
     342                }else{
     343                    $row        = $this->get_bbs_auth_item($_POST["bbs_id"]);
     344                    $user_id    = $row->USER_ID;
     345                    if($user_id && $user_id == $author_info->data->user_login){
    313346                        $rtn["auth"]    = true;
    314347                    }else{
     
    319352                break;
    320353            case "delete_login"://second auth check for modify
    321                 $user_id= $wpdb->get_var("SELECT USER_ID FROM ".$this->ctrl->model->get_table_name("board")." where POST_ID = ".$_POST["bbs_id"]);
    322                 if($user_id == $author_info->data->user_login){
    323                     $rtn["auth"]    = true;
    324                 }else{
    325                     $rtn["auth"]    = false;
    326                 }
    327            
    328                 break;
    329         }
    330        
    331         set_transient( 'bbs_auth', json_encode(array("auth_type"=>$_POST["auth_type"], "auth"=>$rtn["auth"])), 12 * HOUR_IN_SECONDS );
     354                $row        = $this->get_bbs_auth_item($_POST["bbs_id"]);
     355                $user_id    = $row->USER_ID;
     356                if($user_id && $user_id == $author_info->data->user_login){
     357                    $rtn["auth"]        = true;
     358                }else{
     359                    $rtn["auth"]        = false;
     360                }
     361           
     362                break;
     363            case "secret_auth"://pre auth check for secret item
     364                $author_info            = wp_get_current_user();
     365                $rtn["rtn_url"]         = $_POST["rtn_url"];
     366                $row                    = $this->get_bbs_auth_item($_POST["bbs_id"]);
     367               
     368                $auth = json_decode(get_transient( "bbs_auth"));
     369               
     370                if($author_info->caps["administrator"] == 1 || ($auth->auth == 1 && $auth->fid==$row->FID)){
     371                    $rtn["auth"]        = true;
     372                }else{
     373                    $user_id            = $row->USER_ID;
     374                    $op_field           = unserialize($row->OP_FIELD); //if $op_field["secret"] == "1" then secret item
     375                   
     376                    if(($user_id && $user_id == $author_info->data->user_login) || $op_field["secret"] != "1"){
     377                        $rtn["auth"]    = true;
     378                    }else{
     379                        $rtn["auth"]    = false;
     380                    }
     381                }
     382       
     383                break;
     384            case "secret_login"://second auth check for secret item
     385                $row                    = $this->get_bbs_auth_item($_POST["bbs_id"]);
     386
     387                $rtn["db_userpasss"]    = $row->USER_PASSWD;
     388                $hashed_password        = md5($_POST['user_password']);
     389   
     390                if($row->USER_PASSWD == $hashed_password){
     391                    $rtn["auth"]        = true;
     392                }else{
     393                    $rtn["auth"]        = false;
     394                }
     395           
     396                break;
     397               
     398        }
     399       
     400        set_transient( 'bbs_auth', json_encode(array("auth_type"=>$_POST["auth_type"], "auth"=>$rtn["auth"], "fid"=>$row->FID)), 12 * HOUR_IN_SECONDS );
     401       
    332402        $rtn["auth_type"]   = $_POST["auth_type"];
    333403        $rtn["bbs_id"]      = $_POST["bbs_id"];
     
    337407       
    338408        die(); // this is required to return a proper result
     409    }
     410   
     411    private function get_bbs_auth_item($post_id){
     412        global $wpdb;
     413        $row    = $wpdb->get_row($wpdb->prepare(
     414            "SELECT
     415                USER_ID, OP_FIELD, USER_PASSWD, FID
     416            FROM
     417                ".$this->ctrl->model->get_table_name("board")."
     418            WHERE POST_ID = %d"
     419            , $post_id
     420        ));
     421       
     422        return $row;
    339423    }
    340424   
     
    355439    }
    356440   
    357    
    358441    public function has_access_auth($bbstype){
    359442        $author_info = wp_get_current_user();
    360443        $roles = $author_info->roles[0] ? $author_info->roles[0]:"nologin";
    361444        $toxonomy   =   $this->ctrl->func->get_custom_taxonomy();
    362 //echo "bbstype:", $bbstype, "</br>";
    363 //print_r($toxonomy);
    364 //exit;
    365445        switch($bbstype){
    366446            case "write":
     
    382462       
    383463        return $result;
    384         //print_r($toxonomy);   
    385        
    386         /*
    387          * bbs_type:stdClass Object
    388 (
    389     [term_id] => 67
    390     [name] => board
    391     [slug] => %ec%9e%90%ec%9c%a0%ea%b2%8c%ec%8b%9c%ed%8c%90
    392     [term_group] => 0
    393     [term_taxonomy_id] => 68
    394     [taxonomy] => board
    395     [description] => 자유게시판 입니다.
    396     [parent] => 0
    397     [count] => 35
    398     [filter] => raw
    399     [pondol_taxo] => Array
    400         (
    401             [skin] => default
    402             [access_write] => Array
    403                 (
    404                     [0] => administrator
    405                     [1] => editor
    406                     [2] => author
    407                 )
    408 
    409             [access_read] => Array
    410                 (
    411                     [0] => administrator
    412                     [1] => editor
    413                     [2] => author
    414                     [3] => contributor
    415                     [4] => subscriber
    416                     [5] => customer
    417                     [6] => shop_manager
    418                 )
    419 
    420             [access_list] => Array
    421                 (
    422                     [0] => administrator
    423                     [1] => editor
    424                     [2] => author
    425                 )
    426 
    427         )
    428 
    429 )
    430          */
    431464    }
    432465   
  • pondol-bbs/trunk/includes/class.pondol.bbs.templates.php

    r945283 r946704  
    2727            $this->_toxonomy    =   $this->ctrl->func->get_custom_taxonomy();
    2828            //print_r($this->_toxonomy);
     29           
     30            add_action('wp_enqueue_scripts', array($this->ctrl->func, 'load_jquery_ui_google_cdn'));
     31            add_action('wp_enqueue_scripts', array($this->ctrl->func, 'add_ajax'));
     32           
    2933            wp_enqueue_style( 'pondol-bbs-default-style1', plugins_url('../assets/css/'.$this->_toxonomy->pondol_taxo["skin"].'/pondol-bbs.css', __FILE__ ));
    3034            wp_enqueue_script( 'pondolbbs-core-script', plugins_url('../assets/js/pondol-bbs.js', __FILE__ ), false, '1.1.0', true);
    31             add_action('wp_enqueue_scripts', array($this->ctrl->func, 'add_ajax'));
     35           
     36            wp_enqueue_style( 'pondol-bbs-popup-style1', plugins_url('../assets/js/jquery.popup/css/popup.css', __FILE__ ));
     37            wp_enqueue_script( 'pondol-bbs-popup-script', plugins_url('../assets/js/jquery.popup/jquery.popup.js', __FILE__ ), array('jquery-ui-core') , '1.1.0', true);
     38           
    3239           
    3340            switch($bbstype){
     
    5764        global $wpdb, $wp_query;
    5865       
    59         //$term_id = $this->ctrl->func->get_term_id();
    60         //$taxonomy_options = $this->ctrl->func->get_taxonomy_options($term_id);
    61         //$table_style = $this->ctrl->func->get_tmpl_table_style($taxonomy_options);
    6266        $table_style = $this->ctrl->func->get_tmpl_table_style($this->_toxonomy->pondol_taxo);//get table style;
    6367       
     
    9397                                );
    9498                       
    95         $start_no   = $total-($limit*($pagenum-1));
    96         $num_of_pages = ceil( $total / $limit );
     99        $start_no       = $total-($limit*($pagenum-1));
     100        $num_of_pages   = ceil( $total / $limit );
    97101         
    98102        $page_links = paginate_links( array(
     
    104108        'current' => $pagenum
    105109        ) );
    106 
     110       
     111        //main list
    107112        $rows = $wpdb->get_results("
    108113                                select
    109                                     p.*, t.term_taxonomy_id, b.USER_NAME, b.COUNT
     114                                    p.*, t.term_taxonomy_id, b.USER_NAME, b.COUNT, b.OP_FIELD, b.THREAD
    110115                                from
    111116                                    ".$this->ctrl->model->get_table_name("board")." b
     
    124129                                limit
    125130                                    ".$offset.", ".$limit
    126                                    
    127131                                );
    128 
    129        
     132       
     133                //process output
     134        if(is_array($rows)) foreach($rows as $key => $val){
     135            $op_field   = unserialize($val->OP_FIELD);
     136           
     137            $re_len = strlen($val->THREAD)-1;
     138            $re_space   = "";
     139            for($i = 0; $i < $re_len; $i++){
     140                $re_space .="&nbsp;&nbsp;";
     141            }
     142           
     143            $key_img    = $op_field["secret"] == "1" ? ' <img src="'.PONDOL_BBS_URL.'assets/images/icons/key.gif"> ':'';
     144            $rows[$key]->bbs_title  = $re_space.$key_img.$val->post_title;
     145        }
     146       
     147       
     148        $topList    = $wpdb->get_results("
     149                                select
     150                                    p.*, t.term_taxonomy_id, b.USER_NAME, b.COUNT, b.OP_FIELD, b.THREAD
     151                                from
     152                                    ".$this->ctrl->model->get_table_name("board")." b
     153                                left join
     154                                    ".$wpdb->prefix . "posts p
     155                                on
     156                                    b.POST_ID = p.ID
     157                                left join
     158                                    ".$wpdb->prefix . "term_relationships t
     159                                on
     160                                    b.POST_ID = t.object_id
     161                                where
     162                                    p.post_status = 'publish' and t.term_taxonomy_id = ".$wp_query->queried_object->term_taxonomy_id." and b.NOTICE = 1
     163                                order by
     164                                    FID desc, THREAD asc
     165                                limit
     166                                    ".$offset.", ".$limit
     167                                );
     168                               
     169        if(is_array($topList)) foreach($topList as $key => $val){
     170            $op_field   = unserialize($val->OP_FIELD);
     171           
     172            $re_len = strlen($val->THREAD)-1;
     173            $re_space   = "";
     174            for($i = 0; $i < $re_len; $i++){
     175                $re_space .="&nbsp;&nbsp;";
     176            }
     177           
     178            $key_img    = $op_field["secret"] == "1" ? ' <img src="'.PONDOL_BBS_URL.'assets/images/icons/key.gif"> ':'';
     179            $topList[$key]->bbs_title   = $re_space.$key_img.$val->post_title;
     180        }
     181        //print_r($rows);
     182       
     183        //$op_field = unserialize($row->OP_FIELD);
    130184        get_header();
     185       
     186        $hidden_args = array("pondol_bbs_hidden_post_id"=>"");
     187        echo '<form id="pondol_bbs_list_form">';
     188        echo $this->ctrl->func->generate_input($hidden_args);
     189        echo '</form>';
     190       
    131191        @include_once PONDOL_BBS_PATH.'templates/'.$this->_toxonomy->pondol_taxo["skin"].'/archive-list.php';
    132192        $this->ctrl->func->copyright();
     
    142202       
    143203        if($_GET["bbstype"] == "modify"){
    144            
    145        
    146204            $row = $wpdb->get_row("
    147205                                    select
    148                                         p.*, b.USER_NAME
     206                                        p.*, b.USER_NAME, b.OP_FIELD
    149207                                    from
    150208                                        ".$this->ctrl->model->get_table_name("board")." b
     
    156214                                        b.POST_ID = ".$post->ID."
    157215            ");
     216           
     217            $op_field = unserialize($row->OP_FIELD);
    158218
    159219        }elseif($_GET["bbstype"] == "reply"){
    160220            $row = $wpdb->get_row("
    161221                                    select
    162                                         p.ID, p.post_content, p.post_title
     222                                        p.ID, p.post_content, p.post_title, b.OP_FIELD
    163223                                    from
    164224                                        ".$this->ctrl->model->get_table_name("board")." b
     
    170230                                        b.POST_ID = ".$post->ID."
    171231            ");
    172            
     232            $op_field = unserialize($row->OP_FIELD);//need to get some parent's option like secret
    173233            $row->post_title    = "Re: ".$row->post_title;
    174234            $row->post_content  = nl2br("\n\r\n\r\n\r\n\r\n\r ------------ [Original Message] ------------ \r\n&gt;&gt;".str_replace("\n","\n&gt;&gt;",$row->post_content));
     
    179239       
    180240        get_header();
     241       
     242        $hidden_args = array("pondol_bbs_submit_form"=>"1", "bbs-id"=>$row->ID, "bbs-type"=>$_GET["bbstype"], "bbs-category"=>$this->_toxonomy->term_id);
    181243        @include_once PONDOL_BBS_PATH.'templates/'.$this->_toxonomy->pondol_taxo["skin"].'/archive-write.php';
    182244        $this->ctrl->func->copyright();
     
    188250    public function template_view(){
    189251        global $wpdb, $wp_query, $post;
    190        
    191 
    192         $meta_values = get_post_meta( $post->ID);
    193 
    194         $categories = get_the_category( $post->ID );
     252        $login_user_info    = wp_get_current_user();
     253
     254        $meta_values        = get_post_meta( $post->ID);
     255
     256        $categories         = get_the_category( $post->ID );
    195257       
    196258        $this->ctrl->bbs->update_view_count($post->ID);
     
    201263        $row = $wpdb->get_row("
    202264                        select
    203                             p.*, b.USER_NAME
     265                            p.*, b.USER_NAME, b.OP_FIELD, b.FID
    204266                        from
    205267                            ".$this->ctrl->model->get_table_name("board")." b
     
    212274        ");
    213275       
     276       
     277        //auth check for secret items
     278        $op_field   = unserialize($row->OP_FIELD);
     279
     280        if($op_field["secret"] == "1"){
     281            $auth = json_decode(get_transient( "bbs_auth"));
     282           
     283            if($login_user_info->caps["administrator"] != 1){
     284                if($auth->auth != 1 ||  $auth->fid != $row->FID){
     285                    $this->ctrl->func->js_alert(array("cmd"=>"back", "msg"=>__('this is secrete item, you have not auth', 'pondol_bbs')));
     286                }
     287            }
     288           
     289        }
     290       
     291       
     292       
     293        get_header();
     294       
    214295        $hidden_args = array("pondol_bbs_hidden_post_id"=>$post->ID);
    215         get_header();
     296        echo '<form id="pondol_bbs_view_form">';
     297        echo $this->ctrl->func->generate_input($hidden_args);
     298        echo '</form>';
     299       
    216300        @include_once PONDOL_BBS_PATH.'templates/'.$this->_toxonomy->pondol_taxo["skin"].'/archive-view.php';
    217301        $this->ctrl->func->copyright();
  • pondol-bbs/trunk/includes/func.bbs.php

    r945283 r946704  
    130130
    131131   
    132     function add_ajax()
    133     {
    134         //reference : http://www.benmarshall.me/wordpress-ajax-frontend-backend/
    135 
    136         wp_enqueue_script( 'pondolbbs-user_ajax-script', plugins_url('../assets/js/dummy_ajax.js', __FILE__ ), false, '1.1.0', true);
    137         wp_localize_script( 'pondolbbs-user_ajax-script', 'PondolBBSAjax', array(
    138             // URL to wp-admin/admin-ajax.php to process the request
    139             'ajaxurl' => admin_url( 'admin-ajax.php' ),
    140      
    141             // generate a nonce with a unique ID "myajax-post-comment-nonce"
    142             // so that you can check it later when an AJAX request is sent
    143             'security' => wp_create_nonce( 'my-special-string' )
    144         ));
    145     }
     132
    146133
    147134    function generate_input($args){
     
    195182        }
    196183    }
     184   
     185   
     186    function add_ajax()
     187    {
     188        //reference : http://www.benmarshall.me/wordpress-ajax-frontend-backend/
     189
     190        wp_enqueue_script( 'pondolbbs-user_ajax-script', plugins_url('../assets/js/dummy_ajax.js', __FILE__ ), false, '1.1.0', true);
     191        wp_localize_script( 'pondolbbs-user_ajax-script', 'PondolBBSAjax', array(
     192            // URL to wp-admin/admin-ajax.php to process the request
     193            'ajaxurl' => admin_url( 'admin-ajax.php' ),
     194     
     195            // generate a nonce with a unique ID "myajax-post-comment-nonce"
     196            // so that you can check it later when an AJAX request is sent
     197            'security' => wp_create_nonce( 'my-special-string' )
     198        ));
     199       
     200        wp_enqueue_script( 'pondolbbs-global-var', plugins_url('../assets/js/dummy_globalvar.js', __FILE__ ), false, '1.1.0', true);
     201        wp_localize_script( 'pondolbbs-global-var', 'PondolBBSGlobalVar', array(
     202            'PONDOL_BBS_URL' => PONDOL_BBS_URL
     203        ));
     204    }
     205   
     206    function load_jquery_ui_google_cdn() {
     207        global $wp_scripts;
     208         
     209        wp_enqueue_script('jquery-ui-core');
     210        //wp_enqueue_script('jquery-ui-slider');
     211        wp_enqueue_script('jquery-ui-draggable');
     212        // get the jquery ui object
     213        $queryui = $wp_scripts->query('jquery-ui-core');
     214        $protocol = is_ssl() ? 'https' : 'http';
     215        // load the jquery ui theme
     216        $url = $protocol."://ajax.googleapis.com/ajax/libs/jqueryui/".$queryui->ver."/themes/smoothness/jquery-ui.css";
     217        wp_enqueue_style('jquery-ui-smoothness', $url, false, null);
     218    }
     219   
     220    function bbs_wp_editor($content, $editor_id, $setting){
     221        $ini_settings = array(
     222            'wpautop'       => true,  // enable rich text editor
     223            'media_buttons' => true,  // enable add media button
     224            'textarea_name' => 'bbs-content', // name
     225            'textarea_rows' => '10',  // number of textarea rows
     226            'tabindex'      => '',    // tabindex
     227            'editor_css'    => '',    // extra CSS
     228            'editor_class'  => 'pondol-dhtml-textarea', // class
     229            'teeny'         => false, // output minimal editor config
     230            'dfw'           => false, // replace fullscreen with DFW
     231            'tinymce'       => true,  // enable TinyMCE
     232            'quicktags'     => true,  // enable quicktags
     233        );
     234        $settings = array_replace($ini_settings, $setting);
     235       
     236        wp_editor($content, $editor_id, $settings);
     237    }
     238   
     239    //display post option in write page
     240    function show_post_option($config, $arr){
     241        global $current_user;
     242        $rtn            = '';
     243        $op_field       = $config["op_field"];
     244        $pondol_taxo    = $config["pondol_taxo"];
     245       
     246        //if($this->_toxonomy->pondol_taxo["dhtml_editor"] == "true"){//use wp_editor
     247       
     248        if(is_array($arr)) foreach($arr as $key => $val){
     249           
     250            switch($val){
     251                case "html":
     252                    if($pondol_taxo["dhtml_editor"] == "true"){
     253                        $rtn .='<input type="hidden" name="bbs_write_op[html]" value="1"'.$checked.'>';
     254                    }else{
     255                        $checked    = $op_field["html"] == "1" ? " checked":"";
     256                        $rtn .='<input type="checkbox" name="bbs_write_op[html]" value="1"'.$checked.'>'. __('HTML', 'pondol_bbs');
     257                    }
     258
     259                    break;
     260                case "secret":
     261                    $checked    = $op_field["secret"] == "1" ? " checked":"";
     262                    $rtn .='<input type="checkbox" name="bbs_write_op[secret]" value="1"'.$checked.'>'. __('Secrete', 'pondol_bbs');
     263                    break;
     264                case "notice":
     265                    if ( $current_user->caps["administrator"] == 1):
     266                        $checked    = $op_field["notice"] == "1" ? " checked":"";
     267                        $rtn .='<input type="checkbox" name="bbs_write_op[notice]" value="1"'.$checked.'>'. __('Notice', 'pondol_bbs');
     268                    endif;
     269                    break;
     270            }
     271           
     272        }
     273        return $rtn;       
     274    }
     275 
    197276}
  • pondol-bbs/trunk/pages/admin.taxonomy.edit.php

    r943236 r946704  
    88</script>
    99
    10 <!--
    11 <form action="https://www.paypal.com/cgi-bin/webscr"  id="pondol_bbs_paypal_submit_form" method="post" target="_blank">
    12     <input type="hidden" name="cmd" value="_s-xclick">
    13     <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHFgYJKoZIhvcNAQcEoIIHBzCCBwMCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYCZVs9AGNS2RbeUJDdxcHd8UxpvysanjXJlRYzDBsUa0jjdo1/0VLfTBTjdwArmVk8SONeKUMJOnEno8IrGXXAFtsN+9qrKJgF3YIwZGT4EjgxTzVIZ+hgePWmn5ivvAl+igox7huM/mHGdoGx668B2gikVh9pifRWVjhpc9QS5ETELMAkGBSsOAwIaBQAwgZMGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIMPdE3szExtyAcO7wazHXmA56b4phtUnLPuvnE8TiFn2l3+kj1MmgzJlQM7XDm+oIJBFL7MouiieA9Mq4rYioPAEhoYorQQPu18C8D4/kyBtLqvTPICXWCcl3OmpC6H0X58fXSoUmdZyXrdJduO9p9UmEvWXHCN3np/egggOHMIIDgzCCAuygAwIBAgIBADANBgkqhkiG9w0BAQUFADCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20wHhcNMDQwMjEzMTAxMzE1WhcNMzUwMjEzMTAxMzE1WjCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMFHTt38RMxLXJyO2SmS+Ndl72T7oKJ4u4uw+6awntALWh03PewmIJuzbALScsTS4sZoS1fKciBGoh11gIfHzylvkdNe/hJl66/RGqrj5rFb08sAABNTzDTiqqNpJeBsYs/c2aiGozptX2RlnBktH+SUNpAajW724Nv2Wvhif6sFAgMBAAGjge4wgeswHQYDVR0OBBYEFJaffLvGbxe9WT9S1wob7BDWZJRrMIG7BgNVHSMEgbMwgbCAFJaffLvGbxe9WT9S1wob7BDWZJRroYGUpIGRMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbYIBADAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAIFfOlaagFrl71+jq6OKidbWFSE+Q4FqROvdgIONth+8kSK//Y/4ihuE4Ymvzn5ceE3S/iBSQQMjyvb+s2TWbQYDwcp129OPIbD9epdr4tJOUNiSojw7BHwYRiPh58S1xGlFgHFXwrEBb3dgNbMUa+u4qectsMAXpVHnD9wIyfmHMYIBmjCCAZYCAQEwgZQwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tAgEAMAkGBSsOAwIaBQCgXTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0xMDEwMTIwMjA5NTJaMCMGCSqGSIb3DQEJBDEWBBR0wQEjGntoGchmQmJ93x9giR0rQjANBgkqhkiG9w0BAQEFAASBgL6oO6Pl51klzv6FB+bh+HCTi+8RqfpcR3Xcs3I/DTAsFCAq5pXbZE8qYCBXdDBKp4Oc/cpyMAZJ/+F1GIVUdOaMrI9DWBd6GKlMxjs1CmzGnaEeWeNYFRDzWE7jcTFYL2Z4Oi40EIui9rWFCwglF+ArTlh0vAou4/Dw0jy19Dug-----END PKCS7-----
    14     ">
    15 </form>
    16 -->
    1710<table class="form-table">
    1811            <tbody>
  • pondol-bbs/trunk/pondolbbs.php

    r945283 r946704  
    55Description: General BBS Program
    66Author: Pondol
    7 Version: 1.1.4
     7Version: 1.1.5
    88Author URI: http://www.shop-wiz.com/wp/plugins/pondol_bbs
    99License: GPL2
     
    2121define('PONDOL_URL', 'http://www.shop-wiz.com');
    2222define('PONDOL_EMAIL', '[email protected]');
    23 define('PONDOL_BBS_VERSION', '1.1.4');
     23define('PONDOL_BBS_VERSION', '1.1.5');
    2424define('PONDOL_BBS', 'bbs');
    2525define('PONDOL_BBS_TAXO', 'board');
     
    4141        $this->ctrl = new Pondol_BBS_Controller();
    4242       
    43        
    4443        add_action( 'init', array($this->ctrl, 'register_bbs_posttype'));
    4544        add_action( 'init', array($this->ctrl, 'register_bbs_taxonomies'));
    4645       
    47         add_action( 'plugins_loaded', array($this->ctrl, 'create_db_table') );
     46        add_action( 'plugins_loaded', array($this->ctrl, 'create_db_table'));
    4847        add_action( 'plugins_loaded', array($this, 'pondol_bbs_i18n_init'));
    4948
    50         //save bbs post at back_end
    51         //add_action('save_post',  array($this->ctrl->bbs, 'update_bbs_meta'), 20, 1);//actually open new post
    52        
    53         //save bbs post at front_end
    5449        add_action ('parse_request', array($this->ctrl->bbs, 'bbs_save'));
    5550       
     
    5752        {
    5853            add_action("admin_init", array($this->ctrl->admin, 'admin_init'));
    59            
    60                    
    6154        } else {//! is_admin()
    62 
    6355            add_filter( 'template_include', array( $this->ctrl, 'bbs_templates' ), '99');
    6456        }
     
    6961        add_action( 'wp_ajax_nopriv_pondol_bbs_delete', array( $this->ctrl->bbs, 'bbs_delete' ));//not login
    7062        add_action( 'wp_ajax_pondol_bbs_delete', array( $this->ctrl->bbs, 'bbs_delete' ));//login
    71        
     63
    7264    }
    7365
  • pondol-bbs/trunk/readme.txt

    r945283 r946704  
    33Tags: bbs,board,pondol,notice,imagegallery
    44Requires at least: 3.0
    5 Tested up to: 3.8.1
     5Tested up to: 3.9
    66Stable tag: 1.1.3
    77License: GPLv2 or later
     
    1212== Description ==
    1313
    14 This is general bbs(board) plugin
    15 skin selected(you can make skin and add to Pondol BBS)
    16 controll accessing bbs(board) by user level
    17 attached files and download
    18 search enable
    19 contorll table width and alignment
    20 controll item list count
     14This is general bbs(board) plugin.
     15skin selected(you can make skin and add to Pondol BBS).
     16adjust accessing bbs(board) by user level.
     17attache files and download it.
     18search enable.
     19adjust table width and alignment.
     20adjust items listing number.
     21important notice can be shown at top of lists(this option will be shown only to administrator).
     22secret item enable (fuctionally if you set this option, that item will be read by administartor, item owner only).
     23
    2124
    2225= Translation =
     
    3538
    3639== Changelog ==
     40= 1.1.5 =
     41debuggin prohibit a nologinuser could access items what ohter nobody users wrote 
     42add OP_FIELD to pondol_bbs table
     43add secret content
     44
    3745= 1.1.4 =
    3846add widget
  • pondol-bbs/trunk/templates/default/archive-list.php

    r934821 r946704  
    66 * @author      Pondol
    77 * @package     PondolBBS/Templates
    8  * @version     1.0.0
     8 * @version     1.1.5
    99 */
    1010
     
    5050        </thead>
    5151        <tbody>
     52           
     53            <?php
     54                if(is_array($topList)) foreach($topList as $key => $val){
     55            ?>
     56            <tr>
     57                <td><?php _e( 'Notice', 'pondol_bbs' ); ?></td>
     58                <td><a href="javascript:goto_bbs_view('<?php echo $val->guid?>', '<?php echo $val->ID;?>')"><?php echo $val->bbs_title;?></a></td>
     59                <td><?php echo $val->USER_NAME;?></td>
     60                <td><?php echo date("Y.m.d", strtotime($val->post_date));?></td>
     61                <td><?php echo number_format($val->COUNT);?></td>
     62            </tr>
     63            <?php } ?>
    5264            <?php
    5365                if(is_array($rows)) foreach($rows as $key => $val){
    54                    
    55                
    5666            ?>
    5767            <tr>
    5868                <td><?php echo ($start_no - $key); ?></td>
    59                 <td><a href="<?php echo $val->guid?>"><?php echo $val->post_title;?></a></td>
     69                <td><a href="javascript:goto_bbs_view('<?php echo $val->guid?>', '<?php echo $val->ID;?>')"><?php echo $val->bbs_title;?></a></td>
    6070                <td><?php echo $val->USER_NAME;?></td>
    6171                <td><?php echo date("Y.m.d", strtotime($val->post_date));?></td>
  • pondol-bbs/trunk/templates/default/archive-view.php

    r934213 r946704  
    1111if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
    1212?>
    13 <form id="pondol_bbs_view_form">
    14     <?php echo $this->ctrl->func->generate_input($hidden_args); ?>
    15 </form>
    1613<div id="pondol-bbs-view" <?php echo $table_style;?>>
    1714    <table>
     
    7572    </div>
    7673
    77     <!-- password 입력 -->
    78     <div id="pondolbbs_auth_form" style="width:500px; background-color: green; display: none">
    79         <input type="hidden" id="hidden_auth_type">
    80         Password:<input id="pondolbbs_auth_passwd">
    81         </br>
    82         Please enter a password when creating posts.
    83         </br>
    84         <input type="button" class="pondolbbs_btn_getAuth" value="submit">
    85     </div>
    8674<?php comments_template( '', true ); ?>
    8775</div>
  • pondol-bbs/trunk/templates/default/archive-write.php

    r943236 r946704  
    66 * @author      Pondol
    77 * @package     PondolBBS/Templates
    8  * @version     1.0.0
     8 * @version     1.1.5
    99 */
    1010if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
    1111?>
    12 
    1312<script type="text/javascript">
    1413(function($){
     
    3736<div id="pondol-bbs-write" <?php echo $table_style;?>>
    3837    <form id="pondol_bbs_form" method="post" data-validate="parsley" enctype="multipart/form-data" action="" novalidate>
    39         <input type="hidden" name="pondol_bbs_submit_form" value="1" />
    40         <input type="hidden" name="bbs-id" value="<?php echo $row->ID;?>" />
    41         <input type="hidden" name="bbs-type" value="<?php echo $_GET["bbstype"];?>" />
    42         <input type="hidden" name="bbs-category" value="<?php echo $this->_toxonomy->term_id;?>" />
     38        <?php echo $this->ctrl->func->generate_input($hidden_args); ?>
    4339        <table>
    4440            <col width="150px">
    4541            <col width="*">
     42            <tr>
     43                <th><?php _e('Post Title', 'pondol_bbs'); ?></th>
     44                <td><input name="bbs-title" id="bbs_title" type="text" class="required" value="<?php echo $row->post_title;?>" placeholder="<?php _e('Post Title', 'pondol_bbs'); ?>"></td>
     45            </tr>
    4646            <tr>
    4747                <th><?php _e('Your Name', 'pondol_bbs'); ?></th>
     
    5353            </tr>
    5454            <tr>
    55                 <th><?php _e('Post Title', 'pondol_bbs'); ?></th>
    56                 <td><input name="bbs-title" id="bbs_title" type="text" class="required" value="<?php echo $row->post_title;?>" placeholder="<?php _e('Post Title', 'pondol_bbs'); ?>"></td>
     55                <th><?php _e('Post Option', 'pondol_bbs'); ?></th>
     56                <td>
     57                    <?php echo $this->ctrl->func->show_post_option(array("op_field"=>$op_field, "pondol_taxo"=>$this->_toxonomy->pondol_taxo), array("secret", "notice")); ?>
     58                </td>
    5759            </tr>
    5860            <tr>
    5961                <td colspan="2">
     62                    <div>
    6063                    <?php
    61                     if($this->_toxonomy->pondol_taxo["dhtml_editor"] == "true"){
    62                     ?> 
    63                    
    64                         <div>
    65                         <?php $settings = array(
    66                                 'wpautop'       => true,  // enable rich text editor
    67                                 'media_buttons' => true,  // enable add media button
    68                                 'textarea_name' => 'bbs-content', // name
    69                                 'textarea_rows' => '10',  // number of textarea rows
    70                                 'tabindex'      => '',    // tabindex
    71                                 'editor_css'    => '',    // extra CSS
    72                                 'editor_class'  => 'pondol-dhtml-textarea', // class
    73                                 'teeny'         => false, // output minimal editor config
    74                                 'dfw'           => false, // replace fullscreen with DFW
    75                                 'tinymce'       => true,  // enable TinyMCE
    76                                 'quicktags'     => true,  // enable quicktags
    77                             );
    78                             wp_editor($row->post_content, 'bbs-content', $settings);
    79                         ?>
    80                         </div>
    81                     <?php
     64                    if($this->_toxonomy->pondol_taxo["dhtml_editor"] == "true"){//use wp_editor
     65                        $this->ctrl->func->bbs_wp_editor($row->post_content, 'bbs-content', $settings);
    8266                    }else{
    83                     ?>
    84                     <textarea name="bbs-content" type="text" class="required" ><?php echo $row->post_content;?></textarea>
    85                     <?php   
     67                        echo '<textarea name="bbs-content" type="text" class="required" >'.$row->post_content.'</textarea>';
    8668                    }
    8769                    ?>
     70                    </div>
    8871                </td>
    8972            </tr>
  • pondol-bbs/trunk/templates/default/form_auth.php

    r934030 r946704  
    1 <div style="width:500px; background-color: green;">
    2     Password:<input id="pondolbbs_auth_passwd">
     1<div id="pondolbbs_auth_form" style="width:400px;">
     2    <input type="hidden" id="hidden_auth_type">
     3    <h3>Password:</h3>
    34</br>
    4     Please enter a password when creating posts.
    5    
     5    <input type="password" id="pondolbbs_auth_passwd" style="width:90%;">
     6    </br>
     7    <span style="font-size: 10px;"> * Please enter a password when creating posts.</span>
     8    </br>
     9</br>
     10    <div style="text-align: center;">
     11    <input type="button" class="pondolbbs_btn_getAuth" value="submit">
     12    </div>
    613</div>
  • pondol-bbs/trunk/templates/gallery/archive-view.php

    r944228 r946704  
    1111if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
    1212?>
    13 <form id="pondol_bbs_view_form">
    14     <?php echo $this->ctrl->func->generate_input($hidden_args); ?>
    15 </form>
    1613<div id="pondol-bbs-view" <?php echo $table_style;?>>
    1714    <table>
     
    5552    </div>
    5653
    57     <!-- password 입력 -->
    58     <div id="pondolbbs_auth_form" style="width:500px; background-color: green; display: none">
    59         <input type="hidden" id="hidden_auth_type">
    60         Password:<input id="pondolbbs_auth_passwd">
    61         </br>
    62         Please enter a password when creating posts.
    63         </br>
    64         <input type="button" class="pondolbbs_btn_getAuth" value="submit">
    65     </div>
    6654<?php comments_template( '', true ); ?>
    6755</div>
  • pondol-bbs/trunk/templates/gallery/archive-write.php

    r943236 r946704  
    66 * @author      Pondol
    77 * @package     PondolBBS/Templates
    8  * @version     1.0.0
     8 * @version     1.1.5
    99 */
    1010if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
     
    3333<div id="pondol-bbs-write" <?php echo $table_style;?>>
    3434    <form id="pondol_bbs_form" method="post" data-validate="parsley" enctype="multipart/form-data" action="" novalidate>
    35         <input type="hidden" name="pondol_bbs_submit_form" value="1" />
    36         <input type="hidden" name="bbs-id" value="<?php echo $row->ID;?>" />
    37         <input type="hidden" name="bbs-type" value="<?php echo $_GET["bbstype"];?>" />
    38         <input type="hidden" name="bbs-category" value="<?php echo $this->_toxonomy->term_id;?>" />
     35        <?php echo $this->ctrl->func->generate_input($hidden_args); ?>
    3936        <table>
    4037            <col width="150px">
     
    4643            <tr>
    4744                <td colspan="2">
     45                    <div>
    4846                    <?php
    49                     if($this->_toxonomy->pondol_taxo["dhtml_editor"] == "true"){
    50                     ?> 
    51                    
    52                         <div>
    53                         <?php $settings = array(
    54                                 'wpautop'       => true,  // enable rich text editor
    55                                 'media_buttons' => true,  // enable add media button
    56                                 'textarea_name' => 'bbs-content', // name
    57                                 'textarea_rows' => '10',  // number of textarea rows
    58                                 'tabindex'      => '',    // tabindex
    59                                 'editor_css'    => '',    // extra CSS
    60                                 'editor_class'  => 'pondol-dhtml-textarea', // class
    61                                 'teeny'         => false, // output minimal editor config
    62                                 'dfw'           => false, // replace fullscreen with DFW
    63                                 'tinymce'       => true,  // enable TinyMCE
    64                                 'quicktags'     => true,  // enable quicktags
    65                             );
    66                             wp_editor($row->post_content, 'bbs-content', $settings);
    67                         ?>
    68                         </div>
    69                     <?php
     47                    if($this->_toxonomy->pondol_taxo["dhtml_editor"] == "true"){//use wp_editor
     48                        $this->ctrl->func->bbs_wp_editor($row->post_content, 'bbs-content', $settings);
    7049                    }else{
    71                     ?>
    72                     <textarea name="bbs-content" type="text" class="required" ><?php echo $row->post_content;?></textarea>
    73                     <?php   
     50                        echo '<textarea name="bbs-content" type="text" class="required" >'.$row->post_content.'</textarea>';
    7451                    }
    7552                    ?>
     53                    </div>
    7654                </td>
    7755            </tr>
  • pondol-bbs/trunk/templates/gallery/form_auth.php

    r934213 r946704  
    1 <div style="width:500px; background-color: green;">
    2     Password:<input id="pondolbbs_auth_passwd">
     1<div id="pondolbbs_auth_form" style="width:400px;">
     2    <input type="hidden" id="hidden_auth_type">
     3    <h3>Password:</h3>
    34</br>
    4     Please enter a password when creating posts.
    5    
     5    <input type="password" id="pondolbbs_auth_passwd" style="width:90%;">
     6    </br>
     7    <span style="font-size: 10px;"> * Please enter a password when creating posts.</span>
     8    </br>
     9</br>
     10    <div style="text-align: center;">
     11    <input type="button" class="pondolbbs_btn_getAuth" value="submit">
     12    </div>
    613</div>
  • pondol-bbs/trunk/templates/notice/archive-list.php

    r934821 r946704  
    4646        </thead>
    4747        <tbody>
     48           
     49            <?php
     50                if(is_array($topList)) foreach($topList as $key => $val){
     51            ?>
     52            <tr>
     53                <td><?php _e( 'Notice', 'pondol_bbs' ); ?></td>
     54                <td><a href="javascript:goto_bbs_view('<?php echo $val->guid?>', '<?php echo $val->ID;?>')"><?php echo $val->bbs_title;?></a></td>
     55                <td><?php echo date("Y.m.d", strtotime($val->post_date));?></td>
     56                <td><?php echo number_format($val->COUNT);?></td>
     57            </tr>
     58            <?php } ?>
     59           
    4860            <?php
    4961                if(is_array($rows)) foreach($rows as $key => $val){
  • pondol-bbs/trunk/templates/notice/archive-view.php

    r934213 r946704  
    1111if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
    1212?>
    13 <form id="pondol_bbs_view_form">
    14     <?php echo $this->ctrl->func->generate_input($hidden_args); ?>
    15 </form>
    1613<div id="pondol-bbs-view" <?php echo $table_style;?>>
    1714    <table>
     
    6663        <button name="" type="button" onclick="location.href='?bbstype=reply&bbsid=<?php echo $row->ID;?>'"><?php _e( 'Reply', 'pondol_bbs' ); ?></button>
    6764    </div>
    68 
    69     <!-- password 입력 -->
    70     <div id="pondolbbs_auth_form" style="width:500px; background-color: green; display: none">
    71         <input type="hidden" id="hidden_auth_type">
    72         Password:<input id="pondolbbs_auth_passwd">
    73         </br>
    74         Please enter a password when creating posts.
    75         </br>
    76         <input type="button" class="pondolbbs_btn_getAuth" value="submit">
    77     </div>
    7865<?php comments_template( '', true ); ?>
    7966</div>
  • pondol-bbs/trunk/templates/notice/archive-write.php

    r943236 r946704  
    66 * @author      Pondol
    77 * @package     PondolBBS/Templates
    8  * @version     1.0.0
     8 * @version     1.1.5
    99 */
    1010if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
     
    3333<div id="pondol-bbs-write" <?php echo $table_style;?>>
    3434    <form id="pondol_bbs_form" method="post" data-validate="parsley" enctype="multipart/form-data" action="" novalidate>
    35         <input type="hidden" name="pondol_bbs_submit_form" value="1" />
    36         <input type="hidden" name="bbs-id" value="<?php echo $row->ID;?>" />
    37         <input type="hidden" name="bbs-type" value="<?php echo $_GET["bbstype"];?>" />
    38         <input type="hidden" name="bbs-category" value="<?php echo $this->_toxonomy->term_id;?>" />
     35        <?php echo $this->ctrl->func->generate_input($hidden_args); ?>
    3936        <table>
    4037            <col width="150px">
     
    4643            <tr>
    4744                <td colspan="2">
     45                    <div>
    4846                    <?php
    49                     if($this->_toxonomy->pondol_taxo["dhtml_editor"] == "true"){
    50                     ?> 
    51                    
    52                         <div>
    53                         <?php $settings = array(
    54                                 'wpautop'       => true,  // enable rich text editor
    55                                 'media_buttons' => true,  // enable add media button
    56                                 'textarea_name' => 'bbs-content', // name
    57                                 'textarea_rows' => '10',  // number of textarea rows
    58                                 'tabindex'      => '',    // tabindex
    59                                 'editor_css'    => '',    // extra CSS
    60                                 'editor_class'  => 'pondol-dhtml-textarea', // class
    61                                 'teeny'         => false, // output minimal editor config
    62                                 'dfw'           => false, // replace fullscreen with DFW
    63                                 'tinymce'       => true,  // enable TinyMCE
    64                                 'quicktags'     => true,  // enable quicktags
    65                             );
    66                             wp_editor($row->post_content, 'bbs-content', $settings);
    67                         ?>
    68                         </div>
    69                     <?php
     47                    if($this->_toxonomy->pondol_taxo["dhtml_editor"] == "true"){//use wp_editor
     48                        $this->ctrl->func->bbs_wp_editor($row->post_content, 'bbs-content', $settings);
    7049                    }else{
    71                     ?>
    72                     <textarea name="bbs-content" type="text" class="required" ><?php echo $row->post_content;?></textarea>
    73                     <?php   
     50                        echo '<textarea name="bbs-content" type="text" class="required" >'.$row->post_content.'</textarea>';
    7451                    }
    7552                    ?>
     53                    </div>
    7654                </td>
    7755            </tr>
  • pondol-bbs/trunk/templates/notice/form_auth.php

    r934213 r946704  
    1 <div style="width:500px; background-color: green;">
    2     Password:<input id="pondolbbs_auth_passwd">
     1<div id="pondolbbs_auth_form" style="width:400px;">
     2    <input type="hidden" id="hidden_auth_type">
     3    <h3>Password:</h3>
    34</br>
    4     Please enter a password when creating posts.
    5    
     5    <input type="password" id="pondolbbs_auth_passwd" style="width:90%;">
     6    </br>
     7    <span style="font-size: 10px;"> * Please enter a password when creating posts.</span>
     8    </br>
     9</br>
     10    <div style="text-align: center;">
     11    <input type="button" class="pondolbbs_btn_getAuth" value="submit">
     12    </div>
    613</div>
Note: See TracChangeset for help on using the changeset viewer.