Welcome to Geeklog, Anonymous Wednesday, November 27 2024 @ 11:41 am EST
Geeklog Forums
FYI - Media Gallery - Random Image block not available
Status: offline
MartinD
Forum User
Newbie
Registered: 01/15/13
Posts: 13
When you install Media Gallery in GL2 it works fine but the Random Image block will not be available.
The following install script will fail due to the new Topic feature (Multiple) as the Tid column is gone from new block structure. It's easy to fix by changing the insert statement to remove the tid and value ("all" from the script (BLOCK insert) and by manually adding a record to the (your table prefix)topic_assignments table.
install script
DB_query("INSERT INTO {$_TABLES['blocks']} (is_enabled, name, type, title, [b]tid[/b], blockorder, content, rdfurl, rdfupdated, onleft, phpblockfn, help, group_id, owner_id, perm_owner, perm_group, perm_members,perm_anon) VALUES (0, 'mgrandom', 'phpblock', '" . $LANG_MG00['mg_block_header'] . "', 'all', 0, '', '', 0, 1, 'phpblock_mg_randommedia','', 4, 2, 3, 3, 2, 2);",1);
DB_query("INSERT INTO {$_TABLES['blocks']} (is_enabled, name, type, title, [b]tid[/b], blockorder, content, rdfurl, rdfupdated, onleft, phpblockfn, help, group_id, owner_id, perm_owner, perm_group, perm_members,perm_anon) VALUES (0, 'mgenroll', 'phpblock', '" . $LANG_MG00['mg_enroll_header'] . "', 'all', 0, '', '', 0, 1, 'phpblock_mg_maenroll','', 4, 2, 3, 3, 2, 0);",1);
my BLOCK insert statement
INSERT INTO cgc_blocks (is_enabled, name, type, title, blockorder, content, rdfurl, rdfupdated, onleft, phpblockfn, help, group_id, owner_id, perm_owner, perm_group, perm_members,perm_anon) VALUES (1, 'mgrandom', 'phpblock', 'Random Image', 0, '', '', 0, 1, 'phpblock_mg_randommedia','', 4, 2, 3, 3, 2, 2);
INSERT INTO cgc_blocks (is_enabled, name, type, title, blockorder, content, rdfurl, rdfupdated, onleft, phpblockfn, help, group_id, owner_id, perm_owner, perm_group, perm_members,perm_anon) VALUES (0, 'mgenroll', 'phpblock', 'Album Enrollment', 0, '', '', 0, 1, 'phpblock_mg_maenroll','', 4, 2, 3, 3, 2, 0);
my TOPIC_ASSIGMENTS insert
INSERT INTO cgc_topic_assignments (`tid` ,`type` ,`id` ,`inherit` ,`tdefault` ) VALUES ('All', 'block', '16', '0', '0'),
INSERT INTO cgc_topic_assignments (`tid` ,`type` ,`id` ,`inherit` ,`tdefault` ) VALUES ('All', 'block', '18', '0', '0');
(16 & 18 are the block ids from the BLOCK table)
Hope this Helps (someone)
The following install script will fail due to the new Topic feature (Multiple) as the Tid column is gone from new block structure. It's easy to fix by changing the insert statement to remove the tid and value ("all" from the script (BLOCK insert) and by manually adding a record to the (your table prefix)topic_assignments table.
install script
Text Formatted Code
DB_query("INSERT INTO {$_TABLES['blocks']} (is_enabled, name, type, title, [b]tid[/b], blockorder, content, rdfurl, rdfupdated, onleft, phpblockfn, help, group_id, owner_id, perm_owner, perm_group, perm_members,perm_anon) VALUES (0, 'mgrandom', 'phpblock', '" . $LANG_MG00['mg_block_header'] . "', 'all', 0, '', '', 0, 1, 'phpblock_mg_randommedia','', 4, 2, 3, 3, 2, 2);",1);
DB_query("INSERT INTO {$_TABLES['blocks']} (is_enabled, name, type, title, [b]tid[/b], blockorder, content, rdfurl, rdfupdated, onleft, phpblockfn, help, group_id, owner_id, perm_owner, perm_group, perm_members,perm_anon) VALUES (0, 'mgenroll', 'phpblock', '" . $LANG_MG00['mg_enroll_header'] . "', 'all', 0, '', '', 0, 1, 'phpblock_mg_maenroll','', 4, 2, 3, 3, 2, 0);",1);
my BLOCK insert statement
Text Formatted Code
INSERT INTO cgc_blocks (is_enabled, name, type, title, blockorder, content, rdfurl, rdfupdated, onleft, phpblockfn, help, group_id, owner_id, perm_owner, perm_group, perm_members,perm_anon) VALUES (1, 'mgrandom', 'phpblock', 'Random Image', 0, '', '', 0, 1, 'phpblock_mg_randommedia','', 4, 2, 3, 3, 2, 2);
INSERT INTO cgc_blocks (is_enabled, name, type, title, blockorder, content, rdfurl, rdfupdated, onleft, phpblockfn, help, group_id, owner_id, perm_owner, perm_group, perm_members,perm_anon) VALUES (0, 'mgenroll', 'phpblock', 'Album Enrollment', 0, '', '', 0, 1, 'phpblock_mg_maenroll','', 4, 2, 3, 3, 2, 0);
my TOPIC_ASSIGMENTS insert
Text Formatted Code
INSERT INTO cgc_topic_assignments (`tid` ,`type` ,`id` ,`inherit` ,`tdefault` ) VALUES ('All', 'block', '16', '0', '0'),
INSERT INTO cgc_topic_assignments (`tid` ,`type` ,`id` ,`inherit` ,`tdefault` ) VALUES ('All', 'block', '18', '0', '0');
(16 & 18 are the block ids from the BLOCK table)
Hope this Helps (someone)
14
12
Quote
Status: offline
Laugh
Site Admin
Admin
Registered: 09/27/05
Posts: 1470
Location:Canada
Thanks for the fix MartinD.
I know the Media Gallery is being worked on at the moment so hopefully in the near future it will be released with the fix and some new features.
One of the Geeklog Core Developers.
I know the Media Gallery is being worked on at the moment so hopefully in the near future it will be released with the fix and some new features.
One of the Geeklog Core Developers.
11
10
Quote
All times are EST. The time is now 11:41 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content