remove old readme
[atutor.git] / docs / mods / _standard / links / sublinks.php
1 <?php
2 if (!defined('AT_INCLUDE_PATH')) { exit; }
3
4 global $db;
5
6 $links_limit = 3;               //Numero massimo dei possibili sottocontenuti visualizzabili nella home-page
7
8 $sql = "SELECT * FROM ".TABLE_PREFIX."links L INNER JOIN ".TABLE_PREFIX."links_categories C ON C.cat_id = L.cat_id WHERE owner_id=$_SESSION[course_id] ORDER BY SubmitDate DESC LIMIT $links_limit";
9 $result = mysql_query($sql, $db);
10
11 if (mysql_num_rows($result) > 0) {
12         
13         while ($row = mysql_fetch_assoc($result)) {
14                 $list[] = '<a href="'.url_rewrite('mods/_standard/links/index.php?view='.$row['link_id'], AT_PRETTY_URL_IS_HEADER).'"'.
15                           (strlen($row['LinkName']) > SUBLINK_TEXT_LEN ? ' title="'.$row['LinkName'].'"' : '') .'>'. 
16                           AT_print(validate_length($row['LinkName'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'resource_links.LinkName') .'</a>'; 
17         }
18         return $list;   
19 } else {
20         return 0;
21 }
22 ?>