X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=wwwroot%2Fnodes.php;h=5e757b5516545f2fd431200bc703d93f33b2dea3;hb=3a3a699727ba9d72a102fae436571666b20b29fb;hp=22ec5fc1dbe0da8e42de021ce7f53e2c9665df51;hpb=9850bdc46997f51024a8e6d2dc183e8745eacf78;p=mirrors%2FKyberia-bloodline.git diff --git a/wwwroot/nodes.php b/wwwroot/nodes.php index 22ec5fc..5e757b5 100644 --- a/wwwroot/nodes.php +++ b/wwwroot/nodes.php @@ -5,9 +5,6 @@ if (!empty($_POST['FORCE_OB']) && $_POST['FORCE_OB'] == 'true') ob_start(); //header("Location: http://web.archive.org/web/20020925021139/http://kyberia.sk"); //echo "je to uz uplne v pici. vsetky data su stratene, prajem pekny den :)"; //exit; -error_reporting(1); -$_SESSION['debugging']=1; -//exit; //starting timer for benchmarking purposes $timer_start=Time()+SubStr(MicroTime(),0,8); @@ -15,6 +12,10 @@ $timer_start=Time()+SubStr(MicroTime(),0,8); //setting PHPSESSID cookie and starting user session session_start(); +error_reporting(1); +//$_SESSION['debugging']=1; +//exit; + if ($_SESSION['debugging']) { @@ -31,8 +32,10 @@ if ($_SESSION['debugging']) { require('config/config.inc'); require(INCLUDE_DIR.'senate.inc'); -preg_match("/id\/(.*)\//",$_SERVER['HTTP_REFERER'],$ref_match); -$referer_id=$ref_match[1]; +if (isset($_SERVER['HTTP_REFERER'])) { + preg_match("/id\/([0-9]*)\//",$_SERVER['HTTP_REFERER'],$ref_match); + $referer_id=$ref_match[1]; +} //connecting to database and creating universal $db object require(INCLUDE_DIR.'log.inc'); @@ -42,7 +45,6 @@ require(INCLUDE_DIR.'error_messages.inc'); require(INCLUDE_DIR.'database.inc'); $db = new CLASS_DATABASE(); -//$logger = new logger; //XXX if (!empty($_GET['template_id'])) { $template_id=$_GET['template_id']; @@ -54,7 +56,7 @@ if (!empty($_GET['node_name'])) { $node = nodes::redirByName($_GET['node_name']); } elseif (!empty($_GET['node_id'])) { - $node = nodes::getNodeById($_GET['node_id'],$_SESSION['user_id']); + $node = nodes::getNodeById($_GET['node_id'],(isset($_SESSION['user_id']))?$_SESSION['user_id']:''); } //XXX Paths are wrong (!) @@ -67,7 +69,7 @@ $smarty->template_dir = TEMPLATE_DIR; //echo TEMPLATE_DIR.TEMPLATE_SET; //echo $smarty->template_dir; $smarty->compile_dir = SYSTEM_DATA."templates_c/"; -$smarty->config_dir = SMARTY_DIR.'configs/'; #XXX neexistuje +$smarty->config_dir = SMARTY_DIR.'configs/'; //XXX neexistuje $smarty->cache_dir = SMARTY_DIR.'cache/'; $smarty->plugins_dir = SMARTY_PLUGIN_DIR ; if ($_SESSION['debugging']) $smarty->debugging=true; @@ -84,9 +86,11 @@ if ($_SESSION['debugging']) { echo ""; } -if ($node['node_creator']==$_SESSION['user_id']) $node['node_permission']='owner'; +if ((isset($_SESSION['user_id']) && ($node['node_creator']==$_SESSION['user_id']))) { + $node['node_permission']='owner'; +} -if ($_SESSION['cube_vector']) { +if (isset($_SESSION['cube_vector']) && ($_SESSION['cube_vector'])) { if (strpos($node['node_vector'],$_SESSION['cube_vector'])===false) { echo "node::".$node['node_vector']; echo "cube_Vector::".$_SESSION['cube_vector']; @@ -109,14 +113,16 @@ if (empty($node)) { } } -//modifying node glass pearl -if (is_array($children_types[$node['node_type']])) $smarty->assign('children_types',$children_types[$node['node_type']]); +//modifying node glass pearl //XXX WTF +if (is_array($children_types[$node['node_type']])) { + $smarty->assign('children_types',$children_types[$node['node_type']]); +} $smarty->assign('types',$types); //$node['node_type']=$types[$node['node_type']]; -$node['node_content']=StripSlashes($node['node_content']); -$node['node_name']=StripSlashes($node['node_name']); +$node['node_content']= StripSlashes($node['node_content']); +$node['node_name']= StripSlashes($node['node_name']); //checking permissions function _checkPermissions() @@ -276,7 +282,7 @@ elseif ($transaction) { if ($permissions['r']) { //these 4 lines are not the source of kyberia lagging problems. leave them. started on the 10.4. data gained will be used for scientific purposes -if ($_SESSION['user_id']) { +if ((isset($_SESSION['user_id'])) && ($_SESSION['user_id'])) { $q="insert delayed into levenshtein set user_id='".$_SESSION['user_id']."',node_id='".$node['node_id']."'"; $db->update($q); } @@ -337,7 +343,7 @@ else { //assigning user data to smarty if user logged in -if ($user_id=$_SESSION['user_id']) { +if (isset($_SESSION['user_id'])&($user_id=$_SESSION['user_id'])) { $smarty->assign('_POST',$_POST); $smarty->assign('bookmarks',$_SESSION['bookmarks']); $smarty->assign('ignore',$_SESSION['ignore']); @@ -361,7 +367,7 @@ if ($user_id=$_SESSION['user_id']) { $user_id); $newmailset = $db->query($newmail_q); -# $newmailset=$db->query("select user_mail,user_mail_name,user_k,k_wallet from users where user_id='$user_id'"); +//$newmailset=$db->query("select user_mail,user_mail_name,user_k,k_wallet from users where user_id='$user_id'"); $newmailset->next(); $new_mail=$newmailset->getString('user_mail'); @@ -428,7 +434,7 @@ else { } -if ($node['template_id']!='2019721'){ +if (($node['template_id']!='2019721') & (isset($_SESSION['user_id']))){ //setting user location $q="update users set last_action=NOW(),user_location_vector='".$node['node_vector']."',user_action='".addslashes($node['node_name'])."',user_action_id='".$node['node_id']."' where user_id='".$_SESSION['user_id']."'"; $db->executequery($q); @@ -545,7 +551,7 @@ if ($node['external_link']=='header://svg' && !is_numeric($template_id)) { } //show own header -elseif ($_SESSION['header_id']==true) { +elseif (isset($_SESSION['header_id']) & ($_SESSION['header_id']==true)) { $smarty->assign('header_id',$_SESSION['header_id']); $smarty->template_dir=OWN_TEMPLATE_DIR; $content=$smarty->fetch($_SESSION['header_id'].".tpl");