{*/if*}
<tr>
<!--XXX test oflogarithmic threading (original (x-y)-8 ) XXX TODO fit to resolutions-->
- <td width='{math equation="5*log((x-y))-8" x=$child.depth y=$node.vector_depth}%'></td>
+ <td width='{math equation="10*log((x-y))-18" x=$child.depth y=$node.vector_depth}%'></td>
<td valign='top' rowspan='2'>
{* put.Ty hack *}
{if $child.synapse_creator neq ''}
{*end of put.Ty hack *}
</td>
<!--XXX orig: 100-(x-y)-->
- <td width='{math equation="100-(5*log(x-y))" x=$child.depth y=$node.vector_depth}%'>
+ <td width='{math equation="100-(10*log(x-y))+10" x=$child.depth y=$node.vector_depth}%'>
<table class='bordered' width='100%'><tr class='header'>
<td>
<a href='/id/{$child.node_creator}'>{$child.login}</a>
$kset->next();
$user_k=$kset->getString('user_k');
+// XXX hard-coded
$senat_id = 876611;
$K_id = 1961061;
$comms = getCommanders($K_id);
$error=$error_messages['EVENT_PERMISSION_ERROR'];
return false;
}
- $bans=explode(";",$_POST['bans']);
+ $bans=explode(";",$_POST['bans']); // XXX sqli?
$db->query("update node_access set node_permission='' where node_id=$node_id and node_permission='ban'");
foreach ($bans as $ban) {
<?php
- function book() {
- global $db,$error,$node;
- $q="update neurons set link='bookmark',synapse_creator='".$_SESSION['user_id']."',synapse=synapse+1 where dst='".$_SESSION['user_id']."' and src='".$node['node_id']."'";
- $result=$db->update($q);
- if (!$result) {
- $q="insert into neurons set synapse_created=NOW(),dst='".$_SESSION['user_id']."',src='".$node['node_id']."',synapse_creator='".$_SESSION['user_id']."',link='bookmark'";
- $db->query($q);
- }
- $q="update node_access set node_bookmark='yes' where user_id='".$_SESSION['user_id']."' and node_id='".$node['node_id']."'";
- $result=$db->query($q);
- $_SESSION['bookmarks'][$node['node_id']]=$node['node_name'];
-return true;
+function book() {
+ global $db,$error,$node;
+
+ $q="update neurons set link='bookmark',synapse_creator='".$_SESSION['user_id']."',synapse=synapse+1 where dst='".$_SESSION['user_id']."' and src='".$node['node_id']."'";
+ $result=$db->update($q);
+ if (!$result) {
+ $q="insert into neurons set synapse_created=NOW(),dst='".$_SESSION['user_id']."',src='".$node['node_id']."',synapse_creator='".$_SESSION['user_id']."',link='bookmark'";
+ $db->query($q);
}
+ $q="update node_access set node_bookmark='yes' where user_id='".$_SESSION['user_id']."' and node_id='".$node['node_id']."'";
+ $result=$db->query($q);
+
+ $_SESSION['bookmarks'][$node['node_id']]=$node['node_name'];
+
+ return true;
+}
?>
global $error,$node,$db;
$user_id = $_SESSION['user_id'];
- $bookstyl = $_POST['bookstyl'];
+ $bookstyl = $_POST['bookstyl']; //XXX sqli
$set=$db->query("select * from nodes where node_parent=19 and external_link='session://bookstyl' and node_creator='$user_id'");
if($set->getNumRows() == 0) {
$_SESSION['bookstyl']= $bookstyl;
}
-?>
\ No newline at end of file
+?>
// XXX permision check?
function debugging() {
-if ($_SESSION['debugging']) unset($_SESSION['debugging']);
-else $_SESSION['debugging']=true;
+ if ($_SESSION['debugging']) unset($_SESSION['debugging']);
+ else $_SESSION['debugging']=true;
}
+
?>
//echo $q;
}
}else{
-global $error;
-$error="Nemas pravomoci na vykonanie daneho skutku....viac ku tomu nemam co dodat:-)";
-return false;
+ global $error;
+ $error="Nemas pravomoci na vykonanie daneho skutku....";
+ return false;
}
-
-
}
return true;
-}?>
\ No newline at end of file
+}?>
<?php
- function executorlist() {
- global $db,$error,$node;
- $node_id=$node['node_id'];
- if ($node['node_permission']!='owner') {
- $error=$error_messages['EVENT_PERMISSION_ERROR'];
- return false;
- }
+function executorlist() {
+ global $db,$error,$node;
+ $node_id=$node['node_id'];
+ if ($node['node_permission']!='owner') {
+ $error=$error_messages['EVENT_PERMISSION_ERROR'];
+ return false;
+ }
- $executors=explode(";",$_POST['executorlist']);
- $db->query("update node_access set node_permission='' where
- node_id=$node_id and node_permission='exec'");
- foreach ($executors as $execitpr) {
- $set=$db->query("select user_id from users where login='$executor'");
- $set->next();
- if ($set->getString('user_id')) {
- $q="update node_access set node_permission='exec' where node_id=$node_id and
+ $executors=explode(";",$_POST['executorlist']); // XXX sqli
+ $db->query("update node_access set node_permission='' where
+ node_id=$node_id and node_permission='exec'");
+ foreach ($executors as $execitpr) {
+ $set=$db->query("select user_id from users where login='$executor'");
+ $set->next();
+ if ($set->getString('user_id')) {
+ $q="update node_access set node_permission='exec' where node_id=$node_id and
user_id='".$set->getString('user_id')."'";
- $changed=$db->update($q);
- if (!$changed) {
- $q="insert into node_access set
+ $changed=$db->update($q);
+ if (!$changed) {
+ $q="insert into node_access set
node_permission='exec',node_id=$node_id,user_id=".$set->getString('user_id');
- $db->query($q);
- $logger::log('add exec',$node_id,'ok',$executor);
+ $db->query($q);
+ $logger::log('add exec',$node_id,'ok',$executor);
- }
}
- else { $error .= "$executor does not exist..."; }
}
+ else { $error .= "$executor does not exist..."; }
}
+}
?>
$count = mysql_num_rows($q);
while($res = mysql_fetch_object($q)) {
-$content = mysql_fetch_object(mysql_query("select * from `node_content` where `node_id` = '{$res->node_id}'"));
-print $res->node_id;
-print ">>>";
-print $content->node_content;
-print "<br>";
-
-
-
-
+ $content = mysql_fetch_object(mysql_query("select * from `node_content` where `node_id` = '{$res->node_id}'"));
+ print $res->node_id;
+ print ">>>";
+ print $content->node_content;
+ print "<br>";
}
}
-
}
-?>
\ No newline at end of file
+?>
if (($k_wallet+(-1*$k_request)) < 0 or ($user_k-(-1*$k_request)) < 0 or (!$k_request)) {
-$error="Chybne zadanie alebo na to proste nemas:-)";
-return false;
+ $error="Chybne zadanie alebo na to proste nemas:-)";
+ return false;
}
$db->query("update users set k_wallet=k_wallet+(-1*$k_request) , user_k=user_k-(-1*$k_request) where user_id='$user_id'");
+++ /dev/null
-/modules
-
-
-announcment by bad admin:
-<font class='most_important'>
-POZOR POZOR POZOR. V PRIEBEHU NAJBLIZSIEHO MESIACA DOJDE K ODMAZANIU
-ADRESARA MODULES, PRETO JE ODPORUCANE UPRAVIT VSETKY VAM PATRIACE SABLONY A ODSTRANIT Z NICH ZAPISY {include file="modules/nazovsuboru.tpl"}
-je treba zadavat
-{include file="cislosablony.tpl"}
-</font>
\ No newline at end of file
<?
function spamuj_ubik() {
global $db,$node,$error;
+
+/* XXX TODO Rewrite (insecure)
+
$sprava="Ahoj! tak s radostou ta mozem poinformovat o par zmenach v systeme<br>";
// oznamovanie niektorych ficur z newlistu via ubik vsem userom
echo "sprava $sprava <br> bola odoslana $pocitadlo userom";
+*/
return false;
-}?>
\ No newline at end of file
+}?>
global $db,$error;
// 2110364 >> debug user
+// XXX hardcoded, rewrite
$q="select users.login as persona,users.email as email,k,node_id,node_creator,login from nodes
left join users on nodes.node_creator=users.user_id where node_name!='request for access' and node_parent=2091448 and
k>=3";
-/*
-$q="select users.login as persona,users.email as email,k,node_id,node_creator,login from nodes
-left join users on nodes.node_creator=users.user_id where node_name!='request for access' and node_parent=2091448 and
-k>=3 and user_id=2110364";
-*/
-
$set=$db->query($q);
while ($set->next()) {
$noda=$set->getString('node_id');
return false;
}
-?>
\ No newline at end of file
+?>
else {
// ouch!! this is gonna be dirty!!!!! will be revised later:-)
+// XXX hardcoded, rewrite
$q="update nodes set node_parent=2091448, node_vector='00876611020914480$userid' where node_id='$userid'";
$db->update($q);
$q="update nodes set node_children_count=node_children_count+1 where node_id=2091448";
die();
}
}
-?>
\ No newline at end of file
+?>
<?php
// pokus urobit neco z anketami:-))nerehocte sa moc hlasno:-))
- function vote() {
- global $node,$db,$error,$referer_id;
- if (!$referer_id) $referer_id=1;
+function vote() {
+ global $node,$db,$error,$referer_id;
+ if (!$referer_id) $referer_id=1;
- $node_id=$node['node_id'];
- $user_id=$_SESSION['user_id'];
+ $node_id=$node['node_id'];
+ $user_id=$_SESSION['user_id'];
- $set=$db->query("select * from node_access where node_id='$node_id' and user_id='$user_id' and node_permission='ban'");
- if($set->getNumRows()>0) {
- global $error;
- $error="F ankete si uz hlasoval. nene..uz sa to neda viackrat...dufam:-)";
- return false; }
+ $set=$db->query("select * from node_access where node_id='$node_id'
+ and user_id='$user_id' and node_permission='ban'");
+ if($set->getNumRows()>0) {
+ global $error;
+ $error="One vote is enough for everyone";
+ return false;
+ }
-$option=$_POST['poll_option'];
+ $option=$_POST['poll_option'];
+ $option--;
-$option--;
+ if (!is_numeric($option)) {
+ $error="incorrect poll_option. fck";
+ }
-if (!is_numeric($option)) {
- $error="incorrect poll_option. fck";
- }
+ $poll=unserialize($node['node_content']);
+ ++$poll[$option]['number'];
+ $node_content=serialize($poll);
+ $db->query("update nodes set node_content='$node_content'
+ where node_id='$node_id'");
- $poll=unserialize($node['node_content']);
- ++$poll[$option]['number'];
- $node_content=serialize($poll);
- $db->query("update nodes set node_content='$node_content'
-where node_id='$node_id'");
+ $db->query("update node_access set node_permission='ban' where
+ node_id='$node_id' and user_id='$user_id'");
+ Header("Location: /id/".$node['node_parent']."/");
+}
-$db->query("update node_access set node_permission='ban' where
-node_id='$node_id' and user_id='$user_id'");
- Header("Location: /id/".$node['node_parent']."/");
-
- }
-?>
\ No newline at end of file
+?>
echo $q;
$db->update($q);
echo "<br>";
+// XXX hard coded, fix
$q="delete from nodes where node_vector like '020914480$noda%'";
echo $q;
$db->update($q);