WordPress.org

Ready to get started?Download WordPress

Forums

Gallery 2 Integration (35 posts)

  1. arnoldjw
    Member
    Posted 9 years ago #

    I'm working on a Plug-in to embed Gallery2, and gallery pictures. To that effort, I'm trying to integrate WordPress users into Gallery.

    The Gallery side I'm ok on. Its WordPress that’s giving me trouble.

    I can't find all the hooks I need so I'm using the admin_head hook (a hook not in Skippy's List BTW).

    I've looked at the following:
    wp_login
    password_reset
    retreive_password

    But what I need is when a User changes their username, full name, or password, I update gallery. So what I'm now doing without user_edit hooks, is I'm using admin_head and watching for $_POST[action] == update, and then the pages profile.php and user-edit.php. If an update is made to those pages, I can get the post arguments. I need to do this because both of those updates redirect to the edit page by changing the header, and I loose any arguments before another hook is run.

    Is this the right thing to do?

    Anyone want to help?

  2. ski3r
    Member
    Posted 9 years ago #

    hey arnoldjw!
    I'm really looking forward to this plug-in. Plz let me know if you need any help with testing,

  3. arnoldjw
    Member
    Posted 9 years ago #

    Possible Features for Embedding Gallery into WordPress:

    • Have gallery wrapped in current theme.
    • - done

    • Single Signon to WP and G2
    • - done

    • User Synchronization between WP and G2
    • - 50% done

    • Easy Configure and Include G2 Image block (this would be settings in the admin you set, like in the side show a random image block etc.)
    • Adding a G2 image easily to a post
    • Link to a G2 album from a post.
    • Add an Image to WP and G2.
    • Use G2 to resize an Image.

    Anything else?

  4. lawtai
    Member
    Posted 9 years ago #

    Wow this looks to be a really good plugin if you can get it finished and working. Probably woulnd't switch over to Gallery 2 from Gallery 1, till they go final.

  5. ski3r
    Member
    Posted 9 years ago #

    Wohaa!! I can't wait to get my hands on this! One small request though, I would like to have the possibility to choose the Image size and alignment when I add it to the post. Exactly like LZIL does, look here to see what I mean: http://davidseah.com/archives/2004/09/26/lzil02/
    Go arnold, go!

  6. flashcore
    Member
    Posted 9 years ago #

    Hey Arnoldjw,
    I'm one that would be purely interested in just the theme wrap of gallery2, at least for now. If you can point me in the right direction of that, or proffer some advice, i'd love to hear it.

    Thanks!
    -Jim

  7. trueepicure
    Member
    Posted 9 years ago #

    I'm very excited to see that this is happening! I can't wait for the release of the plugin.

  8. arnoldjw
    Member
    Posted 9 years ago #

    Hello Flashcore,

    When I say them wrap, I mean embed gallery withing my selected WP theme. If so then its just a matter of building a WP page like the index (the real index.php)

    basically include the wp-blog-header.php
    get the current theme get_themes(); and get_current_theme();

    Include the theme stylesheet and header and footer

    <?php include(ABSPATH . $current_template_dir . '/wp-footer.php'); ?>

    Inbetween the header and footer you can do a simple embedding of gallery. (see gallery's embed.php file for help.)

    <code>
    $gallerypath = "../gallery2/";
    require_once(dirname(__FILE__) . '/'.$gallerypath.'embed.php');
    $ret = GalleryEmbed::init(array(
    'embedUri' => 'wp-gallery.php', 'relativeG2Path' => $gallerypath, 'loginRedirect' => '/baby/index.php',
    'activeUserId' => 5));
    if ($ret->isError()) {
    // $ret->getAsHtml() has error details..
    exit;
    }

    $g2data = GalleryEmbed::handleRequest();
    if ($g2data['isDone']) {
    exit; // G2 has already sent output (redirect or binary data)
    }

    // Use $g2data['headHtml'] and $g2data['bodyHtml']
    // to display G2 content inside embedding application

    echo $g2data['headHtml'];
    echo $g2data['bodyHtml'];

    require_once(dirname(__FILE__) . '/'.$gallerypath.'embed.php');
    $ret = GalleryEmbed::logout();
    `

  9. sybur
    Member
    Posted 9 years ago #

    Hi Everyone,

    Like many of you I am using WordPress and Gallery2. Two of the best open source apps I've seen. What I would really like to do is put an image block w/the newest image in the gallery on the main page of my WordPress blog. I tried using the code in the Site Admin section of Gallery2 but the image wouldn't load when included in the wordpress index.php. Can anyone help me with this? I am using WordPres 1.5 and Gallery2.

    Thank you,

    Justin

  10. arnoldjw
    Member
    Posted 9 years ago #

    If you're having trouble with the image block besure your webserver, can see itself at your virtual host.

    For other problems with Gallery2's image block I'd try the Gallery Forums, or email me and I can try and help.

  11. Tek
    Member
    Posted 9 years ago #

    All i want is a gallery that looks like the rest of my site and I cannot do this for the life of me!!

    i'm crap!

  12. ski3r
    Member
    Posted 9 years ago #

    bump

  13. pjl
    Member
    Posted 9 years ago #

    Hi Arnold,

    I'm not entirely clear on a couple of the parameters of the GalleryEmbed::init() are.

    'embedUri' => 'wp-gallery.php':

    Is 'wp-gallery.php' the "Page Template"? I'm of course assuming that the embedding code from above goes into a WordPress page template. Is this not so?

    'loginRedirect' => '...':

    If we're doing anonymous logins, I'm guessing a loginRedirect isn't even necessary?

    Finally, is there a status on your plugin? I'm trying currently to embed G2 in my WordPress site using the Siriux layout in G2. I was able to view the overview of albums, but wasn't able to go into any albums.

    Thanks a lot!

    Pat

  14. ski3r
    Member
    Posted 9 years ago #

    bump bump bump...
    I'm starting to think this is a mission impossible. All I want is to add the gallery inside my WP theme. I don't care about the admin interface, all I want is the look. Does anyone know how to make this? I guess I'll have to start looking for another image gallery otherwise...

  15. Ostekjeks
    Member
    Posted 9 years ago #

    You're not the only one with that wish ... But if this project get shelved, what "album service" would you recommend?

  16. drewament
    Member
    Posted 9 years ago #

    ski3r & tek,

    Embed in current theme?? Like this?

    http://amentfamily.us

    I will put together a step-by-step write up....and post with-in the next week (if I don't get backlogged with other projects()

    --Drew

  17. ceo
    Member
    Posted 9 years ago #

    drewament, you are officially my hero! Will be looking forward to the write up with a million thanks! Take your time, though. :)

  18. clarke1866
    Member
    Posted 9 years ago #

    Dang! Do tell (when you get the chance!).

  19. lawtai
    Member
    Posted 9 years ago #

    For Gallery V1

    http://www.wakatara.com/blog/index.php/archives/2005/02/22/integrating-wordpress-and-gallery/

    I have no clue about attempting to integrate v2 if any of you are trying to do that. Drew's using v1 on his site as well.

  20. drewament
    Member
    Posted 9 years ago #

    There ya go guys, Lawtai already wrote a write-up. It should be pretty easy from there.

    One thing I would rec is to copy the css from your WP blog/theme to the standalone css for gallery. (I didn't see where you had mentioned that lawtai)

    I too have not yet started playing with v2 of Gallery. But, when it gets out of Beta you can bet I will be upgrading.

    --Drew

  21. lawtai
    Member
    Posted 9 years ago #

    heh, I actually didn't write up that guide, but used it in helping me to integrate my gallery.

  22. ceo
    Member
    Posted 9 years ago #

    Hmmm, looking over that, I think you mean gallery.header and gallery.footer - not wrapper - that would cause some PHP errors as far as I can tell. Not to mention none of the code you're referencing is in either of those files so far as I know.

    This is nice lawtai, except it's going to generate a seriously invalid page which looks to be a bit more complicated to fix than I can deal with right now.

  23. lawtai
    Member
    Posted 9 years ago #

    Actually, you do want wrapper and not gallery.header/footer. The thing is, you can't use PHP in integrating Gallery. You'll have to use HTML. It'll get the appearance of the rest of your webpage, but it won't have the dynamic aspect of the rest of your webpage.

  24. drewament
    Member
    Posted 9 years ago #

    Mine validates fine...

    http://validator.w3.org/check?uri=http://amentfamily.us/gallery

    And yes, you do want to use the WRAPPER. I am currently working on the dynamic changes (ie. when you changes themes, it changes tham on Gallery as well). I will update once complete. The only thing I won't be able to do is user integration...WAY over my head.

    Side note...THIS page does not validate!! Click link at bottom.

  25. lawtai
    Member
    Posted 9 years ago #

    You can leave the import call for the css file in, so that if you changed your stylesheet your gallery would also change as well. I have no idea how you would do it if you changed the theme of your site though, other than redoing the steps.

  26. drewament
    Member
    Posted 9 years ago #

    Here is a link to my WRAPPER for an example....

    http://amentfamily.us/gallery/html_wrap/wrapper.header.txt

  27. ceo
    Member
    Posted 9 years ago #

    ahh, i see my bad - that's what i get for fast glancing and not reading. :)

  28. BiTurbo27t
    Member
    Posted 9 years ago #

    You can check out my stab at integrating G2 with WP here:

    http://www.pixxelated.com/

    Please don't /. me! It's a self hosted site, and my bandwidth isn't great :(

    I still have a lot of things to finish, and I'll probably upgrade to G2 Beta2 over the weekend if I get the time which should help speed up the gallery section. Let me know if you like it ;)

  29. theglobalguy
    Member
    Posted 9 years ago #

    Looks fantastic! Any hints on how you accomplished that?

  30. BiTurbo27t
    Member
    Posted 9 years ago #

    Thanks TGG. Basically, WP and Gallery are still running seperately, I've just played with the style sheets and incorporated similiar graphics and elements between the two. It takes quite a bit of time, but so far I'm happy with how it's coming. I still need to figure out how to place my navigation links that are present on the home page (WP) into the G2 pages. My workaround for now was to make my whole banner a link back to the home page, but that's not obvious to everyone. It would be tough to put together a tutorial of what I did, because I've tweaked so many files (mostly in G2) for the design. A lot of trial and error. Essentially, I modified the arzel_xt2 theme, and added the image thumbnail scripts for Random, Most Viewed, etc. from G2 into my sidebar. Very easy to do. I'm not a PHP guru, and think that if arnoldjw can make a plug in that marries WP and Gallery gracefully and easily, it would be huge! Hope it works out. The way I've done things, I have to be really careful when upgrading G2, so as not to overwrite files I've changed and blowout my mods :-P

Topic Closed

This topic has been closed to new replies.

About this Topic