<?php plogger_get_header(); print '<div id="thumbnail_container">'; if (plogger_has_pictures()) { print '<div id="overlay"> </div>'; print '<ul class="slides">'; while (plogger_has_pictures()) { plogger_load_picture(); // display thumbnails within album // generate XHTML with thumbnail and link to picture view. $capt = plogger_get_picture_caption(); $img_id = "thumb-" . plogger_get_picture_id(); $imgtag = '<img id="' . $img_id . '" onmouseout="document.getElementById(\'overlay\').style.visibility = \'hidden\';" onmouseover="display_overlay(\'' . $img_id . '\', \'' . plogger_picture_comment_count() . '\')" class="photos" src="' . plogger_get_picture_thumb() . '" title="' . $capt . '" alt="' . $capt . '" />'; print '<li class="thumbnail"><div class="tag"><a href="' . plogger_get_picture_url() . '">' . $imgtag . "</a><br />"; print plogger_download_checkbox(plogger_get_picture_id()); print '</div></li>'; } print '</ul>'; } else { print '<div id="no-pictures-msg">There are no pictures in this album.</div>'; } print '</div>'; plogger_get_footer();
<?php while (plogger_has_pictures()) { plogger_load_picture(); // Find thumbnail width/height $thumb_info = plogger_get_thumbnail_info(); $thumb_width = $thumb_info['width']; // The width of the image. It is integer data type. $thumb_height = $thumb_info['height']; // The height of the image. It is an integer data type. $div_width = $thumb_width + 30; // Account for padding/border width $div_height = $thumb_height + 75; // Account for padding/border width // Generate XHTML with thumbnail and link to picture view $img_id = "thumb-" . plogger_get_picture_id(); $imgtag = '<img id="' . $img_id . '" onmouseout="document.getElementById(\'overlay\').style.visibility = \'hidden\';" onmouseover="display_overlay(\'' . $img_id . '\', \'' . plogger_picture_comment_count() . '\')" class="photos" src="' . plogger_get_picture_thumb() . '" width="' . $thumb_width . '" height="' . $thumb_height . '" title="' . plogger_get_picture_caption('clean') . '" alt="' . plogger_get_picture_caption('clean') . '" />'; ?> <li class="thumbnail"> <div class="tag" style="width: <?php echo $div_width; ?> px; height: <?php echo $div_height; ?> px;"> <a href="<?php echo plogger_get_picture_url(); ?> "><?php echo $imgtag; ?>
function plog_picture_manager($id, $from, $limit) { global $config, $empty; $output = ''; plogger_init_pictures(array('type' => 'album', 'value' => $id, 'from' => $from, 'limit' => $limit, 'sortby' => !empty($config['default_sortby']) ? $config['default_sortby'] : 'id', 'sortdir' => !empty($config['default_sortdir']) ? $config['default_sortdir'] : 'ASC')); // Create javascript initiation function for editable elements if (plogger_has_pictures()) { $output .= "\n\t\t" . '<script type="text/javascript">'; $output .= "\n\t\t\t" . 'Event.observe(window, \'load\', init, false);'; $output .= "\n\t\t\t" . 'function init() {' . "\n"; while (plogger_has_pictures()) { plogger_load_picture(); $output .= "\t\t\t\tmakeEditable('picture-description-" . plogger_get_picture_id() . "');\n\t\t\t\tmakeEditable('picture-caption-" . plogger_get_picture_id() . "');\n"; } $output .= "\t\t\t" . '}'; $output .= "\n\t\t" . '</script>'; } // Reset the picture array plogger_init_pictures(array('type' => 'album', 'value' => $id, 'from' => $from, 'limit' => $limit, 'sortby' => !empty($config['default_sortby']) ? $config['default_sortby'] : 'id', 'sortdir' => !empty($config['default_sortdir']) ? $config['default_sortdir'] : 'ASC')); if (plogger_has_pictures()) { $allow_comment = $config['allow_comments'] ? plog_tr('Allow Comments') : ' '; $output .= "\n\t\t" . '<table style="width: 100%;" cellpadding="3" cellspacing="0"> <col style="width: 15px;" /> <tr class="header"> <th class="table-header-left align-center width-15"><input name="allbox" type="checkbox" onclick="checkToggle(document.getElementById(\'contentList\'));" /></th> <th class="table-header-middle align-center width-150">' . plog_tr('Thumb') . '</th> <th class="table-header-middle align-left width-175">' . plog_tr('Filename') . '</th> <th class="table-header-middle align-left">' . plog_tr('Caption') . '/' . plog_tr('Description') . '</th> <th class="table-header-middle align-center width-125">' . $allow_comment . '</th> <th class="table-header-right align-center width-100">' . plog_tr('Actions') . '</th> </tr>'; $counter = 0; while (plogger_has_pictures()) { if ($counter % 2 == 0) { $table_row_color = 'color-1'; } else { $table_row_color = 'color-2'; } $counter++; plogger_load_picture(); $id = plogger_get_picture_id(); $output .= "\n\t\t\t" . '<tr class="' . $table_row_color . '">'; $output .= "\n\t\t\t\t" . '<td class="align-center width-15"><p class="margin-5"><input type="checkbox" name="selected[]" value="' . $id . '" /></p></td>'; $thumbpath = plogger_get_picture_thumb(); $imgtag = '<img src="' . $thumbpath . '" title="' . plogger_get_picture_caption('clean') . '" alt="' . plogger_get_picture_caption('clean') . '" />'; $output .= "\n\t\t\t\t" . '<td class="align-center width-150"><div class="img-shadow"><a href="' . plogger_get_picture_thumb(THUMB_LARGE) . '" rel="lightbox" title="' . plogger_get_picture_caption('code') . '">' . $imgtag . '</a></div></td>'; $output .= "\n\t\t\t\t" . '<td class="align-left width-175"><p class="margin-5"><strong><a href="' . $_SERVER['PHP_SELF'] . '?level=comments&id=' . $id . '">' . basename(plogger_get_source_picture_path()) . '</a></strong><br /><br /><span>' . sprintf(plog_tr('Comments: %d'), plogger_picture_comment_count()) . '</span></p></td>'; $output .= "\n\t\t\t\t" . '<td class="align-left vertical-top"> <p class="margin-5 no-margin-bottom"><strong>' . plog_tr('Caption') . ':</strong></p> <p class="margin-5 no-margin-top" id="picture-caption-' . plogger_get_picture_id() . '">' . plogger_get_picture_caption() . '</p> <p class="margin-5 no-margin-bottom"><strong>' . plog_tr('Description') . ':</strong></p> <p class="margin-5 no-margin-top" id="picture-description-' . plogger_get_picture_id() . '">' . plogger_get_picture_description() . '</p> </td>'; if ($config['allow_comments']) { $allow_comments = 1 == plogger_picture_allows_comments() ? plog_tr('Yes') : plog_tr('No'); } else { $allow_comments = ' '; } $output .= "\n\t\t\t\t" . '<td class="align-center width-125"><p class="margin-5">' . $allow_comments . '</p></td>'; $output .= "\n\t\t\t\t" . '<td class="align-center width-100"><p class="margin-5"><a href="?action=edit-picture&id=' . $id; if (isset($_GET['entries_per_page'])) { $output .= '&entries_per_page=' . intval($_GET['entries_per_page']); } if (isset($_GET['plog_page'])) { $output .= '&plog_page=' . intval($_GET['plog_page']); } $output .= '"><img style="display: inline;" src="' . $config['gallery_url'] . 'plog-admin/images/edit.gif" alt="' . plog_tr('Edit') . '" title="' . plog_tr('Edit') . '" /></a>'; $parent_id = $_REQUEST['id']; $output .= ' <a href="?action=move-delete&selected%5B%5D=' . $id . '&level=pictures&delete_checked=1&id=' . $parent_id; if (isset($_GET['plog_page'])) { $output .= '&plog_page=' . intval($_GET['plog_page']); } $output .= '" onclick="return confirm(\'' . plog_tr('Are you sure you want to delete this item?') . '\');"><img style="display: inline;" src="' . $config['gallery_url'] . 'plog-admin/images/x.gif" alt="' . plog_tr('Delete') . '" title="' . plog_tr('Delete') . '" /></a></p></td>'; $output .= "\n\t\t\t" . '</tr>'; } $output .= "\n\t\t\t" . '<tr class="footer"> <td class="align-left invert-selection" colspan="6"><a href="#" onclick="checkToggle(document.getElementById(\'contentList\')); return false;">' . plog_tr('Toggle Checkbox Selection') . '</a></td> </tr> </table>' . "\n"; } else { $output .= "\n\n\t\t" . '<p class="actions">' . sprintf(plog_tr('Sadly, there are no pictures yet. Why don\'t you <a title="upload images" href="%s" style="font-weight: bold;">upload some</a>?'), 'plog-upload.php') . '</p>' . "\n"; $empty = true; } return $output; }