function widget($args, $instance)
    {
        extract($args, EXTR_SKIP);
        echo $before_widget;
        ?>
		<!-- Additional Images -->
		<?php 
        if ($images = jhp_get_gallery_images(null, 100, 60, true)) {
            ?>
			<h4>Gallery</h4>
			<script type="text/javascript">jQuery().ready( function() { jQuery("a[rel=lightbox]").lightBox(); });</script>
			<div id="jh-portfolio-additional-images">
			<?php 
            foreach ($images as $id => $image) {
                ?>
			    <a rel="lightbox" href="<?php 
                echo jhp_get_gallery_image($id, 800, 600);
                ?>
"><img src="<?php 
                echo $image;
                ?>
" rel="<?php 
                echo $id;
                ?>
" /></a>
			<?php 
            }
            ?>
			</div>
		<?php 
        }
        ?>
		
		<?php 
        echo $after_widget;
    }
Example #2
0
function jhp_gallery_meta_box($post)
{
    $images = jhp_get_gallery_images($post, 150, 150, true);
    $image_ids = jhp_get_gallery_ids($post);
    ?>
	<style>
		.image-wrapper { text-align: center; display: block; padding: 5px; border: 1px solid #DFDFDF; float: left; margin-right: 7px; margin-bottom: 7px; }
		.image-wrapper img { display: block; }
	</style>
	<p style="display: block; float: right">
		<?php 
    tj_register_custom_media_button('jhp_gallery_images', 'Gallery Image', true, true, 150, 150);
    ?>
		<a class="add-image button thickbox" onclick="return false;" title="Add Image" href="media-upload.php?button=jhp_gallery_images&amp;multiple=yes&amp;type=image&amp;TB_iframe=true&amp;width=640&amp;height=197">
			Add Gallery Image
		</a>
		<input type="hidden" name="jhp_gallery_images" id="jhp_gallery_images" value="<?php 
    echo implode(',', jhp_get_gallery_ids($post));
    ?>
" />
	</p>
	
	<div style="padding: 0 10px; float: left;" id="jhp_gallery_images_container">
		<?php 
    if ($image_ids) {
        ?>
		
			<?php 
        foreach ($image_ids as $id) {
            ?>
				<span class="image-wrapper" id="<?php 
            echo $id;
            ?>
"><img src="<?php 
            echo $images[$id];
            ?>
" />
				<a class="delete_custom_image" rel="jhp_gallery_images:<?php 
            echo $id;
            ?>
">Delete</a> | </span>
			<?php 
        }
        ?>
		
		<?php 
    } else {
        ?>
			<p class="empty-message">No Gallery Images Added <?php 
        if ($url = jhp_get_url($post)) {
            ?>
| <a href="<?php 
            echo $url;
            ?>
" target="_blank">Screenshot your site now</a><?php 
        }
        ?>
</p>
		<?php 
    }
    ?>
	</div>
	<div style="clear: both;" /></div>
	<?php 
}