View Single Post
  #8  
Old 24th December 2005, 12:10
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,779
Thanks: 840
Thanked 5,610 Times in 4,421 Posts
Default

Quote:
Originally Posted by danf.1979
I'm developing a PHP-nuke installer in the "Tools" section. I think most installers would be very similar.
If I have a client that owns more than one web, I need a way to "know" in which site he wants to install php-nuke. From what variable can I get this info?
I dont that it will work this way, because if you know the username you cannot know in which website phpnuke should be installed. Every user can have an unlimited number of websites in ISPConfig.

You will have to let the user select in which website phpnuke shall be installed. Have a look at the backup tool, this tool shows a list of all sites the user is allowd to backup and the list to delect the phpnuke destination may be similar. Dont forget that you have also an admin and resellers and they might have to install packages for their clients too, but how to get the available sites for a user / admin / reseller this is all handled in the code for the site backups and you can copy it from there.

Quote:
Also I need the user and pass to write in the database. How can I get this values? What scripts should I read?
No, dont write your own database functions. ISPCOnfig uses an database wrapper, if you use native mysql functions your extension might be incompatible to future ISPConfig releases. The database wrapper is in the class /home/admispconfig/ispconfig/lib/classes/ispconfig_mysql.lib.php (or similar name in this directory, dont have the sources here currently).

The database wrapper is already initialized if you have included the two main includes as shown in the other tools. You can call the query function e.g. by: $go_api->db->query("Here comes your SQL");

I recommend having a look at the other tools, they show you how to use the db wrapper for querys and inserts.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.

Last edited by till; 24th December 2005 at 12:13.
Reply With Quote