Webmaster общности: Predpriemach.com | SearchEngines.bg

    Admin Notepad

    Автор: ProGame

    С този мод ще имате Нотепад в Админ Панела което ще ви е много удобно да си записвате разни неща там :))

    SQL

    CREATE TABLE phpbb_notes (
    id int(8) not null,
    text text);
    
    INSERT INTO phpbb_notes (id,text) VALUES
    ('1','Text');

    Направете файл admin_notpad.php и го сложете в папка /admin/admin_notepad.php

    <?php
    /***************************************************************************
    * admin_notepad.php
    * ----------------------
    *
    * copyright : ©2003, 2004 Martyn Hackett (webmaster@tophostinguk.com)
    *
    ***************************************************************************/
    
    /***************************************************************************
    *
    * This program is free software; you can redistribute it and/or modify
    * it under the terms of the GNU General Public License as published by
    * the Free Software Foundation; either version 2 of the License, or
    * (at your option) any later version.
    *
    ***************************************************************************/
    
    define('IN_PHPBB', 1);
    
    //
    // First we do the setmodules stuff for the admin cp.
    //
    if( !empty($setmodules) )
    {
    $filename = basename(__FILE__);
    $module['General']['Admin Notepad'] = $filename;
    
    return;
    }
    
    //
    // Load default header
    //
    $no_page_header = TRUE;
    $phpbb_root_path = './../';
    require($phpbb_root_path . 'extension.inc');
    require('./pagestart.' . $phpEx);
    
    //
    // Output the authorisation details
    //
    $template->set_filenames(array(
    'body' => 'admin/admin_notpad.tpl'
    )
    );
    
    if(isset($_POST['post'])){
    $tnote = addslashes($_POST['noteme']);
    $query = mysql_query("UPDATE phpbb_notes SET text = '" . addslashes($_POST['noteme']) . "' WHERE id = 1");
    }
    
    $sql = mysql_query("SELECT text FROM phpbb_notes");
    if(!$sql) { echo mysql_error(); };
    $note = mysql_fetch_array($sql);
    
    include('./page_header_admin.'.$phpEx);
    
    $template->assign_vars(array(
    "U_NOTEPAD" => stripslashes($note['text']))
    );
    
    $template->pparse('body');
    
    include('./page_footer_admin.'.$phpEx);
    
    ?>
    

    Направете файл admin_notepad и го сложете в templates/subsilver/admin/admin_notepad.tbl:

    <HTML>
    <h1>ADMIN NOTEPAD</h1>
    <table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline" height="306">
    <tr>
    <td class="row2" width="100%" height="296">
    <form action="{U_ADMIN_REQUESTS}" method="post">
    <textarea name="noteme" cols=118 rows=30 style="background-color: #EFEFEF;">{U_NOTEPAD}</textarea>
    <input type="submit" name="post" value="Save It!" class="mainoption">
    <input type="reset" value="Reset" name="reset" class="liteoption" />
    </form>
    </td>
    </tr>
    </table>
    <p style="margin-top: 1; margin-bottom: 1" align="center"><span class="copyright">Admin Notepad by ProGame</span></p>
    <p style="margin-top: 1; margin-bottom: 1" align="center"><span class="copyright"><a href="http://mu.silk.com">http://mu.silk.com</a></span>
    </p>
    <p style="margin-top: 1; margin-bottom: 1" align="center">
    <br />
    </p>
    </HTML>

    Успех 😉