3 function smarty_function_get_bookmarks($brawco,&$smarty) {
5 if (is_numeric($brawco['node_id'])) $bookcat=$brawco['node_id'];
6 if (is_numeric($brawco['user_id'])) $user_id=$brawco['user_id'];
9 //returning user specific bookmarks
11 $q="select * from node_access left join nodes on node_access.node_id=nodes.node_id where user_id='$user_id' and node_bookmark='yes' and nodes.node_system_access='public'";
13 while ($set->next()) {
14 $array[]=$set->getRecord();
16 $smarty->assign('get_bookmarks',$array);
20 //returning my own bookmarks divided in categories
21 $q="select distinct bookmark_category,nodes.* from node_access left join nodes on node_access.bookmark_category=nodes.node_id where user_id='".$_SESSION['user_id']."' and node_bookmark='yes' order by node_name";
22 $result=$db->query($q);
23 while ($result->next()) {
24 $categories[$result->getString('node_id')]=$result->getRecord();
27 $q="select * from node_access left join nodes on node_access.node_id=nodes.node_id where user_id='".$_SESSION['user_id']."' and node_bookmark='yes' and node_name is not NULL ";
28 if ($bookcat) $q.=" and (bookmark_category='$bookcat' or bookmark_category=0 or bookmark_category IS NULL) order by node_name desc";
29 if ($bookcat && $_SESSION['user_id']==548) echo $q;
31 else $q.="order by node_name";
32 $result=$db->query($q);
34 while ($result->next()) {
35 if (!$result->getString('bookmark_category')) {
36 $categories['unsorted']['children'][]=$result->getRecord();
37 $categories['unsorted']['sum']+
=$result->getString('node_user_subchild_count');
40 $categories[$result->getString('bookmark_category')]['children'][]=$result->getRecord();
41 $categories[$result->getString('bookmark_category')]['sum']+
=$result->getString('node_user_subchild_count');
45 $smarty->assign('get_bookmarks',$categories);
49 while ($result->next()) {
50 $bookmarks[]=$result->getRecord();
52 $smarty->assign('get_bookmarks',$bookmarks);
This page took 0.324825 seconds and 4 git commands to generate.