engine/modules/show.full.php
$images = array();
$allcontent = $row['full_story'].$row['short_story'].$row['xfields'];
preg_match_all('/(img|src)=("|\')[^"\'>]+/i', $allcontent, $media);
$data=preg_replace('/(img|src)("|\'|="|=\')(.*)/i',"$3",$media[0]);
foreach($data as $url) {
$info = pathinfo($url);
if (isset($info['extension'])) {
if ($info['filename'] == "spoiler-plus" OR $info['filename'] == "spoiler-minus" OR strpos($info['dirname'], 'engine/data/emoticons') !== false) continue;
$info['extension'] = strtolower($info['extension']);
if (($info['extension'] == 'jpg' || $info['extension'] == 'jpeg' || $info['extension'] == 'gif' || $info['extension'] == 'png' || $info['extension'] == 'webp') AND !in_array($url, $images) ) array_push($images, $url);
}
}
if ( count($images) ) {
$social_tags['image'] = str_replace("/thumbs/","/",$images[0]);
$social_tags['image'] = str_replace("/medium/","/",$social_tags['image']);
}
$images = array();
$allcontent = xfieldsdataload( $row['xfields'] );
$data = explode( "~", $allcontent['poster'] ); // <-- 'image' имя доп. поля (укажите свое)
foreach($data as $url) {
$info = pathinfo($url);
if( isset($info['extension']) ) {
if( $info['filename'] == "spoiler-plus" OR $info['filename'] == "spoiler-plus" ) continue;
$info['extension'] = strtolower($info['extension']);
if( ($info['extension'] == 'jpg' || $info['extension'] == 'jpeg' || $info['extension'] == 'gif' || $info['extension'] == 'png') AND !in_array($url, $images) ) array_push($images, $url);
}
}
if( count($images) ) $social_tags['image'] = $config['http_home_url']. "uploads/posts/" . $images[0];
$sql_news_read = $db->query("SELECT SUM(news_read) FROM " . PREFIX . "_post_extras");
$tpl->set ( '{news_read_all}', $sql_news_read );
{news_read_all}
по скобкам < > мог закосячить