에디터로 첨부한 이미지 알트값 제목으로 바꾸고 싶습니다 채택완료
우선 자주 도와주시는 작은별님이 댓글로 달아 놓으신 걸로 적용 해보았습니다
</p><p><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(247, 247, 247);">$(function() { </span><br style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px;"><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(247, 247, 247);"> $("#bo_v_con img, #bo_v_img img").each(function() { </span><br style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px;"><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(247, 247, 247);"> $(this).attr("title", "<?php echo $view[wr_subject]; ?>"); </span><br style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px;"><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(247, 247, 247);"> $(this).attr("alt", "<?php echo $view[wr_subject]; ?>"); </span><br style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px;"><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(247, 247, 247);"> }); </span><br style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px;"><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(247, 247, 247);">});</span> </p><p><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(247, 247, 247);">
적용이 안되던군요 소스 보기에서 나오는 값은 그대로 이미지올릴때 이미지 이름으로 알트값이 들어갑니다 게시판 제목으로 변경 하고 싶은데 제가 저 스크립트를 잘못쓴건가요
파일로 올리는게 아니라 파일설명도 안먹던데 alt가 seo에 좋다고 해서 한번 시도 해볼려고 합니다
부탁드립니다 고수님들
답변 2개
에디터로 첨부한 파일이 썸네일이 생성되는 이미지일 경우
/lib/thumbnail.lib.php 파일에서 아래 함수에 , $view 를 추가하고
// 게시글보기 썸네일 생성
function get_view_thumbnail($contents, $thumb_width=0)
{
global $board, $config, $view;
...
...
좀 더 아래에 있는 $alt 값을 이렇게 수정하면 바뀌긴 하네요.
근데 굳이 이렇게까지 해야 하나 싶네요.
if ($width) {
$thumb_tag = '<img src="'.G5_URL.str_replace($filename, $thumb_file, $data_path).'" alt="'.$view['wr_subject'].'" width="'.$width.'" height="'.$height.'"/>';
} else {
$thumb_tag = '<img src="'.G5_URL.str_replace($filename, $thumb_file, $data_path).'" alt="'.$view['wr_subject'].'"/>';
}
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
$(function() {
$('div#bo_v_con img, div#bo_v_con a img').mouseover(function() {
$(this).attr('title', '<?php echo $view[wr_subject] ?>');
}).mouseout(function() {
$(this).attr('alt', '<?php echo $view[wr_subject] ?>');
});
});
답변에 대한 댓글 2개
해당 스크립트는 웹페이지상에서 마우스를 오버했을 때 바뀌게 하는 코드들입니다.
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
추천꾸욱 좋아요 10개 주고 싶어요