NextGEN FlashViewer 1.4 Beta 2

So, it’s time for the second beta. Nothing much has changed, except that you now have a few extra variable values for $gallery to use in gallery templates. With these you can add links to all the various viewers on top of any gallery.

Option 1 – Changes by hand

First of all you will have to change something to a NextGEN Gallery core file, nggfunctions.php. Use FTP to get yourself a copy of that file and open it in your favorite editor, like Dreamweaver. Scroll down to about line 254 until you find these two lines:

254
255
// look for gallery-$template.php or pure gallery.php
$filename = ( empty($template) ) ? 'gallery' : 'gallery-' . $template;

Change these lines so that they look like this:

254
255
256
// look for gallery-$template.php or pure gallery.php
$filename = ( empty($template) ) ? 'gallery' : 'gallery-' . $template;
$gallery     = apply_filters( 'ngg_gallery_object', $gallery, $galleryID );

Then upload nggfunctions.php to your NextGEN Gallery folder in wp-content/plugins/.

Option 2 – TortoiseSVN

Another way to do this would be to work with the latest alpha release of NextGEN Gallery, where Alex has made the necessary changes already. This can be downloaded via SVN from Google Code. First of all you need a copy of TortoiseSVN (Windows only, although I’m sure you could find something similar for a Mac). Install it and then create a new folder somewhere on your computer. Right click on it, scroll down until you hit “SVN Checkout”. In the next window, write this line into “URL of repository”:

http://nextgen-gallery.googlecode.com/svn/trunk/

Leave the rest of the options like they are and click OK. This will compile the latest developement version of NextGEN Gallery for you.

It’s important to note that you cannot use this compiled version as is. SVN adds a lot of files that tell it about little changes in the files, so the next time you want to get the latest files it only downloads what actually changed. To get yourself a working copy you need to export the files like so: Right-click on the NextGEN Gallery folder->TortoiseSVN->Export… Then chose a folder into which to put the exported files and click ok. Now all those little helper files have been removed and you’ve got yourself a working copy which you can now upload to your plugins directory.

How to take advantage of those extra variable values…

Download gallery.php from whatever folder you keep your templates in (either ‘view’ in the NGG folder or ‘nggallery’ in your theme folder). The original looks like this:

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php if ($gallery->show_slideshow) { ?>
	<!-- Slideshow link -->
	<div class="slideshowlink">
		<a class="slideshowlink" href="<?php echo $gallery->slideshow_link ?>">
			<?php echo $gallery->slideshow_link_text ?>
		</a>
	</div>
<?php } ?>
 
<?php if ($gallery->show_piclens) { ?>
	<!-- Piclense link -->
	<div class="piclenselink">
		<a class="piclenselink" href="<?php echo $gallery->piclens_link ?>">
			<?php _e('[View with PicLens]','nggallery'); ?>
		</a>
	</div>
<?php } ?>

Now change it to look like this:

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php if ($gallery->show_slideshow) { ?>
	<!-- Slideshow link -->
	<div class="slideshowlink">
		<a class="slideshowlink" href="<?php echo $gallery->slideshow_link ?>">
			<?php echo $gallery->slideshow_link_text ?>
		</a>
	</div>
<?php } ?>
 
<?php if ($gallery->show_simple_link) { ?>
	<!-- SimpleViewer link -->
	<div class="slideshowlink">
		<a class="slideshowlink" href="<?php echo $gallery->simple_link ?>">
			<?php echo $gallery->simple_link_text ?>
		</a>
	</div>
<?php } ?>
 
<?php if ($gallery->show_piclens) { ?>
	<!-- Piclense link -->
	<div class="piclenselink">
		<a class="piclenselink" href="<?php echo $gallery->piclens_link ?>">
			<?php _e('[View with PicLens]','nggallery'); ?>
		</a>
	</div>
<?php } ?>

Lines 28-35 are the link for SimpleViewer. Of course you can add as many viewers as you like or change the HTML around. You can find the other variable values by adding this line to gallery.php and then refreshing your browser (don’t forget to delete this line later on):

<?php var_dump($gallery); ?>

Now, all you need is to download the new beta below and test some features. Of yourse, I’d like to know your opinions, any bugs or just what you liked. Please use the forum post for any bugs by following the link at the end of this post. Cheers, Boris!

EDIT: Please go to this post to download the latest beta release!

NextGEN FlashViewer 1.4 Beta 2 NextGEN FlashViewer 1.4 Beta 2, 299.02 KB Join the forum discussion on this post - (1) Posts

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">