Introduction:
----------------
Embedding & Integration of G2 means to embed G2 seamlessly into your homepage or other applications.
This is the place to find out about available G2 integrations / CMS modules, to announce related news, publish download and demo links and add documentation.
Overview of G2 Embedding & Integration
http://codex.gallery2.org/index.php/Gallery2:Embedding
List of Available Integrations:
http://codex.gallery2.org/index.php/Gallery2:Integration:Available_Integrations
G2 Integration Development Documentation
http://codex.gallery2.org/index.php/Gallery2:Embedding:Integration
Embedded URL Rewrite Setup
http://codex.gallery2.org/index.php/Gallery2:Modules:rewrite#URL_Rewrite_Embedded
For the visual integration and css problems, see this topic:
CSS problems/considerations when embedding G2
History (the road to our current solution):
For a short explanation why things are done in G2 integration as they are, take a look at this post. and for a little longer explanation, see the development topic CMS Integration (How to Customize G2 or Create a module? is even older, but obsolete) which describes the process of our decision making. The forum topic was the start of all integration discussions.
We are always open for new ideas, so don't hesitate posting yours.
Posts: 5
just thought i'd add that my drupal demo site is:
http://aurora.walkah.net/drupalgallery
Posts: 105
phpBB status from here:
http://area51.phpbb.com/phpBB22/viewtopic.php?sid=&f=4&t=16726
Posts: 5
I just finished a first running version for PostNuke
Project site:
http://www.hdtvtotal.com/pnGallery2.html
Demo site:
http://www.hdtvtotal.com/module-pnGallery2.html
It's based on valiants xaraya embedding code, so it's no hack, but instead tries to embed smoothly into PostNuke. And a usable release is not far away.
Posts: 7994
Sweet! Great work, Black-y!
Posts: 1
I have gallery2 and TikiPro integrated together. Feel free to give it a test at:
http://clyde.tikipro.org/gallery2/
Any feedback would be great!
Posts: 32509
updated list, added phpnuke.
@developers: please add your integration + a README to the cvs.
1. first checkout the cvs integration module:
cvs -d:ext:your_username@cvs.sourceforge.net:/cvsroot/gallery co integration
2. Create your directory
cd integration/gallery2/
mkdir yourIntegrationName (i.e. "mkdir drupal", or "mkdir postnuke")
add all your file
3. Add your directory to the cvs:
cvs add yourIntegrationName
4. Add all your files: copy your inegration files to
integration/gallery2/yourIntegrationName/.
5. Add them to the cvs (i.e. type "cvs add *" in all directories)
6. Commit the changes
cd integration/gallery2/yourIntegrationName/
cvs commit
And don't forget to add a short README to explain how to use your integration.
I guess we'll soon get nightly snapshots of the integrations on jpmullans site.
thanks
Posts: 5
Okay, I got up a first running version for download:
http://www.hdtvtotal.com/PNphpBB2-viewtopic-t-380.html
I waited for this post here @menalto until I got the respond that it's also working on other sites than mine. :D And it seems to do:
http://pn.yourgoodtimes.com/index.php?module=pnGallery2&func=main
I'll add it to the CVS when it's more mature, because beside the admin user it doesn't do any Users/Groups sync until now, and parts of it are surely bad code, so please don't look too close at it. It will get better! :D Just wanted to feed the most hungry PostNukers out there.
Posts: 7994
That rocks! Great work, Black-y!
Posts: 9
Anyone have this working in Mambo yet?
Posts: 105
phpBB 2.1.x (latest development version)
State: alpha
Download: http://devarea.mtb-o.net/code/
Thread: http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&t=25068
Contact: Einstein
Posts: 4
## includes/ucp/ucp_profile.php
## includes/ucp/ucp_register.php
where are those files in phpbb2?
im running version 2.0.11 right now and gallery v1.4.4-pl6
Posts: 32509
istoreparts, it's written in bold letters: phpbb version 2.1, which is the development version of 3.0 (formerly 2.2). Which is a whole new version of phpbb and you can't expect the G2 mod to be compatible with earlier versions (<2.1).
Second, you write you're using gallery 1.x. This forum is about gallery 2.x. There is a phpbb 2.0.x + gallery 1.x integration. see http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewforum&f=16
Posts: 9
Wordpress integration?
Posts: 4
I must be thick today, but I cannot find the integration/gallery2 stuff at sourceforge. Care to give me a clue as it's obvious I totally lack one?
Posts: 32509
Currently, the only way to get is, by using cvs
on a linux box:
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/gallery login
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/gallery co integration
on a windows box, use wincvs.
probably, we should add the integration package to the nightly snapshots page...
Posts: 3
yea we should have nightly snapshot coz sf's cvs sometimes drive me crazy!!
Posts: 14
I have installed G2 with Drupal using Walkah's module. However, there does not seem to be any interoperation with the Drupal authentication system -- which is actually the important part. Am I missing something? I don't want my users to be asked to register when they've already registered for the base site (Drupal).
Posts: 4
Hi,
There is any plans for integrate v.2 with WordPress 1.5 and up (www.wordpress.org) ?
Thank you for any comment about this subject.
Hexen
Posts: 13451
Hexen, currently noone has really started on something for Wordpress, but i'd be very suprised if something doesn't get started soonish. I use WP myself, so I have a big interest in it, and several members of the wordpress communtiy has voiced an interest in doing something with WP and G2.
I bet something will turn up, just not sure how/when yet.
Posts: 4
mmm... I would love to se that, there is any newsletter to keep me update on this ?
Thank you for your quick responce!
Posts: 13451
Hexen, subcribe to this thread I guess.
Posts: 22
Embedding and integrating of G2 and Moodle?
Posts: 32509
please don't ask your question in multiple topics, thanks.
Posts: 9
gallery2 (today's nightly) running embedded in our own community-software, at:
http://forum.brz.nu/
i also have a question. at this moment, gallery2 is only running as guest user, and i have to log in seperately (using main.php) to actually upload some files or manage the pages.
is there some documentation known on how exactly our user database is expected to be tied to the gallery's user database? i've read EMBEDDING (and i know its alpha :D), but its not very clear on what to do exactly.
Posts: 32509
no there are no detailed docs, not yet. sorry. coming not so soon, but coming.
Posts: 9
ok i will try and find out a bit myself then thanks anyway!
Posts: 22
same goes here, its kinda blurry
Posts: 1
Hi!
I need help. The mambo component version of gallery is complaining that it can't find embed.php. I checked the zip file I downloaded and it doesn't have that file :cry:
Posts: 32509
premedios, please refer to this http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&t=25979 topic for specific questions about the mambo integration. this topic here is rather for announcements and the like.
(answer to your question: embed.php is part of G2. if your mambo integration says it can't find embed.php, then either the path you specified is wrong/wrong format or your G2 version is really, really old.)
Posts: 32509
After the recent UI/theming change, GalleryEmbed::parseHead(), i.e. the css styles, were broken. It's now fixed, you can update your embed.php from cvs now.
Posts: 573
i'm trying, but all the OSTG sites seem to be down... no /. no SF no thinkgeek
Posts: 32509
updated the introduction in the first post with some links to existing discussions/explanations.
Posts: 5
http://cvs.sourceforge.net/viewcvs.py/gallery/integration/gallery2/ :wink:
Posts: 32509
instructions on how to download the integrations can be found in the first post of this topic. nightly snapshots thereof will be soon available on jmullans snapshots page.
Posts: 32509
Thanks to Jesse Mullan, there are now nightly snapshots available of the integrations.
See the first post of this topic.
Posts: 54
I'm working on a Wordpress embed, and on creating a user
I get Undefined Class Name 'gallerycoreapi' in embed.php on line 249
checked the cvs, and still saw:
GalleryCoreApi::newFactoryInstance('GalleryEntity', 'GalleryUser'
Did I miss an include?
Posts: 8601
did you call GalleryEmbed::init ?
see docs at top of embed.php
Posts: 54
It helps if I read.
I commented out the init.
Thanks
Posts: 32509
GalleryEmbed API Change:
GalleryEmbed::init received a new parameter.
'embedPath' => url path to embedUri (example: '/', or '/cms/')
Until now, the urls that G2 generated were dependent on the current URL (REQUEST_URI), i.e. if you wanted to show a G2 imageblock in your website outside the embedded G2, i.e. in http://domain.com/some/path/index.php?module=other and your embedded G2 was at http://domain.com/some/path/index.php?module=gallery2, then you would have had these settings:
embedUri => 'index.php?module=gallery2
and the resulting urls would have looked like
http://domain.com/some/path/index.php?module=otherindex.php?module=gallery2?somehg2parameters
i.e. the urls would have been broken.
The fix until now was a hack. Manipulate $_SERVER['REQUEST_URI'] manually...
Now it is solved.
Call GalleryEmbed::init now like this...
GalleryEmbed::init('embedUri' => 'index.php?module=gallery2',
'embedPath' => '/some/path', 'activeUserId' => ...., ...,...)
You can still use GalleryEmbed::init like before (just omit embedPath), but I recommend using the new method with embedPath.
Posts: 9
Cheers valiant, that works on mine.
How would I embed the 'Search the Gallery' search form, for example at the top or bottom of the page?
BF
Posts: 32509
Depends... is this search form only for G2 search or is it for syndicated search where you should be able to search your website and G2?
- Search only for G2 and only in G2 pages -> change the layout of G2, place the search form whereever you want to.
- Search only for G2, but the search form should be everywhere on your website -> depends, you could use GalleryEmbed or just the direct form submit url.
- Search G2 with the same search form as for the rest of the website -> use the GalleryEmbed:: search functions.
Posts: 6
Can I recomend an optional parameter to createGroup in embed.php? It would be helpful to specify a group type when creating a group. Something like...
This would make creating users on the fly easier for admin users and would only require changing two lines
Patrick
Posts: 32509
pkellum, Admin users in G2 are members of the EveryBody, All Users and the Administrators group.
All groups in G2 are of group_type GROUP_NORMAL. All but the 3 special groups GROUP_EVERYBODY, GROUP_ALL_USERS, GROUP_SITE_ADMINS. And there is only 1 group for each of the three special groups.
Do you intend to create a second admin group?? why?
Hm, I guess I see the problem. If one decides to not synchronize groups, just users - and that will be the default case - then one has to createUser, loadEntityByExternalId, and call a GalleryCoreApi method to add a user to the admin group.
Is that you problem?
Posts: 6
I didn't know there wasa supposed to be only one entry for each of those groups. How do I go about adding a user to the admin group using the embed API? I'm not sure how I'm supposed to find the group ID for the admin group.
Posts: 32509
The problem with the embed API, which is an extension to the G2 API, is that the group / membership functions are assuming you synchronize users AND groups with G2.
I guess the more common case is that only users are synchronized.
So you would like to have a function to add a externalId to a G2 group id.
Such a function does not exist at the moment.
So what you have to do at the moment is.
1. get the G2 user id (entityId) for a user (either by GalleryCoreApi::loadEntityByExternalId or by other means)
2. get the G2 group id (entityId) for the admin group:
3. add the user to the admin group:
Posts: 6
Thanks, that worked great! Also helped me learn a bit about how the API works (always a good thing )
That was one of the few remaining issues I had writing a module for PGV (a genealogy viewer).
Thanks!
Posts: 32509
@Integration writers:
I'm chaning the return value of GalleryEmbed::parseHead($headHtml) in the next few days.
Until now, the javascript return value was an array and each entry was just the code, without the <script> tags.
I didn't capture script tags which don't have a code, but a src link for a linked js file.
It will be changed to:
javascript is again an array, but now each element contains the full script section, i.e. <script ....>...</script>.
And I use this occasion to start writing unit tests for GalleryEmbed, starting with a test for parseHead.
Posts: 9
I am embedding Gallery through my custom page "mypage.php" and image links are routed through "mypage.php?..." as expected.
If I right click on an image and view its properties the location is of the form "gallery2/main.php?..."
Is this behaviour correct or should the image properties display "mypage.php?..." as well?
This is my configuration:
$ret = GalleryEmbed::init(array('embedUri' => 'mypage.php',
'embedPath' => '/myfolder/',
'relativeG2Path' => '../gallery2',
'loginRedirect' => '../index.php',
'activeUserId' => $uid));
BF
Posts: 32509
this is correct. all image urls (downloadItem urls) are routed through G2 directly for performance purposes. as permissions are handled through cookies, this works. everything fine as it is.
Posts: 32509
GalleryEmbed API update:
GalleryEmbed::parseHead now captures all javascript tags (new: also the script tags with a src attribute, as it is used in the site admin -> maintenance view).
This required a change in the return value of ::parseHead. The javascript return value includes now the complete <script ..... </script> tag. Before it was just the string between <script ...>this string</script> tags.
And if you take a look at embed.php and wonder what happened to the GalleryEmbed class: it was moved to modules/core/classes/GalleryEmbed.class for various reasons.