dotherightthing
Forum Replies Created
-
Forum: Plugins
In reply to: [Plugin: NextGEN Gallery] extend imagebrowser tagUpdate: I was passing the image ID to the page via the URL in order to set the default imagebrowser image, but I found that this failed when the ID was > 2. Note sure what is going on here.
The imagebrowser urls are pretty crazy though, so I might try to code this functionality into the singlepic template.
Forum: Plugins
In reply to: [Plugin: NextGEN Gallery] extend imagebrowser tagTo get the dimensions you set in your NextGen options:
http://wordpress.org/support/topic/293899I’ll let you know if I find out how to get the dimensions of a particular image (to check whether it is landscape or portrait).
Dan
Forum: Themes and Templates
In reply to: [Plugin: NextGEN Gallery] Accessing ‘Image settings’ dimensionsI found the answer:
$ngg_options = nggGallery::get_option('ngg_options'); // from nggfunctions.php
echo( $ngg_options['imgWidth'] . 'x' . $ngg_options['imgHeight'] ); // eg '600x400'HTH someone π
Dan
Forum: Plugins
In reply to: [Plugin: NextGEN Gallery] extend imagebrowser tagHi dpaule,
I wanted the imagebrowser functionality, so this is what I did:
In /nggallery/lib/shortcodes.php – uncomment the two lines after:
// do_shortcode on the_excerpt could causes several unwanted output. Uncomment it on your own riskNow you can use the shortcodes in your PHP code.
So in this case you can copy the singlepic shortcode into the imagebrowser template.
In this case I first added the imagebrowser shortcode to my gallery template, /themes/mytheme/nggallery/gallery-mytemplate.php:
$img_id = 1; // id of the pic you'd like to display echo do_shortcode('[imagebrowser id="' . $img_id . '" template="mytemplate"]');Then I added the singlepic shortcode to my imagebrowser template, /themes/mytheme/nggallery/imagebrowser-mytemplate.php,
replacing:
<div class="pic"><?php echo $image->href_link ?></div>with:
<div class="pic"><?php echo do_shortcode('[singlepic id="' . $image->pid . '" h="321"]'); ?></div>I’m not sure how to dynamically pull the image width, so what I am doing is setting only the height dimension. This forces the browser to render the proportionate width. Not sure if there are any cross-browser issues here but it looked ok to me in Firefox 3.5, IE6 (Multi IE) and IE8.
HTH
Dan
Forum: Plugins
In reply to: Plugin [NextGEN Gallery] Image IDHi Gerben,
On the off chance that you are still wondering about this:
In /nggallery/lib/shortcodes.php – uncomment the two lines after:
// do_shortcode on the_excerpt could causes several unwanted output. Uncomment it on your own riskNow you can use the shortcodes in your PHP code.
So to output a gallery image based on its ID:
$img_id = $_GET["id"]; echo do_shortcode('[singlepic id="' . $img_id . '" w="600" h="400"]');Dan
Forum: Themes and Templates
In reply to: [Plugin: NextGEN Gallery] Accessing ‘Image settings’ dimensionsHave got the thumbnail dimensions code – I think this will do me for now:
$thumbwidth = $ngg_options[thumbwidth];
$thumbheight = $ngg_options[thumbheight];Forum: Plugins
In reply to: [Plugin: NextGEN Gallery] Nextgen gallery thumbnail images not being createdHi adamholz, not sure if I will be able to post the code here but I will give it a try. Excuse the code mess, it was my first attempt at adding a custom widget…
<?php
function dtrtrm1_custom_nav()
{
?>
<div id="nav">
<ul>
<li><?php if(is_home()) { echo '<strong>'; } ?><a href="<?php bloginfo('url'); ?>" title="Home">Home</a><?php if(is_home()) { echo '</strong>'; } ?></li>
<?php wp_list_pages('title_li=&depth=1&sort_column=menu_order'); ?>
</ul>
<div class="clear"></div>
</div>
<?php
}
add_filter( 'op_page_nav', 'dtrt_rm1_custom_nav' );
?>
<?php
function dtrtrm1_custom_nav_portfolios()
{
?>
<div id="nav">
<ul>
<li><?php if(is_home()) { echo '<strong>'; } ?><a href="<?php bloginfo('url'); ?>" title="Home">Home</a><?php if(is_home()) { echo '</strong>'; } ?></li>
<?php wp_list_pages('title_li=&depth=2&sort_column=menu_order'); ?>
</ul>
<div class="clear"></div>
</div>
<?php
}
add_filter( 'op_page_nav', 'dtrt_rm1_custom_nav' );
?>
Cheers
dForum: Plugins
In reply to: [Plugin: NextGEN Gallery] Nextgen gallery thumbnail images not being createdOk.. it looks like a custom nav function in my theme’s copy of functions.php was somehow causing the issue – have removed that code and the theme works fine now.
This function isn’t required any more so I can remove it, but it does make me feel a little anxious about customising other aspects of this site / other sites in the future.
I’ll do a full reinstall to confirm that this is the only change reqd.
Forum: Plugins
In reply to: [Plugin: NextGEN Gallery] Nextgen gallery thumbnail images not being createdGlad I found this post – the thumbnail generation issue has been driving me crazy!
For me, I upload a zip, then I get multiple errors of:
“
A failure occurred
[more]
1
“The thumbnails ARE created, but, as SteveT_AU mentioned, the thumbnail crops cannot be edited (for me the thumbnail shows on the right hand pane of the editor, but the full image does not appear on the left hand side of the editor).
After reading adamholz’s fix, I tried reverting to the default theme – and now thumbnail generation works fine!
I’d also be very keen to hear from someone who knows why this is!!