لجلب اول صورة من الموضوع واضافتها لبلوك أخر الأخبار العادي (الافتراضي) في مجلة المنتدى للجيل الثالث
فقط حرر قالب : portal_last_news
وابحث عن هذا الكود :
CODE
<span class="l-left UserPhoto">
<?php if ($avater_path){ ?>
<a href='<?php echo $avater_path; ?>' rel="facebox">
<img src='<?php echo $avater_path; ?>' alt="Photo" onload="ResizeAv(this)" />
</a>
<?php if ($avater_path ==''){ ?>
<a href="{$image_path}/
{$_CONF['info_row']['default_avatar']}" rel="facebox">
<img src="{$image_path}/
{$_CONF['info_row']['default_avatar']}" border="0" alt="Photo" onload="ResizeAv(this)" />
</a>
{/if}
{else}
<a href="{$image_path}/
{$_CONF['info_row']['default_avatar']}" rel="facebox">
<img src="{$image_path}/
{$_CONF['info_row']['default_avatar']}" border="0" onload="ResizeAv(this)" />
</a>
{/if}
</span>
واستبدله بـ :
CODE
<span class="l-left">
<a href="index.php?page=topic&show=1&id={$LastNews_subjectList['id']}" title="<?php echo $title;?>">
<?php
$x = 1;
$images = array();
$PowerBB->_CONF['template']['while']['LastNews_subjectList'][$this->x_loop]['text'] = stripslashes($PowerBB->_CONF['template']['while']['LastNews_subjectList'][$this->x_loop]['text']);
preg_match_all('/src=([\'"])?((?(1).*?|\S+))(?(1)\1)/', $PowerBB->_CONF['template']['while']['LastNews_subjectList'][$this->x_loop]['text'], $images);
foreach ($images[2] as $src)
{
if($src)
{
echo '<img border="0" width="200" height="200" src="'.$src.'" alt="'.$PowerBB->_CONF['template']['while']['LastNews_subjectList'][$this->x_loop]['title'].'">';
}
break;
}
if(!preg_match_all('/src=([\'"])?((?(1).*?|\S+))(?(1)\1)/', $PowerBB->_CONF['template']['while']['LastNews_subjectList'][$this->x_loop]['text'], $images))
{
echo '<img border="0" width="200" height="200" src="look/portal/images/traffic_cone.png" alt="'.$PowerBB->_CONF['template']['while']['LastNews_subjectList'][$this->x_loop]['title'].'">';
}
?>
</a>
</span>
تم ارفاق القالب المعدل ..
بالتوفيق