Softaculous


Topic : Storing custom values?


Posted By: njolin on September 22, 2015, 5:04 pm
Is there a way to store the values being created in a custom script?

In my install.xml I have the following:
<input type="text" name="second_email" size="30" value="" >
    <head>Optional - Second Email Address</head>
</input>

and in my edit.xml:
<input type="text" name="second_email" size="30" value="" >
    <head>Optional - Second Email Address</head>
        <optional>true</optional>
</input>

After the install, if I go to edit the installation details, the edit screen doesn't show my custom value.

I would like to be able to store this value, have it editable, and have it able to be delivered via API when calling for installations (&act=installations).

Is this possible?

Thanks much!
Nick


Posted By: Brijesh on September 23, 2015, 7:28 am | Post: 1
Hi Nick,

You will need to create a custom script for that because if you modify the existing package when there is an update in the script this package will be replaced.

You can use the variables with
Code
[[variable_name]]
in the SQL file if you want to save it in the database. Here variable_name refers to the name of your input tag. In you case it should be
Code
[[second_email]]


You will also get the variable in the
Code
$__settings['second_email']
variable in install.php if you would like to store it in a file.

In order to save this variable in Softaculous records you will need to add the following to your input tag :
Code
save="true"


So your input tag should be :
<input type="text" name="second_email" size="30" value="" save="true">
    <head>Optional - Second Email Address</head>
</input>

In order to edit the value from the edit installation page you will need to modify the edit.php to fetch the value posted and update the required entries. Again you can get the value in the
Code
$__settings['second_email']
variable in edit.php

-----------------------
Webuzo - Multi User Hosting Control Panel
AMPPS - Best WordPress/PHP/MySQL development tool

Posted By: njolin on September 23, 2015, 1:24 pm | Post: 2
Great!  Thanks for the reply.  I will give this a shot.

Posted By: nikhil89 on September 24, 2015, 6:41 am | Post: 3
Hi,

Please let us know if you need any further information.

Powered By AEF 1.0.8 © 2007-2008 Electron Inc.