Themeing Gallery2 with Wordpress
flashcore
Joined: 2005-03-31
Posts: 21 |
Posted: Sun, 2005-04-03 03:43 |
Before i get slammed for double posting, i am keeping track of the Wordpress /Gallery2 Integration discussions. However, i am not as interested in full integration, as i am in simply wrapping Gallery2 in my wordpress theme. I figured although i posted in that discussion, something as simple as i've heard this is could be better fielded with a new topic. Correct me if i'm wrong. An example is [url]www.siriux.net[/url] who seems to have done a solid job. I would love to do the same with my site, http://www.hisnameisjimmy.com, but only have basic knowledge of PHP and some working knowledge of CSS. If someone could point me in the right direction, thats all i'm really looking for. However, anymore help than that would be highly appreciated as well. I dont know what it is, but working with this, and trying to figure out the embed stuff or what to do with the global.tpl is really stumping me. Thanks for any help, |
|
Posts: 51
I'm right there with you. I'll love integration when it finally happens. Right now, I would love a simple tutorial....even on G1, since I'm not on G2 yet.
Posts: 8601
siriux.net has a custom G2 layout that uses wordpress css classnames.. that is how it's G2 appearance is themed by wordpress css.
Posts: 21
What would be the easiest way to have G2 use a wordpress CSS? And do you simply edit the layout.css file?
Posts: 45
Seems like the layout of siriux is allready included in the CVS of Gallery2
http://cvs.sourceforge.net/viewcvs.py/gallery/gallery2/layouts/siriux/
Posts: 21
I know the layout is included, but i'm talking about wrapping it. I'm having a ton of trouble doing this, and have tried emulating other websites, but my brain is over-loading.
Posts: 45
I have tried embedding/wrapping it with the default wordpress (kubrick) style too, and had some problems.
But I seemed to get something working now. The css styles in the gallery has to be modified somewhat, since it seems it clashes with the wordpress styles.
I followed the instructions in the embedding document to G2 and info from wordpress about using the theme/style with external pages/applications.
here is the code (it assumes the file named gallery2.php to be in the wordpress directory and gallery2 directory beneath it):
Posts: 21
Where do you put this code? Are you saying you put it in a file called gallery2.php, then throw it in the wordpress directory?
Posts: 45
correct.
Gallery2 has to be in a subdirectory (called gallery2) of the wordpress installation.
If your setup is different, you can change this in accordance to the embedding documentation included with gallery2.
Posts: 51
So..
- I can change the path to G2, perhaps up one dir?
- copy the quoted text above into a file call gallery2.php and place it in my Wordpress dir
- reference this file when i want to add a link to the gallery from the nav bar on my site
Is this correct? Is it this simple? Obviously I don't get the sidebar, but I'm ok with that in my site design.
Now, i just need to install G2! (I'm a G1 site at the moment).
Posts: 45
If you read the documentation, it shouldnt be hard to understand what parts has to be changed.
There are some problems though:
The text in the gallery2 part becomes very small. It must be some collision between the wordpress and gallery2 CSS that makes this.
The embedding solution is _very_ slow in comparison to go straight through main.php file (the normal way gallery2 works). I see that siriux uses the main.php file, so maybe there is a reason to that. I'm not sure what makes the embed.php file so slow in comparison.
I found a template to Wordpress that has somekindof gallery1 and 2 integration guidelines with it. Seems like it modifies the theme and layout of gallery2, so it corresponds to the wordpress style: http://scatteredthoughts.us/pages/scattered-theme/
But this will only work for this theme though, not if you want to change between styles in wordpress.
Posts: 21
I've seen that solution on scattered thoughts, and tried manipulating it. However, i couldn't even get it to work within the included theme, so i dont trust it. I might just have to wait for ArnoldJW's theme.
Posts: 32509
hawkin, embed.php much slower than main.php? i've never tested the performance. but i'm using the embed.php with xaraya and i think the whole performance hit comes from the fact that before I call GalleryEmbed::init() and GalleryEmbed::handleRequest(), I have to boot the whole xaraya system.
I've just reviewed the way requests are handled in standalone by main.php and by embed.php in embedded g2. it's almost identical. the only difference is a cookie value check, which is very fast.
if you could post the code how and when you call embed.php' functions, i can tell you what's going wrong.
ps: if this is just about themeing, there's no reason to call embed.php.
Posts: 62
Are you still having trouble? I just embedded Gallery into wordpress with the Sirux layout and it is pretty simple for the most part. I'm still having a little trouble with cookies and authentication. but visually it is all there... I could post my cocde if you like...
You can check it out here: http://www.marcnjami.com
Posts: 32
plz do!
Posts: 21
I would love to get my hands on that code. Nice job on your site btw, very clean and well-done layout.
Posts: 45
I have tracked down the speed issue to be of my Wordpress installation, so the embed.php file is not the problem.
It was actually a Gallery2 plugin of Alan Harder that made it go so slow (gallery2 got inited twice).
ClimbingMonkey: Have you made your own CSS file that styles both Wordpress and Gallery2?
I still are having problems with the styles if I try to use all the stylesheets together (wordpress, and the 3 gallery uses; layout, theme and template). Gallery2 also bleeds over wordpress when all theese stylesheets are being used.
Is there no way of be able to use the styles together? Do they have to be integrated in one as you have done?
Interesting to see others joining this effort.
Posts: 51
ClimbingMonkey,
That is EXACTLY what I want to do with my gallery install. Just have the header and the footer. Are you using the embed.php scipt?
Posts: 32
The only thing I want is to be able to show the Gallery inside my current WP theme. No offence, but why should it be so damn hard......
Posts: 8601
you mean that sample code i wrote many, many months ago on an ancient G2 version and i've never used wordpress before? can't say i'm surprised..... :P
Posts: 45
I think actually your code worked, but when used in addition to an embedding, things got doubled, and cause of that things became very slow. Suprisingly it still worked actually.
Posts: 17
ClimbingMonkey,
Outstanding effort if I may say so. That's a gorgeous site you came up with there.
Do please post the code!! (a howto for us n00bs would be especially helpful, even if the request itself is a bit errr..."over the top")
Dude....all this writer can say is "wow"
Posts: 1301
ClimbingMonkey
Great site - nicely done! (almost makes me want to try wordpress again, but I am sticking with pmachine for now).
Gaile
Posts: 1378
What code you after Haggis??
The embedded php?? to link your WP and Gallery??
Posts: 54
I've done something simliar, but its in plugin form for Wordpress.
The Plugin is at:
http://holosite.com/software/wp-gallery2.html
its in use at
http://holosite.servepics.com/baby/
It currently wraps the Wordpress theme around an embedded gallery, and syncronizes new users.
Posts: 3
I am trying to follow these threads regarding the integration of WP 1.5 and G2, but I am getting out of my element.
I have WP 1.5 installed in a site /wordpress
I have Gallery2 installed in a subdir /wordpress/gallery
Both are working fine independent of each other...
But I have no clue on how to make it so the gallery looks like the WP Theme.
Everyone is throwing out these snippets of code, but I have no clue where to put it..
I need some primers/help on how to integrate this. I am going from a PHP-Nuke/G1 site...
Anyone want to volunteer some assistance?
Thanks
Posts: 32509
hydog, it's a good idea to wait a few days until things are more advanced. there are a couple of independent WP integration movements here, maybe these will have finally merged in a few days in a single, powerful, easy integration.
Posts: 2
I (sort of) have ozgreg's code working:
http://blog.mahshie.net/gallery2.php
As you can see, this just sticks the entire contents of the gallery page in between the header and footer of my WP site. I have done no customization (yet), so it looks like crap. However, it does what it needs to do.
Step-by-step, here is what I did:
1. Install WP.
2. Install Gallery2 in a subdirectory of WP (use the default directory name "gallery2" for best results).
3. Copy the above text into a file called "gallery2.php" and place it in the top-level WP directory.
I had to make a few changes to get it to work with a different directory. I installed G2 to a directory called "photos". I also had to add a "/" in front of the $loginRedirect values. Here is the content of my "gallery2.php" file:
I apologize if this jumps the gun on other integration options, but it took a while to figure out what needed to be done so I wanted to clarify ozgreg's post.
UPDATE: I tried hawkin's code, and it worked better:
http://blog.mahshie.net/photos.php
I had to add a <div> tag and update everything to use my "photos" directory, but it seems to work pretty well (small fonts notwithstanding).
UPDATE: Commenting out the font-size line from the Matrix themes.css stylesheet fixed the font problem.
Posts: 388
I checked out your WP-Gallery site and must say that is really slick!! I'm a bit envious now but think I'll take valiant's advice and wait awhile till some more integration is polished for WP.
Not sure I follow you when you say, "syncronizes new users". Do you add new users via Gallery, WP only or both? I'm not familar with WP (yet) but it does look mighty nice.
Posts: 45
onlydarksets : Thanks for the tip about the font size style!
I had to do two small changes (in matrix theme.css file) to get it working with the default Kubrick style of Wordpress:
In addition I modifyed my gallery2.php file code to include the current userid:
It does not add any mapping between the usertables, so that you have to insert yourself.
In 'g2_ExternalIdMap' table ie:
g_externalId, 1 = the wordpress user ID
g_entityId, 6 = the galleryuser ID
PS: g_entityType MUST BE GalleryUser
Posts: 62
Here it is:
There are three things to edit, but it should work well. If you want the css prettyness pull it out of the sirux layout css and paste it into your wordpress css...
-CM
Posts: 32509
hawkin, please don't use your own SQL. use GalleryEmbed::addexternalIdMap.
@ALL: Please organize yourself. There are about 5 different WP integrations, all quite similar. But if everyone starts from scratch, it will take much longer. i.e. see the mambo integration thread, they try to develop the existing code further and further.
Posts: 1378
I agree it is silly to have soo many code bases and threads going..
So I have very very quickly setup a site
http://wpg2.ozgreg.com/ (it be up shortly) with a forum that we can post attachments etc so we can combine everything all together under the same roof.
Everyone undertaking WP/G2 work please come over to the new site and lets combine all the efforts into one place..
Posts: 32509
ozgreg, it may be a good idea to search the G2 forums for "wordpress" and pm/email the guys you find in the threads.
probably you should also contact jmullan and h0bbel. both G2 devs, interested in a WP integration. jmullan has set up a site a few weeks ago dedicated for G2wp. but i can't find the link ATM. just pm them, i guess it is organized pretty quickly.
thanks for the effort!
Posts: 1378
I cannot find the link as well, if they feel concerned over the forum I will simply redirect it to their site.
I got the forums up and running, who hosts them is to me is not a concern, what works the best for the G2/WP community works for me..
Posts: 5
That would be lovely! 8)
Posts: 974
http://wordpressgallery.jpmullan.com/
Posts: 974
(it's just a collection of links at the moment)
Posts: 1378
Jmullan,
Do you want to throw up a forum or just happy for http://wpg2.ozgreg.com to continue??
Posts: 32509
ozgreg, having the forum on your domain is ok. now we need to get everyone on board...
Posts: 13451
Great!! I've emailed the person responsible for the Kalimantan plugin, hopefully he'll show up soon.
Posts: 2
Well, I'm here.
Posts: 1378
Ok so if I can get all developers over to the new board (follow my signature) we can pool what we developed so far and get a project plan together to finish it off..
Posts: 5
I took a look at the site and that's just what I'm trying to do. Does anyone know if there is a plug-in or instructions for this method . .?