게시글 링크, 선택삭제/복사/이동 버턴에 문제가...
본문
안녕하세요.
생초보가 기존 게시판들을 참고해서 뉴스/웹진 게시판을 짜집기해서 만들고 있습니다.
목표는 이미지가 있건없건, 공지건 아니건, 이미지가 있으면 있는대로 없으면 없는대로 자연스런 모양을 표현해보는겁니다. 하지만...,
두 가지 문제가 있습니다.
1. $list[$i]['href']가 게시글로 연결되어야 할텐데,
현재 게시판 리스트로 연결되는, 즉 아무런 변화가 없는 문제.
2. 체크박스 자체는 잘 작동하는데, 체크된 게시글을 [선택삭제], [선택복사], 선택이동]을 클릭시에
메인화면으로 연결되는 문제.
여러분의 도움을 바랍니다.
list.skin.php는 아래와 같습니다.
<?php
if (!defined('_GNUBOARD_')) exit; // Unable to access direct pages
include_once(GML_LIB_PATH . '/thumbnail.lib.php');
include_once('category.skin.php');
// add_stylesheet('css file path', Output order); Smaller numbers printed first
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
?>
<!-- Start board page information { -->
<div id="bo_list_total">
<span><?php echo sprintf(n__('%s total', '%s totals', $show_total_count), $show_total_count); ?>, <?php echo sprintf(n__('%s page', '%s pages', $page), $page); ?></span>
</div>
<!-- } End board page information -->
<section id="list-skin" style="<?php if($member['mb_level'] >= $board['bo_list_level'] && $board['bo_use_list_view'] && $wr_id) echo 'margin-top: 50px;'; ?>">
<?php if ($is_category) { ?>
<nav id="bo_cate">
<h2><?php echo $board['bo_subject'] ?> <?php e__('Category'); ?></h2>
<ul id="bo_cate_ul">
<?php// echo $category_option ?>
<!-- Replace the code above by the below, in case you need to show numbers of posts in each category ------>
<?php echo category_cnt_option($bo_table);?>
</ul>
</nav>
<?php } ?>
<form name="fboardlist" id="fboardlist" action="./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="">
<!--- All Check --->
<?php if ($rss_href || $admin_href || $write_href) { ?>
<div id="gall_allchk" class="btn_bo_user">
<ul>
<?php if ($is_admin) { ?>
<li class="all_chk">
<label for="chkall"><span class="sound_only"><?php e__('All current page posts'); ?></span><?php e__('All check'); ?></label>
<input type="checkbox" id="chkall" onclick="if (this.checked) all_checked(true); else all_checked(false);">
</li>
<?php } ?>
<?php if ($rss_href) { ?><li><a href="<?php echo $rss_href ?>" class="btn_b01 btn"><i class="fa fa-rss" aria-hidden="true"></i><span class="sound_only">RSS</span></a></li><?php } ?>
<?php if ($admin_href) { ?><li><a href="<?php echo $admin_href ?>" class="btn_admin btn"><?php e__('Admin'); ?></a></li><?php } ?>
<?php if ($write_href) { ?><li><a href="<?php echo $write_href ?>" class="btn_b02 btn"><?php e__('Write'); ?></a></li><?php } ?>
</ul>
</div>
<?php } ?>
<!-- } End board page buttons, Search -->
<div id="bo_gall" style="backgound:#f7f7f9;width:<?php echo $width; ?>">
<?php foreach($list as $rows){ ?>
<div style="float:left;vertical-align:top;padding:10px 0 10px 0;background:#fff;width:100%">
<div class="gall_chk li_chk">
<?php if ($is_admin) { ?>
<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 ?>">
<?php } ?>
<!--// Checkbox, Num, Notice, Category -------------------->
<?php
$thumb = get_list_thumbnail($bo_table, $rows['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height'], false, true);
if($thumb['src']){
echo "<a class=\"bo_tit\" href=".$list[$i]['href'].">
<img style='float: left; margin: 5px 15px 5px 0px;' src=\"{$thumb['src']}\" />";
}
?></a>
<span class="gall_info">
<?php
if($rows['is_notice']){
echo '<i class="fa fa-bell" aria-hidden="true"></i> '.__('Notice').'!';
} else{
echo $rows['num'];
}
?>
<?php if($is_category){ ?>
<?php if($rows['ca_name']){ ?>
<a href="<?php echo $rows['ca_name_href']; ?>"--><?php echo $rows['ca_name']; ?></a>
<?php } ?>
<?php } ?>
</span>
<!--// Subject -------------------->
<a href="<?php echo $list[$i]['href'] ?>" class="bo_tit">
<p class="bo_v_title bo_v_tit"><?php echo cut_str($rows['subject'],200,""); ?></p>
</a>
<!--// Comment, Datetime, Hit -------------------->
<span class="gall_info">
<?php if($rows['wr_comment']){ ?>
<i class="fa fa-comment"></i>
<?php echo number_format($rows['wr_comment']); ?>
<?php } ?>
<?php
if(substr($rows['wr_datetime'], 0, 10) == GML_TIME_YMD){
echo substr($rows['wr_datetime'], 11, 8);
} else{
echo substr($rows['wr_datetime'], 0, 10);
}
?>
<?php echo number_format($rows['wr_hit']); ?>
</a>
</span>
<!--// Content tip -------------------->
<a href="<?php echo $list[$i]['href']; ?>">
<p><?php echo cut_str(strip_tags($rows['wr_content']),'160','...'); ?></p>
</a>
</div>
</div>
<?php } ?>
</div>
<?php if ($list_href || $is_checkbox || $write_href) { ?>
<div class="bo_fx">
<?php if ($list_href || $write_href) { ?>
<ul class="btn_bo_user">
<?php if ($is_checkbox) { ?>
<li><input type="submit" name="btn_submit" value="<?php e__('Delete Selection'); ?>" onclick="document.pressed=this.value" class="btn btn_b01"></li>
<li><input type="submit" name="btn_submit" value="<?php e__('Copy Selection'); ?>" onclick="document.pressed=this.value" class="btn btn_b01"></li>
<li><input type="submit" name="btn_submit" value="<?php e__('Move Selection'); ?>" onclick="document.pressed=this.value" class="btn btn_b01"></li>
<?php } ?>
<?php if ($list_href) { ?><li><a href="<?php echo $list_href ?>" class="btn_b01 btn"><?php e__('List'); ?></a></li><?php } ?>
<?php if ($write_href) { ?><li><a href="<?php echo $write_href ?>" class="btn_b02 btn"><?php e__('Write'); ?></a></li><?php } ?>
</ul>
<?php } ?>
</div>
<?php } ?>
</form>
<p> </p>
<!-- 게시판 검색 시작 { -->
<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"><?php e__('Search target'); ?></label>
<select name="sfl" id="sfl">
<option value="wr_subject||wr_content||wr_1||wr_2||wr_3||wr_4||wr_5||wr_6||wr_7||wr_8||wr_9||wr_10"<?php echo get_selected($sfl, 'wr_subject||wr_content||wr_1||wr_2||wr_3||wr_4||wr_5||wr_6||wr_7||wr_8||wr_9||wr_10'); ?>><?php e__('All'); ?></option>
<option value="wr_subject||wr_content"<?php echo get_selected($sfl, 'wr_subject||wr_content'); ?>><?php e__('Title + Content'); ?></option>
<option value="wr_subject"<?php echo get_selected($sfl, 'wr_subject', true); ?>><?php e__('Subject'); ?></option>
<option value="wr_content"<?php echo get_selected($sfl, 'wr_content'); ?>><?php e__('Content'); ?></option>
<option value="mb_id,1"<?php echo get_selected($sfl, 'mb_id,1'); ?>><?php e__('Member ID'); ?></option>
<option value="mb_id,0"<?php echo get_selected($sfl, 'mb_id,0'); ?>><?php e__('Member ID(C)'); ?></option>
<option value="wr_name,1"<?php echo get_selected($sfl, 'wr_name,1'); ?>><?php e__('Writer'); ?></option>
<option value="wr_name,0"<?php echo get_selected($sfl, 'wr_name,0'); ?>><?php e__('Commenter'); ?></option>
</select>
<label for="stx" class="sound_only"><?php e__('Search term'); ?><strong class="sound_only"> <?php e__('Required'); ?></strong></label>
<input type="text" name="stx" value="<?php echo stripslashes($stx) ?>" required id="stx" class="sch_input" size="25" maxlength="20" placeholder="<?php e__('Enter search term'); ?>">
<input type="submit" value="검색" class="sch_btn">
</form>
</fieldset>
<!-- } 게시판 검색 끝 -->
</section>
<p> </p>
<!-- Pagination -->
<?php echo $write_pages; ?>
<!-- } End Board List -->
<?php if($is_checkbox) { ?>
<noscript>
<p><?php e__('If you are not using JavaScript, please be careful because you can delete the selection immediately without a separate verification process.'); ?></p>
</noscript>
<?php } ?>
<?php include_once(GML_THEME_JS_PATH. '/list_js.php'); ?>
!-->
답변 2
말씀하신 내용으로만 유추를 하자면 </a> 태그가 제대로 안닫혔거나
눌렀을때 이동되는 경로에 문제가 있는거 같습니다.
그래서 </a> 태그가 제대로 닫혔는지, href="" 이동 값을 찍어보시고 제대로 나오는지 확인 하신 후
제대로된 값을 넣어줘야 할 것 같아요!
감사합니다. anchor 짝이 맞지않았습니다.
답변을 작성하시기 전에 로그인 해주세요.