[Userscript] Forumotion backup templates

  Bài viết hay nhất1

Forumotion backup templates



Userscript này sẽ giúp bạn lưu trữ tất các template (đã chỉnh sửa) của diễn đàn một cách dễ dàng.
Tất cả template được chọn sẽ được lưu trữ trong một tập tin nén để phục hồi khi cần thiết.


Screenshot


[You must be registered and logged in to see this image.]

Xem thêm ảnh chụp màn hình khác tại đây.


Cập nhật


2.0.1

- Hỗ trợ template phiên bản Mobile.
- Chức năng thông báo trên Desktop.
- Cảnh báo nếu thoát khi tiến trình đang chạy.
- Kiểm tra tính hợp lệ của tệp zip tải lên.
- Thêm chế độ One-Click.

0.6.1

- Sửa lỗi trên Firefox.

0.6.0

- Chức năng Nhập và Xuất templates.


Hướng dẫn


Cài trình quản lý

Sử dụng trình duyệt Chrome, Firefox hoặc Opera phiên bản mới nhất.

Cài đặt tiện ích hỗ trợ userscript trước khi sử dụng:

  • Chrome: Tampermonkey
  • Firefox: Greasemonkey
  • Opera: Violent monkey

Cài script backup

Cài đặt userscript Forumotion backup templates.
Nhấn vào liên kết sau: [You must be registered and logged in to see this link.]
Sau khi hiện ra bảng xác nhận thì nhấn Install (Cài đặt).

Chú ý: Đã có phiên bản Add-on / extension riêng cho từng trình duyệt. [You must be registered and logged in to see this link.].

Sử dụng

Truy cập ACP >> Display >> Skins >> Themes management để sử dụng.
Rê chuột vào dấu ? để xem hướng dẫn.


Mã nguồn

Code:
// ==UserScript==
// @name         Forumotion backup templates
// @namespace    http://devs.forumvi.com/
// @version      2.0.1
// @description  Export & Import forumotion Templates
// @copyright    2014+, Zzbaivong
// @icon         http://i19.servimg.com/u/f19/18/83/32/63/icon-610.png
// @match        http://*/admin/index.forum?mode=export*
// @match        http://*/admin/index.forum?*&mode=export*
// @resource     jszip https://openuserjs.org/src/libs/baivong/jszip.js
// @resource     jsziputils https://openuserjs.org/src/libs/baivong/jszip-utils.js
// @resource     filesaver https://openuserjs.org/src/libs/baivong/FileSaver.js
// @resource     zzFmBackup https://openuserjs.org/src/libs/baivong/zzFmBackup.js
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @run-at       document-end
// @grant        GM_addStyle
// @grant        GM_getResourceText
// ==/UserScript==

/**
 * jsZip (v2.5.0) By Stuart Knightley <http://stuartk.com/jszip>
 * jszip-utils (v0.0.2) By Stuart Knightley, David Duponchel <http://stuk.github.io/jszip-utils>
 * FileSaver (2015-05-07) By Eli Grey <http://eligrey.com>
 * zzFmBackup (v2.0.1) By Zzbaivong <http://devs.forumvi.com>
 */

function addscript(source) {
    $("<script>", {
        type: "text/javascript",
        text: source
    }).appendTo("head");
}

GM_addStyle("#zzBackup fieldset{counter-reset:section;border:1px solid #07f}#zzBackup legend{color:#e000a2}#zzBackup ol{margin:5px 0 15px;list-style:none outside none}#zzBackup li:before{counter-increment:section;content:counter(section) '.';width:30px;display:inline-block;text-align:right;margin-right:5px}.backupOption{font-size:18px;color:#00a8a1}#importNoti strong{color:#DA4FB8}#zzBackup dt label{display:block;margin-top:10px;color:#777}#zzBackup dt label:hover{color:#111}#zzBackup label input:checked ~ span{color:#0094CA}.buttonOne{display:none;margin-top:10px;padding:7px 20px;background:#f90e5e;color:#FFF;font-weight:700;border:3px solid #DDD}.buttonOne:hover{border-color:#444;cursor:pointer}.buttonOne:active{background:#444}#zzBackup :disabled,#zzBackup :disabled ~ span{color:#999;cursor:not-allowed}");
addscript(GM_getResourceText("jszip"));
addscript(GM_getResourceText("jsziputils"));
addscript(GM_getResourceText("filesaver"));
addscript(GM_getResourceText("zzFmBackup"));

Chi tiết mã nguồn xem trên Github: [You must be registered and logged in to see this link.]


Tác giả


[You must be registered and logged in to see this link.]: zzFmBackup (v2.0.1)

Cảm ơn

[You must be registered and logged in to see this link.] đã dịch code này sang ngôn ngữ English.
Stuart Knightley: jsZip (v2.5.0)
Stuart Knightley, David Duponchel: jszip-utils (v0.0.2)
Eli Grey: FileSaver (2015-05-07)
  Bài viết hay nhất2
tem @@!, ra đây là cái mà huynh ấy nghiên cứu bấy lâu :v
  Bài viết hay nhất3
Lâu nay ad bận thật mà, code này làm mất 2 ngày >:(
  Bài viết hay nhất4
Thằng này là người phát hiện không xài được trên FireFox nhé :v
  Bài viết hay nhất5
Cập nhật phiên bản hoàn chỉnh cho Chrome và Firefox :3
The author of this message was banned from the forum - See the message
  Bài viết hay nhất7
ko luu css à baivong
  Bài viết hay nhất8
CSS thì fm có chức năng backup riêng mà, trong chỗ Themes management, kéo xuống phần Export your skinImport the skin. Ngoài CSS, nó còn lưu được các icon và button của diễn đàn, vì thế mình không làm phần này.
  Bài viết hay nhất9
I need English Version please...
  Bài viết hay nhất10
Sorry for initial reply. But, I have a problem, I have installed the script. But noting happens when I go to ACP >> Display >> Skins >> Themes management
I am using Chrome
[You must be registered and logged in to see this image.]
  Bài viết hay nhất11
[You must be registered and logged in to see this link.]
ashik4u wrote:Sorry for initial reply. But, I have a problem, I have installed the script. But noting happens when I go to ACP >> Display >> Skins >> Themes management
I am using Chrome
[You must be registered and logged in to see this image.]
Can you describe in more detail?
  Bài viết hay nhất12
[You must be registered and logged in to see this link.]
ashik4u wrote:I need English Version please...
Check for update: version 0.5
  Bài viết hay nhất13
[You must be registered and logged in to see this link.]
Zzbaivong wrote:[You must be registered and logged in to see this link.]
ashik4u wrote:Sorry for initial reply. But, I have a problem, I have installed the script. But noting happens when I go to ACP >> Display >> Skins >> Themes management
I am using Chrome
[You must be registered and logged in to see this image.]
Can you describe in more detail?
It's okay now bro. I have cleared the cache of my browser and it is working fine. And also thanks for the English version. <3
  Bài viết hay nhất14
Cập nhật phiên bản 0.6:
Sửa một số lỗi nhỏ, bổ sung chi tiết các thông báo và đặc biệt giảm tối thiểu khả năng xảy ra lỗi từ chối truy cập (request limits). :3

Hướng dẫn:
Sử dụng chức năng cập nhật của tiện ích quản lý userscript hoặc cài đặt lại Forumotion backup templates.
  Bài viết hay nhất15
Cái này có bảo mật ko huynh?
Đang thắc mắc 1 cái là sử dụng các tiện ích mở rộng của trình duyệt có thể ứng dụng cho forumotion tới mức nào? o.O
  Bài viết hay nhất16
Userscript về cơ bản là javascript, có một số API đặc biệt nên nó mạnh hơn javascript một tý.
Khả năng truy cập dữ liệu của nó chỉ ở tầng mặt của trang (front-end), và chỉ cho cá nhân người dùng, tức là người nào cài thì thì người đó dùng.
Vì thế bạn có thể ứng dụng nó cho các mục đích cá nhân, tới mức... mà javascript có khả năng thực hiện.

Javascript có thể chèn mã độc, đánh cắp dữ liệu người dùng thì userscript cũng vậy. Khi sử dụng, bạn nên tránh các script không rõ nguồn gốc, các script bị nén, bị mã hóa.

Ps: Gần đây mình có gặp trường hợp: các nai tơ facebook bị dụ dỗ chạy userscript auto tag. :fb148:
  Bài viết hay nhất17
Cài đặt usescript Forumotion backup templates:
Chrome: [You must be registered and logged in to see this link.]
Firefox: Gồm 2 script, cài đặt lần lượt theo thứ tự:
Script 1: [You must be registered and logged in to see this link.]
Script 2: [You must be registered and logged in to see this link.]


cài đặt làm sao ạ ?
  Bài viết hay nhất18
Click vào là nó ra nút Install thôi, nếu ở quán net bị chặn dropbox thì vào đây.
  Bài viết hay nhất19
Em không hiểu chức năng này cho lắm ?
  Bài viết hay nhất20
[You must be registered and logged in to see this link.]
AnChina wrote:Em không hiểu chức năng này cho lắm ?
Cài vào là biết ngay :D
Hiểu đơn giản là nó có thể tạo tập tin nén và giải nén templates tự động. :3
The author of this message was banned from the forum - See the message
  Bài viết hay nhất22
Cập nhật phiên bản 0.6.1:

  1. Sửa lỗi trên Firefox sau khi nâng cấp Greasemonkey.
  2. Kết hợp 2 phiên bản Chrome và Firefox thành 1.
  3. Thay đổi liên kết file nguồn, lưu trữ trên server maxCDN (Dropbox bị nhiều quán Net chặn).
  Bài viết hay nhất23
Mình có test thử cái này, nhìn chung là nó chạy khá nhanh & tốt, nhưng lại hơi khó chịu trong việc edit template. Điển hình là việc ngắt dòng (word-wrap), tuy giúp giảm kích cỡ của file, cũng là 8 file text, nhưng có sự khác biệt không quá lớn và mình muốn hỏi về việc bỏ word-wrap khi xuất thành file nén có được không? :3
[You must be registered and logged in to see this image.]
Thanks!
  Bài viết hay nhất24
Đùa ah, ko lẽ bạn edit template bằng Notepad ?
Bạn nên dùng một Text editor như Brackets
  Bài viết hay nhất25
Không dùng đc cho cốc cốc à :(
  Bài viết hay nhất26
You cannot reply to topics in this forum