Help Hỗ trợ giúp mình trang chủ porta

lacluoc

Corporal
Tham gia
03/11/2015
Bài viết
146
Được Like
71
Mình có làm cái trang chủ giống hướng dẫn dưới đây. nhưng cái recent này 2 cột nhưng nó chỉ hiển thị 2 cột với trình duyệt chrome còn firefox thì nó chỉ hiển thị 1 cột, giờ chỉnh sao để cho nó hiển thị 2 cột hết hả các bạn. Cảm ơn các bạn nhiều.

  1. demo1-png.831


    Đầu tiên các bạn vào template EWRblock_RecentNews thay hết bằng code sau
    Mã:
    <xen:require css="EWRblock_RecentNews.css" />

    <div id="recentNews">
    <xen:foreach loop="$RecentNews" value="$news" i="$i">
    <div class="content-news">
    <div class="author">
    <div class="author-content">
    <span class="avata">
    <a href="{xen:link members, $news}"></a><xen:avatar user="$news" size="s" img="true" />
    </span>
    <span class="name"><a href="{xen:link members, $news}" class="username">{$news.username}</a></span>
    </div>
    </div>
    <div class="thumb">
    <span class="rt-image">
    <a href="{xen:link threads, $news}"><img src="<xen:if is="{$news.image}">{$news.image}<xen:else />http://mamcongnghe.com/images/news.jpg</xen:if>"
    style="max-height: 600px; max-width: 380px;"></a>
    </span>
    </div>
    <div class="metaContent">
    <div class="ovf">
    <h2><a href="{xen:link threads, $news}" class="newsTitle">{$news.title}</a></h2>
    <div class="newsTexts">{xen:helper snippet, $news.message, 300}</div>
    </div>
    <div class="postedBy">
    <span class="views"><a href="{xen:link threads, $news}">{xen:number $news.view_count}</a></span>
    <span class="cm"><a href="{xen:link threads/reply, $news}" class="NoPopupGadget OverlayTrigger">{xen:number $news.reply_count}</a></span>
    <span class="liked">{xen:number $news.reply_count}</span>
    <span class="share"><a href="#" onclick="window.open('https://www.facebook.com/sharer.php?u={xen:link full:threads, $news}','pagename','resizable,height=500,width=600'); return false;"></a></span>
    </div>
    </div>
    </div>
    </xen:foreach>
    </div>
    <div id="Loadpage"></div>
    <xen:if hascontent="true">
    <div class="section sectionMain">
    <xen:contentcheck>
    <xen:if is="{$option.pagenav} && {$option.count} > {$option.limit}">
    <xen:if is="{$category}">
    <xen:pagenav link="articles" linkdata="{$category}" page="{$page}" perpage="{$option.limit}" total="{$option.count}" />
    <xen:else />
    <xen:pagenav link="portal" page="{$page}" perpage="{$option.limit}" total="{$option.count}" />
    </xen:if>
    </xen:if>
    </xen:contentcheck>
    </div>
    </xen:if>
    Sau đó vào EWRblock_RecentNews.css thay hết bằng code sau
    Mã:
    #recentNews{-webkit-column-count:2;-webkit-column-gap:10px;-webkit-column-fill:auto;-moz-column-count:2;-moz-column-gap:10px;-moz-column-fill:auto;-webkit-column-count:2;-moz-column-count:2;column-count:2;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-webkit-column-fill:auto;-moz-column-fill:auto;column-fill:auto;margin-top:10px;}@media (max-width: 600px) {#recentNews{-webkit-column-count:1;-moz-column-count:1;-webkit-column-count:1;-moz-column-count:1;column-count:1;}}@media (max-width: 800px) {.sidebar{width:100%;}}.content-news{display:block;background:xFEFEFE;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.2);-moz-box-shadow:0 1px 1px rgba(0,0,0,0.2);-khtml-box-shadow:0 1px 1px rgba(0,0,0,0.2);box-shadow:0 1px 1px rgba(0,0,0,0.2);-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.2);-moz-box-shadow:0 1px 1px rgba(0,0,0,0.2);margin:0 0px 15px;-webkit-column-break-inside:avoid;-moz-column-break-inside:avoid;-webkit-column-break-inside:avoid;-moz-column-break-inside:avoid;column-break-inside:avoid;-webkit-transition:all .2s ease;-moz-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease;-webkit-border-radius:3px;-moz-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;font-size:14px;font-family:Arial;}.thumb{margin:0 15px;overflow:hidden;}.thumb img{max-width:100%!important;margin:0 auto;display:block;}.content-news .ovf{padding:0 15px 15px;}.content-news .ovf h2 a{font-size:17px;font-weight:bold;text-decoration:none;line-height:18px;padding:5px 0;display:block;}.content-news .ovf h2 a:hover{color:rgb(0,148,131);}.content-news .author{width:100%;height:30px;-webkit-border-radius:3px 3px 0 0;-moz-border-radius:3px 3px 0 0;-khtml-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0;-webkit-border-radius:3px 3px 0 0;-moz-border-radius:3px 3px 0 0;}.author-content .avata{width:16px;height:16px;background:xddd;display:inline-block;margin:7px;overflow:hidden;-webkit-border-radius:10px;-moz-border-radius:10px;-khtml-border-radius:10px;border-radius:10px;-webkit-border-radius:10px;-moz-border-radius:10px;float:left;}.author-content .avata img{width:16px;height:16px;}.author-content .name{display:inline-block;line-height:30px;float:left;font-size:13px;font-family:Arial;}.author-content .name a{text-decoration:none;color:xB2B2B2;}.author-content .name a:hover{color:x545454;}.postedBy{padding:10px;background:xf5f5f5;-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;-khtml-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;}.postedBy span{background:url(styles/default/xenforo/like-icon.png) no-repeat;padding-left:16px;margin:0 5px;}.postedBy .views{background-position:0 0;}.postedBy .cm{background-position:0 -16px;}.postedBy .liked{background-position:0 -32px;}.postedBy .share{background:url(http://i.imgur.com/CUvIEx6.png) 0 center no-repeat;padding-left:21px;}.postedBy .share a:after{content:"Chia sẻ lên Facebook";}@media (min-width:800px) and (max-width:910px) {.postedBy .share a:after{content:"Chia sẻ";}}@media (min-width:600px) and (max-width:670px) {.postedBy .share a:after{content:"Chia sẻ";}}@media (max-width:340px) {.postedBy .share a:after{content:"Chia sẻ";}}.button_more{display:block;text-align:center;}.button_more a{padding:9px;display:block;border-top:none;color:x38AACE;font-size:11pt;}span.avata .img{width:16px!important;height:16px!important;background-size:16px 16px;}a.Loadend{color:xC71212;}
    #recentNews > div > div > span { display:block!important; }
    #recentNews { height: auto!important; }
    #recentNews .content-news:nth-child(4) .thumb img, #recentNews .content-news:nth-child(6) .thumb img { display:none; }
    Vào AdminCP -> XenPorta -> Layout -> Portal chỉnh cho cái block bạn dùng lên trên cùng bên phải ( bắt buộc ).
    Sau đó vào AdminCP -> XenPorta -> Blocks -> Block bạn dùng -> Chỉnh số bài là 10.
    Vậy là ok.
 
Sửa lần cuối:
  • Like
Reactions: THB

kamchatka

MasterCorporal
Tham gia
14/04/2015
Bài viết
248
Được Like
162
đơn giản thôi bác
1 . bác mở file : library/EWRporta/Block/RecentNews.php
Thêm vào đoạn code bên dưới
PHP:
            return $post;
        }
       
        if (preg_match('#\[media=youtube\](.+?)\[/media\]#i', $post['message'], $matches)){
            $post['promote_data'] = 'http://img.youtube.com/vi/'.$matches[1].'/0.jpg';
            $post['image'] = 'http://img.youtube.com/vi/'.$matches[1].'/0.jpg';
            return $post;
        }

        return $post;
    }
}

Hoặc chép toàn bộ của mình
PHP:
<?php

class EWRporta_Block_RecentNews extends XenForo_Model
{
    public function getModule(&$options, $page, $category = false)
    {
     
        $page = ($page - 1) * $options['limit'];
        $fromWhere = '';
        $fromOrder = '';

        if ($category)
        {
            $fromWhere = "INNER JOIN EWRporta_catlinks ON (EWRporta_catlinks.thread_id = xf_thread.thread_id)
                INNER JOIN EWRporta_categories ON (EWRporta_categories.category_id = EWRporta_catlinks.category_id AND EWRporta_categories.category_slug = '".$category."')";
        }
       
        if ($options['sticky'])
        {
            $fromOrder = "sticky DESC, ";
        }

        $news = $this->_getDb()->fetchAll("
            SELECT xf_thread.*, xf_user.*, xf_post.message, xf_post.attach_count, xf_node.title AS node_title,
                IF(xf_user.username IS NULL, xf_thread.username, xf_user.username) AS username,
                IF(EWRporta_promotes.promote_date IS NULL, xf_thread.post_date, EWRporta_promotes.promote_date) AS promote_date,
                EWRporta_promotes.promote_icon, EWRporta_promotes.promote_data
            FROM xf_thread
                LEFT JOIN xf_user ON (xf_user.user_id = xf_thread.user_id)
                INNER JOIN xf_post ON (xf_post.post_id = xf_thread.first_post_id)
                INNER JOIN xf_node ON (xf_node.node_id = xf_thread.node_id)
                LEFT JOIN EWRporta_promotes ON (EWRporta_promotes.thread_id = xf_thread.thread_id)
            $fromWhere
            WHERE ( xf_thread.node_id IN (".$this->_getDb()->quote($options['forum']).") OR EWRporta_promotes.promote_date < ? )
                AND xf_thread.discussion_state = 'visible'
                AND IF(EWRporta_promotes.promote_date IS NULL, xf_thread.post_date, EWRporta_promotes.promote_date) < ?
            ORDER BY $fromOrder promote_date DESC
            LIMIT ?, ?
        ", array(XenForo_Application::$time, XenForo_Application::$time, $page, $options['limit']));

        foreach ($news AS &$post)
        {
            if (!$options['social'])
            {
                $post['categories'] = $this->getModelFromCache('EWRporta_Model_Categories')->getCategoryLinks($post);
            }
       
            $strtime = new DateTime(date('r', $post['promote_date']));
            $strtime->setTimezone(new DateTimeZone(XenForo_Application::get('options')->guestTimeZone));
            list($post['month'], $post['day']) = explode('.', $strtime->format('n.d'));
            $post['month'] = new XenForo_Phrase('month_'.$post['month'].'_short');

            if ($post['attach_count'])
            {
                $post['attachments'] = $this->getModelFromCache('XenForo_Model_Attachment')->getAttachmentsByContentId('post', $post['first_post_id']);
                $post['attachments'] = $this->getModelFromCache('XenForo_Model_Attachment')->prepareAttachments($post['attachments']);
            }

            if ($post['promote_icon'] != 'disabled')
            {
                switch ($post['promote_icon'])
                {
                    case 'avatar':        $post['showIcon'] = true;                                                        break;
                    case 'attach':        if ($post['attach'] = $this->getAttach($post)) { $post['showIcon'] = true; }    break;
                    case 'image':        if ($post['image'] = $this->getImage($post)) { $post['showIcon'] = true; }        break;
                    case 'medio':        if ($post['medio'] = $this->getMedio($post)) { $post['showIcon'] = true; }        break;
                }

                if (empty($post['showIcon']))
                {
                    $post = $this->getDefault($post);
                }
            }

            $post['message'] = str_ireplace('prbreak]', 'prebreak]', $post['message']);
            $post['message'] = preg_replace('#\n{3,}#', "\n\n", trim($post['message']));

            if ($trimLoc = stripos($post['message'], '[prebreak]'))
            {
                $prbreak = '';

                if (($breakLoc = stripos($post['message'], '[/prebreak]', $trimLoc+10)) && ($length = $breakLoc - $trimLoc-10))
                {
                    $link = XenForo_Link::buildPublicLink('full:threads', $post);
                    $prbreak = " [url='".$link."']".substr($post['message'], $trimLoc+10, $length).'[/url] [size=2][...][/size]';
                }

                $post['message'] = substr($post['message'], 0, $trimLoc).$prbreak;
            }
            else
            {
                $post['message'] = XenForo_Helper_String::wholeWordTrim($post['message'], $options['truncate']);
            }
        }

        $options['parseBB'] = true;
        $options['count'] = $this->getCount($options, $category);

        return $news;
    }

    public function getCount($options, $category = false)
    {
    
        $fromWhere = '';

        if ($category)
        {
            $fromWhere = "INNER JOIN EWRporta_catlinks ON (EWRporta_catlinks.thread_id = xf_thread.thread_id)
                INNER JOIN EWRporta_categories ON (EWRporta_categories.category_id = EWRporta_catlinks.category_id AND EWRporta_categories.category_slug = '".$category."')";
        }

        $count = $this->_getDb()->fetchRow("
            SELECT COUNT(*) AS total
                FROM xf_thread
                LEFT JOIN EWRporta_promotes ON (EWRporta_promotes.thread_id = xf_thread.thread_id)
            $fromWhere
            WHERE (xf_thread.node_id IN (".$this->_getDb()->quote($options['forum']).") OR EWRporta_promotes.promote_date < ?)
                AND xf_thread.discussion_state = 'visible'
                AND IF(EWRporta_promotes.promote_date IS NULL, xf_thread.post_date, EWRporta_promotes.promote_date) < ?
        ", array(XenForo_Application::$time, XenForo_Application::$time));

        return $count['total'];
    }

    public function getAttach(&$post)
    {
        if (!empty($post['attachments'][$post['promote_data']]))
        {
            if ($post['attachments'][$post['promote_data']]['thumbnailUrl'])
            {
                $post['message'] = str_ireplace('[attach]'.$post['promote_data'].'[/attach]', '', $post['message']);
                $post['message'] = str_ireplace('[attach=full]'.$post['promote_data'].'[/attach]', '', $post['message']);
                return $post['attachments'][$post['promote_data']];
            }
        }

        return false;
    }

    public function getImage(&$post)
    {
        $post['message'] = str_ireplace('[img]'.$post['promote_data'].'[/img]', '', $post['message']);
        return $post['promote_data'];
    }

    public function getMedio(&$post)
    {
        if (XenForo_Application::autoload('EWRmedio_Model_Media'))
        {
            if ($medio = $this->getModelFromCache('EWRmedio_Model_Media')->getMediaByID($post['promote_data']))
            {
                $post['message'] = str_ireplace('[medio]'.$post['promote_data'].'[/medio]', '', $post['message']);
                $post['message'] = str_ireplace('[medio=full]'.$post['promote_data'].'[/medio]', '', $post['message']);
                return $medio;
            }
        }

        return false;
    }

    public function getDefault($post)
    {
        
        if (preg_match('#\[medio\](\d+)\[/medio\]#i', $post['message'], $matches))
        {
            $post['promote_data'] = $matches[1];
            $post['medio'] = $this->getMedio($post);
            return $post;
        }
       
        if (!empty($post['attachments']))
        {
            foreach ($post['attachments'] AS $attach)
            {
                if ($attach['thumbnailUrl'])
                {
                    $post['promote_data'] = $attach['attachment_id'];
                    $post['attach'] = $this->getAttach($post);
                    return $post;
                }
            }
        }

        if (preg_match('#\[img\](.+?)\[/img\]#i', $post['message'], $matches))
        {
            $post['promote_data'] = $matches[1];
            $post['image'] = $this->getImage($post);
           
            return $post;
        }
       
        if (preg_match('#\[media=youtube\](.+?)\[/media\]#i', $post['message'], $matches)){
            $post['promote_data'] = 'http://img.youtube.com/vi/'.$matches[1].'/0.jpg';
            $post['image'] = 'http://img.youtube.com/vi/'.$matches[1].'/0.jpg';
            return $post;
        }

        return $post;
    }
}
rôi save lại nó tự động get thumnail từ youtube
2. Trong EWRblock_RecentNews tìm
Đoạn này là tiêu đề :
<div class="ovf">
<h2><a href="{xen:link threads, $news}" class="newsTitle">{$news.title}</a></h2>
Đoạn này là lấy trích dẫn 300 ký tự :

<div class="newsTexts">{xen:helper snippet, $news.message, 300}</div>
</div>
sau đó bạn di chuyển lên phần trên thumnail , rồi vào EWRblock_RecentNews.css chỉnh lại chút kích thước là ok
 

lacluoc

Corporal
Tham gia
03/11/2015
Bài viết
146
Được Like
71
đơn giản thôi bác
1 . bác mở file : library/EWRporta/Block/RecentNews.php
Thêm vào đoạn code bên dưới
PHP:
            return $post;
        }
      
        if (preg_match('#\[media=youtube\](.+?)\[/media\]#i', $post['message'], $matches)){
            $post['promote_data'] = 'http://img.youtube.com/vi/'.$matches[1].'/0.jpg';
            $post['image'] = 'http://img.youtube.com/vi/'.$matches[1].'/0.jpg';
            return $post;
        }

        return $post;
    }
}

Hoặc chép toàn bộ của mình
PHP:
<?php

class EWRporta_Block_RecentNews extends XenForo_Model
{
    public function getModule(&$options, $page, $category = false)
    {
    
        $page = ($page - 1) * $options['limit'];
        $fromWhere = '';
        $fromOrder = '';

        if ($category)
        {
            $fromWhere = "INNER JOIN EWRporta_catlinks ON (EWRporta_catlinks.thread_id = xf_thread.thread_id)
                INNER JOIN EWRporta_categories ON (EWRporta_categories.category_id = EWRporta_catlinks.category_id AND EWRporta_categories.category_slug = '".$category."')";
        }
      
        if ($options['sticky'])
        {
            $fromOrder = "sticky DESC, ";
        }

        $news = $this->_getDb()->fetchAll("
            SELECT xf_thread.*, xf_user.*, xf_post.message, xf_post.attach_count, xf_node.title AS node_title,
                IF(xf_user.username IS NULL, xf_thread.username, xf_user.username) AS username,
                IF(EWRporta_promotes.promote_date IS NULL, xf_thread.post_date, EWRporta_promotes.promote_date) AS promote_date,
                EWRporta_promotes.promote_icon, EWRporta_promotes.promote_data
            FROM xf_thread
                LEFT JOIN xf_user ON (xf_user.user_id = xf_thread.user_id)
                INNER JOIN xf_post ON (xf_post.post_id = xf_thread.first_post_id)
                INNER JOIN xf_node ON (xf_node.node_id = xf_thread.node_id)
                LEFT JOIN EWRporta_promotes ON (EWRporta_promotes.thread_id = xf_thread.thread_id)
            $fromWhere
            WHERE ( xf_thread.node_id IN (".$this->_getDb()->quote($options['forum']).") OR EWRporta_promotes.promote_date < ? )
                AND xf_thread.discussion_state = 'visible'
                AND IF(EWRporta_promotes.promote_date IS NULL, xf_thread.post_date, EWRporta_promotes.promote_date) < ?
            ORDER BY $fromOrder promote_date DESC
            LIMIT ?, ?
        ", array(XenForo_Application::$time, XenForo_Application::$time, $page, $options['limit']));

        foreach ($news AS &$post)
        {
            if (!$options['social'])
            {
                $post['categories'] = $this->getModelFromCache('EWRporta_Model_Categories')->getCategoryLinks($post);
            }
      
            $strtime = new DateTime(date('r', $post['promote_date']));
            $strtime->setTimezone(new DateTimeZone(XenForo_Application::get('options')->guestTimeZone));
            list($post['month'], $post['day']) = explode('.', $strtime->format('n.d'));
            $post['month'] = new XenForo_Phrase('month_'.$post['month'].'_short');

            if ($post['attach_count'])
            {
                $post['attachments'] = $this->getModelFromCache('XenForo_Model_Attachment')->getAttachmentsByContentId('post', $post['first_post_id']);
                $post['attachments'] = $this->getModelFromCache('XenForo_Model_Attachment')->prepareAttachments($post['attachments']);
            }

            if ($post['promote_icon'] != 'disabled')
            {
                switch ($post['promote_icon'])
                {
                    case 'avatar':        $post['showIcon'] = true;                                                        break;
                    case 'attach':        if ($post['attach'] = $this->getAttach($post)) { $post['showIcon'] = true; }    break;
                    case 'image':        if ($post['image'] = $this->getImage($post)) { $post['showIcon'] = true; }        break;
                    case 'medio':        if ($post['medio'] = $this->getMedio($post)) { $post['showIcon'] = true; }        break;
                }

                if (empty($post['showIcon']))
                {
                    $post = $this->getDefault($post);
                }
            }

            $post['message'] = str_ireplace('prbreak]', 'prebreak]', $post['message']);
            $post['message'] = preg_replace('#\n{3,}#', "\n\n", trim($post['message']));

            if ($trimLoc = stripos($post['message'], '[prebreak]'))
            {
                $prbreak = '';

                if (($breakLoc = stripos($post['message'], '[/prebreak]', $trimLoc+10)) && ($length = $breakLoc - $trimLoc-10))
                {
                    $link = XenForo_Link::buildPublicLink('full:threads', $post);
                    $prbreak = " [url='".$link."']".substr($post['message'], $trimLoc+10, $length).'[/url] [size=2][...][/size]';
                }

                $post['message'] = substr($post['message'], 0, $trimLoc).$prbreak;
            }
            else
            {
                $post['message'] = XenForo_Helper_String::wholeWordTrim($post['message'], $options['truncate']);
            }
        }

        $options['parseBB'] = true;
        $options['count'] = $this->getCount($options, $category);

        return $news;
    }

    public function getCount($options, $category = false)
    {
   
        $fromWhere = '';

        if ($category)
        {
            $fromWhere = "INNER JOIN EWRporta_catlinks ON (EWRporta_catlinks.thread_id = xf_thread.thread_id)
                INNER JOIN EWRporta_categories ON (EWRporta_categories.category_id = EWRporta_catlinks.category_id AND EWRporta_categories.category_slug = '".$category."')";
        }

        $count = $this->_getDb()->fetchRow("
            SELECT COUNT(*) AS total
                FROM xf_thread
                LEFT JOIN EWRporta_promotes ON (EWRporta_promotes.thread_id = xf_thread.thread_id)
            $fromWhere
            WHERE (xf_thread.node_id IN (".$this->_getDb()->quote($options['forum']).") OR EWRporta_promotes.promote_date < ?)
                AND xf_thread.discussion_state = 'visible'
                AND IF(EWRporta_promotes.promote_date IS NULL, xf_thread.post_date, EWRporta_promotes.promote_date) < ?
        ", array(XenForo_Application::$time, XenForo_Application::$time));

        return $count['total'];
    }

    public function getAttach(&$post)
    {
        if (!empty($post['attachments'][$post['promote_data']]))
        {
            if ($post['attachments'][$post['promote_data']]['thumbnailUrl'])
            {
                $post['message'] = str_ireplace('[attach]'.$post['promote_data'].'[/attach]', '', $post['message']);
                $post['message'] = str_ireplace('[attach=full]'.$post['promote_data'].'[/attach]', '', $post['message']);
                return $post['attachments'][$post['promote_data']];
            }
        }

        return false;
    }

    public function getImage(&$post)
    {
        $post['message'] = str_ireplace('[img]'.$post['promote_data'].'[/img]', '', $post['message']);
        return $post['promote_data'];
    }

    public function getMedio(&$post)
    {
        if (XenForo_Application::autoload('EWRmedio_Model_Media'))
        {
            if ($medio = $this->getModelFromCache('EWRmedio_Model_Media')->getMediaByID($post['promote_data']))
            {
                $post['message'] = str_ireplace('[medio]'.$post['promote_data'].'[/medio]', '', $post['message']);
                $post['message'] = str_ireplace('[medio=full]'.$post['promote_data'].'[/medio]', '', $post['message']);
                return $medio;
            }
        }

        return false;
    }

    public function getDefault($post)
    {
       
        if (preg_match('#\[medio\](\d+)\[/medio\]#i', $post['message'], $matches))
        {
            $post['promote_data'] = $matches[1];
            $post['medio'] = $this->getMedio($post);
            return $post;
        }
      
        if (!empty($post['attachments']))
        {
            foreach ($post['attachments'] AS $attach)
            {
                if ($attach['thumbnailUrl'])
                {
                    $post['promote_data'] = $attach['attachment_id'];
                    $post['attach'] = $this->getAttach($post);
                    return $post;
                }
            }
        }

        if (preg_match('#\[img\](.+?)\[/img\]#i', $post['message'], $matches))
        {
            $post['promote_data'] = $matches[1];
            $post['image'] = $this->getImage($post);
          
            return $post;
        }
      
        if (preg_match('#\[media=youtube\](.+?)\[/media\]#i', $post['message'], $matches)){
            $post['promote_data'] = 'http://img.youtube.com/vi/'.$matches[1].'/0.jpg';
            $post['image'] = 'http://img.youtube.com/vi/'.$matches[1].'/0.jpg';
            return $post;
        }

        return $post;
    }
}
rôi save lại nó tự động get thumnail từ youtube
2. Trong EWRblock_RecentNews tìm
Đoạn này là tiêu đề :
<div class="ovf">
<h2><a href="{xen:link threads, $news}" class="newsTitle">{$news.title}</a></h2>
Đoạn này là lấy trích dẫn 300 ký tự :

<div class="newsTexts">{xen:helper snippet, $news.message, 300}</div>
</div>
sau đó bạn di chuyển lên phần trên thumnail , rồi vào EWRblock_RecentNews.css chỉnh lại chút kích thước là ok
Bạn thật nhiệt tình :), nhưng cái tiêu đề đang bị dưới tên user đăng bài, mình muốn nó ở trên cùng rồi mới đến user đăng bài bạn ah
Còn cái youtube mình đã thay code mới hoàn toàn như của bạn nhưng trang chủ nó vẫn ko ăn link youtube ví dụ http://abvtv.net/threads/noel-da-chuan-bi-ve-nho-ngay-nay-nam-ngoai-qua-moi-nguoi.4/ . một lần nữa rất cảm ơn bạn vì đã nhiệt tình
 

kamchatka

MasterCorporal
Tham gia
14/04/2015
Bài viết
248
Được Like
162
ah thấy rồi , bạn đưa cái user dưới lun ngang hàng với thẻ view, fb... kìa , mà hình như bạn thiếu icon , chỉ thấy sô , bạn thay hết bằng font awesome icons đi sẽ đủ không gian đó , còn cái thumnail mình làm bt mà bạn xài xenportal ver nhiu
 

lacluoc

Corporal
Tham gia
03/11/2015
Bài viết
146
Được Like
71
ah thấy rồi , bạn đưa cái user dưới lun ngang hàng với thẻ view, fb... kìa , mà hình như bạn thiếu icon , chỉ thấy sô , bạn thay hết bằng font awesome icons đi sẽ đủ không gian đó , còn cái thumnail mình làm bt mà bạn xài xenportal ver nhiu
mình dung xenporta 1.6. Bạn có thể giúp mình chỉnh sửa rồi mình copy vào ko vì mình ko phải dân code nên không biết gì.
mà mình thấy các tính năng lựa chọn khi promote ra trang chủ không hoạt động như:
  • Default Promotion Hierarchy
  • Avatar:
  • Disable Promotion Icon
Còn dùng code trang chủ khác thì bình thường, nhưng mình lại chỉ kết giao diện trang chủ này mới chết
 
Sửa lần cuối:

kamchatka

MasterCorporal
Tham gia
14/04/2015
Bài viết
248
Được Like
162
ủa nó tự động promote ra xenporta mà , để mình test thử xem đc ko
 

lacluoc

Corporal
Tham gia
03/11/2015
Bài viết
146
Được Like
71
mình dung xenporta 1.6. Bạn có thể giúp mình chỉnh sửa rồi mình copy vào ko vì mình ko phải dân code nên không biết gì.
mà mình thấy các tính năng lựa chọn khi promote ra trang chủ không hoạt động như:
  • Default Promotion Hierarchy
  • Avatar:
  • Disable Promotion Icon
Còn dùng code trang chủ khác thì bình thường, nhưng mình lại chỉ kết giao diện trang chủ này mới chết
cái recent này 2 cột nhưng nó chỉ hiển thị 2 cột với trình duyệt chrome còn firefox thì nó chỉ hiển thị 1 cột, giờ chỉnh sao để cho nó hiển thị 2 cột hết hả bạn
 

lacluoc

Corporal
Tham gia
03/11/2015
Bài viết
146
Được Like
71
cái recent này 2 cột nhưng nó chỉ hiển thị 2 cột với trình duyệt chrome còn firefox thì nó chỉ hiển thị 1 cột, giờ chỉnh sao để cho nó hiển thị 2 cột hết hả bạn
@PVS @THB giúp mình cái này với
 

lacluoc

Corporal
Tham gia
03/11/2015
Bài viết
146
Được Like
71
Cho xem demo nào ít thì thôi mình k nhận . bạn có thể thuê mình rip portal nào cảm thấy ưng ý

Cái này mình thấy nó lỗi nên xóa khỏi web rồi, mình ko hiểu về code nên ko rõ lỗi này là nhiều hay ít, mình chỉ cần fix cho nó hiển thị được trên firefox thôi còn lại ko cần sửa gì nữa. Bạn thử xem như vậy có nặng lắm ko.
 

HungTQ

Sergeant
Tham gia
01/03/2016
Bài viết
428
Được Like
308
Cái này mình thấy nó lỗi nên xóa khỏi web rồi, mình ko hiểu về code nên ko rõ lỗi này là nhiều hay ít, mình chỉ cần fix cho nó hiển thị được trên firefox thôi còn lại ko cần sửa gì nữa. Bạn thử xem như vậy có nặng lắm ko.
ây chà bạn sửa lỗi rồi lại kêu mình lục cái đống code đó tìm lỗi có mà chết à . demo inbox đi bạn trưa về mình xem
 

Hướng dẫn sử dụng

XenForo 1 XenForo 2
Translate by PVS

Dịch vụ XenForo của VNXF

Mobile/Zalo: 0906081284

Telegram: anhanhxf

Chỉ nhận web nội dung lành mạnh

Nhà Tài Trợ

Mút Xốp Không Gian
Mút Sofa Không Gian
Top Bottom