choi

each board can view picture and video

......@@ -60,7 +60,8 @@ create table picvideo(
idx int not null primary key auto_increment,
picname varchar(300) unique,
vidname varchar(300) unique,
bulletin_id int not null
bulletin_id int not null,
boardtitle varchar(50) not null
)engine=innodb;
```
......@@ -87,7 +88,7 @@ create table picvideo(
>건의사항: suggestion_board
---
### 최종 수정: 2021-12-02 02:22<br>
### 최종 수정: 2021-12-03 05:28<br>
### 수정 내용:
1. 채팅 구현(팝업)
2. 시간 실시간 반영
......@@ -102,3 +103,4 @@ create table picvideo(
11. 요소 좌우 길이 80%로 조절
12. 게시판 [공지사항/작곡가 구인/가수 구인/자유게시판/건의사항]으로 분화
13. 공지사항 게시판에는 운영자만 글쓰기 가능하게 함.
14. 게시판별 게시글 사진 및 동영상 열람기능 추가. 하지만 아직 업로드기능 개발중
\ No newline at end of file
......
......@@ -165,7 +165,33 @@ router.get('/read/notice/:idx', function(req,res,next){
var sql_comment = "select idx, nickname, comment from notice_comment where bulletin_id =?"
board.query(sql_comment, [idx], function(err,comment){
if (err) console.error("err : " + err);
res.render('read.ejs', {'ID':id, 'nickname': nickname, title:"공지사항 글 상세", row:row[0], comment:comment, comment_length : comment.length, usernick:req.user.nickname})
var sql_picvideo = "select * from picvideo where bulletin_id=? and boardtitle = 'notice'"
board.query(sql_picvideo, [idx], function(err, picvideos) {
if (err) console.error("err : " + err);
var picarr = []
var vidarr = []
for(var i=0; i<picvideos.length; i++){
var picadd = "../../../assets/img/" + picvideos[i].picname;
var vidadd = "../../../assets/video/" + picvideos[i].vidname;
if(picvideos[i].picname != null){
picarr.push(picadd)
}
if(picvideos[i].vidname != null){
vidarr.push(vidadd)
}
}
res.render('read.ejs', {'ID':id, 'nickname': nickname, title:"공지사항 글 상세",
row:row[0],
comment:comment,
comment_length : comment.length,
usernick:req.user.nickname,
picarr:picarr,
picarr_length:picarr.length,
vidarr:vidarr,
vidarr_length:vidarr.length
})
})
})
console.log(logString+req.user.ID+'('+nickname+') 유저가 공지사항 '+idx+'번 게시글을 보고있습니다.('+ip+')')
}
......@@ -407,7 +433,33 @@ router.get('/read/composer/:idx', function(req,res,next){
var sql_comment = "select idx, nickname, comment from composer_comment where bulletin_id =?"
board.query(sql_comment, [idx], function(err,comment){
if (err) console.error("err : " + err);
res.render('read.ejs', {'ID':id, 'nickname': nickname, title:"작곡가 구인 글 상세", row:row[0], comment:comment, comment_length : comment.length, usernick:req.user.nickname})
var sql_picvideo = "select * from picvideo where bulletin_id=? and boardtitle = 'composer'"
board.query(sql_picvideo, [idx], function(err, picvideos) {
if (err) console.error("err : " + err);
var picarr = []
var vidarr = []
for(var i=0; i<picvideos.length; i++){
var picadd = "../../../assets/img/" + picvideos[i].picname;
var vidadd = "../../../assets/video/" + picvideos[i].vidname;
if(picvideos[i].picname != null){
picarr.push(picadd)
}
if(picvideos[i].vidname != null){
vidarr.push(vidadd)
}
}
res.render('read.ejs', {'ID':id, 'nickname': nickname, title:"작곡가 구인 글 상세",
row:row[0],
comment:comment,
comment_length : comment.length,
usernick:req.user.nickname,
picarr:picarr,
picarr_length:picarr.length,
vidarr:vidarr,
vidarr_length:vidarr.length
})
})
})
console.log(logString+req.user.ID+'('+nickname+') 유저가 작곡가 구인 '+idx+'번 게시글을 보고있습니다.('+ip+')')
}
......@@ -649,7 +701,33 @@ router.get('/read/singer/:idx', function(req,res,next){
var sql_comment = "select idx, nickname, comment from singer_comment where bulletin_id =?"
board.query(sql_comment, [idx], function(err,comment){
if (err) console.error("err : " + err);
res.render('read.ejs', {'ID':id, 'nickname': nickname, title:"가수 구인 글 상세", row:row[0], comment:comment, comment_length : comment.length, usernick:req.user.nickname})
var sql_picvideo = "select * from picvideo where bulletin_id=? and boardtitle = 'singer'"
board.query(sql_picvideo, [idx], function(err, picvideos) {
if (err) console.error("err : " + err);
var picarr = []
var vidarr = []
for(var i=0; i<picvideos.length; i++){
var picadd = "../../../assets/img/" + picvideos[i].picname;
var vidadd = "../../../assets/video/" + picvideos[i].vidname;
if(picvideos[i].picname != null){
picarr.push(picadd)
}
if(picvideos[i].vidname != null){
vidarr.push(vidadd)
}
}
res.render('read.ejs', {'ID':id, 'nickname': nickname, title:"가수 구인 글 상세",
row:row[0],
comment:comment,
comment_length : comment.length,
usernick:req.user.nickname,
picarr:picarr,
picarr_length:picarr.length,
vidarr:vidarr,
vidarr_length:vidarr.length
})
})
})
console.log(logString+req.user.ID+'('+nickname+') 유저가 가수 구인 '+idx+'번 게시글을 보고있습니다.('+ip+')')
}
......@@ -891,7 +969,33 @@ router.get('/read/free/:idx', function(req,res,next){
var sql_comment = "select idx, nickname, comment from free_comment where bulletin_id =?"
board.query(sql_comment, [idx], function(err,comment){
if (err) console.error("err : " + err);
res.render('read.ejs', {'ID':id, 'nickname': nickname, title:"자유게시판 글 상세", row:row[0], comment:comment, comment_length : comment.length, usernick:req.user.nickname})
var sql_picvideo = "select * from picvideo where bulletin_id=? and boardtitle = 'free'"
board.query(sql_picvideo, [idx], function(err, picvideos) {
if (err) console.error("err : " + err);
var picarr = []
var vidarr = []
for(var i=0; i<picvideos.length; i++){
var picadd = "../../../assets/img/" + picvideos[i].picname;
var vidadd = "../../../assets/video/" + picvideos[i].vidname;
if(picvideos[i].picname != null){
picarr.push(picadd)
}
if(picvideos[i].vidname != null){
vidarr.push(vidadd)
}
}
res.render('read.ejs', {'ID':id, 'nickname': nickname, title:"자유게시판 글 상세",
row:row[0],
comment:comment,
comment_length : comment.length,
usernick:req.user.nickname,
picarr:picarr,
picarr_length:picarr.length,
vidarr:vidarr,
vidarr_length:vidarr.length
})
})
})
console.log(logString+req.user.ID+'('+nickname+') 유저가 자유게시판 '+idx+'번 게시글을 보고있습니다.('+ip+')')
}
......@@ -1133,7 +1237,7 @@ router.get('/read/suggestion/:idx', function(req,res,next){
var sql_comment = "select idx, nickname, comment from suggestion_comment where bulletin_id =?"
board.query(sql_comment, [idx], function(err,comment){
if (err) console.error("err : " + err);
var sql_picvideo = 'select * from picvideo where bulletin_id=?'
var sql_picvideo = "select * from picvideo where bulletin_id=? and boardtitle = 'suggestion'"
board.query(sql_picvideo, [idx], function(err, picvideos) {
if (err) console.error("err : " + err);
var picarr = []
......@@ -1141,7 +1245,9 @@ router.get('/read/suggestion/:idx', function(req,res,next){
for(var i=0; i<picvideos.length; i++){
var picadd = "../../../assets/img/" + picvideos[i].picname;
var vidadd = "../../../assets/video/" + picvideos[i].vidname;
if(picvideos[i].picname != null){
picarr.push(picadd)
}
if(picvideos[i].vidname != null){
vidarr.push(vidadd)
}
......
......@@ -106,7 +106,7 @@
var viddata = vidarr[i]
%>
<video id="video_<%=i%>" class="video-js vjs-big-play-button vjs-big-play-centered vjs-fluid" controls preload="auto" width="640" height="268" data-setup='{}'>
<video id="video_<%=i%>" class="video-js vjs-big-play-button vjs-big-play-centered vjs-fluid" controls preload="auto" width="1000" height="450" data-setup='{}'>
<source src="<%=viddata%>" type="video/mp4" label="720P" selected="true">
</video>
<%
......