print_string('errornoimages', 'lightboxgallery'); } print_simple_box_end(); if ($gallery->perpage) { print_paging_bar(count($allimages), $page, $gallery->perpage, $CFG->wwwroot . '/mod/lightboxgallery/view.php?id=' . $cm->id . '&' . ($editing ? 'editing=1&' : '')); } $showtags = !in_array('tag', explode(',', get_config('lightboxgallery', 'disabledplugins'))); if (!$editing && $showtags) { $sql = 'SELECT description FROM ' . $CFG->prefix . 'lightboxgallery_image_meta WHERE gallery = ' . $gallery->id . ' AND metatype = \'tag\' GROUP BY description ORDER BY COUNT(description) DESC, description ASC'; if ($tags = get_records_sql($sql, 0, 10)) { lightboxgallery_print_tags(get_string('tagspopular', 'lightboxgallery'), $tags, $course->id, $gallery->id); } } $options = array(); if ($gallery->folder && has_capability('mod/lightboxgallery:addimage', $context)) { $options[] = '<a href="' . $CFG->wwwroot . '/mod/lightboxgallery/imageadd.php?id=' . $gallery->id . '">' . get_string('addimage', 'lightboxgallery') . '</a>'; } if ($gallery->comments && has_capability('mod/lightboxgallery:addcomment', $context)) { $options[] = '<a href="' . $CFG->wwwroot . '/mod/lightboxgallery/comment.php?id=' . $gallery->id . '">' . get_string('addcomment', 'lightboxgallery') . '</a>'; } if (count($options) > 0) { echo '<div style="text-align:center; font-size: 0.8em;">' . implode(' | ', $options) . '</div>'; } if (!$editing && $gallery->comments && has_capability('mod/lightboxgallery:viewcomments', $context)) { if ($comments = get_records('lightboxgallery_comments', 'gallery', $gallery->id, 'timemodified DESC')) { foreach ($comments as $comment) {
print_heading('<a href="' . $CFG->wwwroot . '/mod/lightboxgallery/view.php?l=' . $gallery->id . '">' . $gallery->name . '</a>'); print_simple_box_start('center'); } $imagelabel = lightboxgallery_resize_label($image->image); echo '<div class="thumb"> <div class="image"><a class="overlay" href="' . $webroot . '/' . $image->image . '" rel="lightbox[search-result]" title="' . ($image->metatype == 'caption' ? s($image->description) : $image->image) . '">' . lightboxgallery_image_thumbnail($gallery->course, $gallery, $image->image) . '</a></div> ' . $imagelabel . ' </div>'; $imagesdisplay[] = "'{$image->lid}{$image->image}'"; } print_simple_box_end(); if (count($imagesdisplay) > 0) { $sql = 'SELECT description FROM ' . $CFG->prefix . 'lightboxgallery_image_meta WHERE CONCAT(gallery, image) IN (' . implode(',', $imagesdisplay) . ') AND description != \'' . $search . '\' AND metatype = \'tag\' GROUP BY description ORDER BY COUNT(description) DESC, description ASC'; if ($tags = get_records_sql($sql, 0, 10)) { lightboxgallery_print_tags(get_string('tagsrelated', 'lightboxgallery'), $tags, $course->id, $l); } } } else { echo '<br />'; print_simple_box(get_string('errornosearchresults', 'lightboxgallery'), 'center'); } print_footer($course); ?>