2.10정식용 최신그림 추출(베타버젼) 정보
일반 2.10정식용 최신그림 추출(베타버젼)
본문
음 무던히도 노력을 해보았지만 역시나 버그 잡기가 장난아니게 힘듭니다.
제 서버만의 문제인지 모르나 어쩌튼 제 서버에서는 생각하던대로 작동을 안해서 조금 수정을 보았습니다.
//#############################################################
//# userlib.inc.php 아래 글에다가 추가를 해주시면 됩니다.
//#############################################################
// 최신그림 추출
function newpic($skins, $bo_table, $subject, $rows, $subjectlen='')
{
global $cfg;
$sql = " select * from $cfg[table_board] where bo_table = '$bo_table' ";
$bd = sql_fetch_array($sql);
if ($subjectlen == '') $subjectlen = $bd[bo_subject_len];
$cfg[board_table_prefix] = "gb_write_"; // 게시판 테이블의 접두사
$cfg[url] = "http://111.111.111.111/~oldccc/gnu2"; //자기계정을 설정해주시면 됩니다.
$skindir = "$cfg[url]/skin/$skins";
$skinimg = "$skindir/images";
$filedir = "$cfg[url]/data/file";
include "./ccc/skin/$skins/newpic_head.skin.php";
// echo "<table border=0 cellpadding=0 cellspacing=0 width=100% align=center height=20 style='font-family:Verdana; font-size:9pt;'><tr>"; //에러체크를 위해서 올렸습니다.
$table = "{$cfg[board_table_prefix]}{$bo_table}";
$result = sql_query_error(" select * from $table where wr_comment = 0 order by wr_id desc limit {$rows} ");
for ($i = 0; $row = mysql_fetch_array($result); $i++) {
$icon_file = "";
if ($row[wr_file1] || $row[wr_file2])
$icon_file = "<img src='$skinimg/icon_file.gif' align=absmiddle>";
$icon_link = "";
if ($row[wr_link1] || $row[wr_link2])
$icon_link = "<img src='$skinimg/icon_link.gif' align=absmiddle>";
$a_list_link = "<a href='$cfg[url]/gbview.php?$qstr&page=$page&wr_id=$data[wr_id]' class=s_a>";
$icon_new = "";
if ($row[wr_datetime] >= date("Y-m-d H:i:s", time() - $bd[bo_new] * 3600))
$icon_new = "<img src='$skinimg/icon_new.gif' align=absmiddle>";
$icon_hot = "";
if ($row[wr_hit] >= $bd[bo_hot])
$icon_hot = "<img src='$skinimg/icon_hot.gif' align=absmiddle>";
$icon_battle = "";
if ($row[wr_commentcnt] >= $bd[bo_battle])
$icon_battle = "<img src='$skinimg/icon_battle.gif' align=absmiddle>";
$icon_secret = "";
if ($row[wr_secret])
$icon_secret = "<img src='$skinimg/icon_secret.gif' align=absmiddle>";
$wr_commentcnt = ($row[wr_commentcnt]) ? $row[wr_commentcnt] : null;
$wr_subject = get_text(cut_str($row[wr_subject], $subjectlen, '…'));
$wr_content = get_text(cut_str($row[wr_content], 400, '....[계속]'));
$wr_id = $row[wr_id];
$wr_name = $row[wr_name];
$wr_datetime = $row[wr_datetime];
$wr_images = $row[wr_file1];
$temp_tr = false;
if ($i > 0 && ($i % 5 == 0)) $temp_tr = true; // 아직 지정갯수 넘어가면 다른줄에 출력하는건 하지 않았습니다.
echo "
<td valign=top>
<table width=100%>
<tr>
<td align=center> ";
if ($wr_images) {
echo "
<a href='{$cfg[url]}/gbview.php?bo_table={$bo_table}&wr_id={$wr_id}'>
<img src='{$filedir}/{$wr_images}' width=110 height=80 border=0> </a> ";
}
echo "
</td>
</tr>
</table>
</td> ";
// include "http://61.40.183.198/~ryl/ccc/skin/$skins/newpic_main.skin.php";
// 이 부분이 에러가 나는군요~ 위에 echo로 쏘아주는거랑 똑같은데 변수값이 넘어가지를 않습니다.
// 여러가지 방법을 다 해보았지만 역시나 되지를 않습니다.
// 마지막 방법으로 자료를 배열로 넘기고 한번만 include하면 문제 없이 작동할것 같습니다.
// 오늘은 시간관계상 여기까지만....
}
mysql_free_result($result);
echo "</tr></table>";
}
//#############################################################
//# newpic_head_skin.php
//#############################################################
<!-- 최신글 추출 head 부분 -->
<table border=0 cellpadding=0 cellspacing=0 width=100% align=center height=20 style='font-family:Verdana; font-size:9pt;'>
<tr>
<td width=22 height=22 style='font-size:9pt; font:돋움'>
<?="<img src='$skinimg/qaz_lost_02.gif' width=22 height=29 border=0>" ?></td>
<td height=22 width=343 background='<?=$skinimg?>/qaz_lost_04.gif' >
<?="<b>$subject</b>"?></td>
<td height=22 align=right background='<?=$skinimg?>/qaz_lost_04.gif' >
<?="<a href='$cfg[url]/gblist.php?bo_table=$bo_table'>
<img src='$skinimg/more.gif' width=40 height=15 border=0></a>" ?></td>
<td width=22 height=22 align=right>
<?="<img src='$skinimg/qaz_lost_03.gif' width=22 height=29 border=0>" ?></td>
</tr>
</table>
<table border=0 cellpadding=0 cellspacing=0 width=100% align=center height=20 style='font-family:Verdana; font-size:9pt;'>
<tr>
//#############################################################
//# newpic_main_skin.php
//#############################################################
<td valign=top>
<table width=100%>
<tr>
<td align=center> ";
<? if ($wr_images) { ?>
<a href='<?=$cfg[url]?>/gbview.php?bo_table=<?=$bo_table?>&wr_id=<?=$wr_id?>'>
<img src='<?=$filedir?>/<?=$wr_images?>' width=110 height=80 border=0> </a> ";
<? } ?>
</td>
</tr>
</table>
</td>
테스트를 해보시고 글좀 올려주세요 !
제 서버만의 문제인지 모르나 어쩌튼 제 서버에서는 생각하던대로 작동을 안해서 조금 수정을 보았습니다.
//#############################################################
//# userlib.inc.php 아래 글에다가 추가를 해주시면 됩니다.
//#############################################################
// 최신그림 추출
function newpic($skins, $bo_table, $subject, $rows, $subjectlen='')
{
global $cfg;
$sql = " select * from $cfg[table_board] where bo_table = '$bo_table' ";
$bd = sql_fetch_array($sql);
if ($subjectlen == '') $subjectlen = $bd[bo_subject_len];
$cfg[board_table_prefix] = "gb_write_"; // 게시판 테이블의 접두사
$cfg[url] = "http://111.111.111.111/~oldccc/gnu2"; //자기계정을 설정해주시면 됩니다.
$skindir = "$cfg[url]/skin/$skins";
$skinimg = "$skindir/images";
$filedir = "$cfg[url]/data/file";
include "./ccc/skin/$skins/newpic_head.skin.php";
// echo "<table border=0 cellpadding=0 cellspacing=0 width=100% align=center height=20 style='font-family:Verdana; font-size:9pt;'><tr>"; //에러체크를 위해서 올렸습니다.
$table = "{$cfg[board_table_prefix]}{$bo_table}";
$result = sql_query_error(" select * from $table where wr_comment = 0 order by wr_id desc limit {$rows} ");
for ($i = 0; $row = mysql_fetch_array($result); $i++) {
$icon_file = "";
if ($row[wr_file1] || $row[wr_file2])
$icon_file = "<img src='$skinimg/icon_file.gif' align=absmiddle>";
$icon_link = "";
if ($row[wr_link1] || $row[wr_link2])
$icon_link = "<img src='$skinimg/icon_link.gif' align=absmiddle>";
$a_list_link = "<a href='$cfg[url]/gbview.php?$qstr&page=$page&wr_id=$data[wr_id]' class=s_a>";
$icon_new = "";
if ($row[wr_datetime] >= date("Y-m-d H:i:s", time() - $bd[bo_new] * 3600))
$icon_new = "<img src='$skinimg/icon_new.gif' align=absmiddle>";
$icon_hot = "";
if ($row[wr_hit] >= $bd[bo_hot])
$icon_hot = "<img src='$skinimg/icon_hot.gif' align=absmiddle>";
$icon_battle = "";
if ($row[wr_commentcnt] >= $bd[bo_battle])
$icon_battle = "<img src='$skinimg/icon_battle.gif' align=absmiddle>";
$icon_secret = "";
if ($row[wr_secret])
$icon_secret = "<img src='$skinimg/icon_secret.gif' align=absmiddle>";
$wr_commentcnt = ($row[wr_commentcnt]) ? $row[wr_commentcnt] : null;
$wr_subject = get_text(cut_str($row[wr_subject], $subjectlen, '…'));
$wr_content = get_text(cut_str($row[wr_content], 400, '....[계속]'));
$wr_id = $row[wr_id];
$wr_name = $row[wr_name];
$wr_datetime = $row[wr_datetime];
$wr_images = $row[wr_file1];
$temp_tr = false;
if ($i > 0 && ($i % 5 == 0)) $temp_tr = true; // 아직 지정갯수 넘어가면 다른줄에 출력하는건 하지 않았습니다.
echo "
<td valign=top>
<table width=100%>
<tr>
<td align=center> ";
if ($wr_images) {
echo "
<a href='{$cfg[url]}/gbview.php?bo_table={$bo_table}&wr_id={$wr_id}'>
<img src='{$filedir}/{$wr_images}' width=110 height=80 border=0> </a> ";
}
echo "
</td>
</tr>
</table>
</td> ";
// include "http://61.40.183.198/~ryl/ccc/skin/$skins/newpic_main.skin.php";
// 이 부분이 에러가 나는군요~ 위에 echo로 쏘아주는거랑 똑같은데 변수값이 넘어가지를 않습니다.
// 여러가지 방법을 다 해보았지만 역시나 되지를 않습니다.
// 마지막 방법으로 자료를 배열로 넘기고 한번만 include하면 문제 없이 작동할것 같습니다.
// 오늘은 시간관계상 여기까지만....
}
mysql_free_result($result);
echo "</tr></table>";
}
//#############################################################
//# newpic_head_skin.php
//#############################################################
<!-- 최신글 추출 head 부분 -->
<table border=0 cellpadding=0 cellspacing=0 width=100% align=center height=20 style='font-family:Verdana; font-size:9pt;'>
<tr>
<td width=22 height=22 style='font-size:9pt; font:돋움'>
<?="<img src='$skinimg/qaz_lost_02.gif' width=22 height=29 border=0>" ?></td>
<td height=22 width=343 background='<?=$skinimg?>/qaz_lost_04.gif' >
<?="<b>$subject</b>"?></td>
<td height=22 align=right background='<?=$skinimg?>/qaz_lost_04.gif' >
<?="<a href='$cfg[url]/gblist.php?bo_table=$bo_table'>
<img src='$skinimg/more.gif' width=40 height=15 border=0></a>" ?></td>
<td width=22 height=22 align=right>
<?="<img src='$skinimg/qaz_lost_03.gif' width=22 height=29 border=0>" ?></td>
</tr>
</table>
<table border=0 cellpadding=0 cellspacing=0 width=100% align=center height=20 style='font-family:Verdana; font-size:9pt;'>
<tr>
//#############################################################
//# newpic_main_skin.php
//#############################################################
<td valign=top>
<table width=100%>
<tr>
<td align=center> ";
<? if ($wr_images) { ?>
<a href='<?=$cfg[url]?>/gbview.php?bo_table=<?=$bo_table?>&wr_id=<?=$wr_id?>'>
<img src='<?=$filedir?>/<?=$wr_images?>' width=110 height=80 border=0> </a> ";
<? } ?>
</td>
</tr>
</table>
</td>
테스트를 해보시고 글좀 올려주세요 !
추천
11
11
댓글 전체
감사합니다.
include "./ccc/skin/$skins/newpic_head.skin.php";이부분
include "./skin/$skins/newpic_head.skin.php";렇게하고
include "http://61.40.183.198/~ryl/ccc/skin/
$skins/newpic_main.skin.php";
이부분
include "./skin/$skins/newpic_main.skin.php"; 이렇게하니
넘어가여
문제는 같은그림이 두게씩 출력됩니다
그럼 후다닥.....
include "./skin/$skins/newpic_head.skin.php";렇게하고
include "http://61.40.183.198/~ryl/ccc/skin/
$skins/newpic_main.skin.php";
이부분
include "./skin/$skins/newpic_main.skin.php"; 이렇게하니
넘어가여
문제는 같은그림이 두게씩 출력됩니다
그럼 후다닥.....