php 배열 수정에 관한 문제입니다

tak-88의 이미지

<?php
// directory
$bulletin_dir = "/home/a/public_html/club/upload/count/bulletin/";
 
// max, min year
$max_year = date("Y");
for ($i = 1970; $i <= $max_year; $i++)
{
    if (is_dir($bulletin_dir.$i))
    {
        $min_year = $i;
        break;
    }}
 
$this_month = date("m");
 
// paging param
if ($page == "") $page = 1;
 
$start_max_year = $max_year;
if ($start_max_year % 4 != 0)   $start_max_year = $start_max_year + (4 - ($start_max_year %4));
 
$item_total = $start_max_year - $min_year + 1;
$item_per_page = 4;
$link_per_page = 10;
 
// start_year
$start_year = $max_year - 4 * ($page - 1);
if ($start_year % 4 != 0)   $start_year = $start_year + (4 - ($start_year %4));?>
 
<!------메인 테이블의 2열 시작 ------>
<table width="680" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="left" valign="top"><table width="680" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="480" align="left" valign="top">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="468">
                  <!--------여백을 위한 빈 테이블 입니다 ------>
</td> </tr> <tr>
    <td height="20" valign="bottom">
 
<a href="/main/main.html">&nbsp;&nbsp;HOME</a>&gt;신문만들기&gt;
 
<a href="<?=$PHP_SELF?>"><strong>달별로 보기 </strong></a></td> </tr> <tr>
                <td height="1" bgcolor="cccccc">
</td> </tr>
              <tr>
                <td><table width="680" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="20">&nbsp;</td>
                      <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="/images/bul/ho9_title_bg.gif"><img src="/images/bul/ho9_title.gif" width="80" height="24"></td>
</tr>
</table></td> </tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="169"><img src="/images/bul/ho9_title_head.gif" width="169" height="88"></td>
           <td width="157" align="center" valign="middle">&nbsp;</td>
         <td width="316" align="right" valign="bottom"><div>*먼저 찾으실 호수의 연도를 선택하여 주세요
        </div>
    <script language="javascript">
    function move(){
  if (document.move_form.page.value != '' && document.move_form.page.value != <?=$page?>)
location.href = "<?=$PHP_SELF?>?page=" + document.move_form.page.value;
}
</script>
<form name="move_form">
<select style='width:110px;' name="page" onChange="move()">
<option selected>연도 바로 가기</option>
<?php
$link_page = 1;
for ($i=1; $i<=($start_max_year - $min_year+1); $i++)
{
if ($start_max_year-$i+1 <= $max_year)
{
echo ('
<option value="'.$link_page.'">'.($start_max_year-$i+1).'년</option>
');
}
if ($i%4 == 0) $link_page++;
}
?>
</select></form></td> </tr>
</table></td> </tr>
<tr>
<td>&nbsp;</td> </tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="/images/bul/ho9_table_top.gif" width="642" height="19"></td>
</tr>
<tr>
<td align="center" background="/images/bul/ho9_table_bg.gif">
<table width="608" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25" align="center" bgcolor="E7E4DB"><table width="100%" height="25" border="0" cellpadding="0" cellspacing="1" bgcolor="ffffff">
<tr align="center" bgcolor="E7E4DB">
<?php
for ($i = 0; $i <4; $i++)
{
    if ($start_year - $i <= $max_year)
  if (($start_year-$i) < 1970)
   echo ('<td width="150">&nbsp;</td>');
  else
         echo ('<td width="150"><strong><font color="6C6231">'.($start_year-$i).' 년</font></strong></td>');
    else
        echo ('<td width="150"></td>');
}
?>
</tr>
</table>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>
<table width="580" cellspacing="0" cellpadding="0">
<tr>
<?php
for ($i = 0; $i <4; $i++)
{   
    echo ('<td width="150" >');
    if ($start_year - $i <= $max_year)
    {
        echo ('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
 
        for ($j=1; $j<=12; $j++)
        {
   if (($start_year-$i) < 1970){
    echo ('<tr><td align="center" width="150" height="216" >&nbsp;</td></tr>');
   } else if(($start_year-$i).$j <= 19707) {
    echo ('<tr><td align="center" width="150" height="242" >&nbsp;</td></tr>');
   } else{
 
     if (is_dir($bulletin_dir.($start_year-$i).'/'.$j))
      if (($start_year-$i).$j == 19708)
       echo ('<tr><td align="center" >
       <a href="/bulletin/bulletin_monthly_view.html?year='.($start_year-$i).'&month='.$j.'" target="_new">
       <img src="http://www.a.or.kr/club/upload/count/bulletin/'.($start_year-$i).'/'.$j.'/01.jpg" width="150" height="216" style="border:1 solid #CCCCCC">
       시작</a></td></tr>');
 
      else
       echo ('<tr><td align="center" >
       <a href="/bulletin/bulletin_monthly_view.html?year='.($start_year-$i).'&month='.$j.'" target="_new">
       <img src="thumb/thumb.php?src=/bulletin/thumb/'.($start_year-$i).'/'.$j.'.jpg&w=150&h=216" width="150" height="216" style="border:1 solid #CCCCCC"></a>
       <a href="/bulletin/bulletin_monthly_view.html?year='.($start_year-$i).'&month='.$j.'" target="_new">'.($start_year-$i).'년 '.$j.'월</a></td></tr>');
     else
      echo ('<tr><td align="center" width="150" height="240">'.($start_year-$i).'년 '.$j.'월</td></tr>');
   }  }        echo ('</table></td>');    }}?>
</tr>
</table></td> </tr>
</table></td> </tr>
<tr>
<td><img src="/images/bul/ho9_table_bottom.gif" width="642" height="19"></td> </tr>
</table></td> </tr>
<tr> <td>&nbsp;</td> </tr>
<tr> <td align="center">
<?php
html_paging($item_total, $item_per_page, $link_per_page, $page, "");
?>
</td> </tr> <tr>
<td>&nbsp;</td> </tr>
<tr> <td>&nbsp;</td>
</tr> </table></td>
<td width="20">&nbsp;</td> </tr>
</table></td> </tr> </table>
</td> </tr> </table> </td>
  </tr>  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<!--메인 테이블의 2 열끝 -->
<?php
html_bottom();
?>

지금 현재 이게 신문처럼 소스를 만들었는데

현재는 배열이 4개로 나뉘어져 4년치호수가 밑으로 12부씩 내려가게 되어있습니다

근데 이 배열을 좀 바꿔서

한페이지에 1년치만 나오게 하고 싶습니다

좌측부터 4개씩 3줄이 나오도록이요

그럼 이 소스를 어떻게 해야되나요?

지금 이것저것 만저보는데 제가 초보자라 좀 어렵네요

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.