Trasovatelnejsi templaty
[mirrors/Kyberia-bloodline.git] / cron / swish_generator.php
CommitLineData
ae9f7457 1#!/usr/bin/php
2
b42b2bf9 3<?php
a3be90c6 4/*
5 * Script that XXX
6 * Called XXX
7 */
8
9//error_reporting(0);
10
11// Use relative address of config file
12// Change this, if you move you cron directory.
13$dir=substr(__FILE__, 0, strrpos(__FILE__, '/'));
14require($dir.'/../wwwroot/config/config.inc');
b42b2bf9
H
15
16//connecting to database and creating universal $db object
a3be90c6 17require(INCLUDE_DIR.'/log.inc');
18require(INCLUDE_DIR.'/database.inc');
19require(INCLUDE_DIR.'/nodes.inc');
b42b2bf9
H
20$db=new CLASS_DATABASE();
21
a3be90c6 22$set=$db->query("select nodes.*,node_content from nodes
23 left join node_content on node_content.node_id=nodes.node_id
24 where node_system_access='public' and
25 date(node_created)<=current_date()-interval 1 day and
26 (nodes.k>0 or nodes.node_views>0)");
b42b2bf9
H
27while ($set->next()) {
28 $node_id=$set->getString('node_id');
29 $node_content=$set->getString('node_content');
30 $node_name=$set->getString('node_name');
31 $node_views=$set->getString('node_views');
32 $node_creator=$set->getString('node_creator');
33 $template_id=$set->getString('template_id');
34 $k=$set->getString('k');
35 $string.="<node_views>$node_views</node_views>\n";
36 $string.="<node_creator>$node_views</node_creator>\n";
37 $string.="<k>$k</k>\n<template_id>$template_id</template_id>\n";
38 $string.="<node_id>$node_id</node_id>\n<node_name>$node_name</node_name>\n";
39 $string.="<node_content>$node_content</node_content>\n";
40 $header="Path-Name: $node_id\n";
41 $header.="Content-Length: ".strlen($string);
42 echo $header."\n\n".$string;
43}
44echo EOF;
45
46?>
47
This page took 0.442482 seconds and 4 git commands to generate.