초심자들의 사이트맵 메뉴 이렇게 해보세요 정보
초심자들의 사이트맵 메뉴 이렇게 해보세요관련링크
http://hitecmi.com
737회 연결
첨부파일
본문
<!--저와같은 초보자들에게 조금이나마 도움이 되길 바라면서.....
먼저 아래와 같이 만들면 sir처럼 상단그룹메뉴와 좌측메뉴, 사이트맵을 한방에 처리합니다
torry님께서 올려주신 팁과 목진철님께서 올려주신팀을 응용하였습니다.
회원님께 감사드리며,
저희 홈페이지 새로 개편중에 적용하다 팁을 공유합니다.
먼저, 나오지 않게하는 파일 만들기는 아래내용을 임의폴더에 임의로 만듬.
예제) hitec_menu_not.php
위의 최신글이 나오는 파일에 인클우드 :
<? include "$g4[path]/user/hitec_menu_not.php";?> 추가예제파일 참조 하여 주시구요
첨부파일은 3개파일을 압축한 것입니다. 이렇게 좌측과 상단, 사이트맴또는 메인페이지에
구성할 수 있습니다. -->
<!-- hitec_menu_not.php 파일 시작 -->
<?
switch (TRUE) {
case $member[mb_level] == 7: //7등급
$NotSelect="'club'";
$NotSelectTable="'popup', 'guest'";
break;
case $member[mb_level] == 10: //관리자는 모두 보여짐
$NotSelect="''";
$NotSelectTable="''";
break;
default: // 디폴트 값
$NotSelect="'club','product'";
$NotSelectTable="'popup', 'guest'";
break;
}
?>
<!-- hitec_menu_not.php 파일 끝 // 이런식으로추가 수정하시면 됨 -->
<!-- 예제파일 시작 -->
<?
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php");
$g4[title] = "HOME";
include_once("./_head.php");
#echo "<script language=\"javascript\" src=\"$g4[path]/js/sideview.js\"></script>\n";
include "$g4[path]/user/hitec_menu_not.php"; // 제외 시킬 그룹과 게시판 테이블명
$cnt_bo_1 = 3; // 한줄당 분류 갯수 (게시판 컬럼 수)
$user_img = ''.$g4[path].'/user/img';
?>
<style type="text/css">
<!--
.style1 {
color: #660000;
font-weight: bold;
}
-->
</style>
<table width="670" cellpadding=0 cellspacing=0><tr><td valign=top align=center>
<!-- 메인화면 최신글 시작 -->
<table width="100%" cellpadding=0 cellspacing=0><tr><td valign=top align=center>
<? // 그룹별, 게시판별 최신글 //
$sql = " select bo_table, bo_subject from $g4[board_table] where gr_id not in ('club','community','company','product','') and bo_table not in ($NotSelectTable) and bo_use_search>0 order by bo_order_search ";
#//최신글에서는 이렇게 그룹 다 제외하고 나오게할 게시물만 선택. 검색에서도 그룹에서도//
#//메뉴에서도 편리하게 처리할 수 있다고 봅니다.. 나만 근가여.. ㅠ,ㅠ//
$result = sql_query($sql);
$k=0;
echo "<tr valign='top'>";
for ($i=0; $row=mysql_fetch_array($result); $i++) {
$k=$k+1;
echo "<td width=50% style=padding:5 0 0 0;>";
echo latest("scroll", $row[bo_table], 5, 30, "4,25"); //스크롤
echo "</td>";
if($k==2) {echo "</tr><tr valign='top'>"; $k=0;} //if($k==2) 단정열
}
?>
</td></tr></table>
<!-- 메인화면 최신글 끝 -->
<img src="<?=$user_img?>/top_sitemap.gif" border="0">
<table width=100% cellpadding=0 cellspacing=0 align=center border=0>
<tr>
<td class=sitemap> <img src='<?=$user_img?>/icon_nemo.gif'> <B><?=$config[cf_title]
?> SITEMAP </B>(최근에 자료가 업데이트 된 곳은 <img src="<?=$user_img?>/icon_new.gif" border="0" align="absmiddle"> 아이콘이 표시됩니다.) </td>
</tr>
<tr>
<td class=sitemap>
<?
$sql = " select gr_id, gr_subject from $g4[group_table]
where gr_id not in ($NotSelect) order by gr_1"; //$NotSelect: 제외시킬 그룹, 관리자그룹에서 메뉴에 표시될 그룹순서지정 gr_1 필드사용
$result = sql_query($sql);
while ($row=mysql_fetch_array($result)) {
echo "<table width=100% cellpadding=4 cellspacing=1 border=0><tr>";
echo "<td valign=top width=200><table width='200' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='1'><img src='$user_img/sitemap_title_left.gif' width='1' height='30'></td>
<td bgcolor='F0F0F0'> <img src='$user_img/sitemap_title_icon.gif' width='19' height='19' align='absmiddle'><strong class='text'> $row[gr_subject]</strong></td>
<td width='1'><img src='$user_img/sitemap_title_right.gif' width='1' height='30'></td>
</tr>
</table></td>";
echo "<td width='' bgcolor=#FFFFFF><table width='450' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='3' height='3'><img src='$user_img/sitemap_table1.gif' width='3' height='3'></td>
<td height='3' background='$user_img/sitemap_table1_bg.gif'></td>
<td width='3' height='3'><img src='$user_img/sitemap_table2.gif' width='3' height='3'></td>
</tr>
<tr>
<td width='3' background='$user_img/sitemap_table4_bg.gif'></td>
<td height='24'>";
$cnt_cell = 1; //cell카운트
$sql2 = " select bo_table, bo_subject, bo_new from $g4[board_table]
where gr_id = '$row[gr_id]'
and bo_table not in ($NotSelectTable)
and bo_use_search>0 order by bo_order_search "; //$NotSelectTable: 제외시킬 게시판 테이블, 검색사용/미사용, 검색순서가 메뉴순서로 표시됨
$result2 = sql_query($sql2);
$str_cell = "";//cell 만드는 html코드
$str_cell = "<table width=100% align=center border=0><tr>";//cell 안에 테이블 시작
for ($i=0; $i<count($sql2); $i++)
if (trim($result2)){
while ($board=mysql_fetch_array($result2)) {
//$str_cell .= '<td width=33%>';
$new_time = date("Y-m-d H:i:s", time() - ($board[bo_new] * 3600));
$sql3 = " select count(*) as cnt from $g4[write_prefix]$board[bo_table] where wr_datetime >= '$new_time' ";
$row3 = sql_fetch($sql3);
if ($row3[cnt] > 0)
$new = " <img src=\"$user_img/icon_new.gif\" border=\"0\" align=\"absmiddle\">";
else
$new = "";
$str_cell .= "<td width=25% height=22 valign=center><img src='$user_img/sitemap_icon.gif' width='17' height='9'>$bar<a href='$g4[path]/bbs/board.php?bo_table=$board[bo_table]'> $board[bo_subject]$new</a></td>";
if ($cnt_cell == $cnt_bo_1) { $cnt_cell = 0; $str_cell .= "</tr>"; }
$cnt_cell++;
}
echo $str_cell;
}
echo "</table></td>
<td width='3' background='$user_img/sitemap_table2_bg.gif'></td>
</tr>
<tr>
<td width='3' height='3'><img src='$user_img/sitemap_table3.gif' width='3' height='3'></td>
<td height='3' background='$user_img/sitemap_table3_bg.gif'></td>
<td width='3' height='3'><img src='$user_img/sitemap_table4.gif' width='3' height='3'></td>
</tr>
</table></td></tr></table>";
}
?>
</td>
</tr>
</table>
</td></tr></table>
<?
include_once("./_tail.php"); // _tail.php의 상대 경로
?>
<!-- 예제파일 끝 -->
*********** 초보자의 아픔을 딛고 ***********
먼저 아래와 같이 만들면 sir처럼 상단그룹메뉴와 좌측메뉴, 사이트맵을 한방에 처리합니다
torry님께서 올려주신 팁과 목진철님께서 올려주신팀을 응용하였습니다.
회원님께 감사드리며,
저희 홈페이지 새로 개편중에 적용하다 팁을 공유합니다.
먼저, 나오지 않게하는 파일 만들기는 아래내용을 임의폴더에 임의로 만듬.
예제) hitec_menu_not.php
위의 최신글이 나오는 파일에 인클우드 :
<? include "$g4[path]/user/hitec_menu_not.php";?> 추가예제파일 참조 하여 주시구요
첨부파일은 3개파일을 압축한 것입니다. 이렇게 좌측과 상단, 사이트맴또는 메인페이지에
구성할 수 있습니다. -->
<!-- hitec_menu_not.php 파일 시작 -->
<?
switch (TRUE) {
case $member[mb_level] == 7: //7등급
$NotSelect="'club'";
$NotSelectTable="'popup', 'guest'";
break;
case $member[mb_level] == 10: //관리자는 모두 보여짐
$NotSelect="''";
$NotSelectTable="''";
break;
default: // 디폴트 값
$NotSelect="'club','product'";
$NotSelectTable="'popup', 'guest'";
break;
}
?>
<!-- hitec_menu_not.php 파일 끝 // 이런식으로추가 수정하시면 됨 -->
<!-- 예제파일 시작 -->
<?
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php");
$g4[title] = "HOME";
include_once("./_head.php");
#echo "<script language=\"javascript\" src=\"$g4[path]/js/sideview.js\"></script>\n";
include "$g4[path]/user/hitec_menu_not.php"; // 제외 시킬 그룹과 게시판 테이블명
$cnt_bo_1 = 3; // 한줄당 분류 갯수 (게시판 컬럼 수)
$user_img = ''.$g4[path].'/user/img';
?>
<style type="text/css">
<!--
.style1 {
color: #660000;
font-weight: bold;
}
-->
</style>
<table width="670" cellpadding=0 cellspacing=0><tr><td valign=top align=center>
<!-- 메인화면 최신글 시작 -->
<table width="100%" cellpadding=0 cellspacing=0><tr><td valign=top align=center>
<? // 그룹별, 게시판별 최신글 //
$sql = " select bo_table, bo_subject from $g4[board_table] where gr_id not in ('club','community','company','product','') and bo_table not in ($NotSelectTable) and bo_use_search>0 order by bo_order_search ";
#//최신글에서는 이렇게 그룹 다 제외하고 나오게할 게시물만 선택. 검색에서도 그룹에서도//
#//메뉴에서도 편리하게 처리할 수 있다고 봅니다.. 나만 근가여.. ㅠ,ㅠ//
$result = sql_query($sql);
$k=0;
echo "<tr valign='top'>";
for ($i=0; $row=mysql_fetch_array($result); $i++) {
$k=$k+1;
echo "<td width=50% style=padding:5 0 0 0;>";
echo latest("scroll", $row[bo_table], 5, 30, "4,25"); //스크롤
echo "</td>";
if($k==2) {echo "</tr><tr valign='top'>"; $k=0;} //if($k==2) 단정열
}
?>
</td></tr></table>
<!-- 메인화면 최신글 끝 -->
<img src="<?=$user_img?>/top_sitemap.gif" border="0">
<table width=100% cellpadding=0 cellspacing=0 align=center border=0>
<tr>
<td class=sitemap> <img src='<?=$user_img?>/icon_nemo.gif'> <B><?=$config[cf_title]
?> SITEMAP </B>(최근에 자료가 업데이트 된 곳은 <img src="<?=$user_img?>/icon_new.gif" border="0" align="absmiddle"> 아이콘이 표시됩니다.) </td>
</tr>
<tr>
<td class=sitemap>
<?
$sql = " select gr_id, gr_subject from $g4[group_table]
where gr_id not in ($NotSelect) order by gr_1"; //$NotSelect: 제외시킬 그룹, 관리자그룹에서 메뉴에 표시될 그룹순서지정 gr_1 필드사용
$result = sql_query($sql);
while ($row=mysql_fetch_array($result)) {
echo "<table width=100% cellpadding=4 cellspacing=1 border=0><tr>";
echo "<td valign=top width=200><table width='200' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='1'><img src='$user_img/sitemap_title_left.gif' width='1' height='30'></td>
<td bgcolor='F0F0F0'> <img src='$user_img/sitemap_title_icon.gif' width='19' height='19' align='absmiddle'><strong class='text'> $row[gr_subject]</strong></td>
<td width='1'><img src='$user_img/sitemap_title_right.gif' width='1' height='30'></td>
</tr>
</table></td>";
echo "<td width='' bgcolor=#FFFFFF><table width='450' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='3' height='3'><img src='$user_img/sitemap_table1.gif' width='3' height='3'></td>
<td height='3' background='$user_img/sitemap_table1_bg.gif'></td>
<td width='3' height='3'><img src='$user_img/sitemap_table2.gif' width='3' height='3'></td>
</tr>
<tr>
<td width='3' background='$user_img/sitemap_table4_bg.gif'></td>
<td height='24'>";
$cnt_cell = 1; //cell카운트
$sql2 = " select bo_table, bo_subject, bo_new from $g4[board_table]
where gr_id = '$row[gr_id]'
and bo_table not in ($NotSelectTable)
and bo_use_search>0 order by bo_order_search "; //$NotSelectTable: 제외시킬 게시판 테이블, 검색사용/미사용, 검색순서가 메뉴순서로 표시됨
$result2 = sql_query($sql2);
$str_cell = "";//cell 만드는 html코드
$str_cell = "<table width=100% align=center border=0><tr>";//cell 안에 테이블 시작
for ($i=0; $i<count($sql2); $i++)
if (trim($result2)){
while ($board=mysql_fetch_array($result2)) {
//$str_cell .= '<td width=33%>';
$new_time = date("Y-m-d H:i:s", time() - ($board[bo_new] * 3600));
$sql3 = " select count(*) as cnt from $g4[write_prefix]$board[bo_table] where wr_datetime >= '$new_time' ";
$row3 = sql_fetch($sql3);
if ($row3[cnt] > 0)
$new = " <img src=\"$user_img/icon_new.gif\" border=\"0\" align=\"absmiddle\">";
else
$new = "";
$str_cell .= "<td width=25% height=22 valign=center><img src='$user_img/sitemap_icon.gif' width='17' height='9'>$bar<a href='$g4[path]/bbs/board.php?bo_table=$board[bo_table]'> $board[bo_subject]$new</a></td>";
if ($cnt_cell == $cnt_bo_1) { $cnt_cell = 0; $str_cell .= "</tr>"; }
$cnt_cell++;
}
echo $str_cell;
}
echo "</table></td>
<td width='3' background='$user_img/sitemap_table2_bg.gif'></td>
</tr>
<tr>
<td width='3' height='3'><img src='$user_img/sitemap_table3.gif' width='3' height='3'></td>
<td height='3' background='$user_img/sitemap_table3_bg.gif'></td>
<td width='3' height='3'><img src='$user_img/sitemap_table4.gif' width='3' height='3'></td>
</tr>
</table></td></tr></table>";
}
?>
</td>
</tr>
</table>
</td></tr></table>
<?
include_once("./_tail.php"); // _tail.php의 상대 경로
?>
<!-- 예제파일 끝 -->
*********** 초보자의 아픔을 딛고 ***********
추천
1
1
댓글 10개
음 ) ___-___( 별 반응이 없는 팁이었나봅니다.
제가 초보자라고 다른님도 초보자로 몰고 간것같은 느낌이 팎팎-
죄송합니다. 꾸벅 ∀
자삭할까요? <- 코멘트 달기 유도작전같아 보임.
제가 초보자라고 다른님도 초보자로 몰고 간것같은 느낌이 팎팎-
죄송합니다. 꾸벅 ∀
자삭할까요? <- 코멘트 달기 유도작전같아 보임.
먼저 감사의 말씀을 드리고 싶습니다.
초보 입장에서 보면 구현된 스크린샷이나 특징을 알기 쉽게 설명해주셨다면 이해하는데 도움이 되었을것 같습니다.
정성스럽게 만들고 공개해주신 팁이 사장되지 않고 발전되어 많은 분들께 사용되어지길 바랍니다.
팁을 적용해보지 않고 말씀 드리는 것이어서 죄송합니다.
초보 입장에서 보면 구현된 스크린샷이나 특징을 알기 쉽게 설명해주셨다면 이해하는데 도움이 되었을것 같습니다.
정성스럽게 만들고 공개해주신 팁이 사장되지 않고 발전되어 많은 분들께 사용되어지길 바랍니다.
팁을 적용해보지 않고 말씀 드리는 것이어서 죄송합니다.
제가 설명이 좀 부족했나봅니다.
초보단계에서는 상단메뉴 좌측메뉴 메인페이지 구성이 쉽지가 않더라구요
그래서 제나름데로의 방법을 알려주려 했는데, 좀 모자람 같습니다.
덧붙여 보완설명입니다.
위의 파일경로
이곳에서 ↓
<?
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php");
$g4[title] = "HOME";
include_once("./_head.php");
#echo "<script language=\"javascript\" src=\"$g4[path]/js/sideview.js\"></script>\n";
include "$g4[path]/user/hitec_menu_not.php"; // 제외 시킬 그룹과 게시판 테이블명
$cnt_bo_1 = 3; // 한줄당 분류 갯수 (게시판 컬럼 수)
$user_img = ''.$g4[path].'/user/img'; <<<<<<<< 이미지파일 경로
?>
////// <? include "$g4[path]/user/hitec_menu_not.php";?> 과
////// $user_img = ''.$g4[path].'/user/img'; 이곳의 경로만 수정하시면 될겁니다.
////// hitec_menu_not.php 이파일에서 나오지 않게하려는 그룹과 게시판 보드명을 적으시면 되구요
$sql = " select bo_table, bo_subject from $g4[board_table] where gr_id not in ('club','community','company','product','') and bo_table not in ($NotSelectTable) and bo_use_search>0 order by bo_order_search ";
↑ 이문장은 아래처럼 응용할 수 있습니다.
$NotSelectTable 과 $NotSelect <-- 이것은 hitec_menu_not.php 파일에서 지정
1. ----- where gr_id not in ($NotSelect) and bo_table not in ($NotSelectTable)///
2. ----- where gr_id not in ($NotSelect,'club','community','company','product','') and bo_table not in ($NotSelectTable,'board01','board02','board03')
3. 그외 $user_img = ''.$g4[path].'/user/img'; <== 이것처럼 정의해놓고 써도되고, 여러방법이 있는걸로 압니다.
사용자의 코딩방법데로 하시면 될겁니다.
위 방법들은 짜집기를 하다보면 알게됩니다. ㅋㅋㅋ 제가 글커든요.. 에구 .
초보단계에서는 상단메뉴 좌측메뉴 메인페이지 구성이 쉽지가 않더라구요
그래서 제나름데로의 방법을 알려주려 했는데, 좀 모자람 같습니다.
덧붙여 보완설명입니다.
위의 파일경로
이곳에서 ↓
<?
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php");
$g4[title] = "HOME";
include_once("./_head.php");
#echo "<script language=\"javascript\" src=\"$g4[path]/js/sideview.js\"></script>\n";
include "$g4[path]/user/hitec_menu_not.php"; // 제외 시킬 그룹과 게시판 테이블명
$cnt_bo_1 = 3; // 한줄당 분류 갯수 (게시판 컬럼 수)
$user_img = ''.$g4[path].'/user/img'; <<<<<<<< 이미지파일 경로
?>
////// <? include "$g4[path]/user/hitec_menu_not.php";?> 과
////// $user_img = ''.$g4[path].'/user/img'; 이곳의 경로만 수정하시면 될겁니다.
////// hitec_menu_not.php 이파일에서 나오지 않게하려는 그룹과 게시판 보드명을 적으시면 되구요
$sql = " select bo_table, bo_subject from $g4[board_table] where gr_id not in ('club','community','company','product','') and bo_table not in ($NotSelectTable) and bo_use_search>0 order by bo_order_search ";
↑ 이문장은 아래처럼 응용할 수 있습니다.
$NotSelectTable 과 $NotSelect <-- 이것은 hitec_menu_not.php 파일에서 지정
1. ----- where gr_id not in ($NotSelect) and bo_table not in ($NotSelectTable)///
2. ----- where gr_id not in ($NotSelect,'club','community','company','product','') and bo_table not in ($NotSelectTable,'board01','board02','board03')
3. 그외 $user_img = ''.$g4[path].'/user/img'; <== 이것처럼 정의해놓고 써도되고, 여러방법이 있는걸로 압니다.
사용자의 코딩방법데로 하시면 될겁니다.
위 방법들은 짜집기를 하다보면 알게됩니다. ㅋㅋㅋ 제가 글커든요.. 에구 .
감사합니다.
인덱스에 추가하면 잘됩니다.
그런데
사이트맵 메뉴아래 게시판 불러오면 오류가 생깁니다.
부탁드립니다.
인덱스에 추가하면 잘됩니다.
그런데
사이트맵 메뉴아래 게시판 불러오면 오류가 생깁니다.
부탁드립니다.
경로지정에 관한 FAQ와 팁을 살펴보시기 바랍니다.
http://sir.co.kr/g4_faq.php
http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&sca=&sfl=mb_id,1&stx=aechae
바로 이 부분(키워드) 때문에 그러시겠지요?
중점부분 : _common.php의 파일유무와 경로, common.php의 연결문제.
키워드 : common.php, 경로, 하위, 메인 ...
경로에 관한 부분은 주위에서 설명하는 것보다,
관련 자료를 스스로 파악하시는 것이 후환(?!)을 말끔히 없애는 방법입니다.
또한 '오류가 발생한다'는 질문형태(?!)의 코멘트는,
답변을 생각했던 유저로 하여금 타이핑을 멈추게 할 수 있습니다.
이것은 대체 뭘 보고, 무슨 영감을 받아서 문제를 해결해야 할지를 모르니
당연할 수 밖에 없습니다.
http://sir.co.kr/g4_faq.php
http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&sca=&sfl=mb_id,1&stx=aechae
바로 이 부분(키워드) 때문에 그러시겠지요?
중점부분 : _common.php의 파일유무와 경로, common.php의 연결문제.
키워드 : common.php, 경로, 하위, 메인 ...
경로에 관한 부분은 주위에서 설명하는 것보다,
관련 자료를 스스로 파악하시는 것이 후환(?!)을 말끔히 없애는 방법입니다.
또한 '오류가 발생한다'는 질문형태(?!)의 코멘트는,
답변을 생각했던 유저로 하여금 타이핑을 멈추게 할 수 있습니다.
이것은 대체 뭘 보고, 무슨 영감을 받아서 문제를 해결해야 할지를 모르니
당연할 수 밖에 없습니다.
유용하게 쓰겠습니다.
언젠가 급할 때는 사용해 봐야겠네요. 감사합니다
유용하게 쓰겠습니다.

좋은팁 감사합니다^^
좋은 팁입니다.