Forums / Contribution-Writing Guidelines / auto installer for sql in admin

auto installer for sql in admin

Locked
Results 1 to 9 of 9
This thread is locked. New replies are disabled.
10 Jul 2014, 11:28
#1
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Posts:
2,383
Plugin Contributions:
5

auto installer for sql in admin

I need a sample and the only mod I can remember that does this is image handler - way to much code! What mod is a good example or can someone post some guidelines / bits of code?
10 Jul 2014, 13:23
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Posts:
13,980
Plugin Contributions:
46

Re: auto installer for sql in admin

There are two approaches to the admin auto-install
  1. Use a file in /includes/functions/extra_functions if you don't need to create a message to the user.
  2. Use an auto_loader and an init_include if you do need to "message" the user.

The Super Globals plugin uses method #1 and shows the insertion of a new configuration group and the associated admin-pages settings.
10 Jul 2014, 13:36
#3
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Posts:
2,383
Plugin Contributions:
5

Re: auto installer for sql in admin

Perfect and it looks like I need that super globals plugin. It really would be nice to have the helpful mods for development grouped together.
10 Jul 2014, 14:09
#4
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Posts:
10,011
Plugin Contributions:
1

Re: auto installer for sql in admin

lat9:

There are two approaches to the admin auto-install
  1. Use a file in /includes/functions/extra_functions if you don't need to create a message to the user.
  2. Use an auto_loader and an init_include if you do need to "message" the user.

The Super Globals plugin uses method #1 and shows the insertion of a new configuration group and the associated admin-pages settings.


and Super Orders might an example for #2..
10 Jul 2014, 14:14
#5
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Posts:
2,383
Plugin Contributions:
5

Re: auto installer for sql in admin

Well, that brought up a few more questions. I'm creating a table in this mod so I need to check to see if the table exists first. Is there a zc function for that?

Secondly, in creating a table - I assume I have to worry about whether there's db prefix. syntax hint?

Thanks to both of you for responding so quickly today.
10 Jul 2014, 14:33
#6
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Posts:
10,011
Plugin Contributions:
1

Re: auto installer for sql in admin

delia:

Well, that brought up a few more questions. I'm creating a table in this mod so I need to check to see if the table exists first. Is there a zc function for that?

Secondly, in creating a table - I assume I have to worry about whether there's db prefix. syntax hint?

Thanks to both of you for responding so quickly today.


That's why I suggested you look at Super Orders.. It covers a lot of things like checking to see if a table exists, and registering supporting admin pages that aren't found in a menu like popups..
10 Jul 2014, 14:34
#7
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Posts:
13,980
Plugin Contributions:
46

Re: auto installer for sql in admin

Take a look at the init_referrers.php (init_include) used by SNAP Affiliates. It uses the sniffer class to see if a table exists (or on an upgrade if a field within a table exists).
10 Jul 2014, 14:40
#8
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Posts:
2,383
Plugin Contributions:
5

Re: auto installer for sql in admin

Oh, good! Digging in now.
10 Jul 2014, 14:53
#9
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Posts:
2,383
Plugin Contributions:
5

Re: auto installer for sql in admin

Thanks, I did it!!!