print

4. Hello World for ACP

You are here: C97net3. Developer's Guide

Learn the first step of qE's ACP development

Creating the "Hello World" for the ACP (administration contol panel) is not so different than for UI.

But you may want to verify if the user is really an admin, and not a regular user.

Hello World for ACP

  1. With a text editor, create a blank file in qE /admin folder, eg: test.php, place it in the same folder as index.php.
  2. Then add some PHP lines:
    <?php
    // always use admin_init.php for ACP

    require './includes/admin_init.php';

    // verify if administrator? 1 - lowest level of admin, 5 - highest level

    admin_check (1);

    // as qE is template based, all output must be contained in $txt['main_body']

    $txt['main_body'] = 'Hello World';

    // send the content of $txt[main_body] to output
    // always remember, flush_tpl() also exit the script, so always put flush_tpl
    // at the end of the script!

    flush_tpl ('adm');
    ?>
  3. Try it. It should print "Hello World" using your ACP skin. Easy eh? If you haven't login as admin, you will be asked to login first.

There is no comment. Why not be the first?

read more More Comments/Post Your Own

Account

Search

Tags

acp add all also any create default display don download easy echo etc features field file files folder form function includes information init kemana link list may module name need number own page php please qengine read require script set site skin time tpl url use user using version welcome