OK, I need to "hide" an album from viewing.... unless someone knows the exact URL to the album.
1. Is this possible with the standard gallery software? (I'm using the latest nightly build as of yesterday).
2. If not, can someone please instruct me as to where the SQL query is that pulls the albums and shows them on the main page? I just need to add a WHERE clause to the query, if possible.
Thanks!
Jenn
Posts: 178
Why don't you use Gallery's permission system to hide the album and create a user that view that album?
Posts: 40
Well, here's the deal.... NO ONE should be able to view it directly from www.newdawncustoms.com/coverage/ (it's the very last album....). EVERYONE should only be able to view it from the direct URL. (Coverage is our events coverage section, but I'm using the gallery to double as a "Member's Vehicles" section as well.
Posts: 32509
you'll have this feature in G 2.1, but it's not yet part of g2.
Posts: 40
Can you tell me where to find the SQL query? I can make it do what I want if I could find it.
Posts: 32509
modules/core/classes/helpers/GalleryChildEntityHelper_simple.class function _fetchChildItemIds
but this function is pretty much the most unreadable method of g2...
Posts: 40
Yes, I see that.... you guys don't make anything easy do you?? :D
I see no SQL queries there in that function, by the way....
Posts: 32509
$gallery->search(sql query here)
is used in g2.
our SQL is slightly different from the mysql / postgresql / oracle / .. .SQL
- we use the names of our classes instead of tables, e.g. [GalleryEntity] instead of g2_Entity. the db layer of g2 replaces the class names with the table names
- we use class member names instead of column names, e.g. [GalleryEntity::id] instead of g2_Entity.g_id
that's about it.
special things as LIMIT, bit operations etc. are also abstracted since they are not implemented the same way in all databases
in this fetchChildItemIds function, we're assembling the SQL query. thus it's very, very unreadable. we even marked the function as unreadable, we need to refactor it.
Posts: 40
So, basically unless I spend the time to de-code the coding structure, I'm SOL....
Is there a way I can modify the Siriux theme to NOT show galleries prior to 2003?? Does this sound feasible?
Posts: 32509
in theme.inc of siriux, function showAlbumPage, you can check the children's creationTimestamp and remove them from the list...
Posts: 40
I'm so sorry that I'm being so difficult.... but I honestly don't see how to do that.... I really could just put if($item_id != "126875") { around the code that shows the albums.... but unfortunately I'm not entirely sure which code shows them....
Posts: 32509
of course you can also check for other child properties
Posts: 40
OK, now the function looks like this:
And it's not working.....
Posts: 32509
as far as i understand you, you want that the album with id 12876 is not listed when you browse the parent album of album 12867. correct?
what exactly does it still show? the thumbnail for 12867?
Posts: 40
Please see http://www.newdawncustoms.com/coverage/
Click to page 3. The last album (Member Vehicles) I do not want to show on the main page. It's ID is 12867. Or, I set the year to 2002, so if we could not show any albums with the "creationdate" as anything in 2002.
Posts: 32509
hmm, let's debug.
in your foreach loop, do a print "$id, "; and after the foreach call exit;
then browse to http://www.newdawncustoms.com/coverage/main.php?g2_view=core.ShowItem&g2_itemId=7&g2_page=3 and check what ids are printed.
Posts: 40
On page one, it lists 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 etc..... up to as many album that show.... on page three it says 0, 1 (since there are only two albums listed).
I added print "$id <br />"; underneath the foreach() function.
Posts: 32509
aha, the keys of the children array aren't the child ids...
use this instead:
foreach ($theme['children'] as $id => $child) {
if ($child['id'] == '12867') {
unset($theme['children'][$id]);
}
}
Posts: 40
PERFECT! Thank you SOOOOO much! I'll try and remember all this for next time I need to change something..... lol.
You're fantastic.
Posts: 32509
np
glad it works for you. of course it's far from perfect and the official hide feature will be much better.
Posts: 40
Yes, as soon as 2.1 is released I'm certain I will upgrade and use the real feature, but for now this is good!
Posts: 23
Has anyone an idea, when Gallery 2.1 will be released?
I'm waiting for the hide-feature, too ... and still stay on Gallery 1.x to have this.
Posts: 32509
the hide feature is already available in nightly snapshots of g2. go get it...
g2.1 will be released on march 1st (tentative release date).
Posts: 38
Unless I am reading the original request wrong, I already do exactly what the original request was asking for, by just using permissions.
In my own gallery2 implementation http://www.pjamedia.com/gallery2 even if you are logged in (as a regular user, not admin) or not , there is one hidden album, which you have to enter the exact URL to access. The exact URL is: http://www.pjamedia.com/gallery2/v/hidden/rawresults/
The way I did it was to create a root level album for which only the Admin user has permission - so no one else can see this. This is called Hidden (surprisingly enough!) I then create a sub-album under this which has everybody View Items permissions assigned.
Isn't that what was being asked for, or did I read it wrong?
Cheers,
Paul
Posts: 32509
it's not quite the same.
of course you can hide something behind a "door / mountain". but if you don't want to use a non-public album just as obstacle to hide things behind it (e.g. because you don't want longer URLs), then the hidden items module is what you want.
Posts: 53
I bumped from G2.0 to G2.1 20060206 today and am trying to get the Hidden module to work. I've activated and isntalled it, but I can't find any interface for it on the item pages.
Can any give me an idea where I would actually hide something? I suspect that it should be the actions drop-down below the item (near "Edit Permissions"?) but I see no menu item.
I've now officially spent hours trying to chase this down.
Help?
Posts: 32509
install and activate the module.
then go to a album, click edit album and there set the password at the bottom.
Posts: 53
Aha! Found the check-box.
This seems kinda ... well ... buried. Wouldn't it make sense to have "Hide/Unhide Item" available as a menu selection in the << item actions >> menu beneath the albums/photos?
Also - is there a way view thumbnails for all the contents of an album, check box the items I want, and hide them en masse? Seems this would also be much faster than individually editing each item.
Posts: 32509
obviously there's no such mass hide option. just hide the whole album..
you can of course file feature requests on http://sf.net/projects/gallery/ -> RFE
Posts: 53
Consider it filed: 1426690