Changeset 963607
- Timestamp:
- 08/11/2014 09:07:28 AM (12 years ago)
- Location:
- pondol-bbs/trunk
- Files:
-
- 15 edited
-
assets/js/pondol-bbs.js (modified) (5 diffs)
-
includes/class.pondol.bbs.php (modified) (11 diffs)
-
includes/class.pondol.bbs.templates.php (modified) (2 diffs)
-
includes/func.bbs.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
-
templates/default/archive-list.php (modified) (1 diff)
-
templates/default/archive-view.php (modified) (1 diff)
-
templates/gallery/archive-list.php (modified) (1 diff)
-
templates/gallery/archive-view.php (modified) (1 diff)
-
templates/newtype/archive-list.php (modified) (1 diff)
-
templates/newtype/archive-view.php (modified) (1 diff)
-
templates/notice/archive-list.php (modified) (1 diff)
-
templates/notice/archive-view.php (modified) (1 diff)
-
templates/sample/archive-list.php (modified) (1 diff)
-
templates/sample/archive-view.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
pondol-bbs/trunk/assets/js/pondol-bbs.js
r946704 r963607 70 70 eval("var obj="+response); 71 71 switch(obj.auth_type){ 72 case "modify_auth": 72 case "modify_auth"://when click modify btn, 73 73 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; 76 76 }else{ 77 77 var bbsid = $(this).parent().attr("user-attr-bbsid"); … … 81 81 } 82 82 break; 83 case "modify_login": 83 case "modify_login"://when auth form is submitted 84 84 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; 86 86 }else{ 87 87 alert("password is incorrect.") … … 89 89 } 90 90 break; 91 case "delete_auth": 91 case "delete_auth"://when click delete btn. 92 92 if(obj.auth == true){ 93 93 if(confirm('this will be deleted. are you sure.')){ … … 100 100 } 101 101 break; 102 case "delete_login": 102 case "delete_login"://when auth form is submitted 103 103 if(obj.auth == true){ 104 104 if(confirm('this will be deleted. are you sure.')){ … … 146 146 }; 147 147 $.post(PondolBBSAjax.ajaxurl, data, function(response) { 148 //console.log(response)148 console.log(response) 149 149 eval("var obj="+response); 150 150 location.href = obj.list_link; -
pondol-bbs/trunk/includes/class.pondol.bbs.php
r953184 r963607 83 83 $auth = json_decode(get_transient( "bbs_auth")); 84 84 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 ){ 86 87 87 88 $POST_ID = $postData["ID"] = $_POST['bbs-id']; … … 98 99 $this->update_into_board($arr); 99 100 }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'))); 101 102 } 102 103 }else{//save new item or reply … … 316 317 switch($_POST["auth_type"]){ 317 318 case "modify_auth"://pre auth check for modify 319 case "delete_auth"://pre auth check for delete 318 320 $author_info = wp_get_current_user(); 319 321 if($author_info->caps["administrator"] == 1){ … … 330 332 break; 331 333 case "modify_login"://second auth check for modify 334 case "delete_login"://second auth check for delete 332 335 $row = $this->get_bbs_auth_item($_POST["bbs_id"]); 333 336 $user_password = $row->USER_PASSWD; … … 343 346 344 347 break; 345 case "delete_auth"://pre auth check for modify 348 /* 349 case "delete_auth"://pre auth check for delete 346 350 $author_info = wp_get_current_user(); 347 351 if($author_info->caps["administrator"] == 1){ … … 358 362 359 363 break; 360 case "delete_login"://second auth check for modify364 case "delete_login"://second auth check for delete 361 365 $row = $this->get_bbs_auth_item($_POST["bbs_id"]); 362 366 $user_id = $row->USER_ID; … … 368 372 369 373 break; 374 * */ 375 370 376 case "secret_auth"://pre auth check for secret item 371 377 $author_info = wp_get_current_user(); … … 431 437 432 438 public function bbs_delete(){ 433 //global $wpdb; // this is how you get access to the database434 439 $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 ){ 436 441 $rtn["list_link"] = get_transient( "list_link"); 437 442 $postData["ID"] = $_POST["bbs_id"]; … … 439 444 wp_update_post($postData); 440 445 }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'))); 442 447 } 443 448 echo json_encode($rtn); … … 450 455 $roles = $author_info->roles[0] ? $author_info->roles[0]:"nologin"; 451 456 $toxonomy = $this->ctrl->func->get_custom_taxonomy(); 457 //print_r($toxonomy); 452 458 switch($bbstype){ 453 459 case "write": … … 465 471 466 472 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."]")); 468 474 } 469 475 -
pondol-bbs/trunk/includes/class.pondol.bbs.templates.php
r957078 r963607 184 184 $topList[$key]->bbs_title = $re_space.$key_img.$val->post_title; 185 185 } 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 186 189 //print_r($rows); 187 190 … … 299 302 } 300 303 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 302 307 get_header(); 303 308 $hidden_args = array("pondol_bbs_hidden_post_id"=>$post->ID); -
pondol-bbs/trunk/includes/func.bbs.php
r957082 r963607 5 5 6 6 var $_taxonomy_options; 7 var $_taxonomy; 7 8 8 9 function js_alert($arr){ … … 125 126 126 127 } 128 $this->_taxonomy = $term; 127 129 $this->_taxonomy_options = $term->pondol_taxo; 128 130 return $term; … … 199 201 200 202 wp_enqueue_script( 'pondolbbs-global-var', plugins_url('../assets/js/dummy_globalvar.js', __FILE__ ), false, '1.1.0', true); 203 /* 201 204 wp_localize_script( 'pondolbbs-global-var', 'PondolBBSGlobalVar', array( 202 205 'PONDOL_BBS_URL' => PONDOL_BBS_URL, 203 206 'toxonomy' => $arg 204 207 )); 208 */ 209 wp_localize_script( 'pondolbbs-global-var', 'PondolBBSGlobalVar', array( 210 'PONDOL_BBS_URL' => PONDOL_BBS_URL, 211 'toxonomy' => $this->_taxonomy 212 )); 213 205 214 } 206 215 -
pondol-bbs/trunk/readme.txt
r954658 r963607 47 47 48 48 == Changelog == 49 = 1.1.8.2 = 50 When Permalink Settings is Default, error occur 49 51 = 1.1.8.1 = 50 52 adjusting templates widget -
pondol-bbs/trunk/templates/default/archive-list.php
r948524 r963607 93 93 ?> 94 94 <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> 96 96 </div> -
pondol-bbs/trunk/templates/default/archive-view.php
r953184 r963607 69 69 <button name="" type="button" class="pondolbbs_btn_modify"><?php _e( 'Modify', 'pondol_bbs' ); ?></button> 70 70 <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> 72 72 </div> 73 73 -
pondol-bbs/trunk/templates/gallery/archive-list.php
r950150 r963607 58 58 ?> 59 59 <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> 61 61 </div> -
pondol-bbs/trunk/templates/gallery/archive-view.php
r948524 r963607 48 48 <button name="" type="button" class="pondolbbs_btn_modify"><?php _e( 'Modify', 'pondol_bbs' ); ?></button> 49 49 <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> 51 51 </div> -
pondol-bbs/trunk/templates/newtype/archive-list.php
r953184 r963607 96 96 </div> 97 97 <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> 99 99 </div> 100 100 <div class="pagination a2"> -
pondol-bbs/trunk/templates/newtype/archive-view.php
r948524 r963607 65 65 <button name="" type="button" class="pondolbbs_btn_modify"><?php _e( 'Modify', 'pondol_bbs' ); ?></button> 66 66 <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> 68 68 </div> -
pondol-bbs/trunk/templates/notice/archive-list.php
r948524 r963607 88 88 ?> 89 89 <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> 91 91 </div> -
pondol-bbs/trunk/templates/notice/archive-view.php
r948524 r963607 60 60 <button name="" type="button" class="pondolbbs_btn_modify"><?php _e( 'Modify', 'pondol_bbs' ); ?></button> 61 61 <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> 63 63 </div> -
pondol-bbs/trunk/templates/sample/archive-list.php
r953184 r963607 92 92 </div> 93 93 <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> 95 95 </div> 96 96 <div class="pagination a2"> -
pondol-bbs/trunk/templates/sample/archive-view.php
r953184 r963607 97 97 <button type="button" class="pondolbbs_btn_modify"><?php _e( 'Modify', 'pondol_bbs' ); ?></button> 98 98 <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> 100 100 </div>
Note: See TracChangeset
for help on using the changeset viewer.