Attached is an enhanced gallery.module which has the following mods:
1) Ensure image type selection works
2) Allow for multiple images in the block
3) Use Gallery2 naming for Image Types
4) Set breadcrumb ****requires mod to main.php**** Kludge!
5) Add navigation block
6) Use Full Names (using profile.module) - degrades to username if not available
7) Include drupal/g2 css file (currently very basic)
8) Add parameter for max_size from depdev

See the README2.txt file for installation details.

Enjoy -- let me know if you have any problems.

Comments

pitpit’s picture

good work !!
juste some questions and comments:

- what does the "Use Full Names" feature you talk about ? (I don't have profile.module and can not test it) ?

- why did you alter
gallery_error(t('Error deleting Gallery user'), $ret); (L 126 on 1.10)
to
gallery_error(t('Error deleting Gallery user')); (L 182 on patched file)

- It is a shame to not be able to unselect every image data in the gallery block. there is a fix in my patch to do it work and avoid ' implode()' warning.

- I enjoy to be able to select multiple gallery block contents and to have the gallery navigation in the gallery sidebar !

- I just disagree to have to alter the main.php, could we not find another way?

thanks foryou work

Dpdev

sethcohn’s picture

very very nice. +1 on the mods.

kiz_0987’s picture

- what does the "Use Full Names" feature you talk about ? (I don't have profile.module and can not test it) ?

G2 uses Username and FullName in its user profiles. In the standard gallery.module these are both the drupal username. In my site (not up yet) I use Full Names in Drupal (using profile.module), so I wanted to transfer the same info into G2.

- why did you alter
gallery_error(t('Error deleting Gallery user'), $ret); (L 126 on 1.10)
to
gallery_error(t('Error deleting Gallery user')); (L 182 on patched file)

That's because I manually patched the file to v1.10 and got it wrong! I will update for the next version. Thanks.

- It is a shame to not be able to unselect every image data in the gallery block. there is a fix in my patch to do it work and avoid ' implode()' warning.

I did use your patch, so this should work -- I will retest it. Note that I did not use it for the Image Type as you should at least select one, but if you do not it will default to random.

- I just disagree to have to alter the main.php, could we not find another way?

Yes I hate it too, but that is the only way right now. There is a feature request in G2 to fix this -- you can vote on it to increase the chance it will happen (http://sourceforge.net/tracker/index.php?func=detail&aid=1257054&group_i...).

pitpit’s picture

I did use your patch, so this should work -- I will retest it. Note that I did not use it for the Image Type as you should at least select one, but if you do not it will default to random.
actually, it works, except when it has just been installed (no image type are selected), and we've got a warning on
$params['blocks'] = implode('|', variable_get('gallery_block_block_' . $delta, array('0'=>'randomImage')));
but everything is ok configuring 'gallery block'.

michelle’s picture

This is awesome! No need to mod the theme to move the sidebar into Drupal now. Great work!

I bugged bharat about it on IRC. He's always mega busy, but hopefully he or walkah will have some time to take a closer look at this. I think it's well worth adding to the official one, but it's not my module. :)

Michelle

michelle’s picture

There we go, no more patching main.php. Valiant was nice enough to commit the line. Now we just need to get the other stuff into the gallery.module :)

Michelle

chrisvdb’s picture

Hi,

Thanks for your work! It's a really big improvement...

I have one feature request... would it be possible to make the path (standard 'gallery') configurable? For example, if I prefer to have 'photos' as a path, then I have to go and change the module file manually in several places.

I also have one problem with the module. When I'm not logged in, the embedded gallery works perfectly. However, when I am logged in, I get the following error:

Unable to initialize embedded Gallery
Error (ERROR_MISSING_OBJECT)

* in modules/core/classes/helpers/GalleryUserHelper_medium.class at line 179 (GalleryStatus::error)
* in modules/core/classes/GalleryCoreApi.class at line 506 (GalleryUserHelper_medium::fetchUserByUserName)
* in /var/www/org.absurdistan/www/drupal/modules/gallery.module at line 469 (GalleryCoreApi::fetchUserByUserName)
* in /var/www/org.absurdistan/www/drupal/modules/gallery.module at line 265
* in ??? at line 0
* in /var/www/org.absurdistan/www/drupal/includes/module.inc at line 182
* in /var/www/org.absurdistan/www/drupal/modules/block.module at line 502
* in ??? at line 0
* in /var/www/org.absurdistan/www/drupal/includes/module.inc at line 182
* in /var/www/org.absurdistan/www/drupal/includes/theme.inc at line 864
* in ??? at line 0
* in /var/www/org.absurdistan/www/drupal/includes/theme.inc at line 194
* in /var/www/org.absurdistan/www/drupal/themes/engines/xtemplate/xtemplate.engine at line 190
* in ??? at line 0
* in /var/www/org.absurdistan/www/drupal/includes/theme.inc at line 190
* in /var/www/org.absurdistan/www/drupal/modules/block.module at line 387
* in ??? at line 0
* in /var/www/org.absurdistan/www/drupal/includes/menu.inc at line 354
* in /var/www/org.absurdistan/www/drupal/index.php at line 18

Any idea?

Thanks,
Chris.

tangent’s picture

Status: Needs review » Active

The file you attached isn't a patch. If you want to have a hope of having your changes added you should create a valid patch. The code probably needs a little cleanup as well (remove the commented debug code and such.

I highly recommend splitting your new features into separate feature requests and patches to have a higher chance of getting them accepted.

The breadcrumb and navigation block definitely desirable changes. However, I can't get the navigation block working on all views. The site admin view doesn't apply the rewrite rule of 'view item' so your code doesn't see the 'gallery' paramater. Another rewrite rule needs to be added for admin views or your code needs an update. I'm playing with various rewrite rules but haven't solved this yet.

michelle’s picture

chrisvdb - I've seen that error reported before and I believe it's from not having the image block module activated in Gallery 2.

Michelle

gingibash’s picture

Category: feature » task

enhanced gallery block works only for the first level navigation.

chrisvdb’s picture

MichelleC, gingibash,

Thanks for your replies!

MichelleC: the image block module is enabled in Gallery2. In fact, everything works just fine, as long as I don't log in!

gingibash: could you perhaps explain a bit more? The embedded gallery does work correctly when the user is not logged in...

The (test) site is online at http://chris.vandenberghe.org/drupal/photos.

Thanks again for your replies,
Chris.

gingibash’s picture

what i meant by only first level navigation links work is that when you enable gallery sidbar navigation (i use item actions in sidebar) in drupal it shows correctly, displays all item actions and the links work. then when you choose for example edit photo (from gallery navigation block), sidbar suddenly appears in embeded gallery (eventhough i disabled it in g2 themes) and gallery navigation block in drupal shows empty item actions list.

I hope this makes sense. I will try to put this online and let you see for yourself.

kiz_0987’s picture

Replies to a couple of points here:
- To #8: I did not include a patch file as the changes were extensive, so it was easier to include the whole thing. I'll try to clean up and apply as patches later. I agree with your point about individual patches for each feature and I may split it up a bit.
- To # 12: I understand your point about the sidebar moving from the drupal sidebar back into gallery2 when on admin pages. This is also described in comment #8. I'll also take a look at it.

If you want to see a demo of it check out:
- www.pineapplecat.net/gallery
- www.jitsuottawa.com/gallery

These are multi-site (for both Drupal and G2) with clean_urls/URL_Rewrite. Not totally IE friendly yet.

johndbritton’s picture

If you follow the edit album link while the navigation is being displayed in drupal sidebar, the navigation is shown inside of gallery and not in the sidebar.

kiz_0987’s picture

Yes, this has been previously reported above. It seems to be due to Gallery2 not gallery.module (as all the other sideblocks do stay in the Drupal sidebar, it's only the Item Links that does not). I have requested info on this in the G2 forum here (http://gallery.menalto.com/node/37812).

kos@lab.walkah.net_drupalgallery’s picture

When enable the Gallery Navigation Block it makes my side bar take up the whole screen once i enter any gallery pages.

Any ideas?

kiz_0987’s picture

This is probably a css related issue. What happens if you rename drupal_g2.css so that it is not included? One line that may cause issue in drupal_g2.css is width: auto; in the .block-gallery #gsSidebar declaration. Try commenting it and seeing the difference.

To debug css issues I use the DOM Inspector in Firefox (which is an install option -- if you do not see it under Tools you will need to reinstall).

tko’s picture

Tried commenting out width: auto but still the same problem.

I cant even give u a link for an example because the site is live and i just had to disable the block so that it wouldnt break everything.

kos@lab.walkah.net_drupalgallery’s picture

how can i make a user role and add users which have access to my site but not the gallery module?

kiz_0987’s picture

What exactly are you asking for here? Are you requesting that
1) these users have no access to gallery (ie can't see anything), or
2) that they cannot upload photos, or
3) that the gallery block does not appear?

1) not sure how to do.
2) would require a gallery group to be manually made. gallery.module does not yet support group sync between drupal and G2 (see feature request: http://drupal.org/node/32609)
3) Look at http://drupal.org/node/12445 for some ideas on how to do this. Or set the user visibility flags for the block (which may not be perfect for you)

tko’s picture

To be precise i would like to be able to set roles in drupal which DO and DONT have access to the gallery.

Do for example roles such as:

Full Users - can use full drupal features and can use gallery
Normal Users - can use full drupal features but not view/add to gallery

michelle’s picture

This page is getting way off topic and hard to follow. I suggest using the integration forums at http://gallery.menalto.com/forum/63 so each question can have its own post and so they get higher visibility than stuck here as responses to an issue.

Michelle

kiz_0987’s picture

StatusFileSize
new5.05 KB

As requested, I have added this as a patch file to cvs version instead of a new gallery.module. This has also been slightly updated:

28 Sept 2005
9) Fix incorrect inclusion of 1.10 patch (thanks depdev)
10) More careful $params['blocks'] parsing (thanks depdev)
4 Oct 2005
11) Simple bbcode parser for breadcrumb titles (italics only)

The patch is tar'd with the css and README2.txt files.

gautam_chandna’s picture

Category: task » feature

Hi,

I wanted to add taxonomies (and node type display) of images in Gallery. For that I have this as a basic plan :

This is how the Taxonomy is created [using multiple hierarchy]

GalleryVocabulary
-MainAlbumOneTerm
-MainAlbumTwoTerm
--SubAlbumOne
---SubSubAlbumOne

and so on..

One main Vocabulary for the whole gallery
Multiple Terms "AlbumOne" "AlbumTwo" and so on for the Albums in that particular level.

Each album having multiple "albumOne" "albumTwo" etc.. terms for more sub albums..

Each picture can be given more that one taxonomy term, hence linking of pictures in different albums is also possible.

Hope I'm getting through to all of you..

This is the functionality required for the Module that needs to be implemented.

On Installation -
1. Create a taxonomy Vocabulary for the gallery when installed.

On Addition of an Album or Photo
1. Creation of a Taxonomy Term in a theGalleryVocabulary, each time someone creates an album.

2. All photos contained in 'album' are listed under the term 'album'

3. The Item created also initiates the creation of a node type (could be page or story or anything for that matter) with the Title = Title in gallery, Body = Description in Gallery + the 'picture' (with a hyperlink to its gallery counterpart).

this way searches will lead you to picturesnodes and albumnodes, which when clicked on lead you to their respective albums within gallery. thus no duplication, presence within drupal as simple nodes and improved searching for the whole site.

(not sure what to do with the keywords stored in gallery for each pic - need help on that too.. is there any invisible node type? or some such?)
--------------------------

I'm quite new to making modules for drupal, so am not quite sure what exactly I should do now. Could you please recommend some modules that I could look at for this functionality (so that I can take'em apart and put'em back together?):

1. Creation of simple node with a title and body (guessing page.module should do this)

2. Creation of Taxonomy terms on the fly (guessing aggregator_otf.module)

Thanks for all the help!

[this was earlier a forum discussion located at this place. Let me know if I can help in any way.]

-Gautam Chandna

toddcortez’s picture

Gautam, I also really need Drupal taxomomy linkage with Gallery. But limiting it to a single "Gallery" vocabulary would not work for me at all. I need full access to all defined vocabularies. Also a Drupal "gallery2" node type would be really nice. I've been considering tackling this myself, but don't want to duplicate work that others may have already started (and I'm still quite new to Drupal coding). I'd love to participate in making this enhancement happen.

Todd

kiz_0987’s picture

The taxonomy discussion is well worth having and I'm sure will be long, so I've moved it to it's own thread -- please use: http://drupal.org/node/34607.

In terms of further gallery.module enhancements that I am working on (which do not currently include taxonomy support :-( I will soon upload a new beta (where beta means it might not work fully and could screw up your databases, so play with it but don't use it on a production site) with the following:

Proposed New features:
- add group support
- add photo frames and link target
- Allow order change of photos in the sidebar
- Add debugging options
- Add user view (display G2 and Drupal user IDs, show if there are any differences in the user info, display number of items a user has and link to their albums...) This will not be a comprehensive user sync page (yet).

Enhancements:
- Incorporate (modified) depdev patches for language selection and G2 path.
- Random password for blocked users (right now they can login via G2 (not Drupal) and add photos)
- better config page for full name (checkbox and name of field). Auto-detect if profile.module is installed.

Bug fixes:
- Fixed bug in menu item "gallery" -- needs a title field. Also changed to MENU_NORMAL_ITEM so that it will appear without the admin needing to set it.
- Fixed bug in search where extra & breaks links when clean_urls are not used.
- Fix for not found G2 item (currently gives a Gallery Error when URL Rewrite used)

I mention this in case anyone else is doing or had planned these features.

kiz_0987’s picture

Status: Active » Needs review
walkah’s picture

Hey gang... just catching up on this thread.

@kiz_0987 - looks like you've been hard at work on the integration - thanks for the continued efforts.

I have several comments - most importantly though, it would be much easier to manage if we had per-feature patches - since it's much easier to track, and when there are certain things that aren't ready - they won't block other features.

also, there's no need in a patch to comment where your changes are - that's the point of a patch.

please cleanup your patches (removing dprintr's etc - even if commented).

the profille mode (full name) doesn't seem to actaully be documented anywhere which hardcoded profile field you're looking for...

otherwise, i'll look into incorporating the other features ...

kiz_0987’s picture

StatusFileSize
new7.87 KB

Some people have been having issues applying the patch -- probably due to the number of variants of gallery.module floating around. So I've uploaded the actual module (kiz_0987_v1.1) to avoid this (along with the patch for those that want it).

taybin’s picture

This works great for me, once I found the various places for the necessary settings. The only remaining issue is getting it to look nice with my theme. But this is so much better than before. Thanks!

Floris’s picture

Version: » 4.6.x-1.x-dev
Category: feature » bug
Priority: Normal » Minor
StatusFileSize
new834 bytes

Because the gallery side-bar gets stripped (which gives my site the perfect outlook) I get a javascript error, because gallery checks the search block which off course is stripped. attached the code part which gives the error (site: www.vanrafelghem.be). I don't know if gallery should be paatched for this or you can make a slight adaptation in the module.

pegmonkey’s picture

Component: Code » Documentation
Category: bug » support
Status: Needs review » Active

Great module. I have a question though. Is the block supposed to show up on all nodes? I was sure it was, but then I moved my default gallerydata directory onto a raid array. I modified the config.php in gallery2 to reflect the change. Gallery2 works fine and the block works fine but only when I'm in sitename/gallery. Short of moving the gallerydata back to it's original location, is there something else I can check. I've verified the block settings are set to show the block on all nodes. I'm obviously missing something.

pegmonkey’s picture

Well, tried copying gallerydata back to original location. Same results. Maybe it never did show up on all nodes.

mlepore’s picture

As a response to #18 - the width question.

I was having this same problem with my integration.

First I tried commenting out the width: auto line, but that didn't help.

I continued to dig a bit and I found is that if I changed the Item Action links in the sidebar to use a dropdown list, the problem would go away. I think that the HTML there may have a problem that causes the width to go to full size.

nemot’s picture

Hi,

Great work on this - is exactly what I need. What is the status of the other improvements you mentioned? Also, will this module work with Drupal 4.7?

kiz_0987’s picture

It's not been updated for 4.7, although the cvs version of gallery.module has been. The other mods can be found in a beta version in http://drupal.org/node/35379

Canadrian-1’s picture

I've got problems with the Gallery block in this enhanced module.

  1. Displaying one random image, the top of the block displays the words "Random Image" twice on seperate lines.
  2. I can't get it to display the title of photos. All I get it the filename, even though I've selected Title in the block administration.

Otherwise a good module. Any ideas?

imerlin’s picture

Category: support » feature

I run a Gallery2 installation with Drupal.

I'm wondering if there's a way to make the Image Block only show specific subdirectories in Gallery2.

There are many users and each user has his own sub-gallery under /gallery2. So I'm wondering if it's possible to modify the image block to only show images specific to that user.

youri-1’s picture

Hey,

I'm always getting this errors:

Unable to initialize embedded Gallery
Error (ERROR_MISSING_OBJECT)
in modules/core/classes/helpers/GalleryUserHelper_medium.class at line 179 (gallerystatus::error)
in modules/core/classes/GalleryCoreApi.class at line 506 (galleryuserhelper_medium::fetchuserbyusername)
in /usr/data/websites/scheppers/www.commercieelwebverkeer.be/www/typo/modules/gallery.module at line 469 (gallerycoreapi::fetchuserbyusername)
in /usr/data/websites/scheppers/www.commercieelwebverkeer.be/www/typo/modules/gallery.module at line 265
in ??? at line 0
in /usr/data/websites/scheppers/www.commercieelwebverkeer.be/www/typo/includes/module.inc at line 182
in /usr/data/websites/scheppers/www.commercieelwebverkeer.be/www/typo/modules/block.module at line 502
in ??? at line 0
in /usr/data/websites/scheppers/www.commercieelwebverkeer.be/www/typo/includes/module.inc at line 182
in /usr/data/websites/scheppers/www.commercieelwebverkeer.be/www/typo/includes/theme.inc at line 864
in ??? at line 0
in /usr/data/websites/scheppers/www.commercieelwebverkeer.be/www/typo/includes/theme.inc at line 194
in /usr/data/websites/scheppers/www.commercieelwebverkeer.be/www/typo/themes/engines/phptemplate/phptemp... at line 210
in ??? at line 0
in /usr/data/websites/scheppers/www.commercieelwebverkeer.be/www/typo/includes/theme.inc at line 190
in /usr/data/websites/scheppers/www.commercieelwebverkeer.be/www/typo/includes/common.inc at line 216
in /usr/data/websites/scheppers/www.commercieelwebverkeer.be/www/typo/index.php at line 21

Grtz

Youri

Canadrian-1’s picture

Category: feature » support
Priority: Minor » Critical

I've just made the stupid, stupid, stupid mistake of installing the CVS Gallery 2.1 over my existing gallery. I love the enhanced Gallery module, but unfortunately now it's broken (my whole website, actually). Is there any chance that the 2.1 integration changes from http://drupal.org/node/45159 could be quickly hacked into this enhanced Gallery module?

sifuhall’s picture

I just installed this and wow, it is fantastic.

One question, before I installed this enhancement the process to upload new images was obvious, now I do not see a link to upload a new image.

Did I do something wrong?

Here is my implementation.

http://www.devotion160.com/gallery

andy2605’s picture

Priority: Critical » Normal

Great module and great enhancements!!

1 small issue, in the gallery navigation block, when i select an album, i get 2 listings of the album list

Gallery
album 1
album 2
album 3

Gallery
album 1
etc

Any Ideas?

Also how do i get rid of the standard gallery header? tried uncommenting the css file to no joy

using ver 1.13 of the kiz0987 gallery.module

Canadrian-1’s picture

Sorry to keep pushing here, but... is this module still in active development? Now that G2.1 RC1 is out, what is the status of 2.1 compatability? This module is sweet as candy, but unfortunately I've made the 2.1 plunge and there's no looking back...

fazizi’s picture

Check out my comment #14
http://drupal.org/node/45159#comment-79711

Basically one of the tasks is to migrate the isError() calls, which is pretty straightforward.
I fixed that part based on stardog's initial "hacks", but I haven't taken a look at what else he did to get it working.

If I had more time I could probably do a diff and patch kiz's module, since it looks like it is superior (no offense) to stardog's (sans Gallery 2.1 support).

jivyb’s picture

Title: Enhanced gallery.module » how to set number of images in block?

Hi. I don't see any options for increasing the number of images in a block on the admin>blocks>gallery block page. How do you set the number of images in a block? Also, is there any way to display them in a horizontal row? alter the drupal_g2.css file?

Thanks!

sethcohn’s picture

Title: how to set number of images in block? » Enhanced gallery.module
Component: Documentation » Code

Please do NOT change the title of issues!!

Back on topic, is there any progress on a 2.1 compatible version of this???

jivyb’s picture

Wow--easy there. First, I was just trying to fill out the "title" field in the form. Apparently you're referring to some unwritten ettiquette not in the formatting guidelines? Second, how is asking about setting the number of pictures in an image block off topic when

2) Allow for multiple images in the block

is listed in the description above?

globo’s picture

Sorry to keep pushing here, but... is this module still in active development? Now that G2.1 RC1 is out, what is the status of 2.1 compatability? This module is sweet as candy, but unfortunately I've made the 2.1 plunge and there's no looking back...

I'm not involved into the development. I wrote an email to both developers and got a response. They are working on the module. So be patient, they will be releasing it when it's done.

Just thought I'd let you know. It made me feel a lot better to hear that we're not building our site around an abondoned module.

globo

michelle’s picture

jivyb -

The problem is that changing the title changes the title on the _entire thread_, not just for your comment like it does in the forums. It's an easy mistake to make and I've done it myself. Just something you need to be careful of when responding on issues.

Michelle

sethcohn’s picture

bump.

With the official release of 2.1, can someone PLEASE do a 4.6 module that works with G2.1 ?

kiz_0987’s picture

Status: Active » Closed (fixed)

Now in the main version.