안녕하세요
최신글클릭시 모달창에서 불러오는 내용 관련 질문입니다.
우선 그누보드 자료실내용으로 최신글시 모달창에 내용까지는 어찌 어찌 불러왔는대
내용외 제목, 이미지, 등을 불러오고 싶은대 방법을 모르겠습니다
조언 부탁드립니다.
불러오고 싶은 내용 -----------------------------------------
1. 제목, 이미지, 여분필드 값
2. 기타 직접 입력한 내용
-----------------------------------------------------------------------
현재 설치한 내용 입니다.
// index.php 하단삽입
Copy
// index.php 하단삽입
<div id="popup"></div>
<div id="bg"></div>
<style>
#popup { position: absolute; z-index: 999; display: none; width: 800px; height: 500px; overflow: auto; background-color: #fff}
#bg { position: absolute; z-index: 900; top: 0; left: 0; display: none; width:100%; background-color: #000}
</style>
<script>
var $popup = $("#popup"), $bg = $("#bg");
$(".lat li").on("click", function(e) {
e.preventDefault();
var i = $(this).index();
var bo_table = $(this).find("a").attr("href").replace(/.+bo_table=([^&]+).+/, '$1');
var html = $("." + bo_table).eq(i).html();
$bg.show().css('height', $(document).height());
$popup.show().html(html).css({'top' : $(window).height()/2 - $popup.height()/2, 'left' : $(window).width()/2 - $popup.width()/2 });
});
$popup.on("click", function() {
$(this).hide();
$bg.hide();
});
</script>
// latest.skin.php 하단 삽입
Copy
// latest.skin.php 하단 삽입
<?php
foreach ($list as $v)
echo "<div class="{$bo_table}" style="display:none">{$v['wr_content']} </div>";
?>
현재 이렇게 해서 모달창에 내용은 불러오고 있습니다.
고수님들의 도움 부탁드립니다.

답변 2개 / 댓글 2개
채택된 답변
+20 포인트
2021-08-08 (일) 02:06:40
일단 이렇게 하셔야 합니다.
<?php
foreach ($list as $v)
echo "<div class=\"{$bo_table}\" style=\"display:none\">{$v['wr_content']} </div>";
?>
latest.skin.php 내용도 올려 보세요.
답변에 대한 댓글 2개
2021-08-08 (일) 07:41:32
2021-08-08 (일) 11:40:15
$(".lat li").on("click", function(e) { });
<xxx class="lat" ><li> 이런 부분이 latest.skin.php에 없네요.
이 부분이 어디에 있는 걸까요?
<xxx class="lat" ><li> 이런 부분이 latest.skin.php에 없네요.
이 부분이 어디에 있는 걸까요?
2021-08-08 (일) 00:36:56
제가 프로그램은 모르지만 <--- 중요!
// latest.skin.php 하단 삽입
<?php
foreach ($list as $v)
echo "<div class="{$bo_table}" style="display:none">{$v['wr_content']} </div>";
?>
위 부분에서
$v['wr_subject'] 를 추가하면 제목은 나올 것 같고
여분필드 또한 $v['wr_1'] (여분필드가 wr_1) 을 추가하면 나올 거 같습니다.
이미지는 썸네일을 처리를 한 후에 위처럼 비슷하게 추가하면 나오지 않을까요?
답변을 작성하려면 로그인이 필요합니다.
이게 latest.skin.php 내용 입니다^^
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$latest_skin_url.'/style.css">', 0);
$thumb_width = 880;
$thumb_height = 600;
?>
<!-- <?php echo $bo_subject; ?> 최신글 시작 { -->
<div class="lt">
<!--
<strong class="lt_title"><a href="<?php echo G5_BBS_URL ?>/board.php?bo_table=<?php echo $bo_table ?>"><?php echo $bo_subject; ?></a></strong>
{ -->
<div class="lt_rv_wr">
<ul>
<?php
for ($i=0; $i<count($list); $i++) {
$thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $thumb_width, $thumb_height, false, true);
if($thumb['src']) {
$img = $thumb['src'];
} else {
$img = G5_THEME_IMG_URL.'/noimage.png';
$thumb['alt'] = '이미지가 없습니다.';
}
$img_content = '<img src="'.$img.'" alt="'.$thumb['alt'].'" >';
?>
<li>
<a href="<?php echo $list[$i]['href'] ?>" class="lt_img"><?php echo $img_content; ?></a>
<div class="lt_wr">
<?php echo $img_content; ?>
<span class="lt_img">
<a href="#">
<?php echo $img_content; ?>
</a>
</span>
<?php
echo "<a href=\"".$list[$i]['href']."\" class=\"lt_tit\"><strong>";
if ($list[$i]['icon_secret']) echo "<i class=\"fa fa-lock\" aria-hidden=\"true\"></i><span class=\"sound_only\">비밀글</span> ";
if ($list[$i]['is_notice'])
echo "<strong>".$list[$i]['subject']."</strong>";
else
echo $list[$i]['subject'];
echo "</strong></a>";
?>
<p class="lt_detail"> <?php echo get_text(cut_str(strip_tags($list[$i]['wr_content']), 60), 1); ?></p>
</div>
</li>
</ul>
</div>
<ul>
<?php for ($i=0; $i<count($list); $i++) { ?>
<li>
<?php echo $img_content; ?>
<?php
//echo $list[$i]['icon_reply']." ";
echo "<a href=\"".$list[$i]['href']."\">";
if ($list[$i]['is_notice'])
echo "<strong>".$list[$i]['subject']."</strong>";
else
echo $list[$i]['subject'];
if ($list[$i]['comment_cnt'])
echo $list[$i]['comment_cnt'];
echo "</a>";
// 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_new'])) echo " " . $list[$i]['icon_new'];
if (isset($list[$i]['icon_hot'])) echo " " . $list[$i]['icon_hot'];
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_secret'])) echo " " . $list[$i]['icon_secret'];
?>
<p class="lt_detail">
<?php echo get_text(cut_str(strip_tags($list[$i]['wr_content']), 60), 1); ?>
</p>
<p class="lt_detail"> <?php echo get_text(cut_str(strip_tags($list[$i]['wr_1']), 60), 1); ?></p>
</li>
<?php } ?>
<?php if (count($list) == 0) { //게시물이 없을 때 ?>
<li>게시물이 없습니다.</li>
<?php } ?>
</ul>
</div>
<!-- } <?php echo $bo_subject; ?> 최신글 끝 -->
<script>
$('.lt ul').bxSlider({
slideWidth: 380,
minSlides: 1,
maxSlides: 3,
slideMargin: 20 ,
pager:false,
controls:true,
auto:true
});
</script>
<?php
foreach ($list as $v)
echo "<div class=\"{$bo_table}\" style=\"display:none\">{$v['wr_content']} </div>";
?>