test
[mirrors/Kyberia-bloodline.git] / cron / templates.php
CommitLineData
ae9f7457 1#!/usr/bin/php
b42b2bf9 2<?php
a3be90c6 3/*
4 * Script that XXX ? create template files from sql ?
5 * Called XXX
6 */
7
8
9// Use relative address of config file
10// Change this, if you move you cron directory.
11$dir=substr(__FILE__, 0, strrpos(__FILE__, '/'));
12require($dir.'/../wwwroot/config/config.inc');
13
b42b2bf9 14//connecting to database and creating universal $db object
a3be90c6 15require(INCLUDE_DIR.'/log.inc');
16require(INCLUDE_DIR.'/database.inc');
17require(INCLUDE_DIR.'/nodes.inc');
b42b2bf9
H
18$db=new CLASS_DATABASE();
19
a3be90c6 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'");
b42b2bf9
H
23
24while ($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);
29 fclose($fp);
30 chown(OWN_TEMPLATE_DIR.$template_id.".tpl","www");
31}
32
a3be90c6 33?>
This page took 0.328019 seconds and 4 git commands to generate.