xác thực google maps

Thumbnail youtube trong xenforo

Thảo luận trong 'Hỗ trợ Lập Trình, Mã Nguồn' bắt đầu bởi member, 4 Tháng ba 2015.

Lượt xem: 2,333

  1. member

    member Dự bị

    Bài viết:
    26
    Đã được thích:
    1
    Chỉ với một đoạn code đơn giản bạn có thể hiển thị được Thumbnail video từ Youtube trong Xenforo
    Copy file RecentNews.php đè chồng theo đường dẫn
    \library\EWRporta\Block\RecentNews.php
    thật ra nó thêm một hàm này ở đoạn cuối file RecentNews.php
    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;
        }
    }
    File đính kèm bạn có thể download bên dưới
     

    Các file đính kèm: