<?php //requiring main config file with path/database etc. constants require '../config/config.inc'; //connecting to database and creating universal $db object require SYSTEM_ROOT . '/inc/log.inc'; require SYSTEM_ROOT . '/inc/database.inc'; require SYSTEM_ROOT . '/inc/nodes.inc'; $db = new CLASS_DATABASE(); $handle = opendir("/storage/system/www-kyberia/files"); while (($file = readdir($handle)) !== false) { if (is_numeric($file)) { $files[] = $file; } } foreach ($files as $file) { $q = "update nodes set node_type='12' where node_id='{$file}'"; $db->query($q); //$set=$db->query("select * from tiamat"); } /* while ($set->next()) { $tiamat_id=$set->getString('tiamat_id'); } */ ?>
<?php //requiring main config file with path/database etc. constants require '../config/config.inc'; //connecting to database and creating universal $db object require SYSTEM_ROOT . '/inc/log.inc'; require SYSTEM_ROOT . '/inc/database.inc'; require SYSTEM_ROOT . '/inc/nodes.inc'; $db = new CLASS_DATABASE(); $db_old = new CLASS_DATABASE("kyberia", "kyberia", "cyb3ry", "127.0.0.1"); $q = "select * from nodes where node_type='poll'"; $set = $db->query($q); while ($set->next()) { unset($options); $node_id = $set->getString('node_id'); $old_poll_id = $set->getString('old_id'); $q = "select * from poll_options where id_poll={$old_poll_id}"; $pollset = $db_old->query($q); while ($pollset->next()) { $pollset_array[] = array("text" => $pollset->getString('text'), "number" => $pollset->getString('number')); } $options = serialize($pollset_array); $db->query("insert into node_content set node_id='{$node_id}',node_content='{$options}'"); }
<?php //requiring main config file with path/database etc. constants require '../config/config.inc'; //connecting to database and creating universal $db object require SYSTEM_ROOT . '/inc/log.inc'; require SYSTEM_ROOT . '/inc/database.inc'; require SYSTEM_ROOT . '/inc/nodes.inc'; $db = new CLASS_DATABASE(); $set = $db->query("select distinct node_parent from nodes"); while ($set->next()) { $parent = $set->getString('node_parent'); $countset = $db->query("select count(*) as pocet from nodes where node_parent='{$parent}'"); $countset->next(); $pocet = $countset->getString('pocet'); $db->query("update nodes set node_children_count='{$pocet}' where node_id='{$parent}'"); } ?>
<?php //requiring main config file with path/database etc. constants require '../config/config.inc'; //connecting to database and creating universal $db object require SYSTEM_ROOT . '/inc/log.inc'; require SYSTEM_ROOT . '/inc/database.inc'; require SYSTEM_ROOT . '/inc/nodes.inc'; $db = new CLASS_DATABASE(); $db->query("set autocommit=0"); $db_old = new CLASS_DATABASE("kyberia", "kyberia", "cyb3ry", "127.0.0.1"); $q = "select * from nodes where node_type='7'"; $userset = $db->query($q); while ($userset->next()) { $users[$userset->getString('old_id')] = $userset->getString('node_id'); } $friendset = $db_old->query("select * from friends"); while ($friendset->next()) { $q = "insert into nodes set node_type='8',node_name='friend::" . $users[$friendset->getString('friend_id')] . "::" . $users[$friendset->getString('user_id')] . "::" . rand(1, 23000) . "',node_parent='" . $users[$friendset->getString('friend_id')] . "',node_creator='" . $users[$friendset->getString('user_id')] . "'"; $db->query($q); echo $q; $q = "insert into node_content set node_id=LAST_INSERT_ID(),node_content='" . $friendset->getString('friend_text') . "'"; echo $q; $db->query($q); $db->query("commit"); }
* Script that XXX * Called XXX */ // Use relative address of config file // Change this, if you move you cron directory. $dir = substr(__FILE__, 0, strrpos(__FILE__, '/')); require_once $dir . '/../wwwroot/config/config.inc'; //connecting to database and creating universal $db object require_once INCLUDE_DIR . '/log.inc'; require_once INCLUDE_DIR . '/database.inc'; require_once INCLUDE_DIR . '/nodes.inc'; require_once INCLUDE_DIR . '/permissions.inc'; require_once INCLUDE_DIR . '/ubik.inc'; $_SESSION['user_id'] = UBIK_ID; $db = new CLASS_DATABASE(); $set = $db->query("select * from node_access where \n\t\tnode_id='1961061' and node_permission='execute'"); $citizens = $set->getNumRows(); $set2 = $db->query("select k,node_id,node_creator,login from nodes \n\t\tleft join users on nodes.node_creator=users.user_id where \n\t\tnode_name='request for citizenship'"); echo "TOTAL {$citizens} citizens \n"; while ($set2->next()) { $request_id = $set2->getString('node_id'); $votes = $set2->getString('k'); $login = $set2->getString('login'); $citizen = $set2->getString('node_creator'); echo "citizen {$citizen} - {$login} has {$votes} needs " . floor(log($citizens, "1.42")) . " \n"; if ($citizens < 66 && $votes >= floor($citizens / 6) || $citizens >= 66 && $votes > floor(log($citizens, "1.42"))) { $params['node_parent'] = $request_id; $params['node_creator'] = UBIK_ID; $params['node_content'] = "request of user {$login} approved by {$votes} citizens"; $params['node_name'] = "citizen {$citizen} approved"; //print_r($params);
#!/usr/local/bin/php <?php require '../config/config.inc'; //connecting to database and creating universal $db object require SYSTEM_ROOT . '/inc/log.inc'; require SYSTEM_ROOT . '/inc/database.inc'; require SYSTEM_ROOT . '/inc/nodes.inc'; $db = new CLASS_DATABASE(); $db->query("update users set user_k=6");
#!/usr/bin/php <?php /* * Script that restores number of K for all users. * Called once a day. */ // Use relative address of config file // Change this, if you move you cron directory. $dir = substr(__FILE__, 0, strrpos(__FILE__, '/')); require_once $dir . '/../wwwroot/config/config.inc'; require_once INCLUDE_DIR . '/database.inc'; require_once INCLUDE_DIR . '/log.inc'; $db = new CLASS_DATABASE(); $db->query('update users set user_k = ' . DAILY_K);
<?php //requiring main config file with path/database etc. constants require '../config/config.inc'; //connecting to database and creating universal $db object require SYSTEM_ROOT . '/inc/log.inc'; require SYSTEM_ROOT . '/inc/database.inc'; require SYSTEM_ROOT . '/inc/nodes.inc'; $db = new CLASS_DATABASE(); $set = $db->query("select node_thread_vector,node_id from nodes"); while ($set->next()) { unset($pocet); $ancestor = $set->getString('node_id'); $vector = $set->getString('node_thread_vector'); $countset = $db->query("select count(*) as pocet from nodes where node_thread_vector like '{$vector};{$ancestor}'"); $countset->next(); $pocet = $countset->getString('pocet'); $countset = $db->query("select count(*) as pocet from nodes where node_thread_vector like '{$vector};{$ancestor};%'"); $countset->next(); $pocet += $countset->getString('pocet'); $db->query("update nodes set node_descendant_count='{$pocet}' where node_id='{$ancestor}'"); } ?>
<?php //requiring main config file with path/database etc. constants require '../config/config.inc'; //connecting to database and creating universal $db object require SYSTEM_ROOT . '/inc/log.inc'; require SYSTEM_ROOT . '/inc/database.inc'; require SYSTEM_ROOT . '/inc/nodes.inc'; $db = new CLASS_DATABASE(); $db->query("update nodes set node_thread_vector=concat(';1;6;',node_thread_vector) where node_type=5 and node_thread_vector not like ';1;6%';");
<?php //requiring main config file with path/database etc. constants require '../config/config.inc'; //connecting to database and creating universal $db object require SYSTEM_ROOT . '/inc/log.inc'; require SYSTEM_ROOT . '/inc/database.inc'; require SYSTEM_ROOT . '/inc/nodes.inc'; $db = new CLASS_DATABASE(); $db_old = new CLASS_DATABASE("kyberia", "kyberia", "cyb3ry", "127.0.0.1"); $q = "select node_id,node_content from node_content order by node_id"; $set = $db->query($q); while ($set->next()) { $node_content = $set->getString('node_content'); $new_content = preg_replace_callback("/(http:\\/\\/www.kyberia.sk\\/([a-zA-Z]*).php)?\\?(action=([a-zA-Z]*))?\\&(node_id=([0-9]*))?(\\&alone=([0-9]*))?/i", "changeRegExp", $node_content); if ($new_content != $node_content) { $node_id = $set->getString('node_id'); $new_content = AddSlashes($new_content); $db->query("update node_content set node_content='{$new_content}' where node_id='{$node_id}'"); echo $node_id . " updated<br>"; } } function changeRegExp($match) { global $db; if ($match[8]) { $q = "select node_id from nodes where node_type='4' and old_id='" . $match[8] . "'"; $s = $db->query($q); $s->next(); $id = $s->getString('node_id'); return "/id/{$id}";
<?php error_reporting(E_ALL | E_STRICT); session_start(); require '../config/config.inc'; require INCLUDE_DIR . 'database.inc'; $db = new CLASS_DATABASE(); $set = $db->query("select user_id,last_action from users where (user_id > 2334 and user_id < 123456 and last_action like '2005-11-06 00:00:02')"); while ($set->next()) { echo $set->getString('user_id') . " ; " . $set->getString('last_action') . "<br>"; }
<? require('config/config.inc'); require(SYSTEM_ROOT.'inc/database.inc'); $db=new CLASS_DATABASE(); $query = "select node_id, node_name, node_vector from nodes where node_parent = '63530' or node_vector like '%63530%'"; $set = $db->query($query); $count = $set->getNumRows(); while($set->next()) { echo $set->getString('node_id')." :: ".$set->getString('node_name')." :: ".$set->getString('node_vector')." :: "; $count = strlen($set->getString('node_vector')); $node_vector = $set->getString('node_vector'); for($i = 1; $i <= $count; $i++) { $node_vector = "0".$node_vector; } if(strstr($set->getString('node_vector'), "00000101")) { echo $set->getString('node_vector'); } else { echo $node_vector; } echo "<br>"; }
$event = false; } else { $event = $_POST['event']; } if (empty($_POST['transaction'])) { $transaction = false; } else { $event = $_POST['transaction']; } //initializing node methods if (!empty($_GET['node_name'])) { //omfg what's this! jail , jail, penalty of death! // reopened by maniac, keep this in secret, then you can benefit from it.. if (strpos($_GET['node_name'], '0') === 0) { $numbah = $_GET['node_name']; $db->query("set character_set_connection=latin2"); $set = $db->query("select * from tz.gts where full_number='{$numbah}'"); $set->next(); echo $set->getString('full_name') . "<br>"; echo $set->getString('full_street') . "<br>"; echo $set->getString('city') . "<br>"; echo $set->getString('psc') . "<br>"; echo $set->getString('company') . "<br>"; die; } else { nodes::redirByName($_GET['node_name']); } // END OF JAIL ;) nodes::redirByName($_GET['node_name']); } elseif (!empty($_GET['node_id'])) { $node = nodes::getNodeById($_GET['node_id'], $_SESSION['user_id']);
<?php //requiring main config file with path/database etc. constants require '../config/config.inc'; //connecting to database and creating universal $db object require SYSTEM_ROOT . '/inc/log.inc'; require SYSTEM_ROOT . '/inc/database.inc'; require SYSTEM_ROOT . '/inc/nodes.inc'; $db = new CLASS_DATABASE(); $set = $db->query("select * from tiamat"); while ($set->next()) { $tiamat_id = $set->getString('tiamat_id'); } ?>
#!/usr/bin/php <?php /* * Script that XXX put xapian here? * Called XXX */ // Use relative address of config file // Change this, if you move you cron directory. $dir = substr(__FILE__, 0, strrpos(__FILE__, '/')); require_once $dir . '/../wwwroot/config/config.inc'; require_once INCLUDE_DIR . '/database.inc'; $db = new CLASS_DATABASE(); $db->query('insert into node_content select node_id,node_content from nodes where ( DATE_SUB(CURDATE(),INTERVAL 2 DAY) < node_created OR DATE_SUB(CURDATE(),INTERVAL 2 DAY) < node_updated) ON DUPLICATE KEY UPDATE node_content.node_content = nodes.node_content;');
<?php //requiring main config file with path/database etc. constants require '../config/config.inc'; //require('../config/config_pathz.inc'); //connecting to database and creating universal $db object require SYSTEM_ROOT . '/inc/log.inc'; require SYSTEM_ROOT . '/inc/database.inc'; require SYSTEM_ROOT . '/inc/nodes.inc'; $db = new CLASS_DATABASE(); $db_old = new CLASS_DATABASE("kyberia", "kyberia", "cyb3ry", "127.0.0.1"); define('IMAGES', '/storage/system/www-kyberia/images/clanky/'); $set = $db->query("select node_id,old_id from nodes where node_type='5'"); while ($set->next()) { $oldset = $db_old->query("select title_image from articles where id_article='" . $set->getString('old_id') . "'"); $oldset->next(); $id = $set->getString('node_id'); $image = $oldset->getString('title_image'); if (!empty($image)) { if (strstr($image, ".gif")) { copy(IMAGES . $image, "/storage/system/www-kyberia/images/nodes/" . substr($id, 0, 1) . "/" . substr($id, 1, 1) . "/{$id}.gif"); } elseif (strstr($image, ".jpeg") || strstr($image, ".jpg") || strstr($image, ".JPG")) { $cmd = UTILZ_DIR . "/jpegtopnm " . IMAGES . $image . " | " . UTILZ_DIR . "/ppmquant 256 | " . UTILZ_DIR . "/ppmtogif > /storage/system/www-kyberia/images/nodes/" . substr($id, 0, 1) . "/" . substr($id, 1, 1) . "/{$id}.gif"; echo $cmd . "<br>"; shell_exec($cmd); } } }
<?php //requiring main config file with path/database etc. constants require '../config/config.inc'; //connecting to database and creating universal $db object require SYSTEM_ROOT . '/inc/log.inc'; require SYSTEM_ROOT . '/inc/database.inc'; require SYSTEM_ROOT . '/inc/nodes.inc'; $db = new CLASS_DATABASE(); $bigset = $db->query("select * from nodes where node_type=3 order by node_id"); while ($bigset->next()) { $vector = $bigset->getString('node_thread_vector') . ";" . $bigset->getString('node_id'); $forum_id = $bigset->getString('node_id'); $db->query("update nodes set node_thread_vector='{$vector}' where node_parent={$forum_id}"); echo "<BR>"; } /* $bigset=$db->query("select * from nodes where (node_type=5 or node_type=6) order by node_id"); while ($bigset->next()) { $vector_array[$bigset->getString('node_id')]=$bigset->getString('node_thread_vector').";".$bigset->getString('node_id'); } $set=$db->query("select * from nodes where node_thread_vector=0 and node_type=4 order by node_id"); while ($set->next()) { $vector_array[$set->getString('node_id')]=$set->getString('node_thread_vector').";".$bigset->getString('node_parent'); $vector=$vector_array[$set->getString('node_parent')]; $id=$set->getString('node_id'); $db->query("update nodes set node_thread_vector='$vector' where node_parent=$id"); echo "<BR>"; } */ ?>
<?php /* * Script that XXX * Called XXX */ //error_reporting(0); // Use relative address of config file // Change this, if you move you cron directory. $dir = substr(__FILE__, 0, strrpos(__FILE__, '/')); require $dir . '/../wwwroot/config/config.inc'; //connecting to database and creating universal $db object require INCLUDE_DIR . '/log.inc'; require INCLUDE_DIR . '/database.inc'; require INCLUDE_DIR . '/nodes.inc'; $db = new CLASS_DATABASE(); $set = $db->query("select nodes.*,node_content from nodes \n\t\tleft join node_content on node_content.node_id=nodes.node_id \n\t\twhere node_system_access='public' and \n\t\tdate(node_created)<=current_date()-interval 1 day and \n\t\t(nodes.k>0 or nodes.node_views>0)"); while ($set->next()) { $node_id = $set->getString('node_id'); $node_content = $set->getString('node_content'); $node_name = $set->getString('node_name'); $node_views = $set->getString('node_views'); $node_creator = $set->getString('node_creator'); $template_id = $set->getString('template_id'); $k = $set->getString('k'); $string .= "<node_views>{$node_views}</node_views>\n"; $string .= "<node_creator>{$node_views}</node_creator>\n"; $string .= "<k>{$k}</k>\n<template_id>{$template_id}</template_id>\n"; $string .= "<node_id>{$node_id}</node_id>\n<node_name>{$node_name}</node_name>\n"; $string .= "<node_content>{$node_content}</node_content>\n"; $header = "Path-Name: {$node_id}\n"; $header .= "Content-Length: " . strlen($string);
<?php //requiring main config file with path/database etc. constants require '../config/config.inc'; //connecting to database and creating universal $db object require SYSTEM_ROOT . '/inc/log.inc'; require SYSTEM_ROOT . '/inc/database.inc'; require SYSTEM_ROOT . '/inc/nodes.inc'; $db = new CLASS_DATABASE(); $qNCOld = "select * from node_content"; $i = 0; $set = $db->query($qNCOld); while ($set->next()) { $i++; if ($i % 100 == 0) { echo "{$i} nodes loaded\n"; } $qNCNew = "update nodes set node_content='" . addslashes($set->getString('node_content')) . "' where node_id='" . $set->getString('node_id') . "'"; $db->query($qNCNew); }
#!/usr/bin/php <?php /* * Script that logouts iddle users. * Called twice a hour. */ // Use relative address of config file // Change this, if you move you cron directory. $dir = substr(__FILE__, 0, strrpos(__FILE__, '/')); require $dir . '/../wwwroot/config/config.inc'; //require(INCLUDE_DIR.'/log.inc'); require INCLUDE_DIR . '/database.inc'; //require(INCLUDE_DIR.'/nodes.inc'); $db = new CLASS_DATABASE(); $db->query("update users set user_action=NULL,user_action_id=NULL,user_location_vector=NULL where unix_timestamp()-3600>unix_timestamp(last_action)");
<?php //requiring main config file with path/database etc. constants require '../config/config.inc'; //connecting to database and creating universal $db object require SYSTEM_ROOT . '/inc/log.inc'; require SYSTEM_ROOT . '/inc/database.inc'; require SYSTEM_ROOT . '/inc/nodes.inc'; $db = new CLASS_DATABASE(); $q = "select node_id,node_thread_vector from nodes where node_type='5'"; $set = $db->query($q); while ($set->next()) { $vector_array[$set->getString('node_id')] = $set->getString('node_thread_vector'); } print_r($vector_array); $q = "select * from nodes where node_type='4' and node_thread_vector='0' and old_type='article' order by node_id asc"; $set = $db->query($q); while ($set->next()) { $vector_array[$set->getString('node_id')] = $vector_array[$set->getString('node_parent')] . ";" . $set->getString('node_parent'); $db->query("update nodes set node_thread_vector='" . $vector_array[$set->getString('node_parent')] . ";" . $set->getString('node_parent') . "' where node_id='" . $set->getString('node_id') . "'"); echo "update nodes set node_thread_vector='" . $vector_array[$set->getString('node_parent')] . ";" . $set->getString('node_parent') . "' where node_id='" . $set->getString('node_id') . "'"; }
#!/usr/local/bin/php <?php require '../config/config.inc'; //connecting to database and creating universal $db object require SYSTEM_ROOT . '/inc/log.inc'; require SYSTEM_ROOT . '/inc/database.inc'; require SYSTEM_ROOT . '/inc/nodes.inc'; $db = new CLASS_DATABASE(); $q = "select user_id,login from users"; $set = $db->query($q); $i = 0; while ($set->next()) { $user_id = $set->getString('user_id'); $user_name = $set->getString('login'); $us = $db->query("select node_id from nodes where node_id='{$user_id}'"); if (!$us->getNumRows()) { ++$i; $q = "insert into nodes set node_id='{$user_id}',node_creator='{$user_id}',node_system_access='public',\n node_external_access='yes',template_id='7',node_name='{$user_name}',external_link='session://user',node_vector='{$vector}'"; echo "\n {$i} {$q} <br>"; $db->update($q); } }
<?php //requiring main config file with path/database etc. constants require '../config/config.inc'; //connecting to database and creating universal $db object require SYSTEM_ROOT . '/inc/log.inc'; require SYSTEM_ROOT . '/inc/database.inc'; require SYSTEM_ROOT . '/inc/nodes.inc'; $db = new CLASS_DATABASE(); $db_old = new CLASS_DATABASE("kyberia", "kyberia", "cyb3ry", "127.0.0.1"); $q = "select * from articles"; $set = $db_old->query($q); $db->query("set autocommit=0"); while ($set->next()) { $q = "insert into nodes set "; if (!is_numeric($set->getString('autor'))) { $node_name = $set->getString('autor') . "::" . $set->getString('nazov'); } else { $node_name = $set->getString('nazov'); } $node_name = addslashes(strip_tags($node_name)); $q .= "node_name='{$node_name}'"; $q2 = "select * from nodes where node_type='2' and old_id='" . $set->getString('id_rubrika') . "'"; $res2 = $db->query($q2); $res2->next(); $q .= ",node_parent='" . $res2->getString('node_id') . "'"; $q .= ",node_thread_vector='" . $res2->getString('node_thread_vector') . ";" . $res2->getString('node_id') . "'"; if (is_numeric($set->getString('autor'))) { $autor = nodes::getNodeByOldId($set->getString('autor')); $q .= ",node_creator='" . $autor['node_id'] . "'"; } else {
<?php error_reporting(E_ALL | E_STRICT); require '../config/config.inc'; require INCLUDE_DIR . 'database.inc'; $db = new CLASS_DATABASE(); $user_id = $_GET['user_id']; $node_id = $_GET['node_id']; // listing amount $set = $db->query("select users.listing_amount, users.listing_order from users where users.user_id='{$user_id}' limit 1"); $set->next(); $listing_amount = $set->getString('listing_amount'); if (!is_numeric($listing_amount)) { $listing_amount = 23; } $offset = 0; $q = "select creator.node_name as creator,users.user_id,nodes.node_name,nodes.node_id as node_id from nodes\nleft join node_access on (nodes.node_id=node_access.node_id and node_access.user_id='{$user_id}') left join users on users.user_id=nodes.node_creator left join nodes as creator on nodes.node_creator=creator.node_id where nodes.node_parent='{$node_id}'"; $q .= " order by nodes.template_id,nodes.node_name LIMIT 0,3"; $set = $db->query($q); while ($set->next()) { $get_children_array[] = $set->getRecord(); } printf('<script language="JavaScript" type="text/javascript">function deti(){ var childrens = new Array();'); foreach ($get_children_array as $index => $content) { printf('childrens[%d] = new Array("%s", %d, "%s", %d);' . "\n", $index, $content['creator'], $content['user_id'], $content['node_name'], $content['node_id']); } printf('for (x = 0; x < childrens.length; x++) {document.write(childrens[x] + "<br>");} }</script>');
<?php error_reporting(E_ALL | E_STRICT); session_start(); require '../config/config.inc'; require INCLUDE_DIR . 'database.inc'; $db = new CLASS_DATABASE(); $user_id = $_GET['user_id']; $set = $db->query(sprintf('select moods from users where user_id = %d limit 1', $user_id)); $set->next(); $moods = $set->getString('moods'); echo "session_user_id:: " . $_SESSION['user_id'] . "<br>"; printf('moods:: %s session:: %d , %s , %s', $moods, $_SESSION['mood'], $_SESSION['mood_name'], $_SESSION['mood_text']);
<?php //requiring main config file with path/database etc. constants require '../config/config.inc'; error_reporting(0); //connecting to database and creating universal $db object require SYSTEM_ROOT . '/inc/log.inc'; require SYSTEM_ROOT . '/inc/database.inc'; require SYSTEM_ROOT . '/inc/nodes.inc'; $db = new CLASS_DATABASE(); $q = "select node_id,node_thread_vector from nodes order by node_id asc"; $set = $db->query($q); while ($set->next()) { unset($new_vector); $node_id = $set->getString('node_id'); $old_vector = $set->getString('node_thread_vector'); $old_vector = ltrim($old_vector, ";"); $vector_array = explode(";", $old_vector); foreach ($vector_array as $vector_item) { $new_item = str_pad($vector_item, VECTOR_CHARS, "0", STR_PAD_LEFT); $new_vector .= ";" . $new_item; } $new_id = str_pad($set->getString('node_id'), VECTOR_CHARS, "0", STR_PAD_LEFT); // echo "AAAA".$new_id."BBBB"; $new_vector = $new_vector . ";" . $new_id; $q = "update nodes set node_vector='{$new_vector}' where node_id='{$node_id}'"; echo $q; $db->query($q); } ?>
#!/usr/bin/php <?php require '../config/config.inc'; //connecting to database and creating universal $db object require INCLUDE_DIR . '/log.inc'; require INCLUDE_DIR . '/database.inc'; require INCLUDE_DIR . '/nodes.inc'; $db = new CLASS_DATABASE(); $set = $db->query("select node_id from nodes where node_type='13'"); while ($set->next()) { $id = $set->getString('node_id'); if (is_numeric($id)) { $q = "delete from node_content where node_id='{$id}'"; $db->query($q); $q = "delete from nodes where node_id='{$id}'"; $db->query($q); } }
<?php require '../config/config.inc'; //connecting to database and creating universal $db object require SYSTEM_ROOT . '/inc/log.inc'; require SYSTEM_ROOT . '/inc/database.inc'; require SYSTEM_ROOT . '/inc/nodes.inc'; $db = new CLASS_DATABASE(); $fd = fopen("hysteria.logins", 'r'); while (!feof($fd)) { $data = fread($fd, 4096); } $array = explode("\n", $data); foreach ($array as $login) { $result = $db->query("select user_id from users where login='******'"); if (!$result->getNumRows()) { $db->query("insert into nodes set node_name='{$login}',node_type='7',node_parent='102',node_thread_vector=';1;102'"); $id = $db->getLastInsertId(); $db->query("insert into node_content set node_id='{$id}',node_content='hysteria user {$login}'"); $db->query("insert into users set login='******',user_id='{$id}'"); } else { echo "duplicitny {$login} \n<br>"; } }
#!/usr/local/bin/php <?php require '../config/config.inc'; //connecting to database and creating universal $db object require SYSTEM_ROOT . '/inc/log.inc'; require SYSTEM_ROOT . '/inc/database.inc'; require SYSTEM_ROOT . '/inc/nodes.inc'; $db = new CLASS_DATABASE(); $set = $db->query("select * from node_access where node_bookmark='yes'"); while ($set->next()) { $creator = $set->getString('user_id'); $node = $set->getString('node_id'); $category = $set->getString('bookmark_category'); if (!$category) { $category = $creator; } $help = $db->query("select * from neurons where central='{$category}' and peripheral='{$node}'"); if (!$help->getNumRows()) { $q = "insert into neurons set central='{$category}',peripheral='{$node}',synapse_creator='{$creator}',link='bookmark',synapse_created=NOW()"; echo $q . "\n"; $db->query($q); } unset($help); }
<?php //requiring main config file with path/database etc. constants require '../config/config.inc'; //connecting to database and creating universal $db object require SYSTEM_ROOT . '/inc/log.inc'; require SYSTEM_ROOT . '/inc/database.inc'; require SYSTEM_ROOT . '/inc/nodes.inc'; $db = new CLASS_DATABASE(); $db_old = new CLASS_DATABASE("kyberia", "kyberia", "cyb3ry", "127.0.0.1"); $q = "select * from nodes where node_type='3'"; $userset = $db->query($q); while ($userset->next()) { $users[$userset->getString('old_id')] = $userset->getString('node_id'); } foreach ($users as $key => $value) { $dst = "/storage/system/www-kyberia/images/nodes/" . substr($value, 0, 1) . "/" . substr($value, 1, 1) . "/{$value}.gif"; copy("/storage/system/www-kyberia/images/forums/{$key}.gif", $dst); }