davesnothere
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: WordPress could not establish a secure connection to WordPress.org.My server is online and I don’t have an SSL certificate. Do I need one?
Forum: Fixing WordPress
In reply to: How do I create content not managed by WP?That’s what I was doing wrong, I was putting it into my wp-content directory. Duh. Thanks.
Forum: Fixing WordPress
In reply to: Problems getting subdirectory install workingHooray!!!
That did it. 100 internets for you today.
Forum: Fixing WordPress
In reply to: Problems getting subdirectory install workingCopied.
The index.php in wordpress has:
require('./wp-blog-header.php');
and the one in the root has:
require('./wp/wp-blog-header.php');.htaccess in WP and in root (yes, they’re the same and ‘wp’ is the correct dir name:
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase /wp/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-dLast, General Settings are:
‘WP Address’ http://gen.macunboxed.com/wp
‘Site Address’ http://gen.macunboxed.comI sent you an email thru your website form. Let’s take this offlist to figure out what is going on.
My initial guess is that the pathing isn’t correct. Do you have a URL I can look at? Or, post the code?
Let’s look at the code again, with comments; maybe you can figure out what isn’t working for you.
First, I noticed when I added
var_dump($galleries);, and after some digging, that the path for the large image is nearly identical to the path for the thumbnail, previewurl. Only, the large image isn’t available to me in $galleries (It is avaiable in $images, but that’s useless to us here as $images isn’t available in this php file.)<?php foreach ($galleries as $gallery) : //this lets me look at each entry in the galleries array, and reference it as gallery $pattern = '@thumbs/thumbs_@'; //here is the difference in the path between the thumbs and regular image. I could also write this as '/thumbs\/thumbs_/' but that looks awkward, so I took advantage of perl's ability to use any character to limit the search. $gallery_image = preg_replace($pattern, '', $gallery->previewurl); //define the new path to use below for the full size image. By default, previewurl is the thumb of the first image in the gallery. ?> <p class="swapImage { sin: ['#poster:<?php echo $gallery_image ?>'], sout: ['#poster:<?php echo $gallery_image ?>'] }"><a href="<?php echo $gallery->pagelink ?>"><?php echo $gallery->title ?></a></p> <?php endforeach; ?>Try this, substitute the following code:
<?php foreach ($galleries as $gallery) : ?> <p class="swapImage { sin: ['#poster:<?php echo $gallery->previewurl ?>'], sout: ['#poster:<?php echo $gallery->previewurl ?>'] }"><a href="<?php echo $gallery->pagelink ?>"><?php echo $gallery->title ?></a></p> <?php endforeach; ?>You’ll get the thumbnail. If that doesn’t work, I’ll have to look at your page or your code to help more.
Sorry, I was out of town for the weekend.
Here’s what I did:
I created a page in the admin area, and put the following:
[album id=5 template=list]I then modified one of the existing templates, extended I believe, saved it as ‘wp-content/pluging/nextgen-gallery/view/album-list.php’. Here’s the file:
<?php /** Template Page for the album overview (extended) Follow variables are useable : $album : Contain information about the album $galleries : Contain all galleries inside this album $pagination : Contain the pagination content You can check the content when you insert the tag <?php var_dump($variable) ?> If you would like to show the timestamp of the image ,you can use <?php echo $exif['created_timestamp'] ?> **/ ?> <?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($galleries)) : ?> <div class="ngg-albumoverview"> <!-- List of galleries --> <h2><?php echo $album->name ?></h2> <?php echo $album->albumdesc ?> <div> <?php foreach ($galleries as $gallery) : $pattern = '@thumbs/thumbs_@'; $gallery_image = preg_replace($pattern, '', $gallery->previewurl); ?> <p class="swapImage { sin: ['#poster:<?php echo $gallery_image ?>'], sout: ['#poster:<?php echo $gallery_image ?>'] }"><a href="<?php echo $gallery->pagelink ?>"><?php echo $gallery->title ?></a></p> <?php endforeach; ?> </div> <!-- Pagination --> <?php echo $pagination ?> </div> <?php endif; ?> </div> <div id="rightcol"> <p><img id="poster" src="wp-content/uploads/2010/10/blank.gif" alt="" height="400" /></p>The code at the bottom is the div on the right where the image loads. A bit sloppy, but I was already way over budget at the time, and had to be quick and dirty.
The rollover event itself is handled by jquery. Read my comments on this thread to get jquery working on your page without breaking things: http://wordpress.org/support/topic/adding-your-own-js-without-breaking-wp-plugin-js-scripts?replies=3
As for $gallery->previewurl, it’s set somewhere else (by the nextgen code), and I’m just leveraging that. At the end of your php file, put in:
var_dump($galleries);That will give you a listing of all the variables available to you. That’s what the comment ” You can check the content when you insert the tag <?php var_dump($variable) ?>” is talking about. This thread might help some as well: http://wordpress.org/support/topic/plugin-nextgen-gallery-list-of-options?replies=7What I did around line 22 of the large chunk of code I pasted above:
<?php foreach ($galleries as $gallery) : $pattern = '@thumbs/thumbs_@'; $gallery_image = preg_replace($pattern, '', $gallery->previewurl); ?>is walked the $galleries array (provided by the nextgen engine), and stripped out some of the pathing to make things work.
HTH
Valid as in does it validate? Didn’t bother to check. It works, and what is posted is the same code I am using for the page you are viewing. I haven’t had any errors from it; although, I didn’t check for IE6 compatability on this project, since the client didn’t pay for it.
that would be in nggfunctions.php ln 172
Removing
if ( !$picturelist ) return __('[Gallery not found]','nggallery');Does what I wanted.
Forum: Plugins
In reply to: [Plugin: NextGEN Gallery] No back link once in a gallerymadjax’s post at the bottom of this thread is a simple solution (requires javascript) http://wordpress.org/support/topic/plugin-nextgen-gallery-gallery-title-and-back-link-hack?replies=7
You need to modify the gallery.php file. I believe around line 20 or so. I went the other way, but play around near code looking like this
?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($gallery)) : ?> <div class="ngg-galleryoverview" id="<?php echo $gallery->anchor ?>"> <div id="gallery-heading"> <h3><?php echo $gallery->title?></h3> </div> <div id="gallery-description"> <?php echo $gallery->description ?> </div>I believe that’s handled in the backend:
Gallery > Options > Slideshow > Duration timeYou need to add
<? echo $image->filename ?>to the gallery.php file. probably about line 40 or so. I’ve modified mine a bit, but here’s how my code looks, to give you an idea on where it goes:<?php foreach ( $images as $image ) : ?> <div id="ngg-image-<?php echo $image->pid ?>" class="ngg-gallery-thumbnail-box" <?php echo $image->style ?> > <div class="ngg-gallery-thumbnail" > <a href="<?php echo $image->imageURL ?>" title="<?php echo $image->description ?>" <?php echo $image->thumbcode ?> > <?php if ( !$image->hidden ) { ?> <img title="<?php echo $image->alttext ?>" alt="<?php echo $image->alttext ?>" src="<?php echo $image->thumbnailURL ?>" <?php echo $image->size ?> /> <?php } ?> </a><? echo $image->filename ?> </div> </div> <?php if ( $image->hidden ) continue; if ( $gallery->columns > 0 && ++$i % $gallery->columns == 0 ) { print '<br style="clear: both" />'; } endforeach; ?>Also, you can try
<?php var_dump($gallery) ?><?php var_dump($images) ?>to see everything you can access.Is there something specific you are trying to do?