SlickBoard | CSS/XML Timeline (new) | XML/SWF Charts | Timeline Eons

 < previousnext > 

 

Scripting (PHP, ASP, CFML, Perl, etc.)

 

The download package comes with the sample.xml source file. This is a static XML document prepared manually. However, the source can be either a static XML document, or any script generating the XML code dynamically.

 


PHP

The source file can be sample.php, containing PHP code that generates all the XML code like this:


<?php

print "<slickboard>";
print "<rect fill_color='ff0000' />";   
print "<rect fill_color='00ff00' x='200' />";   
print "</slickboard>";

?>

Or, like this:


<?php

print "

<slickboard>
<rect fill_color='ff0000' /> 
<rect fill_color='00ff00' x='200' />     
</slickboard>

";

?>

Or, generating some XML code like this:


<slickboard>

<?php
print "<rect fill_color='ff0000' />";   
?>

<rect fill_color='00ff00' x='200' />     
</slickboard>

Or, generating one or more variables like this:


<slickboard>
<rect fill_color='ff0000' /> 
<rect fill_color='00ff00' x='<?php print "200"; ?>' />     
</slickboard>

Notice that XML attribute values must be between single-quotes when they are within a printed string that starts and ends with double-quotes.

 


ASP

The source file can be sample.asp, containing ASP code that generates all the XML code like this:


<%

response.write("<slickboard>")
response.write("<rect fill_color='ff0000' />")   
response.write("<rect fill_color='00ff00' x='200' />")   
response.write("</slickboard>")

%>

Or, like this:


<%

response.write("

<slickboard>
<rect fill_color='ff0000' />  
<rect fill_color='00ff00' x='200' />    
</slickboard>

")

%>

Or, generating some XML code like this:


<slickboard>

<%
response.write("<rect fill_color='ff0000' />")   
%>
 
<rect fill_color='00ff00' x='200' /> 
</slickboard>

Or, generating one or more variables like this:


<slickboard>
<rect fill_color='ff0000' />  
<rect fill_color='00ff00' x='<% response.write("200") %>' />    
</slickboard>

Notice that XML attribute values must be between single-quotes when they are within a printed string that starts and ends with double-quotes.

 


Central Source

You may create a different XML source for each board on your web site, or create one central script that generates the code for multiple or all boards. Pass the board's id to the script, and the script might process the related board like this:


<?php

//which board to process
$id =  $_REQUEST['board_id'];

switch ( $id ){
   case 1:
   $x = 100;
   break;
   
   case 2:
   $x = 200;
   break;
   
   case 3:
   $x = 300;
   break;
}

?>
							
<slickboard>
<rect fill_color='ff0000' /> 
<rect fill_color='00ff00' x='<?php print $x; ?>' />     
</slickboard>

 

 

 < previousnext > 


Copyright © 2010-2017, maani.us