Browse Source

휘파람보드 1.1.10

- 버그 fix
master
장선근 6 years ago
parent
commit
46a6cd1fe9
  1. 2
      wheeparam/application/controllers/Board.php
  2. 32
      wheeparam/application/helpers/common_helper.php
  3. 7
      wheeparam/config/wheeparam.sql
  4. 2
      wheeparam/views/themes/admin/board/read.php

2
wheeparam/application/controllers/Board.php

@ -131,7 +131,7 @@ class Board extends WB_Controller {
$this->view = "view"; $this->view = "view";
$this->skin_type = "board/view"; $this->skin_type = "board/view";
$this->skin = $this->data['board']['brd_skin_w'];
$this->skin = $this->data['board']['brd_skin_v'];
} }
/** /**

32
wheeparam/application/helpers/common_helper.php

@ -1269,3 +1269,35 @@ function get_post_summary($post_content="", $length=300)
{ {
return cut_str( trim( strip_tags( str_replace(" ", " ", $post_content)) ) ,$length); return cut_str( trim( strip_tags( str_replace(" ", " ", $post_content)) ) ,$length);
} }
/**
* 유일키 얻는다.
*/
function get_uniqid()
{
$CI =& get_instance();
$tb = $CI->db->dbprefix('uniqid');
// 일주일 이상된 자료는 삭제한다.
$tmp_val = date('YmdHis', strtotime('-1 weeks')) . '00';
$CI->db->where('uq_id <=', $tmp_val);
$CI->db->delete('uniqid');
$CI->db->query("LOCK TABLE {$tb} WRITE ");
$key = null;
while (1) {
// 년월일시분초에 100분의 1초 두자리를 추가함 (1/100 초 앞에 자리가 모자르면 0으로 채움)
$key = date('YmdHis') . sprintf('%02d', (int)(microtime()*100));
$ip_addr = ip2long($CI->input->ip_address());
$result = $CI->db->set('uq_id', $key)->set('uq_ip', $ip_addr)->insert('uniqid');
if ($result) break; // 쿼리가 정상이면 빠진다.
// insert 하지 못했으면 일정시간 쉰다음 다시 유일키를 만든다.
usleep(10000); // 100분의 1초를 쉰다
}
$CI->db->query(" UNLOCK TABLES ");
return $key;
}

7
wheeparam/config/wheeparam.sql

@ -625,6 +625,13 @@ CREATE TABLE `wb_statics_date` (
PRIMARY KEY (`std_date`) PRIMARY KEY (`std_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `wb_uniqid`;
Create Table `wb_uniqid` (
`uq_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`uq_ip` int(10) unsigned NOT NULL,
PRIMARY KEY (`uq_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
# VIEW 생성 # VIEW 생성
CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `wb_board_post_new` AS (SELECT `wb_board_post`.`brd_key` AS `brd_key`, count(*) AS `new_cnt` from `wb_board_post` where ((`wb_board_post`.`post_regtime` > (now() + interval - (24)hour)) and (`wb_board_post`.`post_status` = 'Y')) group by `wb_board_post`.`brd_key`); CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `wb_board_post_new` AS (SELECT `wb_board_post`.`brd_key` AS `brd_key`, count(*) AS `new_cnt` from `wb_board_post` where ((`wb_board_post`.`post_regtime` > (now() + interval - (24)hour)) and (`wb_board_post`.`post_status` = 'Y')) group by `wb_board_post`.`brd_key`);

2
wheeparam/views/themes/admin/board/read.php

@ -65,7 +65,7 @@
<div data-ax-td class="width-100"> <div data-ax-td class="width-100">
<div data-ax-td-label>내용</div> <div data-ax-td-label>내용</div>
<div data-ax-td-wrap> <div data-ax-td-wrap>
<div style="min-height:300px;">
<div style="min-height:300px;line-height:1.4em">
<!-- S:첨부파일중 이미지 표시 --> <!-- S:첨부파일중 이미지 표시 -->
<?php foreach($view['file'] as $f) : if($f['att_is_image']!='Y') continue;?> <?php foreach($view['file'] as $f) : if($f['att_is_image']!='Y') continue;?>
<figure style="margin-bottom:10px;"> <figure style="margin-bottom:10px;">

Loading…
Cancel
Save