TODO: SHA1 passwords
[mirrors/Kyberia-bloodline.git] / wwwroot / nodes.php
index 85fef19f6f4598e64f354434e537beee0dfbd893..427603f538c00a0e49b2fdb3653709f35e01f2ec 100644 (file)
@@ -6,6 +6,7 @@ if (!empty($_POST['FORCE_OB']) && $_POST['FORCE_OB'] == 'true') ob_start();
 //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
@@ -62,11 +63,11 @@ require(SMARTY_DIR.'Smarty.class.php');
 $smarty = new Smarty;
 
 //$smarty->php_handling = SMARTY_PHP_REMOVE; //XXX
-$smarty->template_dir = TEMPLATE_DIR.TEMPLATE_SET;
+$smarty->template_dir = TEMPLATE_DIR;
 //echo TEMPLATE_DIR.TEMPLATE_SET;
 //echo $smarty->template_dir;
-$smarty->compile_dir = SYSTEM_ROOT."data/templates_c/".TEMPLATE_SET;
-$smarty->config_dir = SMARTY_DIR.'configs/';
+$smarty->compile_dir = SYSTEM_DATA."templates_c/";
+$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;
@@ -342,17 +343,32 @@ if ($user_id=$_SESSION['user_id']) {
        $smarty->assign('bookstyl',$_SESSION['bookstyl']);
        $smarty->assign('fook',$_SESSION['fook']);
        $smarty->assign('user_id',$_SESSION['user_id']);
-       if (!empty($_SESSION['cube_vector'])) $smarty->assign('cube_vector',$_SESSION['cube_vector']);
+       if (!empty($_SESSION['cube_vector'])) 
+               $smarty->assign('cube_vector',$_SESSION['cube_vector']);
         $smarty->assign('friends',$_SESSION['friends']); //req by freezy, done by darkaural
        $smarty->assign('user_quota',$_SESSION['user_quota']);
-       $newmailset=$db->query("select user_mail,user_mail_name,user_k,k_wallet from users where user_id='$user_id'");
+
+       $newmail_q = sprintf('select u.user_mail_id
+                               , u.user_k
+                               , u.k_wallet
+                               , u.user_mail
+                               , ms.user_id as mail_sender_id
+                               , ms.login as mail_sender
+                               from users u
+                               left join users ms on ms.user_id = u.user_mail_id
+                               where u.user_id = %d',
+                               $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->next();
        $new_mail=$newmailset->getString('user_mail');
        $newmailset2 = $db->query("select users.user_mail_id,mailsender.login
  from users left join users as mailsender on users.user_mail_id = mailsender.user_id where users.user_id = '$user_id'");
        $newmailset2->next();
        $smarty->assign('new_mail',$new_mail);
-       $smarty->assign('new_mail_name',$newmailset->getString('user_mail_name'));
+       $smarty->assign('new_mail_name',$newmailset->getString('mail_sender'));
        $smarty->assign('new_mail_name2',$newmailset2->getString('login'));
        $user_k=$newmailset->getString('user_k');
        $smarty->assign('user_k',$user_k);
This page took 0.107003 seconds and 4 git commands to generate.