X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=wwwroot%2Fbackend%2Fmysql%2Fbackend.inc;h=971bb104bd3a7aba4f2f97bbfcd87c67b6789d00;hb=91b49c827b74b7c432b1fced7fc93df5121becbf;hp=563caf63c9de6ced2b7ea313e1ed62793b4ec0c0;hpb=637e2914f5777984c69b5df67f012de9059dbb11;p=mirrors%2FKyberia-bloodline.git diff --git a/wwwroot/backend/mysql/backend.inc b/wwwroot/backend/mysql/backend.inc index 563caf6..971bb10 100644 --- a/wwwroot/backend/mysql/backend.inc +++ b/wwwroot/backend/mysql/backend.inc @@ -586,7 +586,7 @@ public static function getLinkedNodes($node_id,$orderby,$offset,$listing_amount) if ((!is_numeric($node_id)) or (!is_numeric($offset)) or (!is_numeric($listing_amount))) - { return -1; } // XXX check return value by caller? + { return false; } // XXX check return value by caller? $orderby=db_escape_string($orderby); $q="select neurons.synapse_created,node_content,author.login,linker.login as linker,nodes.* from neurons @@ -604,38 +604,19 @@ public static function getLinkedNodes($node_id,$orderby,$offset,$listing_amount) $array['node_created']=$array['synapse_created']; $get_linked_nodes[]=$array; } - return $get_linked_nodes; + return (isset($get_linked_nodes) ? $get_linked_nodes : false); } // getThreadedChildren -// XXX -// XXX FUCKING MESS, argh -// returns XXX -// if ($limit > DEF_MAX_GET_THREADED_CHILDREN) -// $limit = DEF_MAX_GET_THREADED_CHILDREN; -// -// // XXX this should go to separate function -// -// if (!empty($params['search'])) { -// if ($params['search_type']=='content') $sql_type.=" and node_content like '%".addslashes($params['search'])."%' "; -// else { -// $q2="select user_id from users where login='".$params['search']."'"; -// $userset=$db->query($q2); -// $userset->next(); -// $id=$userset->getString('user_id'); -// $sql_type=" and nodes.node_creator='$id'"; -// } -// -// } - - -public static function getThreadedChildren($offset,$limit,$orderby,$time,$synapse_time,$security,$link,$search,$search_param) { +public static function getThreadedChildren($node_id,$node_vector,$offset,$limit,$orderby,$time,$synapse_time,$security,$link,$search,$search_param) { global $db; $sql_synapse=""; $sql_type=""; + $sql_time=""; + if ($synapse_time) { $sql_synapse.=" and node_created >'".db_escape_string($synapse_time)."'"; } if ($orderby=='' OR $orderby=='desc') { @@ -662,7 +643,7 @@ public static function getThreadedChildren($offset,$limit,$orderby,$time,$synaps } - + $q=""; if ($link=='yes') $q.="("; $q.="select nodes.node_id,node_name,node_external_access,external_link,node_parent, node_system_access,node_children_count,node_creator,node_created,lastchild_created, @@ -670,8 +651,8 @@ public static function getThreadedChildren($offset,$limit,$orderby,$time,$synaps length(node_vector) as depth,users.login,node_vector, node_content,'' as synapse_creator from nodes left join users on users.user_id=nodes.node_creator - where $sql_time node_vector like '".$node['node_vector']."%' $sql_type - and node_id != '".$node['node_id']."' $security + where $sql_time node_vector like '".$node_vector."%' $sql_type + and node_id != '".$node_id."' $security order by $orderby LIMIT $offset,$limit"; if ($link=='yes') { @@ -683,8 +664,8 @@ public static function getThreadedChildren($offset,$limit,$orderby,$time,$synaps from neurons left join nodes on neurons.src=nodes.node_id left join users on users.user_id=nodes.node_creator - where $sql_time dst_vector like '".$node['node_vector']."%' $sql_synapse $sql_type - and node_id != '".$node['node_id']."' order by $orderby LIMIT $offset,$limit)"; + where $sql_time dst_vector like '".$node_vector."%' $sql_synapse $sql_type + and node_id != '".$node_id."' order by $orderby LIMIT $offset,$limit)"; } if ($link=='yes') $q.=" order by $orderby LIMIT $limit"; @@ -702,6 +683,22 @@ public static function getThreadedChildren($offset,$limit,$orderby,$time,$synaps return $get_children_array; } +// XXX + +public static function getPoll($user_id,$poll_id) { + global $db; + + $set=$db->query("select nodes.*,node_access.node_permission from nodes + left join node_access on (nodes.node_id=node_access.node_id and node_access.user_id='$user_id') + where node_parent='$poll_id' and template_id='1549834' order by node_id desc limit 1"); + + $set->next(); + $array=$set->getRecord(); + + return $array; +} + + } ?>