Sidebar Block contains broken link

chadparry
chadparry's picture

Joined: 2008-05-30
Posts: 38
Posted: Wed, 2008-07-09 20:47

Clicking on the WPG2 thumbnails on my blog was giving me a Not Found error.

I am using WPG2 3.0.6 on Wordpress 2.5.1. I elected to show a Sidebar Block containing a random image. I also created a blog post that contained an embedded image. (See http://chadandelisa.parry.org/blog/archives/its-getting-hot).

The image thumbnails showed up correctly. But clicking on them doesn't go to the correct Gallery2 page. The problem was that the link generated by the wpg2imageblock template was "http://chadandelisa.parry.org/blog/v/In+and+Around+Zurich+2007/IMG_4382.JPG.html" instead of "http://chadandelisa.parry.org/album/v/In+and+Around+Zurich+2007/IMG_4382.JPG.html".

I dug around through the source a little, and decided that the problem was that the template specified "forceFullUrl" when it really meant "forceDirect". I'm not sure how this code works for other people, but I suspect that a simple flag change like this is necessary, and it just needs to be done so that it won't break any configurations that are currently working. Below is the diff for the fix that I am now running on my site.

--- wpg2/templates/wpg2imageblock.tpl.orig      2008-07-09 13:24:37.000000000 -0700
+++ wpg2/templates/wpg2imageblock.tpl   2008-07-09 13:23:52.000000000 -0700
@@ -29,9 +29,9 @@
   {capture assign="linkHref"}{strip}
     {if empty($block.link)}
        {if empty($block.lightboxid)}
-               {g->url arg1="view=core.ShowItem" arg2="itemId=`$block.id`" forceFullUrl=true}
+               {g->url arg1="view=core.ShowItem" arg2="itemId=`$block.id`" forceDirect=true}
        {else}
-               {g->url arg1="view=core.DownloadItem" arg2="itemId=`$block.lightboxid`" forceFullUrl=true}
+               {g->url arg1="view=core.DownloadItem" arg2="itemId=`$block.lightboxid`" forceDirect=true}
        {/if}
     {elseif $block.link != 'none'}
       {$block.link}
 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Fri, 2008-07-11 03:26

chadparry,

Although your solution may have appeared to correct your issue I suspect it has just just covered it up. The ForceFUllURL changes the URL's that Gallery2 is building to a full URL not a URL relative to Gallery2. I am not 100% sure what exactly the forceredirect is doing, I never used that before..

Your issue will be in the rewrite rules (the /v/) not in the template. Easy test would be to disable the Gallery2 rewrite module and see if the links worked then..

____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo

 
trbailey
trbailey's picture

Joined: 2007-04-16
Posts: 172
Posted: Tue, 2008-07-15 01:19

Ozgreg,

I have a similar issue here as well but I haven't tried to hack it.

After reloading the gallery database, the g2 data directory and futzing with it over and over again, I finally noticed I had the wrong host name in the gallery path... :(
It seems to work fine now.
Some People's CHILDREN!
Author:Blog|Site

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Tue, 2008-07-15 02:18

Can you post a screenprint of the wrong path.. I be interested to see what path it is being determined.

trbailey wrote:
Ozgreg,

I have a similar issue here as well but I haven't tried to hack it.

After reloading the gallery database, the g2 data directory and futzing with it over and over again, I finally noticed I had the wrong host name in the gallery path... :(
It seems to work fine now.
Some People's CHILDREN!
Author:Blog|Site

____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo

 
trbailey
trbailey's picture

Joined: 2007-04-16
Posts: 172
Posted: Tue, 2008-07-15 14:18

You could just check your personal mail here, and see for yourself. Or click here: http://trbailey.net/Galleryscreenprint.png

WP & Gallery2 are in separate directories in the web root. They are configured in Apache under a Virtual Host named "home". So the proper url for each is home.trbailey.net/xxx Since the plugin can't find the gallery without help (there's more than one anyway) I have to enter the url. I entered www. trbailey.net/fga when it should have been home.trbailey.net/fga

I was wrong about it being fixed, pictures still don't appear sometimes but clearing the cache fixes it for a while, and I still get a security violation if I try the broken link in a new tab. I really don't want to have to reload all albums for this Gallery, there are 3000 of them and some are really big, but if that's what it takes. I have quite a few images referenced in articles that would require repair.

After a bit of fiddling I find that WPG2 is unable to log in to the gallery correctly. I have a small test box that I setup for testing. I'm seeing extensive swapping and RAM use and I've noted an issue with max_clients in my log so let me test it before I actually cry for help. This may have nothing to do with your plugin.

I'm curious why you wanted a screenshot. Activating the plugin does not find the gallery so it's kind of a moot point. But, if you want to see what it looks like, click this link: http://trbailey.net/Galleryscreenprint1.png

Author:Blog|Site

 
chadparry
chadparry's picture

Joined: 2008-05-30
Posts: 38
Posted: Tue, 2008-07-15 19:23

I had already tried this with the rewrite module disabled, and the links were still broken. All the links were prefixed with http://chadandelisa.parry.org/blog/ instead of http://chadandelisa.parry.org/album/.

The documentation doesn't really say much about what the "forceDirect" flag is for. (Note that it's forceDirect, not forceRedirect). But when I was tracing through the code, I noticed that it is responsible for making sure the Gallery2 path is used as the base URL instead of the Wordpress path. Here is a sample comment from GalleryUrlGenerator.class:

     * @param boolean $forceDirect (optional) if true, ensure Gallery base URL is returned
     *        (different when embedded)

I suspect that the "forceFullUrl" flag is not needed. If Wordpress and Gallery2 share the same host, then a relative URL is sufficient. And if they do not share the same host, then a full URL will be generated anyway even without that flag. If the flag is needed for some configurations, then specifying both flags would work best.

 
trbailey
trbailey's picture

Joined: 2007-04-16
Posts: 172
Posted: Wed, 2008-07-16 05:06

Ozgreg, it's my gallery2 installation. If I link to a different version (on a localnet test box) it works fine. I can't even successfully login to gallery2 now so it's definitely messed up. I have a working backup so I'll just move it and all will be well!
Thanks.
Author:Blog|Site

 
trbailey
trbailey's picture

Joined: 2007-04-16
Posts: 172
Posted: Wed, 2008-07-16 06:18

Notes that may be of interest:

My original gallery2/wpg2 was working fine. I don't know what changed. I moved the entire thing to a testbed box running Debian Lenny (testing), copied the data directory, the gallery code and the database and ran the install. After upgrading to Wordpress 2.6 it started working fine. My attempt to upgrade on the production box failed, apparently due to having activated a maintenance mode plugin. It ran fine on the testing box and images began appearing in articles and on the sidebar grid. I tested it for a while and was able to temporarily point the production WPG2 to the testing box and it worked OK as well, which rules out Wordpress as the culprit.

To get to the point, it's the upgrade to WP 2.6 that seems to have resolved the issue.
Any ideas why?
Did I miss an upgrade notification about versions?

Thanks for working so hard on this plugin, it's AWESOME. I'd like to make a similar plugin for The Next Geneeration of Genealogy but until recently the TNG code made it very difficult. Apparently version 7 is out so I'll have a look. I'd like to be able to embed [token] type tags in articles and have the plugin replace them with fixed TNG searches or TNG reports so users can easily mix pictures and genealogy data in genealogy articles. A bit off topic but you can respond in private if you are a personal history buff...

Author:Blog|Site

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Thu, 2008-07-17 04:01
chadparry wrote:
I had already tried this with the rewrite module disabled, and the links were still broken. All the links were prefixed with http://chadandelisa.parry.org/blog/ instead of http://chadandelisa.parry.org/album/.

I would expect to see those links.. WPG2 makes the links relative to the Wordpress Blog not Relative to Gallery2, the links however should be routed via WPG2 page and certainly not returning a 404..

 
trbailey
trbailey's picture

Joined: 2007-04-16
Posts: 172
Posted: Thu, 2008-07-17 12:00

Jumping in here, perhaps I can be of some assistance with the link issue. I have more time to respond and ozgreg can comment if I mess up, like posting an out of context screenshot ;)

chadparry: it looks like your blog seems to work OK. But, this should work and it does not: http://chadandelisa.parry.org/blog/wpg2
And, understanding leads to awareness. Perhaps you misunderstand how the WPG2 plugin operates. Since the majority of the Gallery2 installation is independent code, meaning it's references from the installed codebase to album data are relative (see MulitSite and MulitRoot options) the plugin basically executes the appropriate gallery2 library functions for you. Therefore the url for most of the functions is from your blog location through a Wordpress hook the authors have called WPG2. The only exception I've seen is for hotlinked (directly referenced) images which seems to use the a link directly to the item (see gallery2 Get Item URL's module). The older plugin used a single php file named wp-gallery2.php if I recall correctly. The contents of that file have now been integrated deeper into the plugin and attached to the page slug WPG2 inside wordpress. Gallery2 uses php classes for much of it's code base, which has some distinct advantages for a product like this. So, when you are requesting an embedded page, the contents need to be fetched using WPG2, not directly from the gallery code base location.
Why?
The WPG2 plugin has to integrate the output so it matches the embedded environment. To do this it needs to have some custom css, (see wpdirectory/wp-contents/plugins/wpg2) gallery user login/logout, user synchronization, and other well written functions. Additionally there is a rewrite module that changes the DISPLAYED url so the url looks like it's part of the embedded environment.

Example: I have a gallery installation at /fga and an embedded environment at /home relative to my web root. All my Wordpress content begins with /home and when WPG2 is working, so do all it's url's with the exception of the hotlinked items mentioned above.
See: http://home.trbailey.net/home/
See: http://home.trbailey.net/home/wpg2
See: http://home.trbailey.net/home/v/seasonal
See: http://home.trbailey.net/home/wpg2?g2_itemId=4421

The first url is for the wordpress index page.
The second uses the special PAGE slug WPG2 which has been taken over by the WPG2 plugin for it's own use. You should see a page in your wp-admin titled 'Gallery' with the page slug 'wpg2'. If you edit the page you'll see the descriptor text indicating what it's there for. You can change the title, but not the page slug.
The third url is a public gallery album I have for various wallpapers, formatted using the URL Rewriter.
The fourth url references the exact same gallery page as the url above it but without the rewriter to make it look better and hide the session id's so both people and search engines don't get lost...

If you can't reach your gallery pages using just your WPBlog url plus WPG2 (httx://yourhost/blog/wpg2), your plugin is not installed correctly.

Experience has taught me to go slow. This is how I make sure it works:
First I go to the gallery installation using it's installation url (/fga in my example above) and configure but don't enable the URL REWRITER module.
Next I go to the wp-admin interface and setup my Permalinks. This writes appropriate rewriter code in the blog .htaccess file
Third I enable the WPG2 plugin, knowing it won't find my gallery because it's in a parallel web directory.
Fourth I enter ONLY the full url to the gallery installation I want to embed in the top line of the WPG2 PATHS screen and press "Validate". In my case this url is http://www.trbailey.net/fga/main.php
Once the plugin validates the installation I test to be sure I can get to my gallery root with /home/wpg2'
Then navigate back the the gallery2 installation and enable the rewriter, but only after it's working.
Finally I return to the WPG2 screen and enable the Gallery2 Rewrites option. The rewriter then writes additional rules to the blog .htaccess, usually above the wordpress rules. It will also write rules to the gallery .htaccess so it's a good thing to have the gallery rewriter working but disabled. This version of the plugin will enable it for you. If it says safe, I think it just removes the rewriter rules in the blog .htaccess so the gallery rewriter still works.

There are many things that can get messed up along the way. If you are in a hosted environment you may not be able to use the rewriter. Some IPS's either don't know how or are simply unable due to url complexity to enable the apache2 rewrite module.

Hope this helps.

Author:Blog|Site

 
trbailey
trbailey's picture

Joined: 2007-04-16
Posts: 172
Posted: Sun, 2008-07-20 09:15

Additional comment:
After looking at your blog, I see you have "hotwired" the entire embedded gallery. How you managed to get the login working is beyond me, unless all your photos are publicly viewable. None of that is necessary. I can take the two archives from Wordpress and Gallery, install each, install WPG2, enable the wordpressembedded gallery theme and have a working blog in just under two hours in a hosted environment. I can do it in 15 minutes on my local net (my server is local) so it seems you've gone to an enormous bit of trouble to get this to work when you didn't need to. There is also Gallery2 Demo Sites that has some fine examples, most of them require only a few lines of code to make a very nice custom embedded gallery.

The intent behind the WPG2 plugin is to "embed" the output in the space normally reserved for articles.
The latest version can be downloaded from this articles: http://gallery.menalto.com/node/71531

If I'm correct you've already got wordpressembedded installed, from the looks of your /album url. If you have the color pack module installed you can easily apply colors to many gallery2 theme's so less modification is necessary. At the bottom of the the wordpressembedded theme window is a color pack drop down box containing Gold Leaf, it looks like this when installed. You can change those colors using style sheets following the directions here: http://codex.gallery2.org/Category:Integration:WPG2_Options which explains all the different css files you can use.

You'll probably need to unpack a fresh copy of the WPG2 archive and work on getting it to validate correctly.
Also, be aware that you can bypass the wpg2 output code by changing the option on the WPG2 major WPG2 minor menu in Wordpress Admin. See here: http://home.trbailey.net/wpg2admin.png for a screen shot. There are many other examples on the WPG2 Codex.

If you can't get WPG2 to validate, post back here and myself or ozgreg or somebody will help further.

I like the gallery2 theme you have at /album, what theme is that?
It looks like a mixture of Siriux and Classic. Is that NZDI?
Again, hope this helps.

Author:Blog|Site

 
foreachloop

Joined: 2007-10-30
Posts: 8
Posted: Sun, 2008-07-20 06:06

Hello guys, I have the exact the same problem and couldn't solve :(, the correct URL of my imageblock on Wordpress sidebar should be
http://www.foreachloop.com/photography/main.php?g2_itemId=286 but instead it shows
http://www.foreachloop.com/blog/wpg2?g2_itemId=286
I have tried turning off the G2 rewrite module but I get 404 not found error. I deleted the WPG2 plugin folder and reinstalled but no luck. :(
Did I miss something here..thank you for your time.

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Sun, 2008-07-20 08:44
foreachloop wrote:
Hello guys, I have the exact the same problem and couldn't solve :(, the correct URL of my imageblock on Wordpress sidebar should be
http://www.foreachloop.com/photography/main.php?g2_itemId=286 but instead it shows
http://www.foreachloop.com/blog/wpg2?g2_itemId=286
I have tried turning off the G2 rewrite module but I get 404 not found error. I deleted the WPG2 plugin folder and reinstalled but no luck. :(
Did I miss something here..thank you for your time.

Not sure how you have managed to do this but your path to Gallery2 is wrong in the Wordpress -> WPG2 -> WPG2 Paths

http://www.foreacloop.com/photography/main.php

It should be -> http://www.foreachloop.com/photography/main.php

____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo

 
trbailey
trbailey's picture

Joined: 2007-04-16
Posts: 172
Posted: Sun, 2008-07-20 08:59

It sounds like your Gallery2 or Wordpress installation path is messed up somewhere. I'm using the exact same copy of the software and it works fine for me, and thousands of other people.

You can try the following:
First I'd check permissions. I use a local network to write files to my web directories so any new files are owned by root. In a hosted environment this may not be an issue unless you use a different permission scheme. In my setup the webserver owns all webserver files so I use:
#chown -R www-data:www-data /var/www

But it may be different on your setup. If you aren't sure you can run the /gallery2/lib/tools interface to check or reset them.

Then:
Disable WPG2
Turn off permalinks in WP (set to numeric default)
Then turn off rewrites in gallery2 using a direct link to the admin interface
Then unless you have custom rewriter rules, open each .htaccess file (plural) in both Wordpress and Gallery2 directories and delete the contents, saving them empty.
Clear performance pages and ALL caches in Gallery2 or delete your /g2data/smarty and /g2data/cache directories

Then add permalinks back in WP and TEST posts and SEARCH plus a known 404 page.

I noticed with the Robots Meta plugin, an automatic upgrade messed up ALL the settings. One of them seems to screw up WPG2 output & the rewriter.
I just did this yesterday so I'm sure it works.

Test the gallery rewrite module to be sure it's working correctly, then leave it turned OFF. The plugin turns it off anyway.
Then enable WPG2, setting a full http path to the gallery installation and let the plugin write the absolute and relative paths.

Then, one at a time, load and resave each screen of settings in the WPG2 menu in Wordpress and be sure Lightbox or Slimbox is disabled for debugging. Why this helped I'm not sure but it cured the issue for me.

Clear browser cache and try it again.

I also noticed that Lightbox script messes up the installation sometimes, depending on your theme.

I've been through this with three different galleries over the past month and they all work fine once they are reinitialized.

This may be overkill but it always seems to work for me when things get messed up.

Author:Blog|Site

 
foreachloop

Joined: 2007-10-30
Posts: 8
Posted: Sun, 2008-07-20 17:50

oh man, there was a stupid mistake that I made! Thank you so much!! But I had tried different WPG2 path quite a few times didn't fix the problem, could it possible I made typo mistakes every time, but anyway now it works like a charm! Yay! :) :)

 
chadparry
chadparry's picture

Joined: 2008-05-30
Posts: 38
Posted: Mon, 2008-07-21 11:58

Thanks Tom. You were right on two counts. 1) I misunderstood the nature of the redirection code. I didn't realize the links were supposed to point to the WPG2 page. 2) My plugin is not installed correctly and so my WPG2 page doesn't work.

I'll follow your steps to get this working again. Since I use a multi-site installation, sometimes it takes some extra work to get redirects functioning like they should. It will be a little while before I post any results. (I'm in Russia this week).

My theme is based on Classic. I just modified breadcrumbing and the default feed, and then I borrowed some visual elements from Siriux. You're welcome to see the changes if you like anything--I copied it to FullOfIt Theme.

 
chadparry
chadparry's picture

Joined: 2008-05-30
Posts: 38
Posted: Fri, 2008-08-01 14:26

I noticed that I didn't have a WPG2 page at all. I must have thought it was superfluous and deleted it. So I disabled the plugin and reenalbed it, and now everything is working fine. I like the idea of having one canonical URL for my photo album, so I set up redirects from the WPG2 page to my normal album URL. Now I'm happy with the setup. Thanks for the help.

 
trbailey
trbailey's picture

Joined: 2007-04-16
Posts: 172
Posted: Fri, 2008-08-01 15:24
chadparry wrote:
I noticed that I didn't have a WPG2 page at all. I must have thought it was superfluous and deleted it. So I disabled the plugin and reenalbed it, and now everything is working fine. I like the idea of having one canonical URL for my photo album, so I set up redirects from the WPG2 page to my normal album URL. Now I'm happy with the setup. Thanks for the help.

First, your "/album" fix doesn't seem to work. Half your images are little slits which usually indicates a security issue with WPG2 so whatever you did, it's not showing up correctly when I use /blog/wpg2
see: http://chadandelisa.parry.org/album/v/HolyLand2008/Petra/IMG_2998.JPG.html
And I suspect it will get worse as life goes on...

What do you mean you setup "redirects" to your "normal album url". The normal wpg2 url is similar to the gallery url, only the base is different. You don't HAVE to use wpg2 to view the gallery, but, you won't be logged in as a wordpress user.

If you don't want to use the Wordpress theme wrapper there is an option to turn it off in the WPG2 plugin. It then just logs you in and opens the gallery without any embedding (wpg2header.php, wpg2.css etc). Also, if add to or alter the rewriter code in either gallery or wordpress directories or edit the theme variables you may end up with issues later on, like images not appearing. Plus, upgrading will mess up your setup and you may end up rewriting much of what you've done. If it's really an issue you may be able to alter the rewriter rules to make it LOOK like you're in /album but it they would be overwritten soon enough...

If the url is that big a deal, move your /blog (entire wordpress) directory to /album/blog and set a new blog address location in wp-admin in Wordpress. Wordpress then adds a rewriter rule to make /album/blog be just /album, then all your urls will be based on /album But, be aware that you need to turn OFF all rewriters before you move the thing, then you'll need to edit the wordpress url in it's database or it won't run. See: http://codex.wordpress.org/Changing_The_Site_URL

I guess I don't understand why the normal WPG2 URL's are an issue for you. Maybe you can elaborate for me & the other curious?

Author:Blog|Site

 
chadparry
chadparry's picture

Joined: 2008-05-30
Posts: 38
Posted: Sat, 2008-08-02 22:35

The main goal of my redirects is to keep the URLs short & descriptive & permanent. It only makes sense to me that my blog is at "/blog/" and my album is at "/album/". And then I like to have individual blog posts and individual pictures with short human-readable names for addresses. (WordPress does a good job of supporting that, and Gallery2 does OK). So I don't want to have a blog at "/album/blog/" or an album at "/blog/wpg2/".

It sounds like one of the issues you think I will have is with security. I admit that it would be nice to restrict certain albums to certain WordPress users. I haven't worried about that in the past because my albums are all public. But I like the idea. I might change my redirects to support that, so that browsers think that they are visiting "/album/main.php" but my scripts think the user requested "/blog/wpg2".

So far though, I am content with my current setup. I occasionally have a broken thumbnail (like the one you found), but I'm not sure how to fix those. That particular thumbnail, for example, had been broken for 3 months before I even installed WPG2.

Thanks again for checking out my site and sending comments.

 
trbailey
trbailey's picture

Joined: 2007-04-16
Posts: 172
Posted: Sun, 2008-08-03 01:31

chadparry:
The reason the WPG2 url is based from the blog is that the plugin "embeds" gallery in the blog. When it's working correctly there is no apparent distinction. Only you know behind the scenes that they are separate applications. Note that for this reason it's appropriate to disable the gallery "register" module to prevent new users in gallery itself. All users should be added or changed through wordpress once WPG2 is enabled.

From what I've seen ALL your photos are public which is the ONLY reason the images show up at all. Your well intended "redirects" effectively bypass WPG2 altogether.

WPG2 doesn't just add a 'hotlink' to a gallery items, it delivers the content just like gallery would, with all gallery's options including outstanding security.

WPG2 also solves the issues associated with having two separate user name bases. It adds a gallery user for each and every wordpress user and assigns that gallery user their wordpress password so it can login and deliver the content appropriate for that wordpress user. Once you enable WPG2 you really shouldn't be even running the gallery from it's base url except for minor admin functions.
If you add a gallery user there won't be a corresponding wordpress user unless you set one up, but then you'll have to rebuild the WPG2 user list to synch them or any photos they add won't validate correctly in WPG2. For that reason the WPG2 team makes certain recommendations regarding WPG2 and gallery. Either install, activate and use WPG2 as it was intended, without intervening redirects, or disable it and use 'hotlinked', public gallery images. You can get the hotlink url using the "Formatted URL's" plugin. Just enable it and make sure you have "Item Actions" in your theme for photos.

If all you want is to rewrite the URL, add a rewrite rule block after all other WPG2 rules to change the /blog/v/galleryimage url to /album/v/galleryimage being careful not to snag any wordpress urls in the logic. It might be better to add rules AFTER both WPG2 and Wordpress rewrite rules.

If you add that rule to the END of the .htaccess AFTER the WPG2 & WP rewriter is enabled it will stay there and won't be over written by wordpress or gallery or WPG2. Just wrap it in ## and add a reminder. No promises this will work on your system but it could be done in a few lines, similar to this after all other rules at the BOTTOM of your .htaccess file in your wordpress directory:

## Custom rewrite rules ##
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /wordpress-directory-from-web-root/
    ##probably /album/ 

    RewriteCond %{REQUEST_URI} !/album/wpg2$ [OR]
    RewriteCond %{REQUEST_URI} !/album/v/$   [OR]
    RewriteCond %{REQUEST_URI} !/album/d/$
    RewriteRule .   -   [L]
</IfModule>

Basically this says:
If the URI part pertaining to this directory (wordpress) is headed for a wpg2 page and it does not begin with /album, ... make it begin with /album ...I think.

I haven't tested it, I think it might need more. The last line is mysterious to me because I'm not yet a fully fledged webmaster or yet an Apache mod_rewrite guru.

Rewrite rules are for webmasters, spiritual gurus, the very needy, the very patient, or the very curious.

I don't think this ruleset will break gallery security. If this won't work you can edit the rewrite rules at the risk of them being overwritten by WPG2. Note that this is NOT a redirect, it's a url rewrite rule. It sends the user to the same page using a different url, thereby retaining gallery security. You can Google Apache mod_rewrite for more help.

If you would like to demo a WPG2 site that works correctly, send email to siggma at trbailey dot net and I'll send you the url, a user name and a password for a site with images that are both private and pubic, and you can login and logout and test it to see how it works. Then you will have more information and you can decide if you want to continue using a bypassed WPG2, sending search engines confusing url's and heading your website vehicle towards a ditch; or belly up to confusion with the rest of us and muddle along the road to Guruhood. :)

Author:Blog|Site

 
chadparry
chadparry's picture

Joined: 2008-05-30
Posts: 38
Posted: Sun, 2008-08-03 19:30

The thing that's interesting is that the "hotlinking" behavior really appeals to me, even though it's anathema to you. :) I like for my album site to be owned and managed exclusively by my album software, and I don't want for a problem in my blog or a blog plugin to be able to break my album. I also might change either my blog software or my album software in the future, so I don't want them to be bound together. (I'm trying to practice modularization, not integration). So the only functionality I want from a WordPress plugin is to show random image blocks and embed images in blog entries.

I guess I'll also check out the "Formatted URL's" plugin, so I know what my options are. Since I also like the random image block, I probably won't change anytime soon.

 
trbailey
trbailey's picture

Joined: 2007-04-16
Posts: 172
Posted: Sun, 2008-08-03 21:23
chadparry wrote:
The thing that's interesting is that the "hotlinking" behavior really appeals to me, even though it's anathema to you. :)

Not really. But attempting to use a product other than it's intended then asking for support seems a bit "anathemic" to me :)

Quote:
I like for my album site to be owned and managed exclusively by my album software, and I don't want for a problem in my blog or a blog plugin to be able to break my album. I also might change either my blog software or my album software in the future, so I don't want them to be bound together. (I'm trying to practice modularization, not integration). So the only functionality I want from a WordPress plugin is to show random image blocks and embed images in blog entries.

Hmm, what gives you the idea that WPG2 will, or even could, "break" your gallery?
It's still the same gallery code that's being executed to display and add images. WPG2 just adds a front end so that same code can be used seamlessly in another application.

Quote:
I guess I'll also check out the "Formatted URL's" plugin, so I know what my options are. Since I also like the random image block, I probably won't change anytime soon.

It might be exactly what you want, especially if all your images are public and you don't have need for image privacy or security.

For yet another idea, see this article and be patient, it takes a sec to load the images from my DSL based server.
http://home.trbailey.net/trb/2008/07/past-life-regression
It might be of interest to you as well and it doesn't require WPG2, rewrites or anything special. Just a few files uploaded to your gallery directory and some patient html coding.
If you are running RC1 or the SVN version you can install PicLens in your browser for more imagery in "en motive excelentai".
Author:Blog|Site

 
chadparry
chadparry's picture

Joined: 2008-05-30
Posts: 38
Posted: Mon, 2008-08-04 12:42
trbailey wrote:
chadparry wrote:
The thing that's interesting is that the "hotlinking" behavior really appeals to me, even though it's anathema to you. :)

Not really. But attempting to use a product other than it's intended then asking for support seems a bit "anathemic" to me :)

That's a good point. When I installed WPG2, it was with the assumption that it created links to my album like I wanted. Now that I know it is an entire front-end, I feel like my current use of it is going to be kind of fragile.

trbailey wrote:
chadparry wrote:
I like for my album site to be owned and managed exclusively by my album software, and I don't want for a problem in my blog or a blog plugin to be able to break my album. I also might change either my blog software or my album software in the future, so I don't want them to be bound together. (I'm trying to practice modularization, not integration). So the only functionality I want from a WordPress plugin is to show random image blocks and embed images in blog entries.

Hmm, what gives you the idea that WPG2 will, or even could, "break" your gallery?
It's still the same gallery code that's being executed to display and add images. WPG2 just adds a front end so that same code can be used seamlessly in another application.

I didn't mean for that to be an accusation. If there were a bug in WordPress or WPG2 (or if I decided to replace either one), I'd like to know that my other site properties would be unaffected.

trbailey wrote:
For yet another idea, see this article and be patient, it takes a sec to load the images from my DSL based server.
http://home.trbailey.net/trb/2008/07/past-life-regression
It might be of interest to you as well and it doesn't require WPG2, rewrites or anything special. Just a few files uploaded to your gallery directory and some patient html coding.
If you are running RC1 or the SVN version you can install PicLens in your browser for more imagery in "en motive excelentai".

The random image block is still an important enough feature to me that I don't want to switch to another solution that doesn't provide it. I'm afraid that my best option for now is to use WPG2 with a hacked-up set of redirects.

 
trbailey
trbailey's picture

Joined: 2007-04-16
Posts: 172
Posted: Mon, 2008-08-04 17:18
trbailey wrote:
For yet another idea, see this article and be patient, it takes a sec to load the images from my DSL based server.
http://home.trbailey.net/trb/2008/07/past-life-regression
It might be of interest to you as well and it doesn't require WPG2, rewrites or anything special. Just a few files uploaded to your gallery directory and some patient html coding.
If you are running RC1 or the SVN version you can install PicLens in your browser for more imagery in "en motive excelentai".

Quote:
The random image block is still an important enough feature to me that I don't want to switch to another solution that doesn't provide it. I'm afraid that my best option for now is to use WPG2 with a hacked-up set of redirects.

This is off topic for this thread but Minislideshow does indeed do random images, it will probably link by tag or keyword as well. Just be sure to read the documentation if you decide to try it. It has another benefit, you can display your gallery on other sites. See: http://myspace.com/siggma for another example.
See Flash Your Web for more info.
Author:Blog|Site

 
chadparry
chadparry's picture

Joined: 2008-05-30
Posts: 38
Posted: Tue, 2008-08-05 10:09

The Minislideshow looks very nice. Thanks for the suggestions.

 
trbailey
trbailey's picture

Joined: 2007-04-16
Posts: 172
Posted: Tue, 2008-08-05 14:48

I'll be wondering and watching what you do with it. I wish I had more time to fiddle and my family was more interested in the internet. All those photos and your very nice png article titles make a real splash! I do like what you've done with your site.
Note that Wordpress versions earlier than 2.3 or so don't support <embed or <object tags in articles, but later version obviously do.
Good Luck!
-Tom
Author:Blog|Site

 
mha84

Joined: 2008-09-09
Posts: 3
Posted: Tue, 2008-09-09 07:28

Every time I click the photo in the side bar and Im not logged in as admin it wont go to the gallery. It just shows a blank template of the theme Im using. I have tried different themes and it still is doing this any Idea on how to fix it thanks.

 
mha84

Joined: 2008-09-09
Posts: 3
Posted: Tue, 2008-09-09 07:29

Every time I click the photo in the side bar and Im not logged in as admin it wont go to the gallery. It just shows a blank template of the theme Im using. I have tried different themes and it still is doing this any Idea on how to fix it thanks.

Heres My site
http://andersonfamilysite.net/

 
trbailey
trbailey's picture

Joined: 2007-04-16
Posts: 172
Posted: Tue, 2008-09-09 11:17
mha84 wrote:
Every time I click the photo in the side bar and Im not logged in as admin it wont go to the gallery. It just shows a blank template of the theme Im using. I have tried different themes and it still is doing this any Idea on how to fix it thanks.

I don't see a sidebar at all, I see a php error message. None of us can even begin to help you solve a link error if we can't see the link. Also note general post guidelines. You need to post the output from "Site Admin -> Maintenance -> system information"
It would be helpful to post us a link to your gallery without wordpress.
I think you may have wordpress installed incorrectly.
If you have WPG2 installed, disable it and post a link to a working wordpress and a separate link to gallery first.
This is what I see:

Warning: require(./wordpress/wp-blog-header.php) [function.require]: failed to open stream: No such file or directory in /home1/boardfor/public_html/andersonfamilysite/index.php on line 17

Fatal error: require() [function.require]: Failed opening required './wordpress/wp-blog-header.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home1/boardfor/public_html/andersonfamilysite/index.php on line 17

/wordpress/wp-blog-header.php

/home1/boardfor/public_html/andersonfamilysite/index.php

It also helps to read the error message.
Author:Blog|Site

 
foreachloop

Joined: 2007-10-30
Posts: 8
Posted: Sun, 2010-03-21 23:46

Hi guys, the old problem comes back to haunt me after i upgraded my Wordpress. Now I got all the latest version for wordpress and gallery2.
I installed the gallery 2 in http://www.foreachloop.com/photography/

so the correct url for the image should be

http://www.foreachloop.com/photography/main.php?g2_itemId=563

but the WPG2 sidebar keeps showing below
http://www.foreachloop.com/blog/wpg2?g2_itemId=563

All the validation is success but URL to WPG2 Output shows http://www.foreachloop.com/blog/wpg2

:( Any idea?

Thank you!