- Make PATH_INFO not changing contents of $_GET[] (it should affect some other variable instead - requires complex rewrite)
- Switch completely to Base36 (Templates, Links, don't change $_GET[], queries should convert between base10 in db and base36 in kyberia automatically, etc...)
-- (IMHO we should use SHA1 or stronger algorithm instead of MD5 for storing passwords)
- (I've implemented this partially. We can now login using various hash algorithms, it's backward compatible, but we still need to edit registration/password changing to use SHA1 when updating passwords in DB)
-
- Rename all files&directories that should not be rewrited to PATH_INFO to start with "_" (and if they should be also ignored by git they should start with "-")
(Rename images to _images - and fix hardcoded stuff...)
(Mark all nodes that should become part of distribution of kyberia software)
(Delete unused tables)
(Replace duplicit tables with VIEWs)
+
+- Image uploading not working (?)
+
+- put "setParent" everywhere
// Simple internal function to set node parrent
-function setParent($params) {
+function setParent($node_id,$parent_id) {
global $db,$node,$error,$error_messages;
- $parent_id=$params['node_parent'];
- $node_id=$params['node_id'];
if (!is_numeric($parent_id)) {
return false;
}
- $q="select node_vector from nodes where node_id='$parent_id'";
- $parent_vector=$db->query($q);
- $new_vector=$parent_vector.str_pad($node_id,VECTOR_CHARS,"0",STR_PAD_LEFT);
+ $q="select node_vector from nodes where node_id='$parent_id'";
+ $set=$db->query($q);
+ $set->next();
+ $parent_vector=$set->getString('node_vector');
+ $new_vector=$parent_vector.str_pad($node_id,VECTOR_CHARS,"0",STR_PAD_LEFT);
+
$q="update nodes set node_parent='$parent_id',node_vector='".$new_vector."
' where node_id='$node_id'";
$db->query($q);
// ouch!! this is gonna be dirty!!!!! will be revised later:-)
// XXX hardcoded, rewrite
-$q="update nodes set node_parent=".REGISTRATION_REQUEST_NODE.", node_vector='000001010473807402091448$userid' where node_id='$userid'";
-$db->update($q);
-
+//$q="update nodes set node_parent=".REGISTRATION_REQUEST_NODE.", node_vector='000001010473807402091448$userid' where node_id='$userid'";
+//$db->update($q);
-// $params['node_parent']=REGISTRATION_REQUEST_NODE;
-// $params['node_id']=$userid;
-// nodes::setParent($params);
+nodes::setParent($userid,REGISTRATION_REQUEST_NODE);
$q="update nodes set node_children_count=node_children_count+1 where node_id=".REGISTRATION_REQUEST_NODE;