Visual Integration using gallery2 embedded
shocksll
![]()
Joined: 2005-06-22
Posts: 352 |
![]() |
This is taken from this thread. http://gallery.menalto.com/node/36897 Valiant, is there anything wrong with doing it like it was embedded. That way they wouldn't have to mod any theme's. Something like below is what i'm thinking. Steve Lineberry |
|
shocksll
![]()
Joined: 2005-06-22
Posts: 352 |
![]() |
It seems to work as expected on my gallery2 test/demo site. http://pictures.thelineberrys.com/gallery2/gallery2embedded.php I just had to change my cookie path to / and delete my cookies. Steve Lineberry |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
i wanted to keep the other thread simple = no programming, just HTML / templates. that's why. embedPath should be '/gallery2/' you shouldn't have to tinker with the cookie path. |
|
shocksll
![]()
Joined: 2005-06-22
Posts: 352 |
![]() |
using the users html that he posted in the other thread and my embed colorpack I was able to come up with this: I had to remove the doctype because his header was getting all screwed up. Steve Lineberry |
|
shocksll
![]()
Joined: 2005-06-22
Posts: 352 |
![]() |
I guess I just feel like I see a lot of people asking how to get g2 inside their own site and I'm not sure if customizing the templates is the best way considering they will have to never change themes or add their own customization to every theme. And since they copied the theme.tpl into the local folder, any theme.tpl updates that are done won't get into their custom version when the upgrade. I was just asking if there is any downside to using embedding to accomplish the visual integration. My code above I feel like does visual integration only and provides all the same functionality that one can do in the standalone gallery2 (such as the login link). Steve Lineberry |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
sorry, i didn't realize you wanted to help, i thought it was another question. |
|
shocksll
![]()
Joined: 2005-06-22
Posts: 352 |
![]() |
valiant wrote:
i wanted to keep the other thread simple = no programming, just HTML / templates. that's why. Thanks for the tips in the change to the embedded code. I had to change the cookie path so I could still be logged in while in both standalone and my gallery2embedded. |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
btw: feel free to add your link to the codex.gallery2.org -> howtos page. |
|
shocksll
![]()
Joined: 2005-06-22
Posts: 352 |
![]() |
Ok, that's cool. I was just suggesting this method because I feel like it makes more sense to the G1 users who are used to the wrapper.footer.default and wrapper.header.default. Where this is one place to add/change your header and footer for the whole site no matter what theme you use. So, is there any downside to using my code above for visual integration only? Steve Lineberry |
|
shocksll
![]()
Joined: 2005-06-22
Posts: 352 |
![]() |
valiant wrote:
$g2_Config['embedUri'] = 'gallery2embedded.php'; It actually didn't work when I changed it to this. I had to change it back to /gallery2/gallery2embedded.php |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
downside? yes, |
|
shocksll
![]()
Joined: 2005-06-22
Posts: 352 |
![]() |
Ok, thanks for the response. Steve Lineberry |
|
h0bbel
![]()
Joined: 2002-07-28
Posts: 13451 |
![]() |
Is there a reason why this is only kept in this thread, and not moved to a proper ( http://codex.gallery2.org/index.php/Gallery2:How_to_visually_embed_G2_in_your_own_website_using_embedded_mode ) codex page? h0bbel - Gallery Team |
|
shocksll
![]()
Joined: 2005-06-22
Posts: 352 |
![]() |
h0bbel wrote:
Is there a reason why this is only kept in this thread, and not moved to a proper ( http://codex.gallery2.org/index.php/Gallery2:How_to_visually_embed_G2_in_your_own_website_using_embedded_mode ) codex page? |
|
h0bbel
![]()
Joined: 2002-07-28
Posts: 13451 |
![]() |
Excellent! Thanks! h0bbel - Gallery Team If you found my help useful, please consider donating to Gallery http://h0bbel.p0ggel.org |
|
pasty901
Joined: 2006-01-13
Posts: 1 |
![]() |
Wonderful - just what i was looking for - slight problems though... Many thanks Pasty |
|
nedret
Joined: 2005-07-06
Posts: 17 |
![]() |
Quote:
It seems to work as expected on my gallery2 test/demo site. Hi shocksll, Your gallery does not seem to be embedded in anything... Did you change it in the mean time? I tried to apply your method, but unsuccessfully so far. For one thing, when clicking on some links, there is a clash between the two headers: Quote:
Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/sanp-staging/html/includes/tags/head1.php:13) in /var/www/vhosts/sanp-staging/html/gallery/modules/core/classes/GalleryPhpVm.class on line 125 Did you come across this problem too? Does anyone know how I can resolve this? |
|
shocksll
![]()
Joined: 2005-06-22
Posts: 352 |
![]() |
pasty901 wrote:
Wonderful - just what i was looking for - slight problems though... You may not need that line where it assigns the session id to the gallery ID. That's only if you have auto start session on. Since you are receiving this error that means that you haven't started a sessions so there isn't an ID or that you've changed the name of your session ID variable and you should use that variable name instead of phpsessid. Check out your phpinfo to see the correct settings for your environment. Steve Lineberry |
|
shocksll
![]()
Joined: 2005-06-22
Posts: 352 |
![]() |
nedret wrote:
Yea, I think I took off the embedding for that site. You can still see it embedded at http://eclecticthreads.thelineberrys.com To fix your error you need to turn output buffering on. |
|
nedret
Joined: 2005-07-06
Posts: 17 |
![]() |
shocksll wrote:
To fix your error you need to turn output buffering on. Wow! This resolved the error, indeed! I have 2 more problems, which I suspect are related to the embedding, so I'll take the liberty to ask them within this thread. 1) When applying a certain frame style (like shadow for example) it does not reflect on the embedded site, although it works if not embedded. Do you happen to know why that may be? 2) The mod_rewrite does not work. Could this be related to embedding the gallery, or not really? |
|
shocksll
![]()
Joined: 2005-06-22
Posts: 352 |
![]() |
nedret wrote:
Your gallery does not seem to be embedded in anything... Did you change it in the mean time? Turns out it was embedded it just didn't look any different. I've change the text around it so you can tell that it's embedded but for the most part it still looks like the default. nedret wrote:
1) When applying a certain frame style (like shadow for example) it does not reflect on the embedded site, although it works if not embedded. Do you happen to know why that may be? Seems to work for me http://pictures.thelineberrys.com/gallery2/gallery2embedded.php?g2_view=core.ShowItem&g2_itemId=4156. What's your url? nedret wrote:
2) The mod_rewrite does not work. Could this be related to embedding the gallery, or not really? mod_rewrite should work but you have to enable it from the embedded version of the site. You probably need to resetup your mod_rewrite module in order for it to use the new embedded url. |
|
nedret
Joined: 2005-07-06
Posts: 17 |
![]() |
shocksll wrote:
It is http://www.sanparks.org/gallery/ |
|
shocksll
![]()
Joined: 2005-06-22
Posts: 352 |
![]() |
Can you give me the url of a page that's supposed to have an image frame? Thanks. Steve Lineberry |
|
nedret
Joined: 2005-07-06
Posts: 17 |
![]() |
Hi Steve, I set the parent directories to have image frames - shadow. Compare this (embedded): http://www.sanparks.org/gallery/default.php?g2_view=core.ShowItem&g2_itemId=177 To this (not embedded): http://www.sanparks.org/gallery/main.php?g2_view=core.ShowItem&g2_itemId=177 Thanks, |
|
nedret
Joined: 2005-07-06
Posts: 17 |
![]() |
shocksll wrote:
mod_rewrite should work but you have to enable it from the embedded version of the site. You probably need to resetup your mod_rewrite module in order for it to use the new embedded url. About mod_rewrite, I'll have to ask for help again. This is what I did: 1. Re-installed the module mod_rewrite. Quote:
RewriteBase /gallery/ What am I missing? I'm getting crazy with this - having spent so much time on it without success... Thanks, Steve! |
|
shocksll
![]()
Joined: 2005-06-22
Posts: 352 |
![]() |
Can you post your default.php file? Steve Lineberry |
|
nedret
Joined: 2005-07-06
Posts: 17 |
![]() |
Hi Steve, Here is default.php: Quote:
<? include($_SERVER['DOCUMENT_ROOT'].'/includes/header_2col.php'); ?> |
|
shocksll
![]()
Joined: 2005-06-22
Posts: 352 |
![]() |
valiant wrote:
embedPath should be '/gallery2/' According to valiant above maybe you should try your embedpath to be default.php to try to get your rewrite working. Also, the reason the shadows don't show up is you took out the whole head section of the gallery2embedded example I had. You need to add a echo $g2moddata['headHtml']; to the head section of your header file. And then you need to move your header file <? include($_SERVER['DOCUMENT_ROOT'].'/includes/header_2col.php'); ?> Check out my example again and you'll see the stuff in the head that you must have deleted when you customized it for yourself. |
|
nedret
Joined: 2005-07-06
Posts: 17 |
![]() |
shocksll wrote:
According to valiant above maybe you should try your embedpath to be default.php to try to get your rewrite working. Unfortunately no luck here. Tried all kinds of combinations - it just does not work. I'll try again tomorrow, as right now it feels like a dead end. shocksll wrote:
Also, the reason the shadows don't show up is you took out the whole head section of the gallery2embedded example I had. You need to add a Yes! Yes! Yes! This worked! It looks like my pain was self- inflicted. Thank you for sticking with me so far! It feels great to sort things out thanks to your advice! Nedret |
|
jerriez
Joined: 2006-03-01
Posts: 5 |
![]() |
Hi I would need help.. I tried to do the embedding for my site, and tried to upload a few test files, Embedded: http://birds.com.sg/photo/gallery2embedded.php Could anyone advise on the problem and solutions? |
|
shocksll
![]()
Joined: 2005-06-22
Posts: 352 |
![]() |
You need to either turn off the urlrewrite or reconfig your urlrewrite while accessing your page from embedded mode. Steve Lineberry |
|
jerriez
Joined: 2006-03-01
Posts: 5 |
![]() |
Thanks a million! Thanks you! |
|
jerriez
Joined: 2006-03-01
Posts: 5 |
![]() |
Hi, However, any problem I would like to ask. Instead of having the thumbnail image shown up, it got this funny image that pops up on the page. How can I make the thumbnail image appears instead of the strange image? |
|
shocksll
![]()
Joined: 2005-06-22
Posts: 352 |
![]() |
Please start a new thread for this question. Thanks. Steve Lineberry |
|
cheapscot
![]()
Joined: 2003-09-13
Posts: 11 |
![]() |
For anyone else who did not know what was meant by "turn output buffering on", it means you add a line to your php.ini file like this: |
|
falieson
Joined: 2006-04-04
Posts: 11 |
![]() |
"Fatal error: Call to a member function on a non-object in /home2/w3b4dm1n/public_html/gallery/gallery2embedded.php on line 34" Quote:
file location: /gallery/gallery2embedded.php |
|
falieson
Joined: 2006-04-04
Posts: 11 |
![]() |
oh sorry. line 34 is: if ($ret->isError()) Quote:
// handle the G2 request |
|
shocksll
![]()
Joined: 2005-06-22
Posts: 352 |
![]() |
If you are using G2.1, you need to use the latest code posted http://codex.gallery2.org/index.php/Gallery2:How_to_visually_embed_G2_in_your_own_website_using_embedded_mode This is the location that I will make updates to the code. Steve Lineberry |
|
falieson
Joined: 2006-04-04
Posts: 11 |
![]() |
How do I remove the navbar and basically everything but just the albums them selves? http://www.cpsigmapi.org/gallery/gallery2embedded.php?g2_itemId=1113 |
|
shocksll
![]()
Joined: 2005-06-22
Posts: 352 |
![]() |
At http://codex.gallery2.org/index.php/Gallery2:Integration_Howto There is some example code of not displaying the sidebar. Add the line GalleryCapabilities::set('showSidebar', false); right under the GalleryCapabilities::set('login',true); Depending on what you want to remove, you might need to make your own theme or check out some of the ones here. http://codex.gallery2.org/index.php/Gallery2:User_Contributions#Themes You might be interested in my EclecticThreads theme http://gallery.menalto.com/node/39159 It's very minimal with no sidebar and you don't even have to add the GalleryCapabilities thing above. If you don't want to see the gallery logo or the footer buttons uncomment the correct style in the gallery2embedded code or add this to your site's css file. change <style type="text/css"> <!-- /*#gsHeader { display : none; } #gsFooter { display: none; }*/ --> </style> to <style type="text/css"> <!-- #gsHeader { display : none; } #gsFooter { display: none; } --> </style> Steve Lineberry |
|
WebKat
![]()
Joined: 2002-11-22
Posts: 182 |
![]() |
I get frustrated with themes as a general rule, because typically I just want to plunk the content into my own website design and not have it try to put in its own colors, backgrounds, etc. I made a theme for my G1 gallery on my website here: http://gallery.opalcat.com which I'm going to have to recreate for G2...ugh... I was hoping to avoid having to create a whole new theme for a site I'm doing for a friend, but when I tried to embed it using the instructions, it works great when I view gallery2embedded.php, but as soon as I click on anything (album, whatever) it goes right back to the non-embedded version. Also, how can I get it to stop using a color pack? I don't want background colors or anything on it, I just want my background to show through! Here it is: http://reardonbuilders.com/gallery/gallery2embedded.php --you can see how stupid it looks with a white background and all of that (I don't want ANY color background). |
|
WebKat
![]()
Joined: 2002-11-22
Posts: 182 |
![]() |
(oh, I already set color pack to "none" but that doesn't help) |
|
shocksll
![]()
Joined: 2005-06-22
Posts: 352 |
![]() |
opalcat wrote:
Also, how can I get it to stop using a color pack? I don't want background colors or anything on it, I just want my background to show through! Here it is: http://reardonbuilders.com/gallery/gallery2embedded.php --you can see how stupid it looks with a white background and all of that (I don't want ANY color background). That's what my embed colorpack is for. Check out http://gallery.menalto.com/node/35451 |
|
shocksll
![]()
Joined: 2005-06-22
Posts: 352 |
![]() |
The reason your gallery keeps jumping out of being embedded is because you have the url rewrite module on and it looks like you configured it while not embedded. Resetup your urlrewrite while embedded to get the .htaccess file to use your gallery2embedded file. Check out the embedded version of my demo site using url rewrite. http://pictures.thelineberrys.com/gallery2embedded.php If you need it to work while embedded and not embedded and with urlrewrite for both, that takes a little more work but as you can see on my demo site I got it working. http://pictures.thelineberrys.com/gallery2/ The key was to move the gallery2embedded.php file to the root and change the top of my gallery2embedded.php to the following. $g2_Config['path'] = dirname(__FILE__) . '/gallery2/'; $g2_Config['embedPath'] = '/'; $g2_Config['g2Uri'] = '/gallery2/'; $g2_Config['loginredirect'] = '/'; $g2_Config['embedUri'] = '/gallery2embedded.php'; And in the urlrewrite setup while embedded I set the htaccess path to be the root of my website and I think I put a / for the path. Steve Lineberry |
|
WebKat
![]()
Joined: 2002-11-22
Posts: 182 |
![]() |
Wow, thanks! *goes off to try it* |
|
nedret
Joined: 2005-07-06
Posts: 17 |
![]() |
Hi shocksll, I just did an upgrade to 2.1.1, which ran fine and displays results with main.php ok, but if I go to my embedded page - default.php, I get the following error: Fatal error: Call to a member function isError() on a non-object in ... which refers to this part: if ($ret->isError()) Would you happen to know why this may be? Thanks! |
|
siennalizard
Joined: 2006-05-12
Posts: 5 |
![]() |
I'm attempting this approach, as I'm a PHPer who's used to include() path issues (and don't mind figuring it out). Problem is, that I can't find the embed.php file I apprently need to include. It doesn't seem to be in the cvs tree that I used at all. require_once( $g2_Config['path'] . 'embed.php');
What am I missing? |
|
shocksll
![]()
Joined: 2005-06-22
Posts: 352 |
![]() |
nedret wrote:
Hi shocksll, You need to update to the latest code. Did you see my post above? http://gallery.menalto.com/node/36918#comment-182058 |
|
shocksll
![]()
Joined: 2005-06-22
Posts: 352 |
![]() |
siennalizard wrote:
I'm attempting this approach, as I'm a PHPer who's used to include() path issues (and don't mind figuring it out). embed.php should be in the root of your gallery2 installation. Along with main.php and index.php, etc. You might want to check to make sure you have uploaded all the files that came in the package. I just checked the minimal package and even it includes embed.php. You mentioned cvs, are you downloading latest code from cvs or are you downloading it as a package from http://codex.gallery2.org/index.php/Gallery2:Download#Packages |
|
siennalizard
Joined: 2006-05-12
Posts: 5 |
![]() |
shocksll wrote:
You mentioned cvs, are you downloading latest code from cvs or are you downloading it as a package from http://codex.gallery2.org/index.php/Gallery2:Download#Packages I'm using a nightly off http://gallery.menalto.com/downloads. It is, afterall where the download link in the header points. main.php doesn't feature, either... Cheers, |
|
shocksll
![]()
Joined: 2005-06-22
Posts: 352 |
![]() |
siennalizard wrote:
Can you send me the url to your site so I can check it out? Thanks. |
|