| 1 | #!/usr/local/bin/php |
| 2 | <?php |
| 3 | error_reporting(0); |
| 4 | //requiring main config file with path/database etc. constants |
| 5 | require('/storage/system/www-docroot/kyberia.sk/config/config.inc'); |
| 6 | |
| 7 | //connecting to database and creating universal $db object |
| 8 | require(SYSTEM_ROOT.'/inc/log.inc'); |
| 9 | require(SYSTEM_ROOT.'/inc/database.inc'); |
| 10 | require(SYSTEM_ROOT.'/inc/nodes.inc'); |
| 11 | $db=new CLASS_DATABASE(); |
| 12 | |
| 13 | $set=$db->query("select nodes.*,node_content from nodes left join node_content on node_content.node_id=nodes.node_id where node_system_access='public' and date(node_created)<=current_date()-interval 1 day and (nodes.k>0 or nodes.node_views>0)"); |
| 14 | while ($set->next()) { |
| 15 | $node_id=$set->getString('node_id'); |
| 16 | $node_content=$set->getString('node_content'); |
| 17 | $node_name=$set->getString('node_name'); |
| 18 | $node_views=$set->getString('node_views'); |
| 19 | $node_creator=$set->getString('node_creator'); |
| 20 | $template_id=$set->getString('template_id'); |
| 21 | $k=$set->getString('k'); |
| 22 | $string.="<node_views>$node_views</node_views>\n"; |
| 23 | $string.="<node_creator>$node_views</node_creator>\n"; |
| 24 | $string.="<k>$k</k>\n<template_id>$template_id</template_id>\n"; |
| 25 | $string.="<node_id>$node_id</node_id>\n<node_name>$node_name</node_name>\n"; |
| 26 | $string.="<node_content>$node_content</node_content>\n"; |
| 27 | $header="Path-Name: $node_id\n"; |
| 28 | $header.="Content-Length: ".strlen($string); |
| 29 | echo $header."\n\n".$string; |
| 30 | } |
| 31 | echo EOF; |
| 32 | |
| 33 | ?> |
| 34 | |