Addon 2x Post Threads to Twitter - Đăng chủ đề lên Twitter cho XenForo 2

PVS

Super Moderator
Thành viên BQT
Tham gia
28/02/2015
Bài viết
16,728
Được Like
12,680
Post Threads to Twitter - Đăng chủ đề lên Twitter cho XenForo 2 1.0

Bạn không muốn mọi chủ đề trong diễn đàn của mình được gửi "tự động" vào tài khoản twitter của diễn đàn. Bản sửa đổi template này cộng với một tập lệnh php nhỏ sẽ giúp người điều hành diễn đàn tự do gửi bất kỳ chủ đề nào đến tài khoản twitter của diễn đàn. Bạn sẽ không cần phải cung cấp cho Mod quyền truy cập trực tiếp vào tài khoản.

Mỗi chủ đề sẽ có nút twitter màu xanh lam bên cạnh các nút inline moderation (như trong hình dưới đây):

Screen Shot 2018-05-02 at 1.47.09 AM.png

CÀI ĐẶT:
Đầu tiên: PHP script
  1. Tải tập tin đính kèm và giải nén vào thư mục diễn đàn của bạn.
  2. Sửa đổi "config.php" với:
    1. Twitter App information. (Bạn có thể lấy từ https://apps.twitter.com)
    2. Database Information.
    3. Site URL (không có dấu gạch chéo)
    4. Adjust the strings to your translation needs.
Thứ hai: Sửa Template
  1. Trong template "thread_view", tìm:
    Mã:
    <xf:if is="$canInlineMod">
                            <xf:macro template="inline_mod_macros" name="button" />
                        </xf:if>
  2. Thay bằng:
    Mã:
                        <xf:if is="$canInlineMod">
                        <span class="tweet"><a class="shareButtons-button shareButtons-button--twitter" target="_New" href="javascript:window.open('tweetpost/tweet.php?id={$thread.thread_id}&title={$thread.title}&username={$thread.username}&action=update','mywindowtitle','width=500,height=150')"><i aria-hidden="true"></i></a></span>
                        </xf:if>
                        <xf:if is="$canInlineMod">
                            <xf:macro template="inline_mod_macros" name="button" />
                        </xf:if>
Thứ ba: Tạo bảng cơ sở dữ liệu
  1. Tìm tệp sql bao gồm "tweeted_threads.sql" (Có thể tìm thấy nó trong thư mục được tạo ở trên)
  2. Chạy nó trong cơ sở dữ liệu diễn đàn để yêu cầu tạo bảng.
Chúc các bạn thành công.


Nguồn: xenforo.com​
 

Đính kèm

  • tweetpost.zip
    15.5 KB · Lượt xem: 13

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

XenForo 1 XenForo 2
Translate by PVS

Dịch vụ XenForo của VNXF

Mr. Tuấn

Mobile/Zalo: 0988 488 096

Telegram: bluekpro

Email: [email protected]

Nhà Tài Trợ

Mút Xốp Không Gian
pallet Thịnh Phát
Top Bottom