Lỗi khi đăng chủ đề mới

Thảo luận trong 'Style & Template Questions' bắt đầu bởi dinhnhan, 31/10/16.

  1. dinhnhan

    dinhnhan New Member

    Bài viết:
    33
    Likes :
    2
    Mọi người cho mình hỏi mình dùng Xenforo 1.5.10 sao khi mình tạo chủ đề mới thì khi vào chủ đề đó để xem thì nó hiện dòng chữ này
    Could not execute callback CustomMeta_descr::getHTML() - Not callable.

    trên đầu trang web. còn khi không vào chủ đề thì nó không hiện lên. cảm ơn tất cả mọi người.
     

    Các file đính kèm:

    Đang tải...
  2. dinhnhan

    dinhnhan New Member

    Bài viết:
    33
    Likes :
    2
    ko ai giúp mình sao?
     
  3. thanhnhatxd

    thanhnhatxd New Member

    Bài viết:
    5
    Likes :
    1
    Tạo folder mới: /library/CustomMeta
    tạo một file trong folder trên: descr.php
    Chèn code này vào file descr.php:
    PHP:
    <?php

    // <xen:callback class="CustomMeta_descr" method="getHTML" params="{xen:helper snippet, $firstPost.message, 155}"></xen:callback>

    class CustomMeta_descr
    {
        public static function 
    getHTML()
            {
            
    $descString func_get_arg(1);
          
            
    $descStart strpos($descString"[IMG]");

            if (
    $descStart === false)
                {
                print 
    '<meta name="description" content="' $descString '">';
                }
            else
                {
                
    $descClean substr($descString$descStart+5);
                print 
    '<meta name="description" content="' $descClean '">';
                }

            }
    }

    ?>
    Sau đó, tìm trong thread_view template, thay đổi dòng sau:
    PHP:
    <meta name="description" content="{xen:helper snippet, $firstPost.message, 155}" /></xen:container>
    Thay bằng:
    PHP:
    <xen:callback class="CustomMeta_descr" method="getHTML" params="{xen:helper snippet, $firstPost.message, 155}"></xen:callback>
     
    anonymousit2016 thích bài này.
  4. anonymousit2016

    anonymousit2016 New Member

    Bài viết:
    6
    Likes :
    1

    cảm ơn bạn nhiều. mình cũng đang bị lỗi này
     
  5. Liwke

    Liwke New Member

    Bài viết:
    1
    Likes :
    0
    hay
     
  6. williamson

    williamson New Member

    Bài viết:
    3
    Likes :
    0
    If you cannot use gmail account because of some technical issues then get connected with the Gmail support desk and find out the solution. We rest assure you that this platform will handle the complicated matters and will let you perform emailing operations in the swift manner.
     
comments powered by Disqus

Chia sẻ trang này

Đang tải...