Tracker: Feature Requests

5 [G2] Apply Random highlight to subalbums - ID: 1262188
Last Update: Comment added ( xkdoan )

It's a tadious job to recursively go into every album
and subalbum to turn the random highlight.


Nobody/Anonymous ( nobody ) - 2005-08-17 15:09

5

Open

None

Nobody/Anonymous

None

Gallery 2

Public


Comments ( 8 )

Date: 2009-10-17 05:48
Sender: xkdoan

Based on AXK's contribution, here are the steps to enable random highlights
on all sub-albums:

Step 1: Create a temporary table with information about folder objects
---------
CREATE TABLE a_random
SELECT g2_Entity.g_id, g2_Entity.g_onLoadHandlers
FROM g2_Derivative
INNER JOIN g2_ChildEntity ON g2_Derivative.g_id = g2_ChildEntity.g_id
INNER JOIN g2_Entity ON g2_Derivative.g_id = g2_Entity.g_id
WHERE
g2_ChildEntity.g_parentId IN
(select g_id from g2_Entity where g_entityType = 'GalleryAlbumItem')
AND g2_Derivative.g_derivativeType = 1;

---------------------------------------------------------------------------------------------------------------
Step 2: Update g2_Entity table with the appropriate values
---------
UPDATE g2_Entity a, a_random c
SET a.g_onLoadHandlers='whatever'
WHERE a.g_id = c.g_id;

---------------------------------------------------------------------------------------------------------------
Step 1: Force Gallery2 to query the database for new information
---------
Admin > Gallery > Maintenance > Clear Database Cache

Cheers,


Date: 2007-05-10 19:47
Sender: axk


addendum to the sql query: make sure to clear the database cache (Site
Admin > Gallery > Maintenance) after directly updating the database.


Date: 2007-05-10 19:22
Sender: axk


very tedious, indeed. this has been bugging me for quite some time now, so
i finally took some time, logged sql queries and poked here and there and
figured the sql to extract the random highlight information. here it is:

SELECT g2_Entity.g_id, g2_Entity.g_onLoadHandlers
FROM g2_Derivative
INNER JOIN g2_ChildEntity ON g2_Derivative.g_id = g2_ChildEntity.g_id
INNER JOIN g2_Entity ON g2_Derivative.g_id = g2_Entity.g_id
WHERE
g2_ChildEntity.g_parentId IN
(select g_id from g2_Entity where g_entityType = 'GalleryAlbumItem')
AND g2_Derivative.g_derivativeType = 1;

this is for RandomHighlight module v0.8.6 or newer (before, there was a
RandomHighlightDerivativeImage entity type).

(re)setting random highlight for all your albums should be a snap now :)

would be great if this could be done from the admin ui. and if there was a
default setting for new albums. thanks everyone for that!



Date: 2007-03-31 16:53
Sender: nobody

Logged In: NO

requested for over 1-1/2 year and still no update. This may not be a high
priority request, but 1-1/2 year? Come on!


Date: 2006-12-19 09:32
Sender: nobody

Logged In: NO

Where is the information stored if an album uses random highlighted
images? I would be satisfied if could change the settings with an sql
query.


Date: 2006-10-31 19:46
Sender: the_man_stephen

Logged In: YES
user_id=932005

I would like to see this option!


Date: 2006-09-05 14:49
Sender: oldiesmann

Logged In: YES
user_id=767280

I would like to see this as well, along with a global album
option that allows you to enable random highlight by default
(so you don't have to enable it manually everytime you
create a new album).


Date: 2006-05-09 21:25
Sender: nobody

Logged In: NO

Where is the information for each album to be random
highlight or not stored? I could not find it in the SQL
database.


Attached File

No Files Currently Attached

Changes ( 3 )

Field Old Value Date By
category_id deleted 2008-10-24 19:29 ckdake
artifact_group_id None 2005-08-18 17:44 mindless
summary Apply Random highlight to subalbums 2005-08-18 17:44 mindless