4. Hello World for ACP

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:
    // 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?

More Comments/Post Your Own


Latest Comments

  • Guest on Forum
    “noFollow links.” - Jun 19
  • username on Forum
    “Sponsor or Premium user” - Jun 14
  • on Forum
    “Template https://www.website.com/skins/_common/section.tpl not found! contact webmaster” - Feb 24
  • admin on 01. Administration Panel
    “Untitled” - Jan 24
  • on 01. Administration Panel
    “Can't Login to Admin” - Jan 23

Most Commented

Online Users

There are 142 users online.


Connect with us on Facebook


Subscribe to our newsletter for the latest updates and exciting promotions!