관리자 퇴근하면 설정된값으로 메인화면 노출. 정보
관리자 퇴근하면 설정된값으로 메인화면 노출.본문
사이트를 운영하는데
- 새볔 01 ~ 09 시 까지는 유저가 올린 최신글이 안올라오고 관리자가 지정된 글만 메인에 노출할려구 구현하였습니다..
- 코드 정리 없이 올립니다.
1. 관리자 페이지 여분필드 이용.
-----------------------------------
<tr class='ht'>
<td colspan=4 align=left><?=subtitle("관리자 부재 설정")?></td>
</tr>
<tr><td colspan=4 class=line1></td></tr>
<tr class='ht'>
<td>안내 제목</td>
<td colspan=3>
<textarea class=ed name='cf_1_subj' rows='5' style='width:99%;' value='<?=get_text($config["cf_1_subj"])?>' title='시간대 안내 제목'><?=$config[cf_1_subj]?></textarea>
</td>
</tr>
<tr class='ht'>
<td>부재시간설정</td>
<td colspan=3>
<input type=text class=ed name='cf_1' value='<?=get_text($config["cf_1"])?>' title='시작시간' style='text-align:right;font-weight:bold;' size=5>
[ - ]
<input type=text class=ed name='cf_2' value='<?=get_text($config["cf_2"])?>' title='끝시간' style='text-align:right;font-weight:bold;' size=5>
</td>
</tr>
<td colspan=4 align=left><?=subtitle("관리자 부재 설정")?></td>
</tr>
<tr><td colspan=4 class=line1></td></tr>
<tr class='ht'>
<td>안내 제목</td>
<td colspan=3>
<textarea class=ed name='cf_1_subj' rows='5' style='width:99%;' value='<?=get_text($config["cf_1_subj"])?>' title='시간대 안내 제목'><?=$config[cf_1_subj]?></textarea>
</td>
</tr>
<tr class='ht'>
<td>부재시간설정</td>
<td colspan=3>
<input type=text class=ed name='cf_1' value='<?=get_text($config["cf_1"])?>' title='시작시간' style='text-align:right;font-weight:bold;' size=5>
[ - ]
<input type=text class=ed name='cf_2' value='<?=get_text($config["cf_2"])?>' title='끝시간' style='text-align:right;font-weight:bold;' size=5>
</td>
</tr>
2. 사이트에서 설정방법
----------------------
<?
//관리자 지정 시간 노출 스킨
/*
$g4['server_time'] = time();
$g4['time_ymd'] = date("Y-m-d", $g4['server_time']);
$g4['time_his'] = date("H:i:s", $g4['server_time']);
$g4['time_ymdhis'] = date("Y-m-d H:i:s", $g4['server_time']);
*/
//시간정의
$g4['time_h'] = date("H", $g4['server_time']); //시간을 계산
//관리자 지정 시간 노출 스킨
/*
$g4['server_time'] = time();
$g4['time_ymd'] = date("Y-m-d", $g4['server_time']);
$g4['time_his'] = date("H:i:s", $g4['server_time']);
$g4['time_ymdhis'] = date("Y-m-d H:i:s", $g4['server_time']);
*/
//시간정의
$g4['time_h'] = date("H", $g4['server_time']); //시간을 계산
$turn_start = $config['cf_1'] - $g4['time_h'];
$turn_end = $config['cf_2'] - $g4['time_h'];
$turn_end = $config['cf_2'] - $g4['time_h'];
//관리자가 지정한 시간에는 노출을 프리미엄으로 전환 한다.
if($turn_start <= 0 && $turn_end > 0){
echo ' ';
echo $config['cf_1_subj'];
echo '<br>';
//관리자 지정출력
if($gr_id){
$gr_count = 14;
$result = if_conf_pro("$gr_count", "5", $show, "", $options="$gr_id");
for ($i=0; $row=sql_fetch_array($result); $i++)
echo latest_ucc_control($row['po_poll6'], $row['po_poll1'], $row['po_ips'], $row['po_cnt2'], $row['po_poll17'],$row['po_poll10'],$row['po_poll12'],$row['po_poll13'],$row['po_poll15'] ,$row['po_poll16'] );
}
else{
$gr_count = 14;
$result = if_conf_pro("$gr_count", "5", $show, "", $options="$gr_id");
for ($i=0; $row=sql_fetch_array($result); $i++)
echo latest_ucc_control($row['po_poll6'], $row['po_poll1'], $row['po_cnt4'], $row['po_cnt2'], $row['po_poll11'],$row['po_poll10'],$row['po_poll12'],$row['po_poll13'],$row['po_poll14'],$row['po_poll15'] ,$row['po_poll16'] );
}
}
//관리자 지정시간이 아닐경우
else{
if($gr_id){
$gr_count = 4;
$result = if_conf_pro("$gr_count", "5", $show, "", $options="$gr_id");
for ($i=0; $row=sql_fetch_array($result); $i++)
echo latest_ucc($row['po_poll6'], $row['po_poll1'], $row['po_ips'], $row['po_cnt2'], $row['po_poll17'],$row['po_poll10'],$row['po_poll12'],$row['po_poll13'] );
}
else{
$gr_count = 4;
$result = if_conf_pro("$gr_count", "5", $show, "", $options="$gr_id");
for ($i=0; $row=sql_fetch_array($result); $i++)
echo latest_ucc($row['po_poll6'], $row['po_poll1'], $row['po_cnt4'], $row['po_cnt2'], $row['po_poll11'],$row['po_poll10'],$row['po_poll12'],$row['po_poll13'],$row['po_poll14'] );
}
}
?>
if($turn_start <= 0 && $turn_end > 0){
echo ' ';
echo $config['cf_1_subj'];
echo '<br>';
//관리자 지정출력
if($gr_id){
$gr_count = 14;
$result = if_conf_pro("$gr_count", "5", $show, "", $options="$gr_id");
for ($i=0; $row=sql_fetch_array($result); $i++)
echo latest_ucc_control($row['po_poll6'], $row['po_poll1'], $row['po_ips'], $row['po_cnt2'], $row['po_poll17'],$row['po_poll10'],$row['po_poll12'],$row['po_poll13'],$row['po_poll15'] ,$row['po_poll16'] );
}
else{
$gr_count = 14;
$result = if_conf_pro("$gr_count", "5", $show, "", $options="$gr_id");
for ($i=0; $row=sql_fetch_array($result); $i++)
echo latest_ucc_control($row['po_poll6'], $row['po_poll1'], $row['po_cnt4'], $row['po_cnt2'], $row['po_poll11'],$row['po_poll10'],$row['po_poll12'],$row['po_poll13'],$row['po_poll14'],$row['po_poll15'] ,$row['po_poll16'] );
}
}
//관리자 지정시간이 아닐경우
else{
if($gr_id){
$gr_count = 4;
$result = if_conf_pro("$gr_count", "5", $show, "", $options="$gr_id");
for ($i=0; $row=sql_fetch_array($result); $i++)
echo latest_ucc($row['po_poll6'], $row['po_poll1'], $row['po_ips'], $row['po_cnt2'], $row['po_poll17'],$row['po_poll10'],$row['po_poll12'],$row['po_poll13'] );
}
else{
$gr_count = 4;
$result = if_conf_pro("$gr_count", "5", $show, "", $options="$gr_id");
for ($i=0; $row=sql_fetch_array($result); $i++)
echo latest_ucc($row['po_poll6'], $row['po_poll1'], $row['po_cnt4'], $row['po_cnt2'], $row['po_poll11'],$row['po_poll10'],$row['po_poll12'],$row['po_poll13'],$row['po_poll14'] );
}
}
?>
추천
0
0
댓글 2개
감사합니다
오!! 매우 유용합니다. 감사합니다.