WPG2 3.x + Wordpress MU
mjh_ca
Joined: 2008-02-01
Posts: 5 |
Posted: Fri, 2008-02-01 07:51 |
Hi there, I posted this to wordpress.org but thought I would post the same question here as well since this forum looks like the better place to ask. Are there docs for implementing WPG2 with Wordpress MU? I found discussion about it over the past year but nothing conclusive. Ideally I'd like to install a single codebase of WPMU, WPG2 and Gallery2 with the goal of having the appearance of "isolated" Gallery2 installations (both data dirs, template dirs, etc, and database) for each user. *original end of message removed* - please see my second post (below), I think this may accomplish what I need -- looking for feedback from the developers here. Thanks! |
|
Posts: 5
Would the use of the Multiroot (using alternate guest user mode) and Useralbum modules accomplish an embeded G2 implementation on Wordpress MU with entirely segregated views of the gallery on a per-blog basis, without the need for multiple blog-specific data directories, multiple sets of g2 tables, etc?
Would you please confirm if my thinking is correct here?
Useralbum module would only need a minor change:
(1) Automatically create an alternate guest user for the useralbum, with permissions restricted to that Useralbum
WPG2 would need added code to support automatic Multiroot functionality:
(1) Detect that we're running on Wordpress MU,
(2) Confirm that Useralbum+Multiroot modules are active,
(3) Determine the corresponding Useralbum ID and the anonymousUserId for the current blog,
(4) Set the multiroot options in wpg2embed.inc prior to displaying the gallery. Set defaultAlbumId & breadcrumbRootId to the Useralbum ID assigned to the Blog's owner, set the anonymousUserId to the alternate guest user assigned to that Useralbum by the mod made to the Useralbum module.
Would this work? Any suggestions? The GalleryCoreAPI looks well written and easy to interface with, so I'd like to attempt writing this. WPG2/G2 developers, if you would please confirm that this type of setup would make sense, and provide any tips regarding the API methods for auto-creating the guest account + permissions for each useralbum, it'd be appreciated.
Posts: 1378
mjh_ca,
I have seen your message, need to have a little think play before I can comment...
____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo
Posts: 5
The Useralbum docs say that there is a performance problem with a large number of Useralbums. Any idea why this is so, and what is considered "large" ? A little concerned about scalability once I manage to implement this.
Posts: 1378
Hiya mjh_ca,
I think I see what you want to achieve, basically using the two G2 modules, you want to firewall the other blogs in MU making it appear that each "blog" has a unique G2 installation, which is an interesting concept and it is pretty clear you have thought a lot about this..
Firstly yes WPG2 3.x series does work with WPMU, the changes listed in the old 2.x thread have been applied to core and I seen a thread in the front page that confirms it is working with WPMU..
What you want to achieve is not that hard, the WP user creation events will allow the extension of the G2 useralbum and detecting if these modules are active is simple (see the WPG2 Validation function)..
I think the issue is going to be with Multiroot as it has some heavy URL mapping and I am concerned that those URL changes may get lost in the WP Permalink structure that I fought soo hard to implement.
I think the first step is to install the Multiroot into a standard WP + G2 installation and see if the different URL's still track as that to me is the high risk issue the code it's self should not be that had to do..
Ozgreg
____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo
Posts: 5
That is exactly the point I'm stuck. The rest is working - each blog gets their own album with an anonymous guest account for jailing via multiroot, and it works (except for the URL rewrites). Needs some code clean-up, but it works.
However, when I set the multiroot options, the URLs generated by GalleryEmbed no longer work. I will begin to dig through the URL rewrite logic to see what I can do, but, do you have any suggestions where to begin? Is this a problem with the G2 multiroot code, rewrite module or something that WPG2 needs to accommodate for? Is there any kind of temporary workaround I could achieve by disabling the URL rewriting in some way?
Thanks for your help so far.
Posts: 1378
Hiya mjh_ca,
The issue you will be fighting is the nature of the greedy WP rewrite rules which are stored internally (within WP) which must be mixed with G2 rewrites (bake well and add 404 icing to the end result). ;-)
I fought getting the rules right for the better part of six weeks to have G2 content (with rewrites) within a Wordpress Page and even then WPG2 can only translate certain rules from G2 back into WP (The Site Admin Page is an example of a rule it cannot translate nor can we support pathinfo url rewrites).
Kirk and I have some thoughts on how to better handle Wordpress+Gallery2 rewrites, the latest and greatest idea on the drawing board would be to firewall the G2 rewrite rules by forcing a prefix (equal to the page slug of the Wordpress Page) to be applied to all Gallery2 rewrite rules, something that would require modifications to WPG2 and G2 rewrite modules to implement.
I suspected this would be the issue with the multiroot code and I cannot think of of a workaround off the top of my head. As for your suggestion to disalbe rewrites, no, you need them to be able to support WPMU and Multiroot..
____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo
Posts: 5
Ok, it actually seems that with the Rewrite Plugin turned off, and no multiroot options set, I'm still getting invalid URLs generated by G2. So, this needs to be fixed first.
The URLs it is generating are:
http://mydomain.com/wpg2/main.php?g2_itemId=12292
and clearly the URLs should be:
http://mydomain.com/wpg2?g2_itemId=12292
Can you please suggest why it is doing this? The WPG2 Paths screen shows:
Validation check shows:
Gallery2 Rewrites page shows:
Posts: 1378
When you switch off the G2 Rewrite module it does not remove the G2 rewrite rules in the .htaccess files.. Thus Delete the G2 .htaccess file and remove the G2 Rewrite Rules from the Wordpress .htaccess file and you should get the correct URL's
____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo
Posts: 68
Any update on this?