HOW TO: Add New Admin Pages

Docs about how to use SocialEngine

HOW TO: Add New Admin Pages

Postby abdelrahman » Tue Mar 24, 2009 4:45 pm

This small guide will help you create a new administrator page.

1. Create a new file and name it admin_example.php (You can change "example" to whatever you want, ensure the file name starts with "admin_")

2. Open up admin_example.php and add the following code:
Code: Select all
<?php
$page = 'admin_example';
include 'admin_header.php';

include 'admin_footer.php';
?>

+ $page = 'admin_example'; - This links the PHP file with the TPL file.

3. Create a new file and name it admin_example.tpl (You can change "example" to whatever you want)

4. Open up admin_example.tpl and add the following code:
Code: Select all
{include file='admin_header.tpl'}

some code that admins will see

{include file='admin_footer.tpl'}


5. Upload admin_example.php to the "admin" directory and admin_example.tpl to the "templates" directory.

6. You can access this file by going to: http://www.domain.com/admin/admin_example.php
+ Replace www.domain.com with your real domain name.
Checkout Netstral Technologies for SocialEngine plugins and custom services.
abdelrahman
SE PRO
 
Posts: 250
Joined: Thu Oct 16, 2008 3:49 pm
Location: localhost
SE Skills: + + + + +

Re: HOW TO: Add New Admin Pages

Postby Arti » Tue Jun 02, 2009 9:49 am

Thats nice! But how I may register this page in the admin sidebar menu? :?
Arti
 
Posts: 1
Joined: Tue Jun 02, 2009 9:28 am
SE Skills: + + + + +

Re: HOW TO: Add New Admin Pages

Postby abdelrahman » Wed Jun 10, 2009 8:52 am

To add this page to the admin side menu, you can do the following:

Note: In this example, I'll add a link under the Network Management menu.

1. Open admin_header.tpl and find the following:

Code: Select all
<div class='menu'><a href='admin_ads.php' class='menu'><img src='../images/icons/admin_ads16.gif' border='0' class='icon2'>{lang_print id=10}</a></div>


2. Directly under the code you saw above, add the following:

Code: Select all
<div class='menu'>
<a href='admin_LINK.php' class='menu'>
<img src='../images/icons/admin_profile16.gif' border='0' class='icon2'>EXAMPLE_LINK</a>
</div>


3. Replace:
- admin_LINK.php to your page's file name (i.e. admin_example.php)
- admin_profile16.gif to the icon you want.
- EXAMPLE_LINK to the text you want, which will be clickable (i.e. General Settings)

I hope that sounded clear.
Checkout Netstral Technologies for SocialEngine plugins and custom services.
abdelrahman
SE PRO
 
Posts: 250
Joined: Thu Oct 16, 2008 3:49 pm
Location: localhost
SE Skills: + + + + +

Re: HOW TO: Add New Admin Pages

Postby mmx » Wed Jan 13, 2010 7:55 pm

What is the purpose of adding a new admin page?


Is it about for those who coding a mod and need to know what changes have to be done in order to add a page?
mmx
SE Junior Expert
 
Posts: 37
Joined: Mon Dec 28, 2009 12:39 pm
SE Skills: + + +

Re: HOW TO: Add New Admin Pages

Postby abdelrahman » Thu Jan 21, 2010 12:44 am

Well, for plugin development it's different. Some people would maybe like to add info on an admin page, if they have other moderators, or maybe they'd like to integrate a tiny script/widget into an admin page.

But, this tutorial is not related to admin pages with plugins.
Checkout Netstral Technologies for SocialEngine plugins and custom services.
abdelrahman
SE PRO
 
Posts: 250
Joined: Thu Oct 16, 2008 3:49 pm
Location: localhost
SE Skills: + + + + +


Return to SocialEngine Documentation

Who is online

Users browsing this forum: No registered users and 2 guests