rich content 사용법
{이미지:0}
'rich content'를 사용하면... 첨부 이미지를 마음대로 배치할 수 있습니다.
skin/board/basic/view.skin.php
[code]<?php
// 파일 출력
$v_img_count = count($view['file']);
if($v_img_count) {
echo "<div id=\"bo_v_img\">\n";
for ($i=0; $i<=count($view['file']); $i++) {
if ($view['file'][$i]['view']) {
//echo $view['file'][$i]['view'];
echo get_view_thumbnail($view['file'][$i]['view']);
}
}
echo "</div>\n";
}
?>
<!-- 본문 내용 시작 { -->
<div id="bo_v_con"><?php echo get_view_thumbnail($view['content']); ?></div>
<?php//echo $view['rich_content']; ?>
<!-- } 본문 내용 끝 -->[/code]
를...
[code]<?php
// 파일 출력
$v_img_count = count($view['file']);
if($v_img_count) {
echo "<div id=\"bo_v_img\">\n";
for ($i=0; $i<=count($view['file']); $i++) {
if ($view['file'][$i]['view']) {
//echo $view['file'][$i]['view'];
//echo get_view_thumbnail($view['file'][$i]['view']);
}
}
echo "</div>\n";
}
?>
<!-- 본문 내용 시작 { -->
<div id="bo_v_con"><?php echo $view['rich_content']; ?></div>
<!-- } 본문 내용 끝 -->[/code]
로 수정합니다.
관련 소스는...
bbs/view.php
에 있습니다.
리치 컨텐트 표기법을 따르지 않는 이미지는 출력되지않게 막아버렸습니다.
병행하는 방법을 몰라서...
{이미지:1}
불편해서 저는 예전 방식을 사용하고 있습니다.
'<그림1>', '<그림2>...
[code]<?php
// 파일 출력
for ($i=0; $i<=count($view[file]); $i++) {
if ($view[file][$i][view]) {
$image_file="{$view[file][$i][view]}"; //<P>태그 삭제
$image_pos="<그림".($i+1).">";
$image_pos2="<그림".($i+1).">"; //추가
//수정
if( strstr($view[content],$image_pos) || strstr($view[content],$image_pos2) ){
$pattern="/($image_pos|$image_pos2)/";
$view[content]=preg_replace($pattern,$image_file,$view[content]);
}
else echo $view[file][$i][view] . "<p>";
}
}
?>
<!-- 본문 내용 시작 { -->
<div id="bo_v_con"><?php echo get_view_thumbnail($view['content']); ?></div>
<?php//echo $view['rich_content']; ?>
<!-- } 본문 내용 끝 -->[/code]
[code]$image_pos="{이미지:".($i+1)."}";
$image_pos2="{이미지:".($i+1)."}"; //추가[/code]
표기법을 이렇게 바꿔도 됩니다.
'이미지:1'부터 시작합니다.
잘못된 부분이 있으면 알려주시면 고맙겠습니다.
원문 출처 : http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=27575
'rich content'를 사용하면... 첨부 이미지를 마음대로 배치할 수 있습니다.
skin/board/basic/view.skin.php
[code]<?php
// 파일 출력
$v_img_count = count($view['file']);
if($v_img_count) {
echo "<div id=\"bo_v_img\">\n";
for ($i=0; $i<=count($view['file']); $i++) {
if ($view['file'][$i]['view']) {
//echo $view['file'][$i]['view'];
echo get_view_thumbnail($view['file'][$i]['view']);
}
}
echo "</div>\n";
}
?>
<!-- 본문 내용 시작 { -->
<div id="bo_v_con"><?php echo get_view_thumbnail($view['content']); ?></div>
<?php//echo $view['rich_content']; ?>
<!-- } 본문 내용 끝 -->[/code]
를...
[code]<?php
// 파일 출력
$v_img_count = count($view['file']);
if($v_img_count) {
echo "<div id=\"bo_v_img\">\n";
for ($i=0; $i<=count($view['file']); $i++) {
if ($view['file'][$i]['view']) {
//echo $view['file'][$i]['view'];
//echo get_view_thumbnail($view['file'][$i]['view']);
}
}
echo "</div>\n";
}
?>
<!-- 본문 내용 시작 { -->
<div id="bo_v_con"><?php echo $view['rich_content']; ?></div>
<!-- } 본문 내용 끝 -->[/code]
로 수정합니다.
관련 소스는...
bbs/view.php
에 있습니다.
리치 컨텐트 표기법을 따르지 않는 이미지는 출력되지않게 막아버렸습니다.
병행하는 방법을 몰라서...
{이미지:1}
불편해서 저는 예전 방식을 사용하고 있습니다.
'<그림1>', '<그림2>...
[code]<?php
// 파일 출력
for ($i=0; $i<=count($view[file]); $i++) {
if ($view[file][$i][view]) {
$image_file="{$view[file][$i][view]}"; //<P>태그 삭제
$image_pos="<그림".($i+1).">";
$image_pos2="<그림".($i+1).">"; //추가
//수정
if( strstr($view[content],$image_pos) || strstr($view[content],$image_pos2) ){
$pattern="/($image_pos|$image_pos2)/";
$view[content]=preg_replace($pattern,$image_file,$view[content]);
}
else echo $view[file][$i][view] . "<p>";
}
}
?>
<!-- 본문 내용 시작 { -->
<div id="bo_v_con"><?php echo get_view_thumbnail($view['content']); ?></div>
<?php//echo $view['rich_content']; ?>
<!-- } 본문 내용 끝 -->[/code]
[code]$image_pos="{이미지:".($i+1)."}";
$image_pos2="{이미지:".($i+1)."}"; //추가[/code]
표기법을 이렇게 바꿔도 됩니다.
'이미지:1'부터 시작합니다.
잘못된 부분이 있으면 알려주시면 고맙겠습니다.
원문 출처 : http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=27575
댓글 2개
10년 전
이 게시판에도 'rich content'가 포함되어 있군요.
첫번째 이미지와 중간에 두번째 이미지를 'rich content' 방식으로 삽입했습니다.
첫번째 이미지와 중간에 두번째 이미지를 'rich content' 방식으로 삽입했습니다.
10년 전
감사합니다
게시판 목록
그누보드5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 3년 전 | 4402 | ||
| 534 | 9년 전 | 5701 | ||
| 533 | 9년 전 | 5175 | ||
| 532 | 9년 전 | 5474 | ||
| 531 | 9년 전 | 8517 | ||
| 530 | 9년 전 | 7115 | ||
| 529 | 9년 전 | 16105 | ||
| 528 | 9년 전 | 6109 | ||
| 527 | 9년 전 | 6959 | ||
| 526 | 9년 전 | 5534 | ||
| 525 | 9년 전 | 6788 | ||
| 524 | 9년 전 | 12044 | ||
| 523 |
|
9년 전 | 25703 | |
| 522 |
|
9년 전 | 12674 | |
| 521 | 9년 전 | 9943 | ||
| 520 | 9년 전 | 9424 | ||
| 519 | 9년 전 | 10384 | ||
| 518 | 9년 전 | 6671 | ||
| 517 |
|
9년 전 | 8385 | |
| 516 | 9년 전 | 9300 | ||
| 515 | 9년 전 | 10224 | ||
| 514 | 9년 전 | 12084 | ||
| 513 | 9년 전 | 8766 | ||
| 512 | 9년 전 | 8572 | ||
| 511 | 9년 전 | 5962 | ||
| 510 | 9년 전 | 7986 | ||
| 509 | 9년 전 | 7651 | ||
| 508 |
wosuch
|
9년 전 | 9414 | |
| 507 | 9년 전 | 6671 | ||
| 506 |
starfield
|
9년 전 | 14070 | |
| 505 | 9년 전 | 6697 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기