<!-- Автораспознование ссылок -->
$('div.post-content p a[rel="nofollow"]').map(function(){
var link = $(this).attr('href');
var hrfstr = link.replace(/^.+?click.php\?/i,'');
if((hrfstr.indexOf(".jpg")!= -1) || (hrfstr.indexOf(".png")!= -1) || (hrfstr.indexOf(".gif")!= -1) ){
$(this).html('<br><center><img src="'+hrfstr+'" style="max-width: 100%"></center>');
}
if(hrfstr.indexOf(".mp3")!= -1) {
$(this).replaceWith('<br /><embed src="http://forumstatic.ru/files/000f/5f/a4/48643.swf" type="application/x-shockwave-flash" allowscriptaccess="always" wmode="transparent" flashvars="comment=track&st=http://forumstatic.ru/files/000f/5f/a4/15057.txt&file='+hrfstr+'" width="400" height="25">' );
}
if(hrfstr.indexOf("youtu")!= -1) {
var End = hrfstr.slice(hrfstr.indexOf('?v=') +3);
$(this).replaceWith('<br /><center><iframe class="youtube-player" src="http://www.youtube.com/embed/'+End+'" frameborder="0" allowfullscreen="true" width="480" height="284"></iframe></center>');
}
});
fd
Страница: 1
Сообщений 1 страница 2 из 2
Поделиться12013-11-17 13:16:45
Поделиться22013-11-17 13:21:09
то есть если у нас запись идет вот такая
$(this).html('<br><center>[url=<img src="'+hrfstr+'" style="max-width: 100%">]</center>');
то скрипт не выполняется
Страница: 1