<?php
function display() {
- /*global $node,$db,$error,$referer_id;
+ global $node,$db,$error,$referer_id,$smarty,$permissions,$template_id;
if (!$referer_id) $referer_id=1;
$node_id=$node['node_id'];
- $user_id=$_SESSION['user_id'];*/
-
- return false;
-}
-
-//XXX TODO: CELY TOHLE JE HACK A JE POTREBA TO NARVAT DO FUNKCE display() nahore...////
+ $user_id=$_SESSION['user_id'];
if ($permissions['r']) {
// }
// }
-// DO NOT MESS WITH THIS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-//creating neural network
-$db->update("update nodes set node_views=node_views+1 where node_id='".$node['node_id']."'");
-if (isset($referer_id) && is_numeric($referer_id)) {
- $q="update neurons set synapse=synapse+1 where dst='".$node['node_id']."' and src='$referer_id'";
- $result=$db->update($q);
- if (!$result) {
- $q="insert into neurons set synapse_creator='".$_SESSION['user_id']."',dst='".$node['node_id']."',src='$referer_id',synapse=1";
- $db->query($q);
- }
-}
-
-
-elseif (!$permissions['r'] && $_GET['magic_word']) {
- $magic_word_big=$_GET['magic_word'];
-
- if ( preg_match("/(\d+)-(.+)/",$_GET['magic_word'],$mu)) {
- $magic_uid=$mu['1'];
- $magic_word=addslashes($mu['2']);
- // XXX WTF column magic_word does not exists
- $q="select login from users where user_id='$magic_uid' and magic_word='$magic_word'";
- $set=$db->query($q);
- if ($set->getNumRows()) {
- $permissions['r']=true;
- }
- }
-}
-
-
-
-
-
-else {
- logger::log('enter',$node['node_id'],'failed');
-}
-
-
//assigning user data to smarty if user logged in
if (isset($_SESSION['user_id'])&&($user_id=$_SESSION['user_id'])) {
$smarty->assign('node_json',json_encode($node));
}
else {
-
$smarty->assign('node',$node);
//new templates by Dark matter
$smarty->template_dir=OWN_TEMPLATE_DIR;
}
//end of displaying
+ return true;
+}