If this is your first visit, check our documentation. To post, register or login.

New Module Help

Locked

Started by confused_aswell on 2 Oct 2008, 10:23 PM · Views: 919

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
2 Oct 2008, 10:23 PM
#1
confused_aswell avatar

confused_aswell

Zen Follower

Join Date:
Apr 2008
Location:
UK
Posts:
315
Plugin Contributions:
1

Post #1 by confused_aswell

Hi

I have almost finished a module but would like to know how to configure the file to work in the admin and so it doesn't have the

  • $host = 'localhost';
  • $user = 'username';
  • $pass = 'password';
  • $db = 'database_name';
    in the file. I would like to be able to add an box to the admin for this module too, can you tell me how to do that also? It is just a one page file that allows users to download their customers details to a csv file, so nothing too complicated.

Thanks,

Phil

3 Oct 2008, 12:37 AM
#2
steven300 avatar

steven300

Totally Zenned

Join Date:
Jan 2008
Posts:
1,564
Plugin Contributions:
1

Post #2 by steven300

Hi Phil, this is how I would approach it:

admin/customers_csv.php (this is the main file which will display your data)
admin/includes/boxes/extra_boxes/customers_csv_tools_dhtml.php (the keyword 'tools' is important here, it instructs which menu the mod is shown under)
admin/includes/extra_datafiles/customers_csv.php (define your database tables used by the main file)
admin/includes/languages/english/customers_csv.php (define your language constants for the main file)
admin/includes/languages/english/extra_definitions/customers_csv.php (define mod's title/filename)

Look at my Zip Validator mod as it uses the same structure.

In your main file, you want to put these at the top and bottom:

require('includes/application_top.php'); 
require(DIR_WS_INCLUDES . 'application_bottom.php');
3 Oct 2008, 7:44 AM
#3
confused_aswell avatar

confused_aswell

Zen Follower

Join Date:
Apr 2008
Location:
UK
Posts:
315
Plugin Contributions:
1

Post #3 by confused_aswell

Hi Steven

Thanks for that, I will give it a try. I may have to come back to you if I get stuck.

Phil