dongwooin.nemoweb.kr <---- 질문도메인입니다 (위에 질문도메인에 나오질 않네요 ㅠ)
안녕하세요 ~ 영카트4 이용자입니다 ~
저번주에 질문을드렸는데 아직 답변을 못받아서요 ㅠ
바쁘신줄 알지만 급하게
질문드린 내용이라 한번 더 질문을 드립니다 ~
http://dongwooin.nemoweb.kr/shop/list.php?ca_id=2010
현재 메뉴 분류를 보면 일자로 쭉 정렬이 안된채 나와있는데요 ~
http://www.smashingsports.co.kr/shop/shopbrand.html?xcode=027&type=Y
똑같진 않더라도 깔끔하게 이런식으로 정렬을 하고 싶은데
listcategory3.inc.php에서 수정을 하는건 알겠는데
해당 코드문을 봐도 전혀 모르겠어서 도움을 요청드립니다..
댓글 8개
분류명이 길어 한줄에 2개 씩만 노출 되도록 하였습니다.
shop/listcategory3.inc.php 를 아래와 같이 수정해 놓았으니 참고하세요.
<?
$list_mod = 2;
$td_width = 100 / $list_mod;
$str = "";
$exists = false;
$depth2_ca_id = substr($ca_id, 0, 2);
$sql = " select ca_id, ca_name from $g4[yc4_category_table]
where ca_id like '${depth2_ca_id}%'
and length(ca_id) = 4
and ca_use = '1'
order by ca_id ";
$result = sql_query($sql);
$str .= "<tr><td width=11 background='$g4[shop_img_path]/ca_bg02.gif'></td>";
$str .= "<td><table width=100% border=0><tr><td>";
$str .= "<table width=100% border=0><tr>";
for ($i=0; $row=sql_fetch_array($result); $i++) {
if ($i > 0 && $i % $list_mod == 0)
$str .= "</tr>\n\n<tr>\n";
$str .= "<td width='{$td_width}%' align=left valign=top>";
if (preg_match("/^$row[ca_id]/", $ca_id))
$span = "<span style='font-weight:bold;'>";
else
$span = "<span>";
$str .= "<a href='./list.php?ca_id=$row[ca_id]'>{$span}$row[ca_name]</span></a>";
$str .= "</td>";
$exists = true;
}
// 나머지 td 를 채운다.
if (($cnt = $i%$list_mod) != 0)
for ($k=$cnt; $k<$list_mod; $k++)
$str .= "<td> </td>\n";
$str .= "</tr></table>";
$str .= "</td></tr></table></td><td width=11 background='$g4[shop_img_path]/ca_bg03.gif'></td>";
if ($exists) {
echo "
<br>
<table width=98% cellpadding=0 cellspacing=0 align=center border=0>
<colgroup width=11>
<colgroup width=''>
<colgroup width=11>
<colgroup width=70>
<tr>
<td width=11><img src='$g4[shop_img_path]/ca_box01.gif'></td>
<td background='$g4[shop_img_path]/ca_bg01.gif'></td>
<td width=11><img src='$g4[shop_img_path]/ca_box02.gif'></td>
<td></td>
</tr>
$str
<tr>
<td width=11><img src='$g4[shop_img_path]/ca_box03.gif'></td>
<td background='$g4[shop_img_path]/ca_bg04.gif'></td>
<td width=11><img src='$g4[shop_img_path]/ca_box04.gif'></td>
<td></td>
</tr>
</table><br>";
}
?>
shop/listcategory3.inc.php 를 아래와 같이 수정해 놓았으니 참고하세요.
<?
$list_mod = 2;
$td_width = 100 / $list_mod;
$str = "";
$exists = false;
$depth2_ca_id = substr($ca_id, 0, 2);
$sql = " select ca_id, ca_name from $g4[yc4_category_table]
where ca_id like '${depth2_ca_id}%'
and length(ca_id) = 4
and ca_use = '1'
order by ca_id ";
$result = sql_query($sql);
$str .= "<tr><td width=11 background='$g4[shop_img_path]/ca_bg02.gif'></td>";
$str .= "<td><table width=100% border=0><tr><td>";
$str .= "<table width=100% border=0><tr>";
for ($i=0; $row=sql_fetch_array($result); $i++) {
if ($i > 0 && $i % $list_mod == 0)
$str .= "</tr>\n\n<tr>\n";
$str .= "<td width='{$td_width}%' align=left valign=top>";
if (preg_match("/^$row[ca_id]/", $ca_id))
$span = "<span style='font-weight:bold;'>";
else
$span = "<span>";
$str .= "<a href='./list.php?ca_id=$row[ca_id]'>{$span}$row[ca_name]</span></a>";
$str .= "</td>";
$exists = true;
}
// 나머지 td 를 채운다.
if (($cnt = $i%$list_mod) != 0)
for ($k=$cnt; $k<$list_mod; $k++)
$str .= "<td> </td>\n";
$str .= "</tr></table>";
$str .= "</td></tr></table></td><td width=11 background='$g4[shop_img_path]/ca_bg03.gif'></td>";
if ($exists) {
echo "
<br>
<table width=98% cellpadding=0 cellspacing=0 align=center border=0>
<colgroup width=11>
<colgroup width=''>
<colgroup width=11>
<colgroup width=70>
<tr>
<td width=11><img src='$g4[shop_img_path]/ca_box01.gif'></td>
<td background='$g4[shop_img_path]/ca_bg01.gif'></td>
<td width=11><img src='$g4[shop_img_path]/ca_box02.gif'></td>
<td></td>
</tr>
$str
<tr>
<td width=11><img src='$g4[shop_img_path]/ca_box03.gif'></td>
<td background='$g4[shop_img_path]/ca_bg04.gif'></td>
<td width=11><img src='$g4[shop_img_path]/ca_box04.gif'></td>
<td></td>
</tr>
</table><br>";
}
?>
게시글 목록
| 번호 | 제목 |
|---|---|
| 56073 | |
| 56067 | |
| 56065 | |
| 56060 | |
| 56058 | |
| 56055 | |
| 56051 | |
| 56048 | |
| 56044 | |
| 56043 | |
| 56042 | |
| 56039 | |
| 56035 | |
| 56032 | |
| 56030 | |
| 56028 | |
| 56025 | |
| 56018 | |
| 56012 | |
| 56010 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기