2 function smarty_function_get_bookmarks($brawco,&$smarty) {
4 if (is_numeric($brawco['node_id'])) $bookcat=$brawco['node_id'];
5 if (is_numeric($brawco['user_id'])) $user_id=$brawco['user_id'];
8 //returning user specific bookmarks
10 $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'";
12 while ($set->next()) {
13 $array[]=$set->getRecord();
15 $smarty->assign('get_bookmarks',$array);
19 //returning my own bookmarks divided in categories
20 $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";
21 $result=$db->query($q);
22 while ($result->next()) {
23 $categories[$result->getString('node_id')]=$result->getRecord();
26 $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'";
27 if ($bookcat) $q.=" and (bookmark_category='$bookcat' or bookmark_category=0 or bookmark_category IS NULL) order by node_name desc";
28 if ($bookcat && $_SESSION['user_id']==548) echo $q;
30 else $q.="order by node_name";
31 $result=$db->query($q);
33 while ($result->next()) {
34 if (!$result->getString('bookmark_category')) {
35 $categories['unsorted']['children'][]=$result->getRecord();
36 $categories['unsorted']['sum']+
=$result->getString('node_user_subchild_count');
39 $categories[$result->getString('bookmark_category')]['children'][]=$result->getRecord();
40 $categories[$result->getString('bookmark_category')]['sum']+
=$result->getString('node_user_subchild_count');
44 $smarty->assign('get_bookmarks',$categories);
48 while ($result->next()) {
49 $bookmarks[]=$result->getRecord();
51 $smarty->assign('get_bookmarks',$bookmarks);
This page took 0.379765 seconds and 4 git commands to generate.