이윰빌더 list 배열을 자바스크립트에 보여주려면 어떻게하나요??
본문
<script type="text/javascript" src="http://maps.google.com/maps/api/js?v=3.exp&sensor=false&language=ko®ion=kr"></script>
<script type="text/javascript">
function mgminfomap(){
var myOptions = {
zoom: 3,
//center: new google.maps.LatLng(27.3114655, 90.94384680000007),
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById('mgmap'), myOptions);
var locations = [
<? for ($i=0; $i<count($list); $i++) {
$name1=strip_tags($list[$i][subject]);
$lat=($list[$i][wr_3]);
$lng=($list[$i][wr_4]);
$address=strip_tags($list[$i][wr_2]);
$mapnum=($list[$i][wr_id]);
$mtem="<table><tr><td colspan=2 width=300><a href={$list[$i][href]}><h3>$name1</h3></a></td></tr><tr><td width=70>주소: </td><td width=230>{$address}</td></tr></table>";
?>
['<?=$mtem?>', '<?=$lat?>', '<?=$lng?>', '<?=$mapnum?>']
<? if ($i==count($list)-1) continue; ?>
,
<? } ?>
];
var infowindow = new google.maps.InfoWindow();
var marker, i;
var bounds = new google.maps.LatLngBounds();
for (i = 0; i < locations.length; i++) {
var myLatLng = new google.maps.LatLng(locations[i][1], locations[i][2]);
var marker = new google.maps.Marker({
position: myLatLng,
map: map
});
bounds.extend(myLatLng);
google.maps.event.addListener(marker, 'click', (function(marker, i) {
return function() {
infowindow.setContent(locations[i][0]);
infowindow.open(map, marker);
}
})(marker, i));
}
zoomChangeBoundsListener = google.maps.event.addListener(map, "bounds_changed",function(event){
if(this.getZoom() > 20)
this.setZoom(16);
google.maps.event.removeListener(zoomChangeBoundsListener);
});
map.fitBounds(bounds);
}
google.maps.event.addDomListener(window, 'load', mgminfomap);
</script>
<!--지도 끝 -->
>> 해당소스에서 $list 배열을 도무지 못하겠네요..
최신글이 없습니다.
최신글이 없습니다.
댓글목록4
이윰IN님의 댓글
아래와 같이 해보세요.
1. /eyoom/user_program/board/list.skin.php 파일 소스 수정
[수정 후]
2. /eyoom/theme/사용테마/skin_bs(mo or pc)/board/스킨명/list.skin.html 파일내 스크립트 소스부분
위의 작성해 주신 소스 부분 중에 php 프로그램 요소를 기준으로 작업한 거예요.
위와 같이 처리하시면 될 듯 싶습니다.
즐거운 성탄되세요.
감사합니다.
축하합니다. 첫댓글 포인트 86포인트를 획득하였습니다.
축하합니다. 지뢰폭탄 포인트 68포인트를 획득하였습니다.
지스타온님의 댓글의 댓글
다른스킨에도 영향이 받을까봐서요
지스타온님의 댓글
그런데요 게시물이 1개만 나와요^^;; 흑 왜그럴까욤?? 소스 다올려볼게요
<?php if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
add_stylesheet('<link rel="stylesheet" href="./style.css" type="text/css" media="screen">',0);
?>
<style>
#mgmap { width: 100%; height:300px; margin:0; padding: 0px; border: 0px; }
</style>
<!--{* 게시판 목록 시작 *}-->
<div class="board-list">
<!--{* 게시판 카테고리 시작 *}-->
<!--{?_is_category}-->
<script>
// 카테고리 이동
function category_view(sca) {
if(sca) var url = "{_category_href}&sca="+sca;
else var url = "{_category_href}";
$(location).attr('href',url);
return false;
}
</script>
<nav>
<h5><strong class="color-red">{board.bo_subject}</strong> 카테고리</h5>
<div class="row col-sm-4">
<select name="ca_name" id="ca_name" required class="form-control" onchange="return category_view(this.value);">
<option value="">전체</option>
<!--{@ _bocate}-->
<option value="{.ca_sca}" {? _decode_sca == .ca_name}selected{/}>{.ca_name}</option>
<!--{/}-->
</select>
</div>
<div class="clearfix"></div>
</nav>
<div class="margin-hr-10"></div>
<!--{/}-->
<!--{* 게시판 카테고리 끝 *}-->
<!--{* 게시판 페이지 정보 및 버튼 시작 *}-->
<div class="board-info margin-bottom-10">
<div class="pull-left margin-top-5">
<span><i class="fa fa-th-list"></i> Total {=number_format(_total_count)}건</span> {_page} 페이지
</div>
<!--{? _write_href}-->
<div class="pull-right">
<!--{?_admin_href}--><a href="{_admin_href}" class="btn-e btn-e-red margin-right-5" type="button"><i class="fa fa-cog"></i> 관리자</a><!--{/}-->
<!--{?_write_href}--><a href="{_write_href}" class="btn-e btn-e-dark" type="button"><i class="fa fa-pencil"></i> 글쓰기</a><!--{/}-->
</div>
<!--{/}-->
<div class="clearfix"></div>
</div>
<!--{* 게시판 페이지 정보 및 버튼 끝 *}-->
<!--{? _is_admin}-->
<form name="fboardlist" id="fboardlist" action="./board_list_update.php" onsubmit="return fboardlist_submit(this);" method="post" class="sky-form">
<input type="hidden" name="bo_table" value="{_bo_table}">
<input type="hidden" name="sfl" value="{_sfl}">
<input type="hidden" name="stx" value="{_stx}">
<input type="hidden" name="spt" value="{_spt}">
<input type="hidden" name="sca" value="{_sca}">
<input type="hidden" name="page" value="{_page}">
<input type="hidden" name="sw" value="">
<!--{/}-->
<div id="mgmap"></div><br />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?v=3.exp&sensor=false&language=ko®ion=kr"></script>
<script type="text/javascript">
function mgminfomap(){
var myOptions = {
zoom: 3,
//center: new google.maps.LatLng(27.3114655, 90.94384680000007),
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById('mgmap'), myOptions);
var locations = [
{@ mapinfo}
['{.mtem}', '{.lat}', '{.lng}', '{.mapnum}']{? .index_ != .size_-1},{/}
{/}
];
var infowindow = new google.maps.InfoWindow();
var marker, i;
var bounds = new google.maps.LatLngBounds();
for (i = 0; i < locations.length; i++) {
var myLatLng = new google.maps.LatLng(locations[i][1], locations[i][2]);
var marker = new google.maps.Marker({
position: myLatLng,
map: map
});
bounds.extend(myLatLng);
google.maps.event.addListener(marker, 'click', (function(marker, i) {
return function() {
infowindow.setContent(locations[i][0]);
infowindow.open(map, marker);
}
})(marker, i));
}
zoomChangeBoundsListener = google.maps.event.addListener(map, "bounds_changed",function(event){
if(this.getZoom() > 20)
this.setZoom(16);
google.maps.event.removeListener(zoomChangeBoundsListener);
});
map.fitBounds(bounds);
}
google.maps.event.addDomListener(window, 'load', mgminfomap);
</script>
<!--지도 끝 -->
<div class="table-list-eb margin-bottom-20">
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th class="hidden-md hidden-sm"><i class="fa fa-list-ol"></i></th>
<!--{? _is_checkbox}-->
<th>
<label for="chkall" class="sound_only">현재 페이지 게시물 전체</label>
<label class="checkbox">
<input type="checkbox" id="chkall" onclick="if (this.checked) all_checked(true); else all_checked(false);"><i></i>
</label>
</th>
<!--{/}-->
<th>제목</th>
<!--{? eyoom_board.bo_use_profile_photo}-->
<th>포토</th>
<!--{/}-->
<th>글쓴이</th>
<th>{=subject_sort_link('wr_datetime', _qstr2, 1)}날짜</a></th>
<th class="hidden-md hidden-sm">{=subject_sort_link('wr_hit', _qstr2, 1)}<i class="fa fa-eye"></i></a></th>
<!--{?_is_good}--><th>{=subject_sort_link('wr_good', _qstr2, 1)}<i class="fa fa-thumbs-up"></i></a></th><!--{/}-->
<!--{?_is_nogood}--><th>{=subject_sort_link('wr_nogood', _qstr2, 1)}<i class="fa fa-thumbs-down"></i></a></th><!--{/}-->
</tr>
</thead>
<tbody>
<!--{@ list}-->
<tr class="{? .is_notice}board-notice{/}">
<td class="td-num hidden-md hidden-sm">
<!--{? .is_notice}-->
<strong class="color-red">알림장</strong>
<!--{: _wr_id == .wr_id}-->
<strong class="color-red">열람중</strong>
<!--{:}-->
{=number_format(.num)}
<!--{/}-->
</td>
<!--{? _is_checkbox}-->
<td class="td-chk">
<label for="chk_wr_id_{.key_}" class="sound_only">{.subject}</label>
<label class="checkbox">
<input type="checkbox" name="chk_wr_id[]" value="{.wr_id}" id="chk_wr_id_{.key_}"><i></i>
</label>
</td>
<!--{/}-->
<td class="td-subject td-width">
<!--{? .icon_reply}-->
<i class="fa fa-reply" style="margin-left:{.reply}px;"></i>
<!--{/}-->
<!--{? _is_category && .ca_name}-->
<a href="{.ca_name_href}" class="btn btn-e-xs btn-default">{.ca_name}</a>
<!--{/}-->
<a href="{.href}">
<!--{? .is_notice}-->
<strong class="color-black">{.subject}</strong>
<!--{: _wr_id == .wr_id}-->
<strong class="color-black">{.subject}</strong>
<!--{:}-->
{.subject}
<!--{/}-->
<!--{? .comment_cnt}--><span class="sound_only">댓글</span><em>{.comment_cnt}</em><span class="sound_only">개</span><!--{/}-->
</a>
<!--{?.icon_new}--><i class="fa fa-dot-circle-o"></i><!--{/}-->
<!--{?.icon_hot}--><i class="fa fa-thumbs-up"></i><!--{/}-->
<!--{?.icon_file}--><i class="fa fa-floppy-o"></i><!--{/}-->
<!--{?.icon_link}--><i class="fa fa-link"></i><!--{/}-->
<!--{?.icon_secret}--><i class="fa fa-lock"></i><!--{/}-->
</td>
<!--{? eyoom_board.bo_use_profile_photo == 1}-->
<td class="td-photo">
<!--{? .mb_photo}-->{.mb_photo}<!--{:}--><span class="user_icon"><i class="fa fa-user"></i></span><!--{/}-->
</td>
<!--{/}-->
<td class="td-name">
<!--{? .gnu_icon}-->
<span style='display:inline-block;margin-right:2px;'><img src="{.gnu_icon}" align="absmiddle"></span>
<!--{/}-->
<!--{? .eyoom_icon}-->
<span style='display:inline-block;margin-right:2px;'><img src="{.eyoom_icon}" align="absmiddle"></span>
<!--{/}-->
<span style='display:inline-block;margin-right:2px;'>{=eb_nameview('basic', .mb_id, .wr_name, .email, .homepage)}</span>
</td>
<td class="td-date">
<!--{? eyoom_board.bo_sel_date_type == '1'}-->
{eb->date_time('Y.m.d',.wr_datetime)}
<!--{: eyoom_board.bo_sel_date_type == '2'}-->
{eb->date_format('Y.m.d',.wr_datetime)}
<!--{/}-->
</td>
<td class="td-num hidden-md hidden-sm">{=number_format(.wr_hit)}</td>
<!--{?_is_good}--><td class="td-num">{=number_format(.wr_good)}</td><!--{/}-->
<!--{?_is_nogood}--><td class="td-num">{=number_format(.wr_nogood)}</td><!--{/}-->
</tr>
<!--{:}-->
<tr>
<td colspan="{colspan}" class="text-center">게시물이 없습니다.</td>
</tr>
<!--{/}-->
</tbody>
</table>
</div>
</div>
<div class="board-footer">
<div class="pull-left">
<!--{? _is_checkbox}-->
<ul class="list-unstyled board-btn-adm pull-left">
<li><button class="btn-e btn-e-red" type="submit" name="btn_submit" value="선택삭제" onclick="document.pressed=this.value">선택삭제</button></li>
<li><button class="btn-e btn-e-red" type="submit" name="btn_submit" value="선택복사" onclick="document.pressed=this.value">선택복사</button></li>
<li><button class="btn-e btn-e-red" type="submit" name="btn_submit" value="선택이동" onclick="document.pressed=this.value">선택이동</button></li>
</ul>
<!--{/}-->
<span class="pull-left">
<!--{?_rss_href}--><a href="{_rss_href}" class="btn-e btn-e-yellow" type="button"><i class="fa fa-rss"></i></a><!--{/}-->
<a href="javascript:;" class="btn-e btn-e-dark" type="button" data-toggle="modal" data-target=".search-modal"><i class="fa fa-search"></i></a>
</span>
</div>
<div class="pull-right">
<!--{? _list_href || _write_href}-->
<ul class="list-unstyled board-btn-user">
<!--{? _write_href}--><li><a href="{_write_href}" class="btn-e btn-e-dark" type="button"><i class="fa fa-pencil"></i> 글쓰기</a></li><!--{/}-->
</ul
지스타온님의 댓글