function nodes::GetUserSubmissionsChildren() created, need to write some usefull...
authorHarvie <tomas@mudrunka.cz>
Mon, 16 May 2011 02:14:55 +0000 (04:14 +0200)
committerHarvie <tomas@mudrunka.cz>
Mon, 16 May 2011 03:38:27 +0000 (05:38 +0200)
wwwroot/backend/mysql/backend.inc
wwwroot/inc/result.inc
wwwroot/inc/smarty/node_methodz/function.get_user_submissions_children.php

index daba57b314d00aced86904a748ebd0d60c94d845..0dc22dcfe951d351c5c3610d4ad39258274dcfbf 100644 (file)
@@ -261,7 +261,7 @@ function getChildrenNodes($orderby="desc",$offset=0,$limit=DEFAULT_LISTING_AMOUN
        $q="select users.*,nodes.* from nodes
 left join users on users.user_id=nodes.node_creator where
 node_parent='$node_handle' order by node_created $orderby LIMIT $offset,$limit";
-       echo $q;
+       #echo $q;
        $result=$db->query($q);
 
        while ($result->next()) {
@@ -273,6 +273,23 @@ node_parent='$node_handle' order by node_created $orderby LIMIT $offset,$limit";
 }
 
 
+function GetUserSubmissionsChildren($user_id,$limit=23,$offset=0,$orderby='') {
+  global $db;
+
+         $q="select users.*,nodes.* from nodes
+left join users on users.user_id=nodes.node_creator where
+node_creator='$user_id' order by node_created $orderby LIMIT $offset,$limit";
+       //$q="select * from nodes LIMIT 10,10";
+  #echo $q;
+  $result=$db->query($q);
+
+  while ($result->next()) {
+    $array[]=addBase36id($result->getRecord());
+  }
+
+  return $array;
+}
+
 function getThreadedChildrenNodes($orderby="desc",$offset=0,$limit=DEFAULT_LISTING_AMOUNT) {
        global $db, $error, $node;
        $node_handle=$node['node_id'];
index ab421a612c789458d810246fc78b3c4879b7b48c..e37c118cdc14907ffdcc2e187b61afc64e9b7581 100644 (file)
@@ -44,7 +44,7 @@ class result extends PDOStatement {
        }
 
        function getInt($column) {      //DEPRECATED!!! Use $this->fetch(); instead!!!
-               $this->getString(); //Dynamic typing OMG...
+               $this->getString($column); //Dynamic typing OMG...
        }
 
        function getNumRows() { //DEPRECATED!!! Use $this->rowCount(); instead!!!
index 8e320752cac26fcd0c4f8199f853747a5dc09c81..68d7482c18adc58b566e7eb4714b4697fb1c3e13 100644 (file)
@@ -4,11 +4,11 @@
 \r
 function smarty_function_get_user_submissions_children($params, &$smarty) {\r
 \r
-       if (!isset($_SESSION['user_id')\r
+       if (isset($_SESSION['user_id']))\r
                $user_id = $_SESSION['user_id'];\r
        else\r
                return -1;\r
-\r
+/*\r
        if (!isset($params['listing_amount']))\r
                $listing_amount = DEFAULT_LISTING_AMMOUNT;\r
        else\r
@@ -23,10 +23,9 @@ function smarty_function_get_user_submissions_children($params, &$smarty) {
                $order_by = $params['order_by'];\r
        else\r
                $order_by = 'node_id';\r
-\r
-       $replies=nodes::GetUserSubmissionsChildren($user_id,$listing_ammount,$offset,$order_by);\r
-\r
+*/\r
+       $replies=nodes::GetUserSubmissionsChildren($user_id /*,$listing_ammount,$offset,$order_by*/ );\r
        $smarty->assign('get_user_submissions_children', $replies);\r
+\r
 }\r
 \r
-?>\r
This page took 0.433734 seconds and 4 git commands to generate.