다른 디렉토리에서 회원정보 뽑기? > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

다른 디렉토리에서 회원정보 뽑기? 정보

다른 디렉토리에서 회원정보 뽑기?

본문

<a href="javascript:clipboard_trackback('http://sir.co.kr/bbs/tb.php/g4_tiptech/3183');" style="letter-spacing: 0pt; font-weight: bold;" title="이 글을 소개할 때는 이 주소를 사용하세요">http://sir.co.kr/bbs/tb.php/g4_tiptech/3183</a><span style="font-weight: bold;"> - 네잎클로버님의 팁</span><br><br>링크의 아래처럼 회원정보를 뽑아낼 수 있었습니다.<br><br>&lt;? $profile = get_member("$mbid"); ?&gt;<br>&lt;?=$profile[mb_nick]?&gt;님의 홈페이지입니다.&lt;br&gt;<br>&lt;?=$profile[mb_hp]?&gt;&lt;br&gt;<br>&lt;?=$profile[mb_tel]?&gt;&lt;br&gt;<br>&lt;a href=mailto:&lt;?=$profile[mb_email]?&gt;&gt;&lt;?=$profile[mb_email]?&gt;&lt;/a&gt;<br><br>이걸 그누보드가 설치된 디렉토리 밖에서도 쓸 수 있는 방법이 없을까요?<br><br><br>public_html ┬─ g4 (그누보드)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ├─ d1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ├─ d2<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; └─ d3<br><br><br>가령 이런 구조일 때 d1, d2, d3에서도 g4의 회원정보를 뽑아낼 수 있는 방법 말이지요.<br><br>팁란에 다른 경로에서도 &lt;?=$g4[path]?&gt;를 쓸 수 있는 팁을 보긴했는데 해보니까 영 안되던지라 좀 더 간단한 다른 방법이 있는가 해서요..<br><br>

댓글 전체

본문에 뭔가 에러가 있는듯 해서 댓글로 다시 올립니다;;;

////////////////////////////////////////////

http://sir.co.kr/bbs/tb.php/g4_tiptech/3183 - 네잎클로버님의 팁

링크의 정보로 팁으로 아래처럼 회원정보를 뽑아낼 수 있었습니다.

<? $profile = get_member("$mbid"); ?>
<?=$profile[mb_nick]?>님의 홈페이지입니다.<br>
<?=$profile[mb_hp]?><br>
<?=$profile[mb_tel]?><br>
<a href=mailto:<?=$profile[mb_email]?>><?=$profile[mb_email]?></a>

이걸 그누보드가 설치된 디렉토리 밖에서도 쓸 수 있는 방법이 없을까요?


public_html ┬─ g4 (그누보드)
                ├─ d1
                ├─ d2
                └─ d3


가령 이런 구조일 때 d1, d2, d3에서도 g4의 회원정보를 뽑아낼 수 있는 방법 말이지요.

팁란에 다른 경로에서도 <?=$g4[path]?>를 쓸 수 있는 팁을 보긴했는데 해보니까 영 안되던지라 좀 더 간단한 다른 방법이 있는가 해서요..
<? $profile = get_member("$mbid"); ?>
이것은 common.php만 include하면 됩니다.
(comon.php가 인클루드 하는 파일들 포함)

<?
$g4_path = "상대 경로....";

include_once("$g4_path/common.php");

$profile = get_member("$mbid");

?>


...

<?=$profile[mb_nick]?>님의 홈페이지입니다.<br>
안되면 그 디렉토리에 index_free.php 로 저장후
설치디렉토리만 변경하시고 테스트 해보십시요... 급조된거라...ㅡㅡ;;

<?
# 현재디렉토리가 home이고 하위에 그누가 설치되었을때 index_free 입니다.
# 예) http://kday.co.kr/home/gb4 
$g4_dir='gb4'; //설치된 디렉토리 여기만 수정.마지막엔 /슬래쉬(x).
####################################################
$g4_another='YES';
$g4_now = $_SERVER['PHP_SELF'];
$g4_web = explode("/", $g4_now);
$g4_myname = array_pop($g4_web);
$g4_path_web = implode("/", $g4_web);
$g4_myurl = "http://".$_SERVER['HTTP_HOST'].$g4_path_web."/".$g4_myname;
$PAGE_BASE['www'] = $g4_myurl;
strstr( PHP_OS, "WIN") ? $g4_strPath = "\\" : $g4_str = "/";
$g4_path_file = getcwd ();
$PAGE_BASE['physical'] = $g4_path_file.$g4_str.$g4_myname;
$g4_www = $PAGE_BASE['www'];
$g4_physical = $PAGE_BASE['physical'];
####################################################
$g4_www = explode("/", $g4_www);  $g4_sz = sizeof($g4_www);
if($g4_another=='YES' && $g4_dir!='') 
 {$index_file=$g4_dir."/".'index.php';  $_head_file=$g4_dir."/".'_head.php';
  $_com_file=$g4_dir."/".'_common.php';}else
 {$index_file='index.php'; $_head_file='_head.php'; $_com_file='_common.php';}
for($g4_for=$g4_sz; $g4_sz>0; $g4_for--){
  if(file_exists($index_file)&&file_exists($_head_file)&& file_exists($_com_file))  
  {  if($g4_for==0) {$g4_sang='.'; break;}
  else{$g4_sang=str_replace("index.php","",$index_file);
  $g4_sang_length=strlen($g4_sang); //길이를 얻는다.
  $g4_sang=substr($g4_sang,0,$g4_sang_length-1);//처음부터 마지막 1자이전까지               
  break;}        
    }else{$index_file="/".$index_file;  $_head_file="/".$_head_file;
  $_com_file="/".$_com_file;}              
}//for
######################################################
?>
<?
 $g4_path = $g4_sang;
 include_once("$g4_path/common.php");
 include_once("$g4[path]/lib/latest.lib.php");
 $g4[title] = "";
 include_once("$g4[path]/_head.php");
##########################################2006.07.05 dalsoo
//이줄 위로부터는 공백란인이 있으시면 헤드가 걸립니다.?>
<? $g4_sang_main="..".$g4_path;?>
<? $main1_width=710; ?>
<table width='<?=$main1_width?>'>
<!-- =====================-->
  <tr valign='center'>
  <td  style='padding-left:40px' align='left' bgcolor='#F8F8F9' height='200' align='center'>
<font color='#8d1009' size='5'></font>
&nbsp;<font color='#006699'>▶<a href='<?=$g4_sang_main?>/index_free.php'>
상위의 메인[홈] 바로가기</font></a><br>  
  <?#-----------------------------------------------------
  //확인후 삭제 하십시요.
  echo"
  <br><font color='#8d1009'>여기가 상대경로(상위)루트 입니다...!!
  &nbsp;&nbsp; ==> $g4_sang</font>
  <br>이제 맘대로 상위에 방을 만들고 멋진 Page를 씁니다..!!!";
  #-----------------------------------------------------
  ?>
</td>
  </tr>
<!-- ===================-->
</table>
<!-- 메인화면 최신글 시작 -->
<table width="100%" cellpadding=0 cellspacing=0><tr><td valign=top>
<?
$sql = " select bo_table, bo_subject from $g4[board_table] order by gr_id, bo_table ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) { 
    echo latest("basic", $row[bo_table], 5, 70);
    echo "<p>\n";
}
?>
</td></tr></table>
<!-- 메인화면 최신글 끝 -->
<script language="JavaScript" type="text/javascript">
function toggle(_s,_h) {
  if (document.all) {
    eval("document.all."+_s+".style.visibility='visible';");
    eval("document.all."+_h+".style.visibility='hidden';"); }
  else {
    if(navigator.userAgent.indexOf("Gecko")!=-1) {// is NS6 ?
      document.getElementById(_s).style.visibility='visible';
      document.getElementById(_h).style.visibility='hidden'; }
    else {
    eval("document.layers['"+_s+"'].visibility='show';");
    eval("document.layers['"+_h+"'].visibility='show';"); }
  }
}
</script>
<?
include_once("$g4[path]/_tail.php");
?>
</body>
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT