관리자 퇴근하면 설정된값으로 메인화면 노출.

11.jpg
사이트를 운영하는데
 
-  새볔 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>
 
 
 
 
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']);  //시간을 계산
         
           $turn_start = $config['cf_1'] - $g4['time_h'];
           $turn_end   = $config['cf_2'] - $g4['time_h'];
          //관리자가 지정한 시간에는 노출을 프리미엄으로 전환 한다.
          if($turn_start <= 0 && $turn_end > 0){
              echo '&nbsp;&nbsp;&nbsp;';
        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'] );
        }
      }
       
      ?>

첨부파일

11.jpg (57.9 KB)
0회 2007-05-21 22:09
|

댓글 2개

오!! 매우 유용합니다. 감사합니다.
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 팁자료실

그누보드4와 관련된 팁을 여러분들과 함께 공유하세요. 나누면 즐거움이 커집니다.

+
제목 글쓴이 날짜 조회
18년 전 조회 5,629
18년 전 조회 5,326
18년 전 조회 3,198
18년 전 조회 5,364
18년 전 조회 2,624
18년 전 조회 5,283
18년 전 조회 3,463
18년 전 조회 2,463
18년 전 조회 3,919
18년 전 조회 3,241
18년 전 조회 3,416
18년 전 조회 3,513
18년 전 조회 3,161
18년 전 조회 5,373
18년 전 조회 1만
18년 전 조회 3,627
18년 전 조회 6,277
18년 전 조회 6,465
18년 전 조회 3,621
18년 전 조회 7,946
🐛 버그신고