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

MacKen

Sergeant
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
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.
 
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
 
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
 
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
 
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'] . ')' : '');
 
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
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'
 
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
 
đâ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
 
Back
Top