지앤미 님의 블로그로 글퍼가기 일부 수정 정보
지앤미 님의 블로그로 글퍼가기 일부 수정
본문
pum_blog.php에서 일부 수정한 것입니다.
<?
include_once('./_common.php');
$blog_chk = sql_fetch("select * from $gb4[blog_table] where mb_id='$member[mb_id]'");
if( $blog_chk['mb_id'] != $member['mb_id'] )
alert('자신의 블로그에만 펌 할 수 있습니다.');
// 원본글 정보를 가져온다.
$r = sql_fetch("select * from {$write_table} where wr_id='{$wr_id}'");
if( $secret == 0 )
$count_field = 'secret_count';
else
$count_field = 'post_count';
include_once('./_common.php');
$blog_chk = sql_fetch("select * from $gb4[blog_table] where mb_id='$member[mb_id]'");
if( $blog_chk['mb_id'] != $member['mb_id'] )
alert('자신의 블로그에만 펌 할 수 있습니다.');
// 원본글 정보를 가져온다.
$r = sql_fetch("select * from {$write_table} where wr_id='{$wr_id}'");
if( $secret == 0 )
$count_field = 'secret_count';
else
$count_field = 'post_count';
$content = "<font color=blue>{$r['wr_name']} 님이 작성한 글입니다.</font> <a href=도메인 주소를 적어주세요/bbs/board.php?bo_table=$bo_table&wr_id={$wr_id} target=_new>(원글바로가기)</a><br><br>\n\n";
$content .= addslashes($r['wr_content']);
$content .= addslashes($r['wr_content']);
// 글을 등록한다.
$sql = "insert into
{$gb4['post_table']}
set
blog_id = '{$blog_chk['id']}'
,category_id = '{$category_id}'
,division_id = '{$division_id}'
,title = '{$r['wr_subject']}'
,content = '{$content}'
,trackback_url = '{$r['trackback_url']}'
,post_date = '{$g4['time_ymdhis']}'
,secret = '1'
,use_comment = '1'
,use_trackback = '1'
,use_rss = '1'
,real_date = '{$g4['time_ymdhis']}'";
sql_query($sql);
// 방금 등록한 글 고유 번호를 센타깐다.
$id = mysql_insert_id();
// 해당 분류의 글 카운트를 증가시킨돠.
if( $category_id )
sql_query("update {$gb4['category_table']} set {$count_field} = {$count_field} + 1 where id = '{$category_id}'");
// 태그를 붙인다.
//tag_add($id, $tag);
$sql = "insert into
{$gb4['post_table']}
set
blog_id = '{$blog_chk['id']}'
,category_id = '{$category_id}'
,division_id = '{$division_id}'
,title = '{$r['wr_subject']}'
,content = '{$content}'
,trackback_url = '{$r['trackback_url']}'
,post_date = '{$g4['time_ymdhis']}'
,secret = '1'
,use_comment = '1'
,use_trackback = '1'
,use_rss = '1'
,real_date = '{$g4['time_ymdhis']}'";
sql_query($sql);
// 방금 등록한 글 고유 번호를 센타깐다.
$id = mysql_insert_id();
// 해당 분류의 글 카운트를 증가시킨돠.
if( $category_id )
sql_query("update {$gb4['category_table']} set {$count_field} = {$count_field} + 1 where id = '{$category_id}'");
// 태그를 붙인다.
//tag_add($id, $tag);
// 해당 블로그 정보 테이블에 글 갯수 증가 및 마지막 업데이트 시간을 현재로 변경한다.
$sql = "update
{$gb4['blog_table']}
set
{$count_field} = {$count_field} + 1
,last_update = '{$g4['time_ymdhis']}'
where
mb_id='{$member['mb_id']}'";
sql_query($sql);
// 월별 글 갯수를 증가시킨다.
$monthly = substr($post_date,0,7);
$res = sql_fetch("select * from {$gb4['monthly_table']} where blog_id='{$current['id']}' and monthly='$monthly'");
if( empty($res) )
sql_query("insert {$gb4['monthly_table']} set blog_id='{$current['id']}', monthly='{$monthly}', {$count_field}=1");
else
sql_query("update {$gb4['monthly_table']} set {$count_field} = {$count_field} + 1 where blog_id='{$current['id']}' and monthly='{$monthly}'");
// 업로드 파일
//sql_query("update {$gb4['file_table']} set post_id='{$id}' where blog_id='{$current['id']}' and post_id='0'");
$result = sql_query(" select * from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no asc ");
for ($i=0; $i<$r = sql_fetch_array($result); $i++)
{
$sql = " insert into {$gb4['file_table']}
set blog_id = '{$blog_chk['id']}',
post_id = '{$id}',
file_num = '{$r['bf_no']}',
file_size = '{$r['bf_filesize']}',
save_name = '{$r['bf_file']}',
real_name = '{$r['bf_source']}',
file_datetime = '{$r['bf_datetime']}'";
sql_query($sql);
$sql = "update
{$gb4['blog_table']}
set
{$count_field} = {$count_field} + 1
,last_update = '{$g4['time_ymdhis']}'
where
mb_id='{$member['mb_id']}'";
sql_query($sql);
// 월별 글 갯수를 증가시킨다.
$monthly = substr($post_date,0,7);
$res = sql_fetch("select * from {$gb4['monthly_table']} where blog_id='{$current['id']}' and monthly='$monthly'");
if( empty($res) )
sql_query("insert {$gb4['monthly_table']} set blog_id='{$current['id']}', monthly='{$monthly}', {$count_field}=1");
else
sql_query("update {$gb4['monthly_table']} set {$count_field} = {$count_field} + 1 where blog_id='{$current['id']}' and monthly='{$monthly}'");
// 업로드 파일
//sql_query("update {$gb4['file_table']} set post_id='{$id}' where blog_id='{$current['id']}' and post_id='0'");
$result = sql_query(" select * from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no asc ");
for ($i=0; $i<$r = sql_fetch_array($result); $i++)
{
$sql = " insert into {$gb4['file_table']}
set blog_id = '{$blog_chk['id']}',
post_id = '{$id}',
file_num = '{$r['bf_no']}',
file_size = '{$r['bf_filesize']}',
save_name = '{$r['bf_file']}',
real_name = '{$r['bf_source']}',
file_datetime = '{$r['bf_datetime']}'";
sql_query($sql);
// 디렉토리가 없다면 생성합니다. (퍼미션도 변경하구요.)
@mkdir("{$g4[path]}/data/blog/file/{$blog_chk[mb_id]}", 0707);
@chmod("{$g4[path]}/data/blog/file/{$blog_chk[mb_id]}", 0707);
$dest_file = "{$g4[path]}/data/blog/file/{$blog_chk[mb_id]}/{$r[bf_file]}";
@copy("{$g4[path]}/data/file/{$bo_table}/{$r[bf_file]}", $dest_file) ;
@chmod($dest_file, 0606);
}
@mkdir("{$g4[path]}/data/blog/file/{$blog_chk[mb_id]}", 0707);
@chmod("{$g4[path]}/data/blog/file/{$blog_chk[mb_id]}", 0707);
$dest_file = "{$g4[path]}/data/blog/file/{$blog_chk[mb_id]}/{$r[bf_file]}";
@copy("{$g4[path]}/data/file/{$bo_table}/{$r[bf_file]}", $dest_file) ;
@chmod($dest_file, 0606);
}
?>
<script type="text/javascript">
var x=window.confirm("블로그를 확인하시겠습니까?")
if (x)
{
var x=window.confirm("블로그를 확인하시겠습니까?")
if (x)
{
}
else
{
history.back();
}
</script>
<?
goto_url(get_post_url($id) );
?>
else
{
history.back();
}
</script>
<?
goto_url(get_post_url($id) );
?>
추천
0
0
댓글 전체
오~ 고맙습니다.
하단.. 저의경우는 아래처럼 해야 하던데요...;;
<script language="JavaScript" >
var x=window.confirm("블로그를 확인하시겠습니까?")
if (x)
{
}
else
{
history.back();
}
</script>
<?
goto_url(get_post_url($id) );
?>
-----
왜그런지 몰겠네요.
하단.. 저의경우는 아래처럼 해야 하던데요...;;
<script language="JavaScript" >
var x=window.confirm("블로그를 확인하시겠습니까?")
if (x)
{
}
else
{
history.back();
}
</script>
<?
goto_url(get_post_url($id) );
?>
-----
왜그런지 몰겠네요.

글쓴 후 내용 확인을 안해봐서 지금 코멘트 봤네요.
게시판 글쓰기시에 스크립트 문구등에 대해서 자동으로 -x가 붙여져서 그렀습니다. 스크립트 사용을 할 수 없도록 보완조치를 취해서 그런 것 같습니다.
저도 이문제 때문에 삽질한 적이 있네요.
게시판 글쓰기시에 스크립트 문구등에 대해서 자동으로 -x가 붙여져서 그렀습니다. 스크립트 사용을 할 수 없도록 보완조치를 취해서 그런 것 같습니다.
저도 이문제 때문에 삽질한 적이 있네요.