query('SELECT ma.author_name FROM biblio_author AS ba LEFT JOIN mst_author AS ma ON ba.author_id=ma.author_id WHERE ba.biblio_id='.$biblio_id); if ($query->num_rows > 0) { $author = ''; while ($data = $query->fetch_row()) { $author .= $data[0]; $author .= ' - '; } // remove last strip $author = substr_replace($author, '', -2); return $author; } } function biblioSimpleList($criteria, $limit, $header_title) { global $sysconf; global $dbs; $book_q = $dbs->query('SELECT biblio_id, title, notes, image FROM biblio '.$criteria.' LIMIT '.$limit.''); $output = ''; if ($book_q->num_rows > 0) { $output .= '
'; $output .= '
'; $output .= '

'.$header_title.'

'; $output .= '
'; while ($book = $book_q->fetch_assoc()) { // cover images var $image_cover = ''; if ($sysconf['tg']['type'] == 'minigalnano') { if (!empty($book['image']) && !defined('LIGHTWEIGHT_MODE')) { $book_image = urlencode($book['image']); $image_loc = '../../images/docs/'.$book_image; } else { $image_loc = '../../images/default/image.png'; } $thumb_url = './lib/minigalnano/createthumb.php?filename='.urlencode($image_loc).'&width=120'; $image_cover = ''.$book['title'].''; } $len = strlen($book['notes']); $lencut = 300; $notes = $book['notes']; if ($len > $lencut) { if (preg_match('/^.{1,300}\b/s', $notes, $match)) { $notes = $match[0].' ...'; } } $output .= '
'; $output .= '
'; $output .= '
'.$image_cover.'
'; $output .= '

'.$book['title'].'

'; $output .= '
'.getAuthors($book['biblio_id']).'
'; $output .= '
'.$notes.'
'; $output .= '
'; } $output .= '
'; } return $output; }