Changeset 946704
- Timestamp:
- 07/11/2014 05:21:48 AM (12 years ago)
- Location:
- pondol-bbs/trunk
- Files:
-
- 9 added
- 21 edited
-
assets/images/icons (added)
-
assets/images/icons/key.gif (added)
-
assets/js/dummy_globalvar.js (added)
-
assets/js/jquery.popup (added)
-
assets/js/jquery.popup/css (added)
-
assets/js/jquery.popup/css/popup.css (added)
-
assets/js/jquery.popup/images (added)
-
assets/js/jquery.popup/images/popup_buttons.gif (added)
-
assets/js/jquery.popup/jquery.popup.js (added)
-
assets/js/pondol-bbs.js (modified) (8 diffs)
-
includes/class.pondol.bbs.admin.php (modified) (1 diff)
-
includes/class.pondol.bbs.controller.php (modified) (1 diff)
-
includes/class.pondol.bbs.model.php (modified) (3 diffs)
-
includes/class.pondol.bbs.php (modified) (18 diffs)
-
includes/class.pondol.bbs.templates.php (modified) (12 diffs)
-
includes/func.bbs.php (modified) (2 diffs)
-
pages/admin.taxonomy.edit.php (modified) (1 diff)
-
pondolbbs.php (modified) (5 diffs)
-
readme.txt (modified) (3 diffs)
-
templates/default/archive-list.php (modified) (2 diffs)
-
templates/default/archive-view.php (modified) (2 diffs)
-
templates/default/archive-write.php (modified) (3 diffs)
-
templates/default/form_auth.php (modified) (1 diff)
-
templates/gallery/archive-view.php (modified) (2 diffs)
-
templates/gallery/archive-write.php (modified) (3 diffs)
-
templates/gallery/form_auth.php (modified) (1 diff)
-
templates/notice/archive-list.php (modified) (1 diff)
-
templates/notice/archive-view.php (modified) (2 diffs)
-
templates/notice/archive-write.php (modified) (3 diffs)
-
templates/notice/form_auth.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
pondol-bbs/trunk/assets/js/pondol-bbs.js
r934030 r946704 2 2 * Copyright 2014 pondol All Rights Reserved 3 3 * Website: http://www.shop-wiz.com 4 * Version 1.0 4 * Version 1.0.1 5 * 5 6 */ 6 7 (function ($) { 8 9 _target_url = ""; 10 7 11 $(document).ready(function () { 12 //modify btn where view page 8 13 $(".pondolbbs_btn_modify").click(function(e){ 9 14 e.preventDefault(); 10 $("#hidden_auth_type").val("modify_login");11 15 var data = { 12 16 action: 'pondol_bbs_auth_check', … … 15 19 bbs_id: $("#pondol_bbs_hidden_post_id").val() 16 20 }; 17 //check if current user have autho to modify or not18 21 get_auth(data); 19 22 20 23 }); 21 24 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 36 26 $(".pondolbbs_btn_delete").click(function(e){ 37 27 e.preventDefault(); 38 $("#hidden_auth_type").val("delete_login");39 28 var data = { 40 29 action: 'pondol_bbs_auth_check', … … 46 35 get_auth(data); 47 36 }); 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); 48 64 65 }); 49 66 50 67 var get_auth = function(data){ … … 55 72 case "modify_auth": 56 73 if(obj.auth == true){ 57 console.log(response);74 //console.log(response); 58 75 location.href = '?bbstype=modify&bbsid='+obj.bbs_id; 59 76 }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(); 62 81 } 63 82 break; … … 67 86 }else{ 68 87 alert("password is incorrect.") 69 $(" #pondolbbs_auth_form").hide();88 $(".dynamicPop").remove(); 70 89 } 71 90 break; … … 77 96 }else{ 78 97 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"}); 80 100 } 81 101 break; … … 87 107 }else{ 88 108 alert("password is incorrect.") 89 $(" #pondolbbs_auth_form").hide();109 $(".dynamicPop").remove(); 90 110 } 91 111 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; 92 131 } 132 93 133 //alert('Got this from the server: ' + response); 94 134 }); 135 } 136 137 setAuthType = function(auth_type){ 138 $("#hidden_auth_type").val(auth_type); 95 139 } 96 140 … … 102 146 }; 103 147 $.post(PondolBBSAjax.ajaxurl, data, function(response) { 104 console.log(response)148 //console.log(response) 105 149 eval("var obj="+response); 106 150 location.href = obj.list_link; 107 151 }); 108 152 } 153 154 155 109 156 }) 157 158 110 159 })(jQuery); -
pondol-bbs/trunk/includes/class.pondol.bbs.admin.php
r945283 r946704 19 19 //save bbs post at back_end 20 20 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);25 21 wp_enqueue_script( 'pondolbbs-admin-script', plugins_url('../assets/js/admin.pondol.bbs.js', __FILE__ ), false, '1.0.0', true); 26 22 } 27 /*28 function pondol_bbs_add_post_meta_boxes() {29 add_meta_box(30 'pondol_bbs_image_box', // Unique ID31 esc_html__( 'Gallery Image', 'pondol_bbs' ), // Title32 array( $this, 'pondol_bbs_image_meta_box'), // Callback function33 PONDOL_BBS, // Admin page (or post type)34 'side', // Context35 'default' // Priority36 );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 */55 23 56 24 function pondol_bbs_taxonomy_add_new_meta_field() { -
pondol-bbs/trunk/includes/class.pondol.bbs.controller.php
r945283 r946704 71 71 function create_db_table(){ 72 72 $this->model->create_db_table("board");//create main board table 73 //$this->model->create_db_table("reply");//create replytable73 $this->model->update_table("board");//create main board table 74 74 } 75 75 -
pondol-bbs/trunk/includes/class.pondol.bbs.model.php
r934030 r946704 13 13 global $wpdb; 14 14 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; 18 18 case "board": 19 19 return $wpdb->prefix . "pondol_bbs"; 20 20 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; 24 24 } 25 25 … … 38 38 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 39 39 40 //echo $flag;41 //exit;42 40 switch($flag){ 43 41 case "board": … … 60 58 return; 61 59 } 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 } 62 73 } -
pondol-bbs/trunk/includes/class.pondol.bbs.php
r944228 r946704 14 14 global $wpdb, $wp_query, $current_user; 15 15 16 //echo "bbs_save start..";17 16 if (isset($_POST['pondol_bbs_submit_form']) && !empty($_POST['pondol_bbs_submit_form'])) { 18 17 ## TITLE … … 56 55 $fileData = ''; 57 56 } 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 59 68 ## AUTHORIP 60 69 if (isset($_SERVER['REMOTE_ADDR'])) $authorIp = stripslashes(trim($_SERVER['REMOTE_ADDR'])); … … 68 77 69 78 70 if($_POST['bbs-id'] && $_POST['bbs-type'] == "modify"){//update 79 if($_POST['bbs-id'] && $_POST['bbs-type'] == "modify"){//update current item 71 80 //check user auth 72 81 $this->ctrl->bbs->has_access_auth("modify"); … … 76 85 77 86 $POST_ID = $postData["ID"] = $_POST['bbs-id']; 87 78 88 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); 79 98 }else{ 80 99 $this->ctrl->func->js_alert(array("cmd"=>"back", "msg"=>__('you have not auth', 'pondol_bbs'))); 81 100 } 82 }else{ 101 }else{//save new item or reply 83 102 84 103 $bbs_name = $_POST['bbs-name']?$_POST['bbs-name']:$current_user->display_name; … … 111 130 $arr = array( 112 131 "POST_ID" => $POST_ID, 132 "NOTICE" => $notice_flag, 113 133 "THREAD" => $FUTURE_THREAD, 114 134 "FID" => $CURRENT_FID, 115 135 "USER_ID" => $current_user->user_login, 116 136 "USER_NAME" => $bbs_name, 137 "OP_FIELD" => $OP_FIELD, 117 138 "USER_PASSWD" => md5($_POST['bbs-password']), 118 139 "COUNT" => 0 … … 127 148 $arr = array( 128 149 "POST_ID" => $POST_ID, 150 "NOTICE" => $notice_flag, 129 151 "THREAD" => "A", 130 152 "FID" => $POST_ID, 131 153 "USER_ID" => $current_user->user_login, 132 154 "USER_NAME" => $bbs_name, 155 "OP_FIELD" => $OP_FIELD, 133 156 "USER_PASSWD" => md5($_POST['bbs-password']), 134 157 "COUNT" => 0 … … 165 188 166 189 if ($fileData !== '') { 167 //print_r($fileData);168 //echo count($fileData['name']);169 //exit;170 190 $thumImage = true;//as image is attached, the first image set to thumimages 171 191 for ($i = 0; $i < count($fileData['name']); $i++) { 172 192 $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; 177 194 178 195 $_FILES[$key] = array(); … … 194 211 add_post_meta($POST_ID, PONDOL_BBS_IMAGES, wp_get_attachment_url($attachmentId)); 195 212 } 196 197 198 199 200 201 213 $imageCounter++; 202 214 } else { 203 215 wp_delete_attachment($attachmentId); 204 216 } 205 206 217 } 207 218 update_post_meta($POST_ID, "is_submission", true); … … 217 228 public function insert_into_board($arr){ 218 229 global $wpdb; 219 230 //"OP_FIELD" => $OP_FIELD, 220 231 return $wpdb->query( $wpdb->prepare( 221 232 " 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) 224 238 ", 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"] 226 240 ) ); 227 241 }//end of insert_into_board … … 233 247 UPDATE ".$this->ctrl->model->get_table_name("board")." 234 248 SET 235 POST_ID = %d,236 THREAD = %s237 USER_NAME= %s249 NOTICE = %d, 250 USER_NAME = %s, 251 OP_FIELD = %s 238 252 WHERE 239 253 POST_ID = %d 240 254 ", 241 $arr[" POST_ID"], $arr["THREAD"], $arr["USER_NAME"], $arr["POST_ID"]255 $arr["NOTICE"], $arr["USER_NAME"], $arr["OP_FIELD"], $arr["POST_ID"] 242 256 ) ); 243 257 }//end of update_into_board 244 258 259 //update bbs meta as item is saved from back-end 245 260 public function update_bbs_meta($post_id){ 246 261 global $wpdb, $current_user; 247 262 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 249 278 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); 251 282 return $this->insert_into_board($arr); 252 283 } 253 284 } 254 255 285 return; 256 286 } 257 287 258 //update view count 288 //update view count when someone read this 259 289 public function update_view_count($post_id){ 260 290 global $wpdb; … … 273 303 //as click modify btn at viewform, check if have auth or not 274 304 public function bbs_auth_check(){ 275 global $wpdb; // this is how you get access to the database305 //global $wpdb; // this is how you get access to the database 276 306 check_ajax_referer( 'my-special-string', 'security' ); 277 307 … … 281 311 $author_info = wp_get_current_user(); 282 312 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){ 287 317 $rtn["auth"] = true; 288 318 }else{ … … 293 323 break; 294 324 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']); 298 330 299 331 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; 303 335 } 304 336 … … 307 339 $author_info = wp_get_current_user(); 308 340 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){ 313 346 $rtn["auth"] = true; 314 347 }else{ … … 319 352 break; 320 353 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 332 402 $rtn["auth_type"] = $_POST["auth_type"]; 333 403 $rtn["bbs_id"] = $_POST["bbs_id"]; … … 337 407 338 408 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; 339 423 } 340 424 … … 355 439 } 356 440 357 358 441 public function has_access_auth($bbstype){ 359 442 $author_info = wp_get_current_user(); 360 443 $roles = $author_info->roles[0] ? $author_info->roles[0]:"nologin"; 361 444 $toxonomy = $this->ctrl->func->get_custom_taxonomy(); 362 //echo "bbstype:", $bbstype, "</br>";363 //print_r($toxonomy);364 //exit;365 445 switch($bbstype){ 366 446 case "write": … … 382 462 383 463 return $result; 384 //print_r($toxonomy);385 386 /*387 * bbs_type:stdClass Object388 (389 [term_id] => 67390 [name] => board391 [slug] => %ec%9e%90%ec%9c%a0%ea%b2%8c%ec%8b%9c%ed%8c%90392 [term_group] => 0393 [term_taxonomy_id] => 68394 [taxonomy] => board395 [description] => 자유게시판 입니다.396 [parent] => 0397 [count] => 35398 [filter] => raw399 [pondol_taxo] => Array400 (401 [skin] => default402 [access_write] => Array403 (404 [0] => administrator405 [1] => editor406 [2] => author407 )408 409 [access_read] => Array410 (411 [0] => administrator412 [1] => editor413 [2] => author414 [3] => contributor415 [4] => subscriber416 [5] => customer417 [6] => shop_manager418 )419 420 [access_list] => Array421 (422 [0] => administrator423 [1] => editor424 [2] => author425 )426 427 )428 429 )430 */431 464 } 432 465 -
pondol-bbs/trunk/includes/class.pondol.bbs.templates.php
r945283 r946704 27 27 $this->_toxonomy = $this->ctrl->func->get_custom_taxonomy(); 28 28 //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 29 33 wp_enqueue_style( 'pondol-bbs-default-style1', plugins_url('../assets/css/'.$this->_toxonomy->pondol_taxo["skin"].'/pondol-bbs.css', __FILE__ )); 30 34 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 32 39 33 40 switch($bbstype){ … … 57 64 global $wpdb, $wp_query; 58 65 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);62 66 $table_style = $this->ctrl->func->get_tmpl_table_style($this->_toxonomy->pondol_taxo);//get table style; 63 67 … … 93 97 ); 94 98 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 ); 97 101 98 102 $page_links = paginate_links( array( … … 104 108 'current' => $pagenum 105 109 ) ); 106 110 111 //main list 107 112 $rows = $wpdb->get_results(" 108 113 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 110 115 from 111 116 ".$this->ctrl->model->get_table_name("board")." b … … 124 129 limit 125 130 ".$offset.", ".$limit 126 127 131 ); 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 .=" "; 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 .=" "; 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); 130 184 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 131 191 @include_once PONDOL_BBS_PATH.'templates/'.$this->_toxonomy->pondol_taxo["skin"].'/archive-list.php'; 132 192 $this->ctrl->func->copyright(); … … 142 202 143 203 if($_GET["bbstype"] == "modify"){ 144 145 146 204 $row = $wpdb->get_row(" 147 205 select 148 p.*, b.USER_NAME 206 p.*, b.USER_NAME, b.OP_FIELD 149 207 from 150 208 ".$this->ctrl->model->get_table_name("board")." b … … 156 214 b.POST_ID = ".$post->ID." 157 215 "); 216 217 $op_field = unserialize($row->OP_FIELD); 158 218 159 219 }elseif($_GET["bbstype"] == "reply"){ 160 220 $row = $wpdb->get_row(" 161 221 select 162 p.ID, p.post_content, p.post_title 222 p.ID, p.post_content, p.post_title, b.OP_FIELD 163 223 from 164 224 ".$this->ctrl->model->get_table_name("board")." b … … 170 230 b.POST_ID = ".$post->ID." 171 231 "); 172 232 $op_field = unserialize($row->OP_FIELD);//need to get some parent's option like secret 173 233 $row->post_title = "Re: ".$row->post_title; 174 234 $row->post_content = nl2br("\n\r\n\r\n\r\n\r\n\r ------------ [Original Message] ------------ \r\n>>".str_replace("\n","\n>>",$row->post_content)); … … 179 239 180 240 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); 181 243 @include_once PONDOL_BBS_PATH.'templates/'.$this->_toxonomy->pondol_taxo["skin"].'/archive-write.php'; 182 244 $this->ctrl->func->copyright(); … … 188 250 public function template_view(){ 189 251 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 ); 195 257 196 258 $this->ctrl->bbs->update_view_count($post->ID); … … 201 263 $row = $wpdb->get_row(" 202 264 select 203 p.*, b.USER_NAME 265 p.*, b.USER_NAME, b.OP_FIELD, b.FID 204 266 from 205 267 ".$this->ctrl->model->get_table_name("board")." b … … 212 274 "); 213 275 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 214 295 $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 216 300 @include_once PONDOL_BBS_PATH.'templates/'.$this->_toxonomy->pondol_taxo["skin"].'/archive-view.php'; 217 301 $this->ctrl->func->copyright(); -
pondol-bbs/trunk/includes/func.bbs.php
r945283 r946704 130 130 131 131 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 146 133 147 134 function generate_input($args){ … … 195 182 } 196 183 } 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 197 276 } -
pondol-bbs/trunk/pages/admin.taxonomy.edit.php
r943236 r946704 8 8 </script> 9 9 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 -->17 10 <table class="form-table"> 18 11 <tbody> -
pondol-bbs/trunk/pondolbbs.php
r945283 r946704 5 5 Description: General BBS Program 6 6 Author: Pondol 7 Version: 1.1. 47 Version: 1.1.5 8 8 Author URI: http://www.shop-wiz.com/wp/plugins/pondol_bbs 9 9 License: GPL2 … … 21 21 define('PONDOL_URL', 'http://www.shop-wiz.com'); 22 22 define('PONDOL_EMAIL', '[email protected]'); 23 define('PONDOL_BBS_VERSION', '1.1. 4');23 define('PONDOL_BBS_VERSION', '1.1.5'); 24 24 define('PONDOL_BBS', 'bbs'); 25 25 define('PONDOL_BBS_TAXO', 'board'); … … 41 41 $this->ctrl = new Pondol_BBS_Controller(); 42 42 43 44 43 add_action( 'init', array($this->ctrl, 'register_bbs_posttype')); 45 44 add_action( 'init', array($this->ctrl, 'register_bbs_taxonomies')); 46 45 47 add_action( 'plugins_loaded', array($this->ctrl, 'create_db_table') );46 add_action( 'plugins_loaded', array($this->ctrl, 'create_db_table')); 48 47 add_action( 'plugins_loaded', array($this, 'pondol_bbs_i18n_init')); 49 48 50 //save bbs post at back_end51 //add_action('save_post', array($this->ctrl->bbs, 'update_bbs_meta'), 20, 1);//actually open new post52 53 //save bbs post at front_end54 49 add_action ('parse_request', array($this->ctrl->bbs, 'bbs_save')); 55 50 … … 57 52 { 58 53 add_action("admin_init", array($this->ctrl->admin, 'admin_init')); 59 60 61 54 } else {//! is_admin() 62 63 55 add_filter( 'template_include', array( $this->ctrl, 'bbs_templates' ), '99'); 64 56 } … … 69 61 add_action( 'wp_ajax_nopriv_pondol_bbs_delete', array( $this->ctrl->bbs, 'bbs_delete' ));//not login 70 62 add_action( 'wp_ajax_pondol_bbs_delete', array( $this->ctrl->bbs, 'bbs_delete' ));//login 71 63 72 64 } 73 65 -
pondol-bbs/trunk/readme.txt
r945283 r946704 3 3 Tags: bbs,board,pondol,notice,imagegallery 4 4 Requires at least: 3.0 5 Tested up to: 3. 8.15 Tested up to: 3.9 6 6 Stable tag: 1.1.3 7 7 License: GPLv2 or later … … 12 12 == Description == 13 13 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 14 This is general bbs(board) plugin. 15 skin selected(you can make skin and add to Pondol BBS). 16 adjust accessing bbs(board) by user level. 17 attache files and download it. 18 search enable. 19 adjust table width and alignment. 20 adjust items listing number. 21 important notice can be shown at top of lists(this option will be shown only to administrator). 22 secret item enable (fuctionally if you set this option, that item will be read by administartor, item owner only). 23 21 24 22 25 = Translation = … … 35 38 36 39 == Changelog == 40 = 1.1.5 = 41 debuggin prohibit a nologinuser could access items what ohter nobody users wrote 42 add OP_FIELD to pondol_bbs table 43 add secret content 44 37 45 = 1.1.4 = 38 46 add widget -
pondol-bbs/trunk/templates/default/archive-list.php
r934821 r946704 6 6 * @author Pondol 7 7 * @package PondolBBS/Templates 8 * @version 1. 0.08 * @version 1.1.5 9 9 */ 10 10 … … 50 50 </thead> 51 51 <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 } ?> 52 64 <?php 53 65 if(is_array($rows)) foreach($rows as $key => $val){ 54 55 56 66 ?> 57 67 <tr> 58 68 <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> 60 70 <td><?php echo $val->USER_NAME;?></td> 61 71 <td><?php echo date("Y.m.d", strtotime($val->post_date));?></td> -
pondol-bbs/trunk/templates/default/archive-view.php
r934213 r946704 11 11 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 12 12 ?> 13 <form id="pondol_bbs_view_form">14 <?php echo $this->ctrl->func->generate_input($hidden_args); ?>15 </form>16 13 <div id="pondol-bbs-view" <?php echo $table_style;?>> 17 14 <table> … … 75 72 </div> 76 73 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>86 74 <?php comments_template( '', true ); ?> 87 75 </div> -
pondol-bbs/trunk/templates/default/archive-write.php
r943236 r946704 6 6 * @author Pondol 7 7 * @package PondolBBS/Templates 8 * @version 1. 0.08 * @version 1.1.5 9 9 */ 10 10 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 11 11 ?> 12 13 12 <script type="text/javascript"> 14 13 (function($){ … … 37 36 <div id="pondol-bbs-write" <?php echo $table_style;?>> 38 37 <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); ?> 43 39 <table> 44 40 <col width="150px"> 45 41 <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> 46 46 <tr> 47 47 <th><?php _e('Your Name', 'pondol_bbs'); ?></th> … … 53 53 </tr> 54 54 <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> 57 59 </tr> 58 60 <tr> 59 61 <td colspan="2"> 62 <div> 60 63 <?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); 82 66 }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>'; 86 68 } 87 69 ?> 70 </div> 88 71 </td> 89 72 </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> 3 4 </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> 6 13 </div> -
pondol-bbs/trunk/templates/gallery/archive-view.php
r944228 r946704 11 11 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 12 12 ?> 13 <form id="pondol_bbs_view_form">14 <?php echo $this->ctrl->func->generate_input($hidden_args); ?>15 </form>16 13 <div id="pondol-bbs-view" <?php echo $table_style;?>> 17 14 <table> … … 55 52 </div> 56 53 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>66 54 <?php comments_template( '', true ); ?> 67 55 </div> -
pondol-bbs/trunk/templates/gallery/archive-write.php
r943236 r946704 6 6 * @author Pondol 7 7 * @package PondolBBS/Templates 8 * @version 1. 0.08 * @version 1.1.5 9 9 */ 10 10 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly … … 33 33 <div id="pondol-bbs-write" <?php echo $table_style;?>> 34 34 <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); ?> 39 36 <table> 40 37 <col width="150px"> … … 46 43 <tr> 47 44 <td colspan="2"> 45 <div> 48 46 <?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); 70 49 }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>'; 74 51 } 75 52 ?> 53 </div> 76 54 </td> 77 55 </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> 3 4 </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> 6 13 </div> -
pondol-bbs/trunk/templates/notice/archive-list.php
r934821 r946704 46 46 </thead> 47 47 <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 48 60 <?php 49 61 if(is_array($rows)) foreach($rows as $key => $val){ -
pondol-bbs/trunk/templates/notice/archive-view.php
r934213 r946704 11 11 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 12 12 ?> 13 <form id="pondol_bbs_view_form">14 <?php echo $this->ctrl->func->generate_input($hidden_args); ?>15 </form>16 13 <div id="pondol-bbs-view" <?php echo $table_style;?>> 17 14 <table> … … 66 63 <button name="" type="button" onclick="location.href='?bbstype=reply&bbsid=<?php echo $row->ID;?>'"><?php _e( 'Reply', 'pondol_bbs' ); ?></button> 67 64 </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>78 65 <?php comments_template( '', true ); ?> 79 66 </div> -
pondol-bbs/trunk/templates/notice/archive-write.php
r943236 r946704 6 6 * @author Pondol 7 7 * @package PondolBBS/Templates 8 * @version 1. 0.08 * @version 1.1.5 9 9 */ 10 10 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly … … 33 33 <div id="pondol-bbs-write" <?php echo $table_style;?>> 34 34 <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); ?> 39 36 <table> 40 37 <col width="150px"> … … 46 43 <tr> 47 44 <td colspan="2"> 45 <div> 48 46 <?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); 70 49 }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>'; 74 51 } 75 52 ?> 53 </div> 76 54 </td> 77 55 </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> 3 4 </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> 6 13 </div>
Note: See TracChangeset
for help on using the changeset viewer.