1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
|
<?php include_once("./_common.php"); include_once($j3_shopm_path."/shop_header.php");
$qstr = $_SERVER['QUERY_STRING']; if($cate=='all'){ $cate = ""; } // 이상하게 탭에서 value값을 공백으로 지정하면 jquery attr에서 1로 받아와서 다른값을 넣고 치환함
$bbsinfo = bbs_info($b_table); // 게시판 정보 가져오기 //$cust_info = customer_info_get($id_ccode); // 회원 정보 가져오기 $cust_info = $cinfo; if($bbsinfo['b_list_lv']>$cust_info['mb_lv']){ alert("게시판리스트를 볼 권한이 없습니다."); exit; }
if($idx!=''){ if($bbsinfo['b_view_lv']>$cust_info['mb_lv']){ alert("게시판내용을 볼 권한이 없습니다."); exit; }
$cinfo = board_info_get($bbsinfo,$idx); board_hit_add($bbsinfo,$idx); // 조회수 + 함 }
if($bbsinfo['b_table']!=''){ if($idx=='' || $bbsinfo['b_view_list']=='1'){ // 게시판상세에서 리스트보기이거나 상세가 아닌경우 표시됨 if($page==1 || $page==''){ $notice_array = board_list($bbsinfo, $qstr,"1"); } $list_array = board_list($bbsinfo, $qstr,"0"); } } if($bbsinfo['b_cate']==''){ $cate_screen_out = "screen_out"; } else { $cate_array = explode("|",$bbsinfo['b_cate']); }
?> <link href="<?php echo $j3_lib_url."/ckeditor/contents2.css";?>" rel="stylesheet" /> <div id="wrap"> <div id="container" class="" style='<?php if($_COOKIE['hd_height']!='' && $header_fixed=='1'){ echo "margin-top:{$_COOKIE['hd_height']}px !important;"; }?>'>
<?php skin_module_show("board",$sample_idx); // 게시판 스킨을 불러온다. ?>
</div><!--#wrapper--> </div> <?php include_once($j3_shop_path."/shop_footer.php"); ?> <script> $(function(){ //메뉴탭 $("#tabs li").click(function () { // 탭 선택시 선택된 배경 처리 /*$("#tabs li").removeClass("active").css("background-color", "#f8f8f8").css("border-bottom", "1px solid #ccc"); $(this).addClass("active").css("background-color", "#FFF").css("border-bottom", "1px solid #FFF");*/ document.location.href="?b_table=<?php echo $b_table;?>&cate="+$(this).attr("value"); });
$(".board_view_class").click(function(){ $idx = $(this).closest("dd").find("input[name='codes[]']").val(); document.location.href='?<?php echo qstr_except($qstr,"idx");?>&idx='+$idx; });
$(".board_list_class").click(function(){ // 목록으로 document.location.href='?<?php echo qstr_except($qstr,"idx");?>'; });
$(".board_new_class").click(function(){ // 게시글 신규작성 board_new('',''); });
$(".board_edit_class").click(function(){ // 게시글 수정 board_new('<?php echo $idx;?>',''); });
$(".board_del_class").click(function(){ // 게시글 삭제 board_delete('<?php echo $idx;?>'); });
$(".board_reply_class").click(function(){ // 게시글 삭제 board_new('<?php echo $idx;?>','reply'); }); <?php if($idx!=''){ // 상세보기일때만 동작?> $b_cont_img_size = '<?php echo $bbsinfo['b_cont_img_size'];?>'; if($b_cont_img_size>'0'){ $(".w_content_class img").each(function(){ i_width = $(this).width(); i_height = $(this).height(); if(i_width>$b_cont_img_size){ n_height = $b_cont_img_size/i_width*i_height; $(this).css("width",$b_cont_img_size+"px").css("height",n_height+"px"); } }); } <?php }?>
$(".total_cnt_class").html("<?php echo $total_count;?>");
$(".bbs_head_foot_class img").each(function(){ // 상하단 내용 이미지의 폭을 모바일 가로폭 아래로 줄인다. $div_width = $(".bbs_head_foot_class").innerWidth(); $img_width = parseInt($(this).outerWidth()); if($img_width>$div_width){ $img_height = parseInt($(this).outerHeight()); $new_height = Math.round($div_width/$img_width*$img_height); $(this).css("width","100%").css("height",$new_height+"px"); } }); });
function board_new(idx,rep){ // 게시글 신규 or 수정 if(idx==''){ title = "작성"; } else { title = "수정"; }
if(rep=='reply'){ url = "board_new.inc.php?b_table=<?php echo $b_table;?>&pcode="+idx; } // 답변일 경우 else { url = "board_new.inc.php?b_table=<?php echo $b_table;?>&idx="+idx; } // 신규/수정일 경우 $.get(url,function(rtn){ $("#modal_member_box").html(rtn).dialog({ resizable: true, height:550, width:"98%", modal: true, title:"게시글 ["+title+"]", buttons: { 저장: function() { board_save(); }, 닫기: function() { $( this ).dialog( "close" ); } } }); }); }
function board_delete(idx){ // 게시글 삭제 if(confirm('정말로 삭제하시겠습니까?')){ form_data = "b_table=<?php echo $b_table;?>&sel_del=Y&code_idx[]=0&codes[]="+idx; $.ajax({type:"post", url:"<?php echo $j3_shopp_url;?>/ajax.board_reg_process.php", data:form_data, async:false, dataType : "xml", success:function(xml){ var v_mode = $(xml).find("mode").text(); var v_mode_ok = $(xml).find("mode_ok").text(); var v_pwd_idx = $(xml).find("pwd_idx").text(); var v_msg = $(xml).find("msg").text(); if(v_mode_ok!='Y'){ if(v_mode_ok=='D'){ // 비회원 게시물일경우 비밀번호 찾을 띄운다. $("#modal_member_box5 input[name='codes[]']").val(v_pwd_idx); $("#modal_member_box5").dialog({ resizable: true, height:260, width:"98%", modal: true, title:"게시글 [삭제]", buttons: { 삭제: function() { form_data = $("#pwd_del_form").serialize(); $.ajax({type:"post", url:"<?php echo $j3_shopp_url;?>/ajax.board_reg_process.php", data:form_data, async:false, dataType : "xml", success:function(xml){ var v_mode = $(xml).find("mode").text(); var v_mode_ok = $(xml).find("mode_ok").text(); var v_pwd_idx = $(xml).find("pwd_idx").text(); var v_msg = $(xml).find("msg").text(); if(v_mode_ok!='Y'){ alert(v_msg); } else { $(".board_list_class").click(); } }, error:function(rtn,status,error){ alert(error); } }); }, 닫기: function() { $( this ).dialog( "close" ); } } }); } else { // 비회원 아닐경우 에러메시지 alert(v_msg); } } else { $(".board_list_class").click(); } }, error:function(rtn,status,error){ alert(error); } }); } }
function board_save(){ // 게시글 저장 $form_obj = $("#board_reg_form");
if($form_obj.find("input[name='w_name']").val()==''){ alert('작성자를 입력하세요.'); return; }
if(!($(".password_tr_class").hasClass("screen_out"))){ if($form_obj.find("input[name='w_passwd']").val()==''){ alert('비밀번호를 입력하세요..'); return; } }
if($form_obj.find("input[name='w_subject']").val()==''){ alert('제목을 입력하세요.'); return; }
if($("#w_content").val()==''){ alert('내용을 입력하시기 바랍니다.'); return; } if('<?php echo $id_ccode?>'==''){ if($("input[name='captcha_input']").val()==''){ alert('스팸방지 문자를 입력하시기 바랍니다.'); return; } } if($("#board_reg_form input[name='idx']").val()!=''){ $title = "수정"; } else { $title = "작성"; } if(confirm('게시글을 작성하시겠습니까?')){ $($form_obj).find("input[name='qstr']").val('<?php echo $qstr;?>'); if($("input[name='captcha_input']").val()!=''){ form_data = $form_obj.serialize(); $.ajax({type:"post", url:"<?php echo $j3_shopp_url;?>/ajax.board_reg_process.php?spam=Y", data:form_data, async:false, dataType : "xml", success:function(xml){ var v_mode = $(xml).find("mode").text(); var v_mode_ok = $(xml).find("mode_ok").text(); var v_msg = $(xml).find("msg").text(); if(v_mode_ok!='Y'){ alert(v_msg); } else { $form_obj.submit(); } }, error:function(rtn,status,error){ alert(error); } }); } else { $form_obj.submit(); } } } </script> <div id="modal_member_box" title="거래처수정" style="display:none;position:relative;width:100%;height:100%; padding-top:3px;padding-left:3px;background-color:#FFFFFF;"></div>
<div id="modal_member_box5" title="삭제용" style="display:none;width:100%; height:100%; padding-top:3px;padding-left:3px;background-color:#FFFFFF;position:relative;"> <div class='cust_modal3 p10_20'><!-- style='width:100% !important;' --> <h4 class="mb10">비회원게시물삭제</h4> <form name='pwd_del_form' id='pwd_del_form' method='post' action='ajax.board_reg_process.php'> <input type='hidden' name='b_table' value='<?php echo $b_table;?>'> <input type='hidden' name='sel_del' value='Y'> <input type='hidden' name='code_idx[]' value='0'> <input type='hidden' name='codes[]' value=''> <input type='hidden' name='c_mode' value='pwd_del'> <table class="order-sheet table-top-border"> <tfoot class='dcomm_reg_tfoot'> <tr> <td> <label class="l_height30 bold">비밀번호 : </label><input type='password' name='w_passwd' class='mr10 box100_25 gray_line board_passwd_class'><span class="gray txt13">( ※ 게시물 등록 시 입력한 비밀번호를 입력해주세요. )</span> </td> </tr> </tfoot> </table> </form> </div> </div>
|