4 * Script that XXX ? create template files from sql ?
9 // Use relative address of config file
10 // Change this, if you move you cron directory.
11 $dir=substr(__FILE__
, 0, strrpos(__FILE__
, '/'));
12 require($dir.'/../wwwroot/config/config.inc');
14 //connecting to database and creating universal $db object
15 require(INCLUDE_DIR
.'/log.inc');
16 require(INCLUDE_DIR
.'/database.inc');
17 require(INCLUDE_DIR
.'/nodes.inc');
18 $db=new CLASS_DATABASE();
20 $set=$db->query("select nodes.*,node_content.*,nodes.node_id as node_id from nodes
21 left join node_content on nodes.node_id=node_content.node_id
22 where node_type='14'");
24 while ($set->next()) {
25 $node_content=$set->getString('node_content');
26 $template_id=$set->getString('node_id');
27 $fp = fopen (OWN_TEMPLATE_DIR
.$template_id.".tpl", "w+");
28 fwrite($fp,$node_content);
30 chown(OWN_TEMPLATE_DIR
.$template_id.".tpl","www");
This page took 0.787211 seconds and 5 git commands to generate.