4 * Script that restores number of K for all users.
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');
19 // include lastRSS library
20 include INCLUDE_DIR
.'/lastRSS.php';
23 $db=new CLASS_DATABASE();
25 $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='28' and nodes.node_id>100");
27 // create lastRSS object
30 // setup transparent cache
31 $rss->cache_dir
= './cache';
32 $rss->cache_time
= 3600; // one hour
35 while ($set->next()) {
37 if (!preg_match("/http:(.*)/",$set->getString('node_content'))) {
38 $rs = $rss->get("http://kyberia.sk/scripts/google2rss.php?num=25&q=".$set->getString('node_content'));
43 readfile($set->getString('node_content'));
44 $data=ob_get_contents();
47 $rs=$rss->get($set->getString('node_content'));
52 foreach ($rs['items'] as $item) {
53 $q="select node_id from nodes where node_name='".addslashes($item['title'])."'";
54 $itemset=$db->query($q);
55 if (!$itemset->getNumRows()) {
57 $q="insert into nodes set
58 node_name='".addslashes($item['title'])."',
59 node_parent='".$set->getString('node_parent')."',
60 node_thread_vector='".$set->getString('node_thread_vector').";".$set->getString('node_parent')."',
61 node_system_access='".$set->getString('node_system_access')."',
62 node_external_access='".$set->getString('node_external_access')."',external_link='".addslashes($item['link'])."',
63 node_type=13,node_creator='".$set->getString('node_id')."',node_created=NOW()";
65 $id=$db->getLastInsertId();
66 $text=$item['description'];
68 //$text.="<br><br><iframe width='666' height='230' src='".$item['link']."'>";
69 $text=AddSlashes($item['description']);
70 $params['node_content']=$text;
71 $params['node_name']=addslashes($item['title']);
72 $params['node_parent']=$set->getString('node_parent');
73 $params['node_creator']=$set->getString('node_id');
74 nodes
:addNode($params);
This page took 1.109533 seconds and 4 git commands to generate.