type, (array)node_gallery_get_types('image'))) { //if there is no gid value, find it out if (!is_numeric($object->gid)) { $gallery = db_fetch_object(db_query("SELECT * FROM {node_galleries} WHERE nid = %d", $object->nid)); $object->gid = $gallery->gid; } $parent_path = 'node/'. $object->gid; if (module_exists('path')) { $parent_path = drupal_get_path_alias($parent_path); } // Load up the title of the parent $parent_title = db_result(db_query("SELECT title FROM {node} WHERE nid = '". $object->gid ."'")); $tokens['parent-node-gallery-path'] = decode_entities(check_plain($parent_path)); $tokens['parent-node-gallery-path-raw'] = $parent_path; $tokens['parent-node-gallery-title'] = decode_entities(check_plain($parent_title)); $tokens['parent-node-gallery-title-raw'] = $parent_title; return $tokens; } }