Friday 22 April 2011

zpanel hello world module making

Making an zpanel module


Hello world example

Here i am going to show you how to create a module for panel 6. We will start of with the basics and as we progress through, we will be touching some more advanced stuff


First of all lets make the old fashioned hello world
so first we need to create a folder. Now here we learn about the zpanel module structor. so go to you zpanel folder. normall located at c:\zpanel
.














from here you want to go into panel and once in there go into modules. you are now in the module section of zpanel 








now each one of these folders is a section on the zpanel control panel. So for this example we are going to choose the account folder.
now do the following steps
  1. make a folder in the account folder called hello
  2. make a file called index.php
  3. make a file called modinfo.zp.php
Finally open your IDE (any editor that can edit html or php). For now i am going to use netbeans.
first open your modinfo.zp.php file and copy and past this infomation in.
<?php

$thismod['title'] = 'Hello world';
$thismod['icon'] = 'icon.png'; //
$thismod['developer'] = 'Your name'; // not needed
$thismod['developersite'] = 'You website if you have one'; // not needed
?>


 now i hope you understand basic php. So edit the regions to the correct infomation. Save the document and close it. now we need to find an icon. As you can see in the zpanel controll panel all modules have an icon.So go out and find your self an icon. i sugest you search iconfinder.com they have some very good quality free icons. Once you have found your icon just past it in the fold we have been working in c:\zpanel\panel\modules\account\hello. make sure that the icons name is the same as what you said it was in the modinfo.zp.php.
here is my icon





Now last but not least we need to make the content to display! Well go ahead then, open up index.php whitch currently has no content in it.This is the file where you will add all you module code.for are example we will add this:
<?php
// YOU OWN ZPANEL COMMENT BELOW IN THE ECHO :D
echo 'Hello World! My First zpanel module is COMPLETE';
?>


 Save the file and open your zpanel control panel and under the accout section should be your module open it up and have a look :p
if you have any problems post on the fourms or PM me (motters)

No comments:

Post a Comment

i do all this for free so PLEASE NOT SPAM thanks