[Userscripts]Forumotion backup templates

  Bài viết hay nhất1
HeavenBlue
|
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.
Chú ý: Vì link tải bị lỗi nên mình sẽ hướng dẫn cách làm truyền thống bằng cách tạo một trang html với chức năng gần như đầy đủ.

DEMO

[Userscripts]Forumotion backup templates  P5aHHKN

Version

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.

Hướng dẫn

Administration Panel > Modules > HTML pages management và tạo một trang html

Title: Backup and recovery templates
Use your forum header and footer: No
Use this page as homepage: No

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
 
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>Forumotion backup templates</title>
    <meta http-equiv="content-script-type" content="text/javascript" />
    <meta http-equiv="content-style-type" content="text/css" />
    <meta http-equiv="imagetoolbar" content="no" />
    <link href="https://illiweb.com/rs3/10/frm/admin/admin.css" rel="stylesheet" type="text/css" media="screen" />
    <style>
        #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
        }
        #skin,
        #version,
        #importSkinStatus {
            display: none
        }
        .icon_loading {
            background: url(https://lelinhtinh.github.io/ForumotionBackupTemplates/cdn/icons/load.gif) 2px 2px/14px 14px no-repeat transparent;
            border-color: #FFAE00;
            color: #FFAE00;
        }
    </style>
</head>
 
<body>
    <a name="top"></a>
    <div class="conteneur_minwidth_IE">
        <div class="conteneur_layout_IE">
            <div class="conteneur_container_IE">
                <div id="page-header" class="clearfix">
                    <a href="/admin/index.forum"><img src="https://2img.net/i/bl/logo.png" alt="logo" class="logo" />
                    </a><a href="/" class="url">...</a>
                    <div style="padding: 10px;">
                        <h2 id="user_connected">...</h2>
                    </div>
                    <ul class="preview_forum clearfix">
                        <li class="header_admin_left"><img src="https://2img.net/i/fa/admin/icones/loupe.png" alt="" /><a href="/" target="_blank">PREVIEW FORUM</a>
                        </li>
                        <li class="header_admin_right"><img src="https://i.servimg.com/u/f19/18/83/32/63/video_11.png" alt="Toggle" /><a href="https://youtu.be/J6oeQ_f8nQw" target="_blank">VIDEO TUTORIAL</a>
                        </li>
                    </ul>
                </div>
                <div id="page-body">
                    <div id="tabs" class="clearfix">
                        <ul>
                            <li id="activetab" class="tabLi"><a href="#templates" class="tabA"><span>Templates</span></a>
                            </li>
                            <li class="tabLi"><a href="#skin" class="tabA"><span>Skin</span></a>
                            </li>
                            <li class="tabLi"><a href="#version" class="tabA"><span>Version</span></a>
                            </li>
                        </ul>
                    </div>
                    <!-- <div class="panel"> -->
                    <div id="wrapper">
                        <div id="content" class="clearfix">
                            <div id="main" class="expended_main">
                                <div id="main-content">
                                    <h2>Themes management</h2>
                                    <ul class="h2-breadcrumb clearfix">
                                        <li id="backupMode" class="first">Templates</li>
                                    </ul>
                                    <div id="templates" class="tabDiv"></div>
                                    <div id="skin" class="tabDiv">
                                        <blockquote class="block_left">
                                            <p class="explain">In this space you can export/import your favorites <strong>skins</strong>. You can also restore old <strong>skins</strong> already used.</p>
                                        </blockquote>
                                        <form method="post" name="" action="/admin/index.forum?part=themes&sub=styles&mode=export&extended_admin=1">
                                            <input type="hidden" name="mode" value="export" />
                                            <fieldset class="style-theme-export">
                                                <legend>Export your skin</legend>
                                                <dl class="clearfix">
                                                    <dt>
                                                        <label for="options"><img src="https://2img.net/i/fa/admin/icones/question2.png" align="absmiddle" title="Your can export your style or just a part of it, if you want to share or backup." /> Export your skin</label>
                                                    </dt>
                                                    <dd>
                                                        <select id="theme_choosen" name="theme_choosen">
                                                            <option value="actual">Current skin</option>
                                                        </select> : 
                                                        <select id="options" name="options">
                                                            <option value="all">Whole style</option>
                                                            <option value="album">Only the gallery</option>
                                                            <option value="col">Only colors</option>
                                                            <option value="img">All images</option>
                                                            <option value="img_gen">Images : General and explore</option>
                                                            <option value="img_forum">Images : Forum Icons</option>
                                                            <option value="img_topics">Images : Topics icons</option>
                                                            <option value="img_icons">Images : Mini-icons</option>
                                                            <option value="img_buttons">Images : buttons</option>
                                                            <option value="msg_icons">Messages icons</option>
                                                        </select> 
                                                        <div class="div_btns">
                                                            <input type="submit" name="submit" value="Export" class="icon_ok" />
                                                        </div>
                                                    </dd>
                                                </dl>
                                            </fieldset>
                                        </form>
                                        <form target="noreload" method="post" name="" action="/admin/index.forum?part=themes&sub=styles&mode=export&extended_admin=1" enctype="multipart/form-data">
                                            <input type="hidden" name="mode" value="import" />
                                            <fieldset class="style-theme-export">
                                                <legend>Import the skin</legend>
                                                <p id="importSkinStatus" class="messagebox"><img src="https://lelinhtinh.github.io/ForumotionBackupTemplates/cdn/icons/success.gif" alt="icon" style="height: 13px; width: 13px; vertical-align: middle; margin-top: -3px;" /> Skin import is <span style="color:green">complete</span>.</p>
                                                <dl class="clearfix">
                                                    <dt>
                                                        <label for="importfile"><img src="https://2img.net/i/fa/admin/icones/question2.png" title="Here you can import a skin you received from another forum. Your current skin will be replaced. Export it completely at least once before importing a new one!" /> Import the skin</label>
                                                    </dt>
                                                    <dd>
                                                        <input type="file" id="importfile" name="importfile" /> 
                                                        <div class="div_btns">
                                                            <input type="submit" name="submit" value="Import" class="icon_ok" />
                                                        </div>
                                                    </dd>
                                                </dl>
                                            </fieldset>
                                        </form>
                                        <iframe width="0" height="0" frameborder="0" name="noreload" id="uploadSkin"></iframe>
                                    </div>
                                    <div id="version" class="tabDiv">
                                        <blockquote class="block_left">
                                            <p class="explain">You defined a personalized style sheet, if you change version it will be deleted and the version default style will be applied.</p>
                                        </blockquote>
                                        <form action="/admin/index.forum?part=themes&sub=styles&mode=version&extended_admin=1" method="post" name="form_version">
                                            <fieldset>
                                                <legend>Forumotion version</legend>
                                                <dl>
                                                    <dt>
                                                        <label>Change version&nbsp;:</label>
                                                    </dt>
                                                    <dd>
                                                        <input type="radio" name="tpl" id="subsilver" value="subsilver" class="radio" />
                                                        <label for="subsilver" dir=""> phpBB2</label>
                                                        <input type="radio" name="tpl" id="prosilver" value="prosilver" class="radio" />
                                                        <label for="prosilver" dir=""> phpBB3</label>
                                                        <input type="radio" name="tpl" id="punbb" value="punbb" class="radio" />
                                                        <label for="punbb" dir=""> PunBB</label>
                                                        <input type="radio" name="tpl" id="invision" value="invision" class="radio" />
                                                        <label for="invision" dir=""> Invision</label>
                                                    </dd>
                                                </dl>
                                                <div class="div_btns">
                                                    <input type="hidden" name="keep_theme" id="keep_theme_defaut" value="2" checked="checked" class="radio" />
                                                    <input type="submit" class="icon_ok" value="Save" name="change_version" />
                                                </div>
                                            </fieldset>
                                        </form>
                                    </div>
                                </div>
                                <!-- closing tag for #main-content -->
                            </div>
                            <!-- closing tag for #main -->
                            <div id="tools"></div>
                            <!-- closing tag for #tools -->
                        </div>
                        <!-- closing tag for #content -->
                    </div>
                    <!-- closing tag for #wrapper -->
                    <div class="clear"></div>
                    <p class="bottom-help">
                        <a class="help-link" href="https://github.com/lelinhtinh/ForumotionBackupTemplates/issues" target="_blank"><img src="https://2img.net/i/fa/admin/icones/help.png" align="middle" alt="help" />
                        </a>
                    </p>
                    <!-- We request you retain the full copyright notice below including the link to www.phpbb.com.This not only gives respect to the large amount of time given freely by the developersbut also helps build interest, traffic and use of phpBB2. If you (honestly) cannot retainthe full copyright we ask you at least leave in place the "Powered by phpBB" line, with"phpBB" linked to www.phpbb.com. If you refuse to include even this then support on ourforums may be affected.The phpBB Group : 2006-->
                </div>
                <!-- closing tag for #page-body -->
                <div id="page-footer"></div>
                <a name="down"></a>
            </div>
        </div>
    </div>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
    <script src="https://lelinhtinh.github.io/ForumotionBackupTemplates/cdn/latest/jszip.min.js" type="text/javascript"></script>
    <script src="https://lelinhtinh.github.io/ForumotionBackupTemplates/cdn/latest/jszip-utils.min.js" type="text/javascript"></script>
    <script src="https://lelinhtinh.github.io/ForumotionBackupTemplates/cdn/latest/FileSaver.min.js" type="text/javascript"></script>
    <script src="https://lelinhtinh.github.io/ForumotionBackupTemplates/cdn/latest/fmbackup.js" type="text/javascript"></script>
    <script type="text/javascript">
        fmbackup.page_id = "PAGE_ID";
        fmbackup.init();
    </script>
</body>
 
</html>

Lưu ý ở cuối dòng tìm:
Code:
fmbackup.page_id = "PAGE_ID";

Thay PAGE_ID bằng số trang html vừa tạo

VIDEO hướng dẫn

Bạn không có quyền trả lời bài viết