가입인사 게시판스킨인데요. 모바일화면이 너무 비좁게 나와요ㅠㅠ
본문
아래 가입인사소스인데요.
어디를 수정해야 옆으로 긴화면을
한줄에 하나씩 가입인사가 나오게 변경이 가능할까요?
아무리 봐도 모르겠네요 ㅠㅠ
고수님들 도와주세요.
[code]
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 2;
if ($is_checkbox) $colspan++;
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">', 0);
add_stylesheet('<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;700&family=Noto+Sans+KR:wght@300;400;700&display=swap" rel="stylesheet">', 0);
add_stylesheet('<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">', 0);
add_javascript('<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>', 0);
add_javascript('<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>', 0);
add_javascript('<script src="https://unpkg.com/masonry-layout@4/dist/masonry.pkgd.min.js"></script>', 0);
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
$wr_disabled = $is_member ? '' : 'disabled';
$cm_disabled = $is_member ? '' : 'disabled';
$bo_1 = $board['bo_1'] ? explode('|', $board['bo_1']) : array(); // 자동 가입인사 문구
$bo_2 = $board['bo_2'] ? explode('|', $board['bo_2']) : array(); // 자동 환영댓글 문구
$member_profile_img = get_member_profile_img($member['mb_id']);
preg_match('% src="([^"]+)"%i', $member_profile_img, $matches);
$member_profile_src = $matches[1];
$avatar = array();
$imgdir = 'avatar';
if (is_dir($board_skin_path.'/'.$imgdir)) {
if ($handle = opendir($board_skin_path.'/'.$imgdir)) {
while (false !== ($file = readdir($handle))) {
if ($file == "." || $file == "..") continue;
if (!preg_match('%^.*\.(gif|png|jpg|jpeg)$%i', $file)) continue;
$avatar[] = $board_skin_url.'/'.$imgdir.'/'.$file;
}
closedir($handle);
}
}
$imgtxt = $board_skin_path.'/avatar.txt';
$imgarr = file_exists($imgtxt) ? file($imgtxt) : array();
foreach ($imgarr as $img) {
$img = trim($img);
if ($img && substr($img, 0, 1) != '#') {
//$avatar[] = G5_URL.'/image.php?url='.urlencode($img);
$avatar[] = $img;
}
}
?>
<!-- .fwSRA6OHQMjc4Com {{ -->
<div class="fwSRA6OHQMjc4Com">
<div class="prompt card bg-light m-10px">
<div class="card-body p-3">
<h3 class="sr-only"><?php echo $board['bo_subject']; ?> 작성</h3>
<form name="flistwrite" id="flistwrite" action="<?php echo https_url(G5_BBS_DIR)."/write_update.php"; ?>" method="post" onsubmit="return flistwrite_submit(this);">
<input type="hidden" name="w" value="">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="is_list" value="1">
<input type="hidden" name="wr_subject" id="wr_subject" <?php echo $wr_disabled; ?> required value="<?php echo $member['mb_nick']; ?>님의 가입인사">
<input type="hidden" name="wr_link1" value="">
<div class="row mx-n1">
<div class="col-auto px-1">
<div class="pull-left rounded-circle overflow-hidden avatar" <?php if (count($avatar) > 0) { ?> data-toggle="dropdown" data-boundary="viewport" data-display="static" data-flip="false" aria-haspopup="true" aria-expanded="false"<?php } ?> id="avatar"><?php echo $member_profile_img; ?></div>
<?php
echo '<div class="dropdown-menu p-1 clearfix">';
echo '<span class="avatar float-left m-1"><img src="'.$member_profile_src.'" alt=""></span>';
foreach ($avatar as $src) {
echo '<span class="avatar float-left m-1"><img src="'.$src.'" alt="" onerror="this.style.display=\'none\'"></span>';
}
echo '</div>';
?>
</div>
<div class="col px-1">
<textarea name="wr_content" id="wr_content" class="form-control d-block" placeholder="가입인사" <?php echo $wr_disabled; ?> required></textarea>
<button type="submit" class="btn btn-primary d-block mt-1 btn-sm" id="list_write_submit" <?php echo $wr_disabled; ?> accesskey="s">등록</button>
</div>
</div>
</form>
</div>
</div>
<form name="fboardlist" id="fboardlist" action="<?php echo G5_BBS_URL; ?>/board_list_update.php" onsubmit="return fboardlist_submit(this);" method="post">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl ?>">
<input type="hidden" name="stx" value="<?php echo $stx ?>">
<input type="hidden" name="spt" value="<?php echo $spt ?>">
<input type="hidden" name="sst" value="<?php echo $sst ?>">
<input type="hidden" name="sod" value="<?php echo $sod ?>">
<input type="hidden" name="page" value="<?php echo $page ?>">
<input type="hidden" name="sw" value="">
<?php if ($rss_href || $write_href) { ?>
<ul class="<?php echo isset($view) ? 'view_is_list btn_top' : 'btn_top top btn_bo_user';?>">
<?php if ($admin_href) { ?><li><a href="<?php echo $admin_href ?>" class="btn_admin btn" title="관리자"><i class="fa fa-cog fa-spin fa-fw"></i><span class="sound_only">관리자</span></a></li><?php } ?>
<?php if ($rss_href) { ?><li><a href="<?php echo $rss_href ?>" class="btn_b03 btn" title="RSS"><i class="fa fa-rss" aria-hidden="true"></i><span class="sound_only">RSS</span></a></li><?php } ?>
<?php if ($is_admin == 'super' || $is_auth) { ?>
<li>
<button type="button" class="btn_more_opt btn_b03 btn is_list_btn" title="게시판 리스트 옵션"><i class="fa fa-ellipsis-v" aria-hidden="true"></i><span class="sound_only">게시판 리스트 옵션</span></button>
<?php if ($is_checkbox) { ?>
<ul class="more_opt is_list_btn">
<li><button type="submit" name="btn_submit" value="선택삭제" onclick="document.pressed=this.value"><i class="fa fa-trash-o" aria-hidden="true"></i> 선택삭제</button></li>
<li><button type="submit" name="btn_submit" value="선택복사" onclick="document.pressed=this.value"><i class="fa fa-files-o" aria-hidden="true"></i> 선택복사</button></li>
<li><button type="submit" name="btn_submit" value="선택이동" onclick="document.pressed=this.value"><i class="fa fa-arrows" aria-hidden="true"></i> 선택이동</button></li>
</ul>
<?php } ?>
</li>
<?php } ?>
<?php if ($write_href) { ?><li><a href="<?php echo $write_href ?>" class="fix_btn write_btn" title="글쓰기"><i class="fa fa-pencil" aria-hidden="true"></i><span class="sound_only">글쓰기</span></a></li><?php } ?>
</ul>
<?php } ?>
<!-- 게시판 목록 시작 -->
<div id="bo_list">
<?php if ($is_category) { ?>
<nav id="bo_cate">
<h2><?php echo ($board['bo_mobile_subject'] ? $board['bo_mobile_subject'] : $board['bo_subject']) ?> 카테고리</h2>
<ul id="bo_cate_ul">
<?php echo $category_option ?>
</ul>
</nav>
<?php } ?>
<div class="grid row">
<?php
$r = count($list) > 0 ? mt_rand(0, count($list)-1) : 0;
for ($i=0; $i<count($list); $i++) {
$highlight = $i == $r ? 'card-highlight' : '';
// 작성자 회원 아이콘
$mb_icon = $list[$i]['mb_id']
? '<img src="'.G5_DATA_URL.'/member/'.$mb_dir.'/'.get_mb_icon_name($list[$i]['mb_id']).'.gif" alt="">'
: '<img src="'.G5_IMG_URL.'/no_profile.gif" alt="" width="22" height="22">';
// 작성자 회원 프로필 이미지
$mb_pf_img = get_member_profile_img($list[$i]['mb_id']);
preg_match('% src="([^"]+)"%i', $mb_pf_img, $matches);
$mb_pf_src = $matches[1];
// 글 작성시 선택한 아바타가 있다면?
$mb_pf_img = $list[$i]['wr_link1']
? '<img src="'.$list[$i]['wr_link1'].'" onerror="this.src=\''.$mb_pf_src.'\'">'
: $mb_pf_img;
?>
<!-- "prompt card bg-light m-10px" -->
<!-- "pull-left mr-3 overflow-hidden flex-grow-0 flex-shrink-0" -->
<div class="col col-12 col-sm-12 col-md-6 col-lg-4 col-xl-3" id="grid-item-<?php echo $list[$i]['wr_id']; ?>">
<div class="card h-100">
<div class="media p-3 d-flex flex-nowrap">
<div class="pull-left mr-3 overflow-hidden flex-grow-0 flex-shrink-0">
<div class="avatar rounded-circle"><?php echo $mb_pf_img; ?></div>
</div>
<div class="media-body">
<h6 class="m-0 mb-1">
<?php if ($is_category && $list[$i]['ca_name']) { ?>
<a href="<?php echo $list[$i]['ca_name_href'] ?>" class="bo_cate_link"><?php echo $list[$i]['ca_name'] ?></a>
<?php } ?>
<?php if (trim($list[$i]['icon_secret'])) echo ' <span><i class="fa fa-lock" aria-hidden="true"></i><span class="sound_only">비밀글</span></span> '; ?>
<a href="<?php echo $list[$i]['href'] ?>" class="bo_subject"><?php echo $list[$i]['subject'] ?></a>
<?php
//if ($list[$i]['link']['count']) { echo '['.$list[$i]['link']['count'].']'; }
//if ($list[$i]['file']['count']) { echo '['.$list[$i]['file']['count'].']'; }
//if (isset($list[$i]['icon_file'])) echo ($list[$i]['icon_file']);
//if (isset($list[$i]['icon_link'])) echo ($list[$i]['icon_link']);
//if (isset($list[$i]['icon_new'])) echo ($list[$i]['icon_new']);
//if (isset($list[$i]['icon_hot'])) echo ($list[$i]['icon_hot']);
if (trim($list[$i]['icon_new'])) echo ' <span><i class="xi xi-new" aria-hidden="true"></i><span class="sound_only">새글</span></span> ';
if (trim($list[$i]['icon_hot'])) echo ' <span><i class="xi xi-heart" aria-hidden="true"></i><span class="sound_only">인기글</span></span> ';
?>
</h6>
<small class="d-block mb-2"><?php echo cut_str(preg_replace("%[\r\n]+%", " ", strip_tags($list[$i]['wr_content'])), 255) ?></small>
<small class="d-block text-secondary">
<span class=""><?php echo date('D, j M Y', strtotime($list[$i]['wr_datetime'])); ?></span>
<span class="ml-2">─ <?php echo $list[$i]['wr_name'] ?></span>
<?php if ($is_checkbox && false) { ?>
<span class="pull-right">
<label for="chk_wr_id_<?php echo $i ?>" class="sound_only"><?php echo $list[$i]['subject'] ?></label>
<input type="checkbox" name="chk_wr_id[]" value="<?php echo $list[$i]['wr_id'] ?>" id="chk_wr_id_<?php echo $i ?>">
</span>
<?php } ?>
</small>
<?php
// 환영댓글
{
echo '<div class="dropdown mt-3">';
echo '<button class="btn btn-secondary dropdown-toggle btn-sm" type="button" id="auto-welcome-'.$list[$i]['wr_id'].'" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">환영댓글</button> ';
if ($list[$i]['comment_cnt']) {
echo '<a href="'.$list[$i]['href'].'#bo_cm"><span class="btn btn-info btn-sm"><span class="sound_only">댓글</span><span class="">+ '.$list[$i]['wr_comment'].'</span><span class="sound_only">개</span></span></a>';
}
echo '<div class="dropdown-menu drop-welcome" aria-labelledby="auto-welcome-'.$list[$i]['wr_id'].'">';
foreach ($bo_2 as $greeting) {
echo '<button type="button" class="dropdown-item" data-whatever="'.$list[$i]['wr_id'].'" data-greeting="'.$greeting.'">'.$greeting.'</button>';
}
echo '<button type="button" class="dropdown-item" data-toggle="modal" data-target="#cmtModal" data-whatever="'.$list[$i]['wr_id'].'">직접 작성</button>';
echo '</div>';
echo '</div>';
}
// 환영댓글 출력
{
$welcome = '';
$foo = "select wr_name, wr_content from {$write_table}
where wr_parent = '{$list[$i]['wr_id']}' and wr_is_comment = 1 and wr_comment_reply = ''
order by wr_comment desc
limit 10 ";
$bar = sql_query($foo);
for ($j=0; $tmp=sql_fetch_array($bar); $j++)
{
$welcome .= '<li class="text-break">';
$welcome .= '<b>'.$tmp['wr_name'].'</b> ';
$welcome .= '<span>─ '.cut_str(preg_replace("%[\r\n]+%", " ", strip_tags($tmp['wr_content'])), 45).'</span>';
$welcome .= '</li>';
}
if ($j < intval($list[$i]['wr_comment'])) {
$welcome .= '<li class="mt-1"><a href="'.$list[$i]['href'].'#bo_cm">+ 더보기</a></li>';
}
if ($welcome) {
echo '<ul class="card-welcome mt-3 overflow-hidden">'.$welcome.'</ul>';
}
}
?>
</div>
</div>
</div>
</div>
<?php
}
?>
</div>
</div>
</form>
<?php if($is_checkbox) { ?>
<noscript>
<p>자바스크립트를 사용하지 않는 경우<br>별도의 확인 절차 없이 바로 선택삭제 처리하므로 주의하시기 바랍니다.</p>
</noscript>
<?php } ?>
<!-- 페이지 -->
<?php echo $write_pages; ?>
<div id="bo_list_total">
<span>전체 <?php echo number_format($total_count) ?>건</span>
<?php echo $page ?> 페이지
</div>
<fieldset id="bo_sch">
<legend>게시물 검색</legend>
<form name="fsearch" method="get">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="sca" value="<?php echo $sca ?>">
<input type="hidden" name="sop" value="and">
<label for="sfl" class="sound_only">검색대상</label>
<select name="sfl" id="sfl">
<?php echo get_board_sfl_select_options($sfl); ?>
</select>
<input name="stx" value="<?php echo stripslashes($stx) ?>" placeholder="검색어를 입력하세요" required id="stx" class="sch_input" size="15" maxlength="20">
<button type="submit" value="검색" class="sch_btn"><i class="fa fa-search" aria-hidden="true"></i> <span class="sound_only">검색</span></button>
</form>
</fieldset>
<!-- Modal -->
<div class="modal fade" id="cmtModal" tabindex="-1" role="dialog" aria-labelledby="cmtModalTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<form name="flistcomment" id="flistcomment" action="<?php echo G5_BBS_URL; ?>/write_comment_update.php" method="post" onsubmit="return flistcomment_submit(this);">
<input type="hidden" name="w" value="c">
<input type="hidden" name="bo_table" value="<?php echo $bo_table; ?>">
<input type="hidden" name="wr_id" value="">
<input type="hidden" name="comment_id" value="">
<input type="hidden" name="sca" value="<?php echo $sca; ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl; ?>">
<input type="hidden" name="stx" value="<?php echo $stx; ?>">
<input type="hidden" name="spt" value="<?php echo $spt; ?>">
<input type="hidden" name="page" value="<?php echo $page; ?>">
<input type="hidden" name="is_list" value="1">
<div class="modal-header">
<h5 class="modal-title" id="cmtModalTitle">환영댓글</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="form-group">
<textarea name="wr_content" class="form-control" <?php echo $cm_disabled; ?>></textarea>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">닫기</button>
<button type="submit" class="btn btn-primary" id="list_comment_submit" <?php echo $cm_disabled; ?>>등록</button>
</div>
</form>
</div>
</div>
</div>
<script>
$(document).on('click', '#avatar + .dropdown-menu .avatar', function (e) {
var $this = $(this),
$that = $('#avatar img'),
$form = $that.closest('form'),
_src = $this.find('img').attr('src');
$that.attr('src', _src);
$form.find('[name="wr_link1"]').val($this.index() > 0 ? _src : '');
$form.find('[name="wr_content"]').focus();
});
</script>
<script>
$('[data-greeting]').on('click', function(e) {
var $this = $(this),
$modal = $('#cmtModal'),
whatever = $this.data('whatever') || '',
greeting = $this.data('greeting') || '';
if (whatever && greeting) {
//$modal.modal('show', $this);
$modal.find('[name="wr_id"]').val(whatever);
$modal.find('[name="wr_content"]').val(greeting);
$('#list_comment_submit').trigger('click');
return false;
}
});
$('#cmtModal').on('shown.bs.modal', function (e) {
var $modal = $(this),
$button = $(e.relatedTarget),
whatever = $button.data('whatever') || '',
greeting = $button.data('greeting') || '';
if (e.relatedTarget) {
$modal.find('[name="wr_id"]').val(whatever);
$modal.find('[name="wr_content"]').val(greeting).focus();
}
});
$('#cmtModal').on('hidden.bs.modal', function (e) {
var $modal = $(this);
$modal.find('[name="wr_id"]').val('');
$modal.find('[name="wr_content"]').val('');
});
</script>
<script>
function flistwrite_submit(f)
{
// 양쪽 공백 없애기
var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자
f.wr_content.value = f.wr_content.value.replace(pattern, "");
if (!f.wr_content.value)
{
alert("가입인사를 입력하여 주십시오.");
return false;
}
var subject = "";
var content = "";
$.ajax({
url: g5_bbs_url+"/ajax.filter.php",
type: "POST",
data: {
"subject": f.wr_subject.value,
"content": f.wr_content.value
},
dataType: "json",
async: false,
cache: false,
success: function(data, textStatus) {
subject = data.subject;
content = data.content;
}
});
if (subject) {
alert("제목에 금지단어('"+subject+"')가 포함되어있습니다");
f.wr_subject.focus();
return false;
}
if (content) {
alert("내용에 금지단어('"+content+"')가 포함되어있습니다");
if (typeof(ed_wr_content) != "undefined")
ed_wr_content.returnFalse();
else
f.wr_content.focus();
return false;
}
if (typeof(f.bo_table) == "undefined") {
return;
}
var bo_table = f.bo_table.value;
var token = get_write_token(bo_table);
var $f = $(f);
if(typeof f.token === "undefined")
$f.prepend('<input type="hidden" name="token" value="">');
$f.find("input[name=token]").val(token);
document.getElementById("list_write_submit").disabled = "disabled";
return true;
}
function flistcomment_submit(f)
{
var subject = "";
var content = "";
$.ajax({
url: g5_bbs_url+"/ajax.filter.php",
type: "POST",
data: {
"subject": "",
"content": f.wr_content.value
},
dataType: "json",
async: false,
cache: false,
success: function(data, textStatus) {
subject = data.subject;
content = data.content;
}
});
if (content) {
alert("내용에 금지단어('"+content+"')가 포함되어있습니다");
f.wr_content.focus();
return false;
}
// 양쪽 공백 없애기
var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자
f.wr_content.value = f.wr_content.value.replace(pattern, "");
if (!f.wr_content.value)
{
alert("환영댓글을 입력하여 주십시오.");
return false;
}
set_comment_token(f);
document.getElementById("list_comment_submit").disabled = "disabled";
return true;
}
</script>
<?php if ($is_checkbox) { ?>
<script>
function all_checked(sw) {
var f = document.fboardlist;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]")
f.elements[i].checked = sw;
}
}
function fboardlist_submit(f) {
var chk_count = 0;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]" && f.elements[i].checked)
chk_count++;
}
if (!chk_count) {
alert(document.pressed + "할 게시물을 하나 이상 선택하세요.");
return false;
}
if(document.pressed == "선택복사") {
select_copy("copy");
return;
}
if(document.pressed == "선택이동") {
select_copy("move");
return;
}
if(document.pressed == "선택삭제") {
if (!confirm("선택한 게시물을 정말 삭제하시겠습니까?\n\n한번 삭제한 자료는 복구할 수 없습니다\n\n답변글이 있는 게시글을 선택하신 경우\n답변글도 선택하셔야 게시글이 삭제됩니다."))
return false;
f.removeAttribute("target");
f.action = g5_bbs_url+"/board_list_update.php";
}
return true;
}
// 선택한 게시물 복사 및 이동
function select_copy(sw) {
var f = document.fboardlist;
if (sw == 'copy')
str = "복사";
else
str = "이동";
var sub_win = window.open("", "move", "left=50, top=50, width=500, height=550, scrollbars=1");
f.sw.value = sw;
f.target = "move";
f.action = g5_bbs_url+"/move.php";
f.submit();
}
// 게시판 리스트 관리자 옵션
jQuery(function($){
$(".btn_more_opt.is_list_btn").on("click", function(e) {
e.stopPropagation();
$(".more_opt.is_list_btn").toggle();
});
$(document).on("click", function (e) {
if(!$(e.target).closest('.is_list_btn').length) {
$(".more_opt.is_list_btn").hide();
}
});
});
</script>
<?php } ?>
<!-- 게시판 목록 끝&n