모바일에선 글자를 안보이게 하고 싶어요

모바일에선 글자를 안보이게 하고 싶어요

QA

모바일에선 글자를 안보이게 하고 싶어요

본문

PC화면에서는 달력과 내용이 보이게 만들었으며,

988667759_1692581774.4682.png

모바일에선 내용만 보이게 할려고 수정을 하고 있습니다. 

1) 날짜에 관한 내용은 모바일에선 안보이게 하고 싶습니다.

988667759_1692581713.0674.png

 

기본 코드에서 건드린건 1. <?php echo is_mobile() ? 0 : 50?>와 2.<?php echo is_mobile() ? 100 : 50 ?> 이코드 추가했습니다.

1. <div style="width:<?php echo is_mobile() ? 0 : 50?>%;float:left;"> 
    <div class="cal" style="">
        <table width= "100%" cellSpacing="2" cellPadding="0" border="0" align="center">
            <tr style="border-bottom: 1px solid #ccc;">
                <td align="center" class="bgsun">일</td>
                <td align="center" class="bgweek">월</td>
                <td align="center" class="bgweek">화</td>
                <td align="center" class="bgweek">수</td>
                <td align="center" class="bgweek">목</td>
                <td align="center" class="bgweek">금</td>
                <td align="center" class="bgsat">토</td>
            </tr>
            <tr>
                <td colspan="7" bgcolor="#DDDDDD"></td>
            </tr>

....

 

2. <div class="" style="width: <?php echo is_mobile() ? 100 : 50 ?>%; float: left;;overflow: auto;background: #ffffff; ">
    <div id="changeNowListBox">
        <div class="NowListBoxYear"><?= date("Y년"); ?><div class="more_"><a href="/bbs/board.php?bo_table=0403<?= $options["mobile"] ? "&mode=week" : "" ?>"> + </a></div></div>
        <div class="NowListBoxMonthDay"><?= date("m월 d일")?> <?php $yoil_text_set = array("일요일","월요일","화요일","수요일","목요일","금요일","토요일"); $yoil = $yoil_text_set[date('w', strtotime(date("Y-m-d")))]; echo $yoil; ?></div>
        <?php
        $myListSql = "select * from ".$g5['write_prefix'].$bo_table." where left(wr_1,8) <= '".$year.$sel_mon[i].sprintf("%02d",$mday)."'  and left(wr_2,8) >= '".$year.$sel_mon[i].sprintf("%02d",$mday)."'  order by wr_id asc";
        $myListRes = sql_query($myListSql);
        ?>
        <ul class="NowListUl">
    <?php if (sql_num_rows($myListRes) > 0) : ?>
        <?php while($row = sql_fetch_array($myListRes)) :
            switch ($row["wr_9"])
            {
                case "background:rgb(243,80,85)":
                    $tmpName = "[이천IL]";
                  break;
                case "background:rgb(131,183,48);":
                    $tmpName = "[서비스지원국]";
                  break;
                case "background:rgb(249, 188, 35);":
                    $tmpName = "[여성장애인교육팀]";
                  break;
                case "background:rgb(66,174,220);":
                    $tmpName = "[체험홈]";
                  break;
                case "background:rgb(128, 65, 217);":
                    $tmpName = "[주간활동]";
                  break;
                case "background:rgb(1, 0, 225);":
                    $tmpName = "[방과후활동]";
                  break;
            }
        ?>
        <li>
            <div style="display: inline;"><?= $tmpName ?><?= $row["wr_subject"] ?></div>
        </li>
        <?php endwhile ?>
    <?php else : ?>
        <li>
            <div style="display: inline;">오늘은 일정이 없습니다.</div>
        </li>
    <?php endif; ?>
</ul>
    </div>
</div>

 

아래 전체 코드 


<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once("$latest_skin_path/moonday.php");
/*
// 사용방법
<?php
//echo latest("theme/스킨명", "게시판명", 1, 1, 1,"넓이");
echo latest("theme/hp5_calendar", "schedule", 1, 1, 1,"200");
?>
*/
//옵션분리
list($n_table_width,$cellw,$cellh) = explode(",", $options);
if (!$cellw) {
/*    $cellh  = 21;
    $cellw  = 22 + 20;*/
    $cellh  = 39;
    $cellw  = 39 + 20;
}
?>
<style type="text/css">
    .cal {margin-bottom:15px; padding:7px 0; /*border-left:solid 1px #628bc5;  border-right:solid 1px #628bc5;  border-bottom:solid 1px #628bc5;*/ background:#f8f8f8;}
td.title    { text-align: center; height: <?php echo $cellh; ?>px; font-weight: bold; }
td.invalid  { text-align: center; padding-top: 2px; height: <?php echo $cellh; ?>px; width: <?php echo $cellw; ?>px; /*background: url(<?php echo $latest_skin_url; ?>/img/mini2.gif) no-repeat bottom;*/ }
td.valid    { text-align: center; height: <?php echo $cellh; ?>px; width: <?php echo $cellw; ?>px; /*background:#fff;*//*border:1px solid #e5e5e5;*/ }
td.today    { text-align: center; /*background: #eee; border: 1px solid #e5e5e5;*/ height: <?php echo $cellh ?>px; width: <?php echo $cellw; ?>px; font-weight: bold; }
/*.bgsun    {text-align: center; color: #fff;background:#ff5151; font-weight:bold; height:<?php echo $cellh; ?>px; width:<?php echo $cellw; ?>px; }
.bgsat  {text-align: center; color: #fff;font-weight:bold;background:#3862ff;  height:<?php echo $cellh?>px; width:<?php echo $cellw; ?>px; }
.bgweek   {text-align: center;color: #fff;font-weight:bold;background:#666;  height:<?php echo $cellh?>px; width:<?php echo $cellw; ?>px; }*/
.bgsun    { font-size: 17px; text-align: center; color: #ff5151; font-weight: bold; height: <?php echo $cellh;?>px; width: <?php echo $cellw; ?>px; }
.bgsat    { font-size: 17px; text-align: center; color: #3862ff; font-weight :bold; height: <?php echo $cellh?>px; width: <?php echo $cellw; ?>px; }
.bgweek   { font-size: 17px; text-align: center; color: #333; font-weight: bold; height: <?php echo $cellh?>px; width: <?php echo $cellw; ?>px; }
/*.selDay { background: #FF8040; height: <?php echo $cellh?>px; line-height: 200%; overflow: hidden; }*/
.selDay { background: #FF8040; width: 29px; height: 29px; line-height: 240%; overflow: hidden; border-radius: 19px; padding: 0; margin: auto; }
.selDay a.writeday { color: #fff !important; font-size: 17px; display: block; width: 100%; height: 100%; }
p.title     { font-size: 1em; font-weight:bold; }
p.sunday    { text-align: center; color: #FF0000; font-size: 17px; }
p.saturday  { text-align: center; color: #3366CC; font-size: 17px; }
p.weekday   { text-align: center; color: #333; font-size: 17px; }
a:link.writeday, a:visited.writeday  {text-align: center;  color: #0000FF;}
img {border:0}

@media(max-width:767px){
        .cal {margin-bottom: 0px; padding:13px 0; /*border-left:solid 1px #628bc5;  border-right:solid 1px #628bc5;  border-bottom:solid 1px #628bc5;*/ background:#f8f8f8;}
        td.title    { text-align: center; height: <?php echo $cellh; ?>px; font-weight: bold; }
        td.invalid  { text-align: center; padding-top: 2px; height: 25px; width: 53px;}
        td.valid    { text-align: center; height: 25px; width: 53px; }
        td.today    { text-align: center; height: 25px; width: 53px; font-weight: bold; }
        .bgsun    { font-size: 13px; text-align: center; color: #ff5151; font-weight: bold; height: 25px; width: 53px; }
        .bgsat    { font-size: 13px; text-align: center; color: #3862ff; font-weight :bold; height: 25px; width: 53px; }
        .bgweek   { font-size: 13px; text-align: center; color: #333; font-weight: bold; height: 25px; width: 53px; }
        .selDay { background: #FF8040; width: 19px; height: 19px; line-height: 150%; overflow: hidden; border-radius: 19px; padding: 0; margin: auto; }
        .selDay a.writeday { color: #fff !important; font-size: 11px; display: block; width: 100%; height: 100%; }
        p.title     { font-size: 1em; font-weight:bold; }
        p.sunday    { text-align: center; color: #FF0000; font-size: 13px; }
        p.saturday  { text-align: center; color: #3366CC; font-size: 13px; }
        p.weekday   { text-align: center; color: #333; font-size: 13px; }

}
</style>
<?php
$hp_latest_skin = explode("skin/latest/",$latest_skin_url);
//echo $hp_latest_skin[1];
$latest_dir = $hp_latest_skin[1];
$today = getdate();
$b_mon = $today['mon'];
$b_day = $today['mday'];
$b_year = $today['year'];
if ($year < 1) {
   $month = $b_mon;
   $mday = $b_day;
   $year = $b_year;
}
if ($_GET["year"]) {
    $year = $_GET["year"];
}
if ($_GET["month"]) {
    $month = $_GET["month"];
}
$lastday=array(0,31,28,31,30,31,30,31,31,30,31,30,31);
if ($year%4 == 0) $lastday[2] = 29;
$dayoftheweek = date("w", mktime (0,0,0,$month,1,$year));
?>
<div style="width:<?php echo is_mobile() ? 0 : 50?>%;float:left;">
    <div class="cal" style="">
        <table width= "100%" cellSpacing="2" cellPadding="0" border="0" align="center">
            <tr style="border-bottom: 1px solid #ccc;">
                <td align="center" class="bgsun">일</td>
                <td align="center" class="bgweek">월</td>
                <td align="center" class="bgweek">화</td>
                <td align="center" class="bgweek">수</td>
                <td align="center" class="bgweek">목</td>
                <td align="center" class="bgweek">금</td>
                <td align="center" class="bgsat">토</td>
            </tr>
            <tr>
                <td colspan="7" bgcolor="#DDDDDD"></td>
            </tr>
<?php
            $cday = 1;
            $sel_mon[i] = sprintf("%02d",$month);
            $query = "select * from ".$g5['write_prefix'].$bo_table." where left(wr_1,6) <= '".$year.$sel_mon[i]."'  and left(wr_2,6) >= '".$year.$sel_mon[i]."'  order by wr_id asc";
            //echo $query;
            $result = sql_query($query);
            // 내용을 보여주는 부분
            while ($row = sql_fetch_array($result)) {  // 제목글 뽑아서 링크 문자열 만들기..
                if( substr($row[wr_1],0,6) < $year.$sel_mon[i] ) {
                    $start_day[i] =1;
                    $start_day[i]= (int)$start_day[i];
                } else {
                    $start_day[i] = substr($row[wr_1],6,2);
                    $start_day[i]= (int)$start_day[i];
                }
                if( substr($row[wr_2],0,6) > $year.$sel_mon[i] ) {
                    $end_day[i] = $lastday[$month];
                    $end_day[i]= (int)$end_day[i];
                } else {
                    $end_day[i] = substr($row[wr_2],6,2);
                    $end_day[i]= (int)$end_day[i];
                }
                //echo "start_day = ".$start_day[i] ."<br>";
                //echo "end_day = ".$end_day[i] ."<br>";
                for ($i = $start_day[i] ; $i <= $end_day[i];  $i++) {
                    $html_day[$i] = "1";
                }
            }
            // 달력의 틀을 보여주는 부분
            // 여기부터 분석하면 됨
            $temp = 7- (($lastday[$month]+$dayoftheweek)%7);
            // $dayoftheweek; // 6 이다.
            // $temp = 6 이다. 무슨 의미인가?
            if ($temp == 7) $temp = 0;
            $lastcount = $lastday[$month]+$dayoftheweek + $temp;
            // $lastcount = 42
            // $lastcount 는 달력을 이루고 있는 전체 셀의 갯수이다.  2003년 11월은 날짜 30개와 빈칸 12개 다.
            //
            for ($iz = 1; $iz <= $lastcount; $iz++) { // 42번을 칠하게 된다.
                $bgcolor = "#ffffff";  // 쭉 흰색으로 칠하고
                $offset = $iz%7;
                if ($offset == 1) echo ("            <tr>\n"); // 주당 7개씩 한쎌씩을 쌓는다.
                if ($dayoftheweek < $iz  &&  $iz <= $lastday[$month]+$dayoftheweek)    {
                    if ($b_year==$year && $b_mon==$month && $b_day==$cday) {
                        $cstyle = 'today';
                    } else {
                        $cstyle = 'valid';
                    }
                    switch ($offset) {            // 요일에 따라 날짜의 색깔 결정
                        case 1: $dstyle = 'sunday';
                        break;
                        case 0: $dstyle = 'saturday';
                        break;
                        default: $dstyle = 'weekday';
                    }
                    // 전체 루프안에서 숫자가 들어가는 셀들만 해당됨
                    // 즉 11월 달에서 1일부터 30 일까지만 해당
                    $daytext = "$cday";   // $cday 는 숫자 예> 11월달은 1~ 30일 까지
                    $f_date = $year.sprintf("%02d",$month).sprintf("%02d",$cday);
                    //$daytext 은 셀에 써질 날짜 숫자 넣을 공간
                    //if ($iz%7 == 1) $daytext = "<font color=red>$daytext</font>"; // 일요일
                    //if ($iz%7 == 0) $daytext = "<font color=blue>$daytext</font>"; // 토요일
                    // 여기까지 숫자와 들어갈 내용에 대한 변수들의 세팅이 끝나고
                    // 이제 여기 부터 직접 셀이 그려지면서 그 안에 내용이 들어 간다.
                    $myarray = soltolun($year,$month,$cday);
                    $moonday="";
                    echo ("                <td class='".$cstyle."'>");
                    //echo "<p class='".$dstyle."'>".$daytext.$moonday."</p>";
                    if ($html_day[$cday]) {
                        echo "<p class='selDay'>";
                        echo "<a href=\"javascript:nowDayList('{$bo_table}','{$year}','{$month}','{$cday}','{$options["mobile"]}')\" class='writeday'>";
                        echo "<b>".$daytext."</b>";
                        echo "</a>";
                        echo "</p>";
                    }
                    else { // 글쓰기 권한이 없으면 글쓰기 링크는 넣지 않고 그냥 숫자만 출력하기
                        echo "<p class='".$dstyle."'>".$daytext."</p>";
                    }
                    //       echo $html_day[$cday];
                    echo ("</td>\n");  // 한칸을 마무리
                    $cday++; // 날짜를 카운팅
                }
                // 11월에서 1일부터 30일에 해당되지 않으면 그냥 회색을 칠한다.
                else { echo ("                <td class='invalid'> </td>\n"); }
                if (($iz%7) == 0) echo ("            </tr>\n");
            } // 반복구문이 끝남
            ?>
        </table>
    </div>
</div>
<style>
    #changeNowListBox { padding: 12px 12px; height: 254px; width: 100%; }
    #changeNowListBox .NowListBoxYear { font-size: 19px; font-weight: 600; color: #f9aa83; text-align: left; padding: 0px 0px 2px; }
    #changeNowListBox .NowListBoxYear::after { content: "\f073"; font-family: "Font Awesome 5 Free"; font-size: 50px; position: relative; top: 25px; right: -133px; }
    #changeNowListBox .NowListBoxMonthDay { font-size: 21px; font-weight: 600; color: #ff8040; text-align: left; padding: 0px 0px 5px; border-bottom: 3px solid #ff8040; }
    #changeNowListBox table {  padding: 3px 0 0 0; /* width: 260px; */ table-layout: fixed; }
    #changeNowListBox table tr {  }
    #changeNowListBox table tr td { width: 260px;  font-size: 15px; font-weight: 600; color: #ff8040; text-align: left; padding: 5px 0px 3px; /* white-space: nowrap; */ text-overflow: ellipsis; overflow: hidden; }
    .NowListUl {margin-left: 15px;}
    .NowListUl li {list-style: disc;font-size: 15px; font-weight: 600; color: #00000; text-align: left;padding: 5px 0px 3px;}
    .more_ { position: absolute; top: 53px; right: 25px; }
    .more_ a { font-size: 31px; font-weight: 700; color: #ff8040; }
    @media(max-width:767px){
        #changeNowListBox { padding: 12px 12px; height: 178px; width: 100%; position: relative; }
        #changeNowListBox .NowListBoxYear { font-size: 11px; font-weight: 600; color: #ff8040; text-align: left; padding: 0px 0px 2px; }
        /*#changeNowListBox .NowListBoxYear::after { content: "\f073"; font-family: "Font Awesome 5 Free"; font-size: 32px; position: absolute; top: 408px; right: 32px; }*/
        #changeNowListBox .NowListBoxYear::after { content: "\f073"; font-family: "Font Awesome 5 Free"; font-size: 23px; position: absolute; top: 22px; right: 18px; }
        #changeNowListBox .NowListBoxMonthDay { font-size: 13px; font-weight: 600; color: #ff8040; text-align: left; padding: 0px 0px 5px; border-bottom: 3px solid #ff8040; }
        #changeNowListBox table {  padding: 3px 0 0 0; width: 152px; table-layout: fixed; }
        #changeNowListBox table tr {  }
        #changeNowListBox table tr td { width: 152px; font-size: 10px; font-weight: 600; color: #ff8040; text-align: left; padding: 2px 0px 1px; /* white-space: nowrap; */ text-overflow: ellipsis; overflow: hidden; }
        .more_ { position: absolute; top: -5px; right: 5px; }
        .more_ a { font-size: 21px; font-weight: 700; color: #ff8040; }
    }
</style>
<div class="" style="width: <?php echo is_mobile() ? 100 : 50 ?>%; float: left;;overflow: auto;background: #ffffff; ">
    <div id="changeNowListBox">
        <div class="NowListBoxYear"><?= date("Y년"); ?><div class="more_"><a href="/bbs/board.php?bo_table=0403<?= $options["mobile"] ? "&mode=week" : "" ?>"> + </a></div></div>
        <div class="NowListBoxMonthDay"><?= date("m월 d일")?> <?php $yoil_text_set = array("일요일","월요일","화요일","수요일","목요일","금요일","토요일"); $yoil = $yoil_text_set[date('w', strtotime(date("Y-m-d")))]; echo $yoil; ?></div>
        <?php
        $myListSql = "select * from ".$g5['write_prefix'].$bo_table." where left(wr_1,8) <= '".$year.$sel_mon[i].sprintf("%02d",$mday)."'  and left(wr_2,8) >= '".$year.$sel_mon[i].sprintf("%02d",$mday)."'  order by wr_id asc";
        $myListRes = sql_query($myListSql);
        ?>
        <ul class="NowListUl">
    <?php if (sql_num_rows($myListRes) > 0) : ?>
        <?php while($row = sql_fetch_array($myListRes)) :
            switch ($row["wr_9"])
            {
                case "background:rgb(243,80,85)":
                    $tmpName = "[이천IL]";
                  break;
                case "background:rgb(131,183,48);":
                    $tmpName = "[서비스지원국]";
                  break;
                case "background:rgb(249, 188, 35);":
                    $tmpName = "[여성장애인교육팀]";
                  break;
                case "background:rgb(66,174,220);":
                    $tmpName = "[체험홈]";
                  break;
                case "background:rgb(128, 65, 217);":
                    $tmpName = "[주간활동]";
                  break;
                case "background:rgb(1, 0, 225);":
                    $tmpName = "[방과후활동]";
                  break;
            }
        ?>
        <li>
            <div style="display: inline;"><?= $tmpName ?><?= $row["wr_subject"] ?></div>
        </li>
        <?php endwhile ?>
    <?php else : ?>
        <li>
            <div style="display: inline;">오늘은 일정이 없습니다.</div>
        </li>
    <?php endif; ?>
</ul>
    </div>
</div>
<script>
function nowDayList(bo_table, tmpYear, tmpMonth, tmpDay, tmpMobile)
{
    $.post("<?= $latest_skin_url ?>/nowDayList.php", {"bo_table" : bo_table, "tmpYear" : tmpYear, "tmpMonth" : tmpMonth, "tmpDay" : tmpDay, "tmpMobile" : tmpMobile},function(res){
        $("#changeNowListBox").html(res);
    });
}
</script>

 

 

이 질문에 댓글 쓰기 :

답변 2


<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once("$latest_skin_path/moonday.php");
/*
// 사용방법
<?php
//echo latest("theme/스킨명", "게시판명", 1, 1, 1,"넓이");
echo latest("theme/hp5_calendar", "schedule", 1, 1, 1,"200");
?>
*/
//옵션분리
list($n_table_width,$cellw,$cellh) = explode(",", $options);
if (!$cellw) {
/*    $cellh  = 21;
    $cellw  = 22 + 20;*/
    $cellh  = 39;
    $cellw  = 39 + 20;
}
?>
<style type="text/css">
    .cal {margin-bottom:15px; padding:7px 0; /*border-left:solid 1px #628bc5;  border-right:solid 1px #628bc5;  border-bottom:solid 1px #628bc5;*/ background:#f8f8f8;}
td.title    { text-align: center; height: <?php echo $cellh; ?>px; font-weight: bold; }
td.invalid  { text-align: center; padding-top: 2px; height: <?php echo $cellh; ?>px; width: <?php echo $cellw; ?>px; /*background: url(<?php echo $latest_skin_url; ?>/img/mini2.gif) no-repeat bottom;*/ }
td.valid    { text-align: center; height: <?php echo $cellh; ?>px; width: <?php echo $cellw; ?>px; /*background:#fff;*//*border:1px solid #e5e5e5;*/ }
td.today    { text-align: center; /*background: #eee; border: 1px solid #e5e5e5;*/ height: <?php echo $cellh ?>px; width: <?php echo $cellw; ?>px; font-weight: bold; }
/*.bgsun    {text-align: center; color: #fff;background:#ff5151; font-weight:bold; height:<?php echo $cellh; ?>px; width:<?php echo $cellw; ?>px; }
.bgsat  {text-align: center; color: #fff;font-weight:bold;background:#3862ff;  height:<?php echo $cellh?>px; width:<?php echo $cellw; ?>px; }
.bgweek   {text-align: center;color: #fff;font-weight:bold;background:#666;  height:<?php echo $cellh?>px; width:<?php echo $cellw; ?>px; }*/
.bgsun    { font-size: 17px; text-align: center; color: #ff5151; font-weight: bold; height: <?php echo $cellh;?>px; width: <?php echo $cellw; ?>px; }
.bgsat    { font-size: 17px; text-align: center; color: #3862ff; font-weight :bold; height: <?php echo $cellh?>px; width: <?php echo $cellw; ?>px; }
.bgweek   { font-size: 17px; text-align: center; color: #333; font-weight: bold; height: <?php echo $cellh?>px; width: <?php echo $cellw; ?>px; }
/*.selDay { background: #FF8040; height: <?php echo $cellh?>px; line-height: 200%; overflow: hidden; }*/
.selDay { background: #FF8040; width: 29px; height: 29px; line-height: 240%; overflow: hidden; border-radius: 19px; padding: 0; margin: auto; }
.selDay a.writeday { color: #fff !important; font-size: 17px; display: block; width: 100%; height: 100%; }
p.title     { font-size: 1em; font-weight:bold; }
p.sunday    { text-align: center; color: #FF0000; font-size: 17px; }
p.saturday  { text-align: center; color: #3366CC; font-size: 17px; }
p.weekday   { text-align: center; color: #333; font-size: 17px; }
a:link.writeday, a:visited.writeday  {text-align: center;  color: #0000FF;}
img {border:0}
@media(max-width:767px){
        .cal {margin-bottom: 0px; padding:13px 0; /*border-left:solid 1px #628bc5;  border-right:solid 1px #628bc5;  border-bottom:solid 1px #628bc5;*/ background:#f8f8f8;}
        td.title    { text-align: center; height: <?php echo $cellh; ?>px; font-weight: bold; }
        td.invalid  { text-align: center; padding-top: 2px; height: 25px; width: 53px;}
        td.valid    { text-align: center; height: 25px; width: 53px; }
        td.today    { text-align: center; height: 25px; width: 53px; font-weight: bold; }
        .bgsun    { font-size: 13px; text-align: center; color: #ff5151; font-weight: bold; height: 25px; width: 53px; }
        .bgsat    { font-size: 13px; text-align: center; color: #3862ff; font-weight :bold; height: 25px; width: 53px; }
        .bgweek   { font-size: 13px; text-align: center; color: #333; font-weight: bold; height: 25px; width: 53px; }
        .selDay { background: #FF8040; width: 19px; height: 19px; line-height: 150%; overflow: hidden; border-radius: 19px; padding: 0; margin: auto; }
        .selDay a.writeday { color: #fff !important; font-size: 11px; display: block; width: 100%; height: 100%; }
        p.title     { font-size: 1em; font-weight:bold; }
        p.sunday    { text-align: center; color: #FF0000; font-size: 13px; }
        p.saturday  { text-align: center; color: #3366CC; font-size: 13px; }
        p.weekday   { text-align: center; color: #333; font-size: 13px; }
}
</style>
<?php
$hp_latest_skin = explode("skin/latest/",$latest_skin_url);
//echo $hp_latest_skin[1];
$latest_dir = $hp_latest_skin[1];
$today = getdate();
$b_mon = $today['mon'];
$b_day = $today['mday'];
$b_year = $today['year'];
if ($year < 1) {
   $month = $b_mon;
   $mday = $b_day;
   $year = $b_year;
}
if ($_GET["year"]) {
    $year = $_GET["year"];
}
if ($_GET["month"]) {
    $month = $_GET["month"];
}
$lastday=array(0,31,28,31,30,31,30,31,31,30,31,30,31);
if ($year%4 == 0) $lastday[2] = 29;
$dayoftheweek = date("w", mktime (0,0,0,$month,1,$year));
?>
<div style="display:<?php if(is_mobile())echo 'none';?>;width:<?php echo is_mobile() ? 0 : 50?>%;float:left;">
    <div class="cal" style="">
        <table width= "100%" cellSpacing="2" cellPadding="0" border="0" align="center">
            <tr style="border-bottom: 1px solid #ccc;">
                <td align="center" class="bgsun">일</td>
                <td align="center" class="bgweek">월</td>
                <td align="center" class="bgweek">화</td>
                <td align="center" class="bgweek">수</td>
                <td align="center" class="bgweek">목</td>
                <td align="center" class="bgweek">금</td>
                <td align="center" class="bgsat">토</td>
            </tr>
            <tr>
                <td colspan="7" bgcolor="#DDDDDD"></td>
            </tr>
            <?php
            $cday = 1;
            $sel_mon = sprintf("%02d", $month);
            $query = "SELECT * FROM " . $g5['write_prefix'] . $bo_table . " WHERE LEFT(wr_1, 6) <= '" . $year . $sel_mon . "' AND LEFT(wr_2, 6) >= '" . $year . $sel_mon . "' ORDER BY wr_id ASC";
            $result = sql_query($query);
            // Reset arrays
            $html_day = array_fill(1, 31, false);
            $start_day = array_fill(1, 31, 1);
            $end_day = array_fill(1, 31, 1);
            while ($row = sql_fetch_array($result)) {
                $start_date = substr($row['wr_1'], 0, 6);
                $end_date = substr($row['wr_2'], 0, 6);
                for ($i = max($start_date, $year . $sel_mon); $i <= min($end_date, $year . $sel_mon); $i++) {
                    $day = (int)substr($i, 6, 2);
                    $html_day[$day] = true;
                }
            }
            $temp = 7 - (($lastday[$month] + $dayoftheweek) % 7);
            if ($temp == 7) {
                $temp = 0;
            }
            $lastcount = $lastday[$month] + $dayoftheweek + $temp;
            for ($iz = 1; $iz <= $lastcount; $iz++) {
                $offset = $iz % 7;
                if ($offset == 1) {
                    echo ("<tr>\n");
                }
                if ($dayoftheweek < $iz && $iz <= $lastday[$month] + $dayoftheweek) {
                    $cstyle = 'valid';
                    $dstyle = 'weekday';
                    if ($b_year == $year && $b_mon == $month && $b_day == $cday) {
                        $cstyle = 'today';
                    }
                    if ($offset === 1) {
                        $dstyle = 'sunday';
                    } elseif ($offset === 0) {
                        $dstyle = 'saturday';
                    }
                    $daytext = "$cday";
                    echo ("<td class='" . $cstyle . "'>");
                    if ($html_day[$cday]) {
                        echo ("<p class='selDay'>");
                        echo ("<a href=\"javascript:nowDayList('{$bo_table}','{$year}','{$month}','{$cday}','{$options["mobile"]}')\" class='writeday'>");
                        echo ("<b>" . $daytext . "</b>");
                        echo ("</a>");
                        echo ("</p>");
                    } else {
                        echo ("<p class='" . $dstyle . "'>" . $daytext . "</p>");
                    }
                    echo ("</td>\n");
                    $cday++;
                } else {
                    echo ("<td class='invalid'> </td>\n");
                }
                if (($iz % 7) === 0) {
                    echo ("</tr>\n");
                }
            }
            ?>
        </table>
    </div>
</div>
<style>
    #changeNowListBox { padding: 12px 12px; height: 254px; width: 100%; }
    #changeNowListBox .NowListBoxYear { font-size: 19px; font-weight: 600; color: #f9aa83; text-align: left; padding: 0px 0px 2px; }
    #changeNowListBox .NowListBoxYear::after { content: "\f073"; font-family: "Font Awesome 5 Free"; font-size: 50px; position: relative; top: 25px; right: -133px; }
    #changeNowListBox .NowListBoxMonthDay { font-size: 21px; font-weight: 600; color: #ff8040; text-align: left; padding: 0px 0px 5px; border-bottom: 3px solid #ff8040; }
    #changeNowListBox table {  padding: 3px 0 0 0; /* width: 260px; */ table-layout: fixed; }
    #changeNowListBox table tr {  }
    #changeNowListBox table tr td { width: 260px;  font-size: 15px; font-weight: 600; color: #ff8040; text-align: left; padding: 5px 0px 3px; /* white-space: nowrap; */ text-overflow: ellipsis; overflow: hidden; }
    .NowListUl {margin-left: 15px;}
    .NowListUl li {list-style: disc;font-size: 15px; font-weight: 600; color: #00000; text-align: left;padding: 5px 0px 3px;}
    .more_ { position: absolute; top: 53px; right: 25px; }
    .more_ a { font-size: 31px; font-weight: 700; color: #ff8040; }
    @media(max-width:767px){
        #changeNowListBox { padding: 12px 12px; height: 178px; width: 100%; position: relative; }
        #changeNowListBox .NowListBoxYear { font-size: 11px; font-weight: 600; color: #ff8040; text-align: left; padding: 0px 0px 2px; }
        /*#changeNowListBox .NowListBoxYear::after { content: "\f073"; font-family: "Font Awesome 5 Free"; font-size: 32px; position: absolute; top: 408px; right: 32px; }*/
        #changeNowListBox .NowListBoxYear::after { content: "\f073"; font-family: "Font Awesome 5 Free"; font-size: 23px; position: absolute; top: 22px; right: 18px; }
        #changeNowListBox .NowListBoxMonthDay { font-size: 13px; font-weight: 600; color: #ff8040; text-align: left; padding: 0px 0px 5px; border-bottom: 3px solid #ff8040; }
        #changeNowListBox table {  padding: 3px 0 0 0; width: 152px; table-layout: fixed; }
        #changeNowListBox table tr {  }
        #changeNowListBox table tr td { width: 152px; font-size: 10px; font-weight: 600; color: #ff8040; text-align: left; padding: 2px 0px 1px; /* white-space: nowrap; */ text-overflow: ellipsis; overflow: hidden; }
        .more_ { position: absolute; top: -5px; right: 5px; }
        .more_ a { font-size: 21px; font-weight: 700; color: #ff8040; }
    }
</style>
<div class="" style="width: <?php echo is_mobile() ? 100 : 50 ?>%; float: left;;overflow: auto;background: #ffffff; ">
    <div id="changeNowListBox">
        <div class="NowListBoxYear"><?= date("Y년"); ?><div class="more_"><a href="/bbs/board.php?bo_table=0403<?= $options["mobile"] ? "&mode=week" : "" ?>"> + </a></div></div>
        <div class="NowListBoxMonthDay"><?= date("m월 d일")?> <?php $yoil_text_set = array("일요일","월요일","화요일","수요일","목요일","금요일","토요일"); $yoil = $yoil_text_set[date('w', strtotime(date("Y-m-d")))]; echo $yoil; ?></div>
        <?php
        $myListSql = "select * from ".$g5['write_prefix'].$bo_table." where left(wr_1,8) <= '".$year.$sel_mon[i].sprintf("%02d",$mday)."'  and left(wr_2,8) >= '".$year.$sel_mon[i].sprintf("%02d",$mday)."'  order by wr_id asc";
        $myListRes = sql_query($myListSql);
        ?>
        <ul class="NowListUl">
    <?php if (sql_num_rows($myListRes) > 0) : ?>
        <?php while($row = sql_fetch_array($myListRes)) :
            switch ($row["wr_9"])
            {
                case "background:rgb(243,80,85)":
                    $tmpName = "[이천IL]";
                  break;
                case "background:rgb(131,183,48);":
                    $tmpName = "[서비스지원국]";
                  break;
                case "background:rgb(249, 188, 35);":
                    $tmpName = "[여성장애인교육팀]";
                  break;
                case "background:rgb(66,174,220);":
                    $tmpName = "[체험홈]";
                  break;
                case "background:rgb(128, 65, 217);":
                    $tmpName = "[주간활동]";
                  break;
                case "background:rgb(1, 0, 225);":
                    $tmpName = "[방과후활동]";
                  break;
            }
        ?>
        <li>
            <div style="display: inline;"><?= $tmpName ?><?= $row["wr_subject"] ?></div>
        </li>
        <?php endwhile ?>
    <?php else : ?>
        <li>
            <div style="display: inline;">오늘은 일정이 없습니다.</div>
        </li>
    <?php endif; ?>
</ul>
    </div>
</div>
<script>
function nowDayList(bo_table, tmpYear, tmpMonth, tmpDay, tmpMobile)
{
    $.post("<?= $latest_skin_url ?>/nowDayList.php", {"bo_table" : bo_table, "tmpYear" : tmpYear, "tmpMonth" : tmpMonth, "tmpDay" : tmpDay, "tmpMobile" : tmpMobile},function(res){
        $("#changeNowListBox").html(res);
    });
}
</script>

채택 감사 합니다.
모두 무시하시고, 원본에서 아래 부분만 바꾸세요.
<div style="width:<?php echo is_mobile() ? 0 : 50?>%;float:left;">
이 부분을


<?php if(is_mobile()){ ?>
<div style="display:none">
<?php } else { ?>
<div style="width:50%;float:left;">
<?php } ?>

<?php if(!G5_IS_MOBILE) { ?>
수정하려는 내용
<?php } ?>

코드로 감싸면 모바일에서는 보이지않습니다.

답변을 작성하시기 전에 로그인 해주세요.
전체 1,284
QA 내용 검색

회원로그인

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