board 배너 등록 게시판
본문
아래의 코드는 배너를 출력할 곳에 복사해 넣으십시오.
<?
$banner_hit = 30000; // 출력 횟수
// 포인트 배너광고
$banner_table = "게시판 아이디";
$sql = " select wr_id, wr_subject, wr_1, wr_2, wr_hit from {$g4[write_prefix]}{$banner_table}
where wr_is_comment = '0'
and wr_1 = ''
and wr_hit < '".($banner_hit+1)."'
order by rand() limit 1 ";
$row = sql_fetch($sql);
if ($row[wr_id])
{
if ($row[wr_hit] >= $banner_hit)
sql_query(" update {$g4[write_prefix]}{$banner_table} set wr_1 = '종료' where wr_id = '$row[wr_id]' ");
$sql2 = " select bf_file from $g4[board_file_table]
where bo_table = '$banner_table'
and wr_id = '$row[wr_id]'
and bf_no = 0 ";
$row2= sql_fetch($sql2);
if ($row2[bf_file])
$banner_img = "/data/file/$banner_table/$row2[bf_file]";
else
$banner_img = "/img/banner01.gif";
$subj = get_text($row[wr_subject]);
$href = "$g4[bbs_path]/link.php?bo_table={$banner_table}&wr_id={$row[wr_id]}&no=1";
echo "<a href='$href' target='_blank' title='$subj'><img src='$banner_img' border='0' width=88 height=31 style='border:solid 0 #555555;'></a>";
// View(Hit)
sql_query(" update {$g4[write_prefix]}{$banner_table} set wr_hit = wr_hit + 1 where wr_id = '$row[wr_id]' ");
?>
<?
$banner_hit = 30000; // 출력 횟수
// 포인트 배너광고
$banner_table = "게시판 아이디";
$sql = " select wr_id, wr_subject, wr_1, wr_2, wr_hit from {$g4[write_prefix]}{$banner_table}
where wr_is_comment = '0'
and wr_1 = ''
and wr_hit < '".($banner_hit+1)."'
order by rand() limit 1 ";
$row = sql_fetch($sql);
if ($row[wr_id])
{
if ($row[wr_hit] >= $banner_hit)
sql_query(" update {$g4[write_prefix]}{$banner_table} set wr_1 = '종료' where wr_id = '$row[wr_id]' ");
$sql2 = " select bf_file from $g4[board_file_table]
where bo_table = '$banner_table'
and wr_id = '$row[wr_id]'
and bf_no = 0 ";
$row2= sql_fetch($sql2);
if ($row2[bf_file])
$banner_img = "/data/file/$banner_table/$row2[bf_file]";
else
$banner_img = "/img/banner01.gif";
$subj = get_text($row[wr_subject]);
$href = "$g4[bbs_path]/link.php?bo_table={$banner_table}&wr_id={$row[wr_id]}&no=1";
echo "<a href='$href' target='_blank' title='$subj'><img src='$banner_img' border='0' width=88 height=31 style='border:solid 0 #555555;'></a>";
// View(Hit)
sql_query(" update {$g4[write_prefix]}{$banner_table} set wr_hit = wr_hit + 1 where wr_id = '$row[wr_id]' ");
?>
추천0
첨부파일
- banner2.tgz (44.5K) 15회 다운로드 | DATE : 2007-10-18 02:19:35
노가리님의 댓글
노가리쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 작성일^^ 받아야 할텐데 포인트가 문제네요 ㅠ,ㅠ;