changed git call from https to git readonly
[atutor.git] / mods / plog / side_menu.inc.php
1 <?php\r
2 /*\r
3 This is a simple ATutor sidemenu block for LifeType/pLog blog application. I gathers\r
4 the lastest10 posts form the course currently being viewed, as well as private posts, and posts\r
5 form other enrolled courses specific to the current users.\r
6 */\r
7 \r
8 \r
9 global $savant, $_config, $_base_href;\r
10 ob_start(); \r
11 //Get the list of entries associated with the current user\r
12 \r
13 $sql = "SELECT id, user_id,blog_id FROM ".PLOG_PREFIX."articles WHERE user_id = '$_SESSION[member_id]' OR blog_id='$_SESSION[course_id]' ORDER BY date DESC LIMIT 10";\r
14 $result = mysql_query($sql,$db);\r
15 \r
16 if(mysql_num_rows($result) > 0){\r
17         echo '<ul style="margin-left:-2em;">';\r
18         while($row = mysql_fetch_array($result)){\r
19                 $sql2 = "SELECT * FROM ".PLOG_PREFIX."articles_text WHERE article_id = '$row[0]'";\r
20                 $result2 = mysql_query($sql2,$db);\r
21                 while($row2 = mysql_fetch_array($result2)){\r
22                         echo '<li><a href="'.$_base_href.'mods/plog/index.php?blogId='.$row[2]. SEP.'op=ViewArticle'.SEP.'article_Id='.$row[0].'">'.$row2[3].'</a></li>';\r
23                 }\r
24         }\r
25 echo '</ul>';\r
26  }else{\r
27         echo '<em>'._AT('none_found').'</em>';\r
28  }\r
29 ?>\r
30 \r
31 <?php\r
32 $savant->assign('dropdown_contents', ob_get_contents());\r
33 ob_end_clean();\r
34 \r
35 $savant->assign('title', _AT('plog_current'));\r
36 $savant->display('include/box.tmpl.php');\r
37 \r
38 ?>