I don't code so be gentle....
I believe that a change by PLG to the script has broken it. Referring below, gallery2 table column names have a g_ prefix thus the $opt{'menalto-prefix'} (referring to the table name prefix) substitution is wrong. I did not get things working by changing $opt{'menalto-prefix'} where it seemed appropriate (knowing appropriate is the issue:-) but the script runs by copying back dschwen's original block o' code. There are 3 points in the script where this error exists.
- SELECT
- f.g_id, i.g_title, i.g_summary, i.g_description, i.g_canContainChildren, a.g_orderWeight, a.g_viewCount
- FROM
- g2_FileSystemEntity f, g2_ChildEntity c, g2_Item i, g2_ItemAttributesMap a
- WHERE
- i.g_id = f.g_id AND
- f.g_id = c.g_id AND
- i.g_id = a.g_itemId AND
- c.g_parentId = ".$db1->quote($parentId)." AND
- f.g_pathComponent=".$db1->quote($path[$level-1]).";
- ";
+SELECT
+ f.".$opt{'menalto-prefix'}."id,
+ i.".$opt{'menalto-prefix'}."title,
+ i.".$opt{'menalto-prefix'}."summary,
+ i.".$opt{'menalto-prefix'}."description,
+ i.".$opt{'menalto-prefix'}."canContainChildren,
+ a.".$opt{'menalto-prefix'}."orderWeight,
+ a.".$opt{'menalto-prefix'}."viewCount,
+ FROM_UNIXTIME(e.".$opt{'menalto-prefix'}."creationTimestamp)
+ FROM ".$opt{'menalto-prefix'}."Item i
+ JOIN ".$opt{'menalto-prefix'}."FileSystemEntity f ON i.".$opt{'menalto-prefix'}."id = f.".$opt{'menalto-prefix'}."id
+ JOIN ".$opt{'menalto-prefix'}."ChildEntity c ON f.".$opt{'menalto-prefix'}."id = c.".$opt{'menalto-prefix'}."id
+ JOIN ".$opt{'menalto-prefix'}."ItemAttributesMap a ON i.".$opt{'menalto-prefix'}."id = a.".$opt{'menalto-prefix'}."itemId
+ JOIN ".$opt{'menalto-prefix'}."Entity e ON e.".$opt{'menalto-prefix'}."id = i.".$opt{'menalto-prefix'}."id
+ WHERE c.".$opt{'menalto-prefix'}."parentId = ".$db1->quote($parentId)."
+ AND f.".$opt{'menalto-prefix'}."pathComponent=".$db1->quote($path[$level-1])."
+;";