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
9 global $savant, $_config, $_base_href;
\r
11 //Get the list of entries associated with the current user
\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
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
27 echo '<em>'._AT('none_found').'</em>';
\r
32 $savant->assign('dropdown_contents', ob_get_contents());
\r
35 $savant->assign('title', _AT('plog_current'));
\r
36 $savant->display('include/box.tmpl.php');
\r