Plugin Directory

Changeset 963607


Ignore:
Timestamp:
08/11/2014 09:07:28 AM (12 years ago)
Author:
pondol
Message:

1.1.8.2

Location:
pondol-bbs/trunk
Files:
15 edited

Legend:

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

    r946704 r963607  
    7070                eval("var obj="+response);
    7171                switch(obj.auth_type){
    72                 case "modify_auth":
     72                case "modify_auth"://when click modify btn, 
    7373                    if(obj.auth == true){
    74                         //console.log(response);
    75                         location.href = '?bbstype=modify&bbsid='+obj.bbs_id;
     74                        //location.href = '?bbstype=modify&bbsid='+obj.bbs_id;
     75                        location.href = './?'+PondolBBSGlobalVar.toxonomy.taxonomy+'='+PondolBBSGlobalVar.toxonomy.name+'&bbstype=modify&bbsid='+obj.bbs_id;
    7676                    }else{
    7777                        var bbsid = $(this).parent().attr("user-attr-bbsid");
     
    8181                    }                   
    8282                    break;
    83                 case "modify_login":
     83                case "modify_login"://when auth form is submitted
    8484                    if(obj.auth == true){
    85                         location.href = '?bbstype=modify&bbsid='+obj.bbs_id;
     85                        location.href = './?'+PondolBBSGlobalVar.toxonomy.taxonomy+'='+PondolBBSGlobalVar.toxonomy.name+'&bbstype=modify&bbsid='+obj.bbs_id;
    8686                    }else{
    8787                        alert("password is incorrect.")
     
    8989                    }                   
    9090                    break;
    91                 case "delete_auth":
     91                case "delete_auth"://when click delete btn.
    9292                    if(obj.auth == true){
    9393                        if(confirm('this will be deleted. are you sure.')){
     
    100100                    } 
    101101                    break;
    102                 case "delete_login":
     102                case "delete_login"://when auth form is submitted
    103103                    if(obj.auth == true){
    104104                        if(confirm('this will be deleted. are you sure.')){
     
    146146                  };
    147147            $.post(PondolBBSAjax.ajaxurl, data, function(response) {
    148                 //console.log(response)
     148                console.log(response)
    149149                eval("var obj="+response);
    150150                location.href = obj.list_link;
  • pondol-bbs/trunk/includes/class.pondol.bbs.php

    r953184 r963607  
    8383                $auth = json_decode(get_transient( "bbs_auth"));
    8484               
    85                 if($auth->auth_type == "modify_auth" &&  $auth->auth == 1 ){
     85                //echo get_transient( "bbs_auth");
     86                if(($auth->auth_type == "modify_auth" || $auth->auth_type == "modify_login") &&  $auth->auth == 1 ){
    8687                   
    8788                    $POST_ID    = $postData["ID"]   = $_POST['bbs-id'];
     
    9899                    $this->update_into_board($arr);
    99100                }else{
    100                     $this->ctrl->func->js_alert(array("cmd"=>"back", "msg"=>__('you have not auth', 'pondol_bbs')));
     101                    $this->ctrl->func->js_alert(array("cmd"=>"back", "msg"=>__('you have not auth of modify', 'pondol_bbs')));
    101102                }
    102103            }else{//save new item or reply
     
    316317        switch($_POST["auth_type"]){
    317318            case "modify_auth"://pre auth check for modify
     319            case "delete_auth"://pre auth check for delete
    318320                $author_info = wp_get_current_user();
    319321                if($author_info->caps["administrator"] == 1){
     
    330332                break;
    331333            case "modify_login"://second auth check for modify
     334            case "delete_login"://second auth check for delete
    332335                $row            = $this->get_bbs_auth_item($_POST["bbs_id"]);
    333336                $user_password  = $row->USER_PASSWD;
     
    343346           
    344347                break;
    345             case "delete_auth"://pre auth check for modify
     348                /*
     349            case "delete_auth"://pre auth check for delete
    346350                $author_info = wp_get_current_user();
    347351                if($author_info->caps["administrator"] == 1){
     
    358362       
    359363                break;
    360             case "delete_login"://second auth check for modify
     364            case "delete_login"://second auth check for delete
    361365                $row        = $this->get_bbs_auth_item($_POST["bbs_id"]);
    362366                $user_id    = $row->USER_ID;
     
    368372           
    369373                break;
     374                 * */
     375                 
    370376            case "secret_auth"://pre auth check for secret item
    371377                $author_info            = wp_get_current_user();
     
    431437   
    432438    public function bbs_delete(){
    433         //global $wpdb; // this is how you get access to the database
    434439        $auth = json_decode(get_transient( "bbs_auth"));
    435         if($auth->auth_type == "delete_auth" &&  $auth->auth == 1 ){
     440        if(($auth->auth_type == "delete_auth" || $auth->auth_type == "delete_login") &&  $auth->auth == 1 ){
    436441            $rtn["list_link"]           = get_transient( "list_link");
    437442            $postData["ID"]             = $_POST["bbs_id"];
     
    439444            wp_update_post($postData);
    440445        }else{
    441             $this->ctrl->func->js_alert(array("cmd"=>"back", "msg"=>__('you have not auth', 'pondol_bbs')));
     446            $this->ctrl->func->js_alert(array("cmd"=>"back", "msg"=>__('you have not auth of delete', 'pondol_bbs')));
    442447        }
    443448        echo json_encode($rtn);
     
    450455        $roles = $author_info->roles[0] ? $author_info->roles[0]:"nologin";
    451456        $toxonomy   =   $this->ctrl->func->get_custom_taxonomy();
     457        //print_r($toxonomy);
    452458        switch($bbstype){
    453459            case "write":
     
    465471       
    466472        if($result == false){
    467             $this->ctrl->func->js_alert(array("cmd"=>"back", "msg"=>__('your access not allowed', 'pondol_bbs')));
     473            $this->ctrl->func->js_alert(array("cmd"=>"back", "msg"=>__('your access not allowed', 'pondol_bbs')."[".$bbstype."]"));
    468474        }
    469475       
  • pondol-bbs/trunk/includes/class.pondol.bbs.templates.php

    r957078 r963607  
    184184            $topList[$key]->bbs_title   = $re_space.$key_img.$val->post_title;
    185185        }
     186       
     187        $btnlink["write"]   = get_site_url()."?".$wp_query->tax_query->queries[0]["taxonomy"]."=".$wp_query->tax_query->queries[0]["terms"][0]."&bbstype=write";
     188       
    186189        //print_r($rows);
    187190       
     
    299302        }
    300303
    301    
     304        //$btnlink["reply"] = get_site_url()."?".$this->_toxonomy->taxonomy."=".$this->_toxonomy->name."&bbstype=reply&bbsid=".$row->ID;
     305        $btnlink["reply"]   = "./?".$this->_toxonomy->taxonomy."=".$this->_toxonomy->name."&bbstype=reply&bbsid=".$row->ID;
     306       
    302307        get_header();
    303308        $hidden_args = array("pondol_bbs_hidden_post_id"=>$post->ID);
  • pondol-bbs/trunk/includes/func.bbs.php

    r957082 r963607  
    55
    66    var $_taxonomy_options;
     7    var $_taxonomy;
    78   
    89    function js_alert($arr){
     
    125126       
    126127        }
     128        $this->_taxonomy    = $term;
    127129        $this->_taxonomy_options = $term->pondol_taxo;
    128130        return $term;
     
    199201       
    200202        wp_enqueue_script( 'pondolbbs-global-var', plugins_url('../assets/js/dummy_globalvar.js', __FILE__ ), false, '1.1.0', true);
     203        /*
    201204        wp_localize_script( 'pondolbbs-global-var', 'PondolBBSGlobalVar', array(
    202205            'PONDOL_BBS_URL' => PONDOL_BBS_URL,
    203206            'toxonomy'      => $arg
    204207        ));
     208        */
     209        wp_localize_script( 'pondolbbs-global-var', 'PondolBBSGlobalVar', array(
     210            'PONDOL_BBS_URL' => PONDOL_BBS_URL,
     211            'toxonomy'      => $this->_taxonomy
     212        ));
     213       
    205214    }
    206215   
  • pondol-bbs/trunk/readme.txt

    r954658 r963607  
    4747
    4848== Changelog ==
     49= 1.1.8.2 =
     50When Permalink Settings is Default, error occur
    4951= 1.1.8.1 =
    5052adjusting templates widget
  • pondol-bbs/trunk/templates/default/archive-list.php

    r948524 r963607  
    9393?>
    9494    <div class="button_group">
    95         <button name="" type="button" onclick="location.href='<?php echo get_site_url();?>/<?php echo $wp_query->tax_query->queries[0]["taxonomy"];?>/<?php echo $wp_query->tax_query->queries[0]["terms"][0];?>?bbstype=write'"><?php _e( 'Write', 'pondol_bbs' ); ?></button>
     95        <button name="" type="button" onclick="location.href='<?php echo $btnlink["write"];?>'"><?php _e( 'Write', 'pondol_bbs' ); ?></button>
    9696    </div>
  • pondol-bbs/trunk/templates/default/archive-view.php

    r953184 r963607  
    6969        <button name="" type="button" class="pondolbbs_btn_modify"><?php _e( 'Modify', 'pondol_bbs' ); ?></button>
    7070        <button name="" type="button" class="pondolbbs_btn_delete"><?php _e( 'Delete', 'pondol_bbs' ); ?></button>
    71         <button name="" type="button" onclick="location.href='?bbstype=reply&bbsid=<?php echo $row->ID;?>'"><?php _e( 'Reply', 'pondol_bbs' ); ?></button>
     71        <button name="" type="button" onclick="location.href='<?php echo $btnlink["reply"];?>'"><?php _e( 'Reply', 'pondol_bbs' ); ?></button>
    7272    </div>
    7373
  • pondol-bbs/trunk/templates/gallery/archive-list.php

    r950150 r963607  
    5858?>
    5959    <div class="button_group">
    60         <button name="" type="button" onclick="location.href='<?php echo get_site_url();?>/<?php echo $wp_query->tax_query->queries[0]["taxonomy"];?>/<?php echo $wp_query->tax_query->queries[0]["terms"][0];?>?bbstype=write'"><?php _e( 'Write', 'pondol_bbs' ); ?></button>
     60        <button name="" type="button" onclick="location.href='<?php echo $btnlink["write"];?>'"><?php _e( 'Write', 'pondol_bbs' ); ?></button>
    6161    </div>
  • pondol-bbs/trunk/templates/gallery/archive-view.php

    r948524 r963607  
    4848        <button name="" type="button" class="pondolbbs_btn_modify"><?php _e( 'Modify', 'pondol_bbs' ); ?></button>
    4949        <button name="" type="button" class="pondolbbs_btn_delete"><?php _e( 'Delete', 'pondol_bbs' ); ?></button>
    50         <button name="" type="button" onclick="location.href='?bbstype=reply&bbsid=<?php echo $row->ID;?>'"><?php _e( 'Reply', 'pondol_bbs' ); ?></button>
     50        <button name="" type="button" onclick="location.href='<?php echo $btnlink["reply"];?>'"><?php _e( 'Reply', 'pondol_bbs' ); ?></button>
    5151    </div>
  • pondol-bbs/trunk/templates/newtype/archive-list.php

    r953184 r963607  
    9696        </div>
    9797        <div class="buttonRight">
    98             <button name="" type="button" onclick="location.href='<?php echo get_site_url();?>/<?php echo $wp_query->tax_query->queries[0]["taxonomy"];?>/<?php echo $wp_query->tax_query->queries[0]["terms"][0];?>?bbstype=write'"><?php _e( 'Write', 'pondol_bbs' ); ?></button>
     98            <button name="" type="button" onclick="location.href='<?php echo $btnlink["write"];?>'"><?php _e( 'Write', 'pondol_bbs' ); ?></button>
    9999        </div>
    100100        <div class="pagination a2">
  • pondol-bbs/trunk/templates/newtype/archive-view.php

    r948524 r963607  
    6565        <button name="" type="button" class="pondolbbs_btn_modify"><?php _e( 'Modify', 'pondol_bbs' ); ?></button>
    6666        <button name="" type="button" class="pondolbbs_btn_delete"><?php _e( 'Delete', 'pondol_bbs' ); ?></button>
    67         <button name="" type="button" onclick="location.href='?bbstype=reply&bbsid=<?php echo $row->ID;?>'"><?php _e( 'Reply', 'pondol_bbs' ); ?></button>
     67        <button name="" type="button" onclick="location.href='<?php echo $btnlink["reply"];?>'"><?php _e( 'Reply', 'pondol_bbs' ); ?></button>
    6868    </div>
  • pondol-bbs/trunk/templates/notice/archive-list.php

    r948524 r963607  
    8888?>
    8989    <div class="button_group">
    90         <button name="" type="button" onclick="location.href='<?php echo get_site_url();?>/<?php echo $wp_query->tax_query->queries[0]["taxonomy"];?>/<?php echo $wp_query->tax_query->queries[0]["terms"][0];?>?bbstype=write'"><?php _e( 'Write', 'pondol_bbs' ); ?></button>
     90        <button name="" type="button" onclick="location.href='<?php echo $btnlink["write"];?>'"><?php _e( 'Write', 'pondol_bbs' ); ?></button>
    9191    </div>
  • pondol-bbs/trunk/templates/notice/archive-view.php

    r948524 r963607  
    6060        <button name="" type="button" class="pondolbbs_btn_modify"><?php _e( 'Modify', 'pondol_bbs' ); ?></button>
    6161        <button name="" type="button" class="pondolbbs_btn_delete"><?php _e( 'Delete', 'pondol_bbs' ); ?></button>
    62         <button name="" type="button" onclick="location.href='?bbstype=reply&bbsid=<?php echo $row->ID;?>'"><?php _e( 'Reply', 'pondol_bbs' ); ?></button>
     62        <button name="" type="button" onclick="location.href='<?php echo $btnlink["reply"];?>'"><?php _e( 'Reply', 'pondol_bbs' ); ?></button>
    6363    </div>
  • pondol-bbs/trunk/templates/sample/archive-list.php

    r953184 r963607  
    9292        </div>
    9393        <div class="buttonRight">
    94             <button name="" type="button" onclick="location.href='<?php echo get_site_url();?>/<?php echo $wp_query->tax_query->queries[0]["taxonomy"];?>/<?php echo $wp_query->tax_query->queries[0]["terms"][0];?>?bbstype=write'"><?php _e( 'Write', 'pondol_bbs' ); ?></button>
     94            <button name="" type="button" onclick="location.href='<?php echo $btnlink["write"];?>'"><?php _e( 'Write', 'pondol_bbs' ); ?></button>
    9595        </div>
    9696        <div class="pagination a2">
  • pondol-bbs/trunk/templates/sample/archive-view.php

    r953184 r963607  
    9797    <button type="button" class="pondolbbs_btn_modify"><?php _e( 'Modify', 'pondol_bbs' ); ?></button>
    9898    <button type="button" class="pondolbbs_btn_delete"><?php _e( 'Delete', 'pondol_bbs' ); ?></button>
    99     <button type="button" onclick="location.href='?bbstype=reply&bbsid=<?php echo $row->ID;?>'"><?php _e( 'Reply', 'pondol_bbs' ); ?></button>
     99    <button type="button" onclick="location.href='<?php echo $btnlink["reply"];?>'"><?php _e( 'Reply', 'pondol_bbs' ); ?></button>
    100100</div>
Note: See TracChangeset for help on using the changeset viewer.