Protected cron scripts from being accessed through webserver
[mirrors/Kyberia-bloodline.git] / cron / templates.php
CommitLineData
b42b2bf9
H
1#!/usr/local/bin/php
2<?php
3require('../config/config.inc');
4//connecting to database and creating universal $db object
5require(SYSTEM_ROOT.'/inc/log.inc');
6require(SYSTEM_ROOT.'/inc/database.inc');
7require(SYSTEM_ROOT.'/inc/nodes.inc');
8$db=new CLASS_DATABASE();
9
10$set=$db->query("select nodes.*,node_content.*,nodes.node_id as node_id from nodes left join node_content on nodes.node_id=node_content.node_id where node_type='14'");
11
12while ($set->next()) {
13 $node_content=$set->getString('node_content');
14 $template_id=$set->getString('node_id');
15 $fp = fopen (OWN_TEMPLATE_DIR.$template_id.".tpl", "w+");
16 fwrite($fp,$node_content);
17 fclose($fp);
18 chown(OWN_TEMPLATE_DIR.$template_id.".tpl","www");
19}
20
21
22
23
24
25?>
This page took 0.193524 seconds and 4 git commands to generate.