Here is some information on your current connections
Your on page:".$_SERVER\['PHP_SELF'\];
echo "
Your IP address is:".$_SERVER\['REMOTE_ADDR'\];
echo "
Your browser is:".$_SERVER\['HTTP_USER_AGENT'\];
echo "
Cookies set by this server are:";
foreach ($_COOKIE as $cookie_name => $cookie_value) {
echo "
".$cookie_name."=".$cookie_value ;
}
?>
**/
?>
Escaping the “[“ and “]” between the tag is very important.
When the PageBuilder inserts this script in a Web Page it inserts the entire content of what is between the .
==== Add-on Tool List ====
In the Pagebuilder Add-Ons are listed under the **Add-On** icon or listed on the left side.
To add a new tool list you need to create a file that ends with .tools.inc.php in the includes directory.
In our case lets create a file call **includes/user_info.tools.inc.php** with the content below and save it in the includes/ directory.
addParam("layertype", "script") ;
$e_addLayer->addParam("height", 35) ;
$e_addLayer->addParam("width", 100) ;
$e_addLayer->addParam("top", 140) ;
$e_addLayer->addParam("left", 140) ;
// for now unnamed, should be script name with incremental number.
?>
addParam("blockname", "user_connexion_info.script.inc.php");
$e_addLayer->addParam("layername", "UserInformation");
$e_addLayer->addParam("border_style", "");
?>
getUrl(), "User Connexion Information");?>
The tools scripts are includes and listed based on their names.
It creates an Event that will trigger the pagebuilder.addLayer Event Action. For a full understanding of how events work see the [core:developer_documentation|Radria Core Developer documentation].
The “blockname” parameter is the name of the file that contain the add-on script.
The “layername” parameter is the default name that will be used for that layer. (css div id)
The “border_style” is a default CSS style for the layer. It sometimes needs to add a border in case the scripts do not display anything by default. To show a border change it to:
$e_addLayer->addParam("border_style", "thin");
To add another script to your add-on tool bar list duplicate the line from
getUrl(), "User Connexion Information");?>
The second parameter is the label that will be displayed in the Add-Ons tool list.
The two other ones are optional. The third parameter is the text of the tool tips that will appear when the user leaves the mouse over the link for a couple of seconds.
The 4th parameter is a link to the documentation that will describe what that Add-on script do.
getUrl(),
"User Connexion Information",
"Display the Users network connexion informations",
"docs/mypackagename/pagesname.html#secionname");
?>
If the url of the help is provided a little (?) will appear on the right scripts name.
==== Testing our new Add-On ====
Now you can open the PageBuilder and in the Add-On list you should see a new item: ** User Info ** and when you click on it you see the Add-on script: ** User Connexion Information **
Click on it and the PageBuilder will add in your web page a div layer with the content of whats in the tags in the **includes/user_connexion_info.script.inc.php** add-on script.
Now lets see how we can catch user input.
===== User Input & parameters =====
Some scripts will need user input in order to configure or set them up in a web page.
For that in the Template tag we create variable with special variable in *[]* that will be replaced with the User Input.
==== Countdown script ====
Lets use as an example a simple count down script in Javascript.
Its a javascript code that uses a date variable and some text messages to calculate the number of days left before a specific date and display custom messages accordingly.
The original Javascript code is:
**/
?>
Now the tag is a mix of php and javascript.
The PHP part is use to setup the parameters for the user input.
In the example above the entire code between the tag will be inserted in the web page and all the variable in *[]* will be replaced by the user input values.
We assign the values from the the users to PHP variables, we can then use those variables anywhere in our script.
addParam("blockname", "countdown.js.script.inc.php");
$e_addLayer->addParam("layername", "CountDown");
$e_addLayer->addParam("border_style", "");
?>
getUrl(), "Count Down");?>
===== Include script =====
In the last script the entire content of whats between the tag is inserted into the page.
This means that if you have a bug fix later on for that code you will have to edit and update all the pages.
The solution for this is to include the script and only keeping the user input variable in the tag.
Then on the next upgrade of that script the new code will be used in all the pages without having to edit the pages.
Lets modify our **includes/countdown.js.script.inc.php** script:
**/
?>
In the php code with have added an include statement and moved the javascript code out side the **** tag.
Now if you include the script in multiple pages you just need to update one file (includes/countdown.js.script.inc.php) to modify its code for all the pages.
include("includes/countdown.js.script.inc.php");
in the **** tag.
Month
January:February:March:April:May:June:July:August:September:October:November:December
01:02:03:04:05:06:07:08:09:10:11:12
12
strFBFieldTypeListBoxSmall
Day
01:02:03:04:05:06:07:08:09:10:11:12:13:14:15:16:17:18:19:20:21:22:23:24:25:26:27:28:29:30:31:
01:02:03:04:05:06:07:08:09:10:11:12:13:14:15:16:17:18:19:20:21:22:23:24:25:26:27:28:29:30:31:
30
strFBFieldTypeListBoxSmall
Until count down ends
Message before the day
60:200
strFBFieldTypeChar
strFBFieldTypeText
Today is the Day, Count down has ended
Message on the Date
40:10:
=== Pagebuilder FieldTypes ===
The PageBuilder contains its own fields types that automatically resized uploaded images, list all the available style sheet and the Web Pages or the project.
You will find them in the WebIDE with the prefix **PB_**
* [[pagebuilder:fieldtype:PageBuilderFieldImage|Image auto Resize]]
* [[pagebuilder:fieldtype:PageBuilderFieldListStyles|Available CSS styles]]
* [[pagebuilder:fieldtype:PageBuilderFileListBox|PageBuilder Web Page list]]
==== Custom Form =====
Count down script
Target date:
[Target_Day] [Target_Month]
Message when waiting the target date
[Message_before_the_day]
Message to display on the target date
[Message_on_the_date]
Help
This script display a count down of days from a defined target date.
On the day it will display a custom message.
Now our countdown Add-On script will display the parameters using this custom form.