お世話になります。
<?php $blog->postImg($post) ?>
で記事の中の画像を出力する方法は確認できたのですが
記事の中に画像がない場合、どのように修正を加えたら宜しいでしょうか?
最新バージョン(1.6.11.3)の
basercms\baser\plugins\blog\views\helpers\blog.php
の513行目から変更を加える事で問題解決できると感じてはおりますが
その方法がいまいち分かりません。
function postImg($post, $options = array()) {
$this->setBlogContent($post['BlogPost']['blog_content_id']);
$_options = array('num' => 1, 'link' => true, 'alt' => $post['BlogPost']['name']);
$options = am($_options, $options);
extract($options);
unset($options['num']);
unset($options['link']);
$contents = $post['BlogPost']['content'].$post['BlogPost']['detail'];
$pattern = '/<img.*?src="([^"]+)"[^>]*>/is';
if(!preg_match_all($pattern, $contents, $matches)){
return '';
}
if(isset($matches[1][$num-1])) {
$url = $matches[1][$num-1];
$img = $this->Baser->getImg($url, $options);
if($link) {
$this->Baser->link($img, $url = array('admin'=>false,'plugin'=>'','controller'=>$this->blogContent['name'],'action'=>'archives', $post['BlogPost']['no']));
} else {
echo $img;
}
} else {
return '';
}
}
大変お手数ではございますが、ご教授頂きます様
宜しくお願い致します。
--------------------------------------------------------
スタイルシートにて自己解決致しました。
ありがとうございました。