<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once("$g4[path]/lib/outlogin.lib.php");
include_once("$g4[path]/lib/poll.lib.php");
include_once("$g4[path]/lib/visit.lib.php");
include_once("$g4[path]/lib/connect.lib.php");
include_once("$g4[path]/lib/popular.lib.php");

// $board[shop]; 


//out login skin sql start

  $mct     =  "  po_poll1 = 'skin'  ";  
  $mct    .=  " and po_poll2 = 'outlogin' "; 
  $out_login = "";
  $sql = " select * from $board[shop] where $mct ";
  $out_row = sql_query($sql);
  if(!$out_row){
    $out_login .= 'basic';
  }
  else{
    while ($data = sql_fetch_array($out_row)){
		  $out_login .= $data[po_poll3];
	  }}
//out login skin end


$go_path[skin]  = "./shop.php?url=skin";
if($act){
  $mct     =  "  po_poll1 = 'skin'  ";  
  $mct    .=  " and po_poll2 = '$act' "; 
  $out_login = "";
  $sql = " select * from $board[shop] where $mct ";
  $out_row = sql_query($sql);
  if($cat_row=='0'){
     $sql = " insert into $board[shop]
            set po_poll1 = '$po_poll1',
                po_poll2  = '$act',
                po_poll3  = '$po_poll3' ";
    $result  = sql_query($sql);
	if($result){
	  alert("정상적으로 $act 등록[삽입]되었습니다.", $go_path[skin]);
	}
	else{
	 alert("코드 에러입니다. 소스수정insert[skin.php]이 필요합니다..", $go_path[skin]);
	}
  }
  else{

    $sql = " update $board[shop]
            set po_poll1 = '$po_poll1',
                po_poll2  = '$act',
                po_poll3  = '$po_poll3' ";
    $result = sql_query($sql, FALSE);
	if($result){
	  alert("정상적으로  $act 업데이트되었습니다.", $go_path[skin]);
	}
	else{
	 alert("코드 에러입니다. 소스수정update[skin.php]이 필요합니다..", $go_path[skin]);
	}
  }

}


$colspan = 3;

//out login html start
{?>
<table width=100% cellpadding=0 cellspacing=1>
<tr><td colspan='<?=$colspan?>' class='line1'></td></tr>

<form action="./shop.php?url=skin&act=outlogin" method=post>
<input type=hidden name=po_poll1   value="skin">
<tr><td style='padding-left:10px; height:30px;'>OUT_LOGIN SKIN CHANGE
<td><select name="po_poll3" value="<?=$out_login?>" >
<?
$skin_path  = "../skin";
$skin_path .= "/outlogin/";  // 목록스킨을 지정합니다.
$arr = shop_file("$skin_path");
for ($k=0; $k<count($arr); $k++){
   $option = $arr[$k];
   if (strlen($option) > 10)
   $option = substr($arr[$k], 0, 25) . "";
   echo '<option value="';
   echo $arr[$k];
   echo '"';
   if ($arr[$k] == $out_login)
   echo 'selected';
   echo '>';
   echo  $option;
   echo "\n"; 
   }  
?>    
</select>
</td>
<td>
<input type="submit" name="formbutton1" value="확인">

</td>
</tr>
<tr><td colspan='<?=$colspan?>' class='line2'></td></tr>
<tr><td colspan='<?=$colspan?>' align='center'>
<?=outlogin("$out_login"); // 외부 로그인 ?>
</td></tr>
</form>
</table>
<?}
//out login html end







?>
