Xin anh em chỉ giáo lỗi page forum style xfnews 2014

MacKen

Sergeant
Tham gia
30/11/2015
Bài viết
625
Được Like
542
Như tiêu đề : khi click vao forums thì nhận được thông báo lỗi sau:

Mã:
Error Info
Zend_Db_Statement_Mysqli_Exception: Mysqli prepare error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FORCE INDEX (last_post_date) LEFT JOIN xf_user AS last_post_user ON ' at line 20 - library/Zend/Db/Statement/Mysqli.php:77
Generated By: Admin, Today at 11:12 AM
Stack Trace
#0 /home/kvs/public_html/htx/library/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('?        SELECT...')
#1 /home/kvs/public_html/htx/library/Zend/Db/Adapter/Mysqli.php(381): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Mysqli), '?        SELECT...')
#2 /home/kvs/public_html/htx/library/Zend/Db/Adapter/Abstract.php(478): Zend_Db_Adapter_Mysqli->prepare('?        SELECT...')
#3 /home/kvs/public_html/htx/library/XenForo/Model.php(219): Zend_Db_Adapter_Abstract->query('?        SELECT...', Array, 2)
#4 /home/kvs/public_html/htx/library/Kid/Model/Thread.php(50): XenForo_Model->fetchAllKeyed('?        SELECT...', 'thread_id')
#5 /home/kvs/public_html/htx/library/XenForo/ControllerPublic/Forum.php(104): Kid_Model_Thread->getThreads(Array, Array)
#6 /home/kvs/public_html/htx/library/Waindigo/Thumbnails/Extend/XenForo/ControllerPublic/Forum.php(17): XenForo_ControllerPublic_Forum->actionIndex()
#7 /home/kvs/public_html/htx/library/EWRporta/ControllerPublic/Forum.php(9): Waindigo_Thumbnails_Extend_XenForo_ControllerPublic_Forum->actionIndex()
#8 /home/kvs/public_html/htx/library/WidgetFramework/XenForo/ControllerPublic/Forum.php(12): EWRporta_ControllerPublic_Forum->actionIndex()
#9 /home/kvs/public_html/htx/library/XenForo/FrontController.php(351): WidgetFramework_XenForo_ControllerPublic_Forum->actionIndex()
#10 /home/kvs/public_html/htx/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#11 /home/kvs/public_html/htx/index.php(14): XenForo_FrontController->run()
#12 {main}

Mã:
Request State
array(3) {
  ["url"] => string(31) "http://kvs.kvs/forums/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}

Có anh em nào bị lỗi như trên khi sài style xfnew2014 trên xf phiên bản 1.5.4 chưa ?
 
  • Like
Reactions: THB

MacKen

Sergeant
Tham gia
30/11/2015
Bài viết
625
Được Like
542
FORCE INDEX (last_post_date) LEFT JOIN xf_user AS last_post_user ON
 
  • Like
Reactions: THB

THB

Founder
Thành viên BQT
Tham gia
25/02/2015
Bài viết
6,643
Được Like
3,929
chưa dùng cái style xfnew2014 này nên chịu thua. cho về mặc định xem sao. Nếu ok thì tim styles khác mà dùng.
 

MacKen

Sergeant
Tham gia
30/11/2015
Bài viết
625
Được Like
542
chỉ lỗi page forum còn page khác thumb đều hiện ảnh.... cũng đang tìm người viet addon này fix coi thế nào .... hơi lâu đây
 

kamchatka

MasterCorporal
Tham gia
14/04/2015
Bài viết
248
Được Like
162
dis add-on Waindigo Thumbnails , rồi test lại xem
 
  • Like
Reactions: THB

MacKen

Sergeant
Tham gia
30/11/2015
Bài viết
625
Được Like
542
Mình đã dis add-on Waindigo Thumbnails rồi mà vẫn bị thế
 

Invisible

Private
Tham gia
07/09/2015
Bài viết
2
Được Like
0
Em cũng bị lỗi tương tự, nhưng là ở phần clear spam :( chưa biết nguyên nhân và giải pháp :(
Capture.PNG
 

MacKen

Sergeant
Tham gia
30/11/2015
Bài viết
625
Được Like
542
Lỗi của mình so lỗi add-on KID THUMB ....

Mình sài portal 1.6 style xfnew 2014

version xf < 1.4 thì ok

còn update version 1.5.4 thì click vào link forums báo như trên

Ngược lại thumb ở portal và threads thì ok

ADDON KID thumb >>> này lấy thumbs bài viết là ảnh minh họa

Code nó thế này

Mã:
<xen:if is="{$thread.kid_thumb}">
    <div class="thumb">
    <a title="{$thread.title}" href="{xen:if '{$_threadLink}', {xen:raw $_threadLink}, {xen:link threads, $thread}}">{xen:raw {$thread.kid_thumb.0}}</a>
    </div>
<xen:else/>
    <xen:avatar user="$thread" size="m" img="true" />
</xen:if>

NẾU MÌNH ADD LIST WIDGETS THREAD ( > >>>> PHẦN Widget Type CHỌN >>> Most viewed thread (cho cả portal , forum, thread ) >>> bật addon kid thumb thì Ngoài portal và threads ko có lỗi

ngược lại ở forums bị lỗi nhu trên

SAU ĐÓ MÌNH THỬ BỎ CHỌN LIST WIDGET THREAD Ở FORUMS THÌ CŨNG BỊ LỖI
 

Invisible

Private
Tham gia
07/09/2015
Bài viết
2
Được Like
0
Em tìm ra nguyên nhân lỗi này rồi nhé bác thớt :)
 

MacKen

Sergeant
Tham gia
30/11/2015
Bài viết
625
Được Like
542
NGUYÊN NHÂN LÀ LỠI FUNCTIONS NÀY:

Mã:
public function getThreads(array $conditions, array $fetchOptions = array())
  {
    $whereConditions = parent::prepareThreadConditions($conditions, $fetchOptions);

    $sqlClauses = parent::prepareThreadFetchOptions($fetchOptions);
    $limitOptions = parent::prepareLimitFetchOptions($fetchOptions);

    $forceIndex = (!empty($fetchOptions['forceThreadIndex']) ? 'FORCE INDEX (' . $fetchOptions['forceThreadIndex'] . ')' : '');
  
    $preResults = parent::fetchAllKeyed(parent::limitQueryResults(
      '
        SELECT thread.*, xf_post.message AS kid_content
          ' . $sqlClauses['selectFields'] . '
                FROM xf_thread AS thread INNER JOIN xf_post ON (thread.first_post_id = xf_post.post_id) ' . $forceIndex . '
                ' . $sqlClauses['joinTables'] . '
                WHERE ' . $whereConditions . '
                ' . $sqlClauses['orderClause'] . '
            ', $limitOptions['limit'], $limitOptions['offset']
    ), 'thread_id');
    if($preResults)
{
    foreach ($preResults as $thread_id => &$thread)
    {
      
        $thread['kid_thumb'] = $this->xuly($thread['kid_content'],$thread['first_post_id'],$thread['title'], 1);
        $thread['kid_content'] = XenForo_Helper_String::bbCodeStrip($thread['kid_content']);
        $vowels = array('[IMG]','[MEDIA]','[ATTACH]','[media]');
      
        $thread['kid_content'] = str_replace($vowels, "", $thread['kid_content']);  
    }
}
    return $preResults;
  
  }


Mã:
    $forceIndex = (!empty($fetchOptions['forceThreadIndex']) ? 'FORCE INDEX (' . $fetchOptions['forceThreadIndex'] . ')' : '');
 

MacKen

Sergeant
Tham gia
30/11/2015
Bài viết
625
Được Like
542
cậu kìa là cậu nào ???? cậu cho mình link web được ko ?

Lỗi ở đây nó ko left join thời gian được
 
  • Like
Reactions: THB

MacKen

Sergeant
Tham gia
30/11/2015
Bài viết
625
Được Like
542
Làm theo đường dẫn:

library >> xenforo >> ControllerPublic >> mở file này forum.php

Kéo xuống dòng độ 100->> 105 có dòng text :
Mã:
'order' => 'last_post_date',
'forceThreadIndex' => 'last_post_date'


Sũa nó thành thế này:

Mã:
'order' => 'last_post_date'//,
//'forceThreadIndex' => 'last_post_date'
 

Coolboyhn

MasterCorporal
Tham gia
15/03/2015
Bài viết
340
Được Like
236
Làm theo đường dẫn:

library >> xenforo >> ControllerPublic >> mở file này forum.php

Kéo xuống dòng độ 100->> 105 có dòng text :
Mã:
'order' => 'last_post_date',
'forceThreadIndex' => 'last_post_date'


Sũa nó thành thế này:

Mã:
'order' => 'last_post_date'//,
//'forceThreadIndex' => 'last_post_date'
Tớ đang dùng mobile, cậu có thể đính kèm file đó dùm tớ đc ko, thanks
 

MacKen

Sergeant
Tham gia
30/11/2015
Bài viết
625
Được Like
542
đâu cần đính kèm file gi bạn >> bạn cứ mở file đó theo dường dẫn edit lại 2 dòng đó là ok mà ...

chỉ edit dấu // trước dòng ... không cho thực thi nó để khỏi lõi thôi
 

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