Your module would look something like this:
[code]
//get the info
if ($my->id != 0) {
$user_id = $my->id;
} else {
$user_id = '';
}
//parameters
$database->setQuery("SELECT * FROM #__gallery2");
$param = $database->loadRowList();
/* extract params from the DB query */
$MOS_GALLERY2_PARAMS = array();
foreach ($param as $curr) {
$MOS_GALLERY2_PARAMS[$curr[0]] = $curr[1];
}
if (! defined("MOS_GALLERY2_PARAMS_PATH")) {
define ("MOS_GALLERY2_PARAMS_PATH",$MOS_GALLERY2_PARAMS['path']);
}
if (! defined("MOS_GALLERY2_PARAMS_RELATIVEG2PATH")) {
define ("MOS_GALLERY2_PARAMS_RELATIVEG2PATH",$MOS_GALLERY2_PARAMS['relativeG2Path']);
}
if (! defined("MOS_GALLERY2_PARAMS_EMBEDURI")) {
define ("MOS_GALLERY2_PARAMS_EMBEDURI",$MOS_GALLERY2_PARAMS['embedUri']);
}
if (! defined("MOS_GALLERY2_PARAMS_EMBEDPATH")) {
define ("MOS_GALLERY2_PARAMS_EMBEDPATH",$MOS_GALLERY2_PARAMS['embedPath']);
}
if (! defined("MOS_GALLERY2_PARAMS_LOGINREDIRECT")) {
define ("MOS_GALLERY2_PARAMS_LOGINREDIRECT",$MOS_GALLERY2_PARAMS['loginredirect']);
}
$start_id = 'null';
$max_depth = 'null';
//here we go
$ret = GalleryEmbed::init(array(
'embedUri' => MOS_GALLERY2_PARAMS_EMBEDURI,
'embedPath' => MOS_GALLERY2_PARAMS_EMBEDPATH,
'relativeG2Path' => MOS_GALLERY2_PARAMS_RELATIVEG2PATH,
'loginRedirect' => MOS_GALLERY2_PARAMS_LOGINREDIRECT,
'activeUserId' => $user_id,
'fullInit' => true,
'activeLanguage' => $lang));
list ($ret, $tree) = GalleryCoreApi::fetchAlbumTree($start_id, $max_depth);
if ($ret->isError()) {
if ($ret->getErrorCode() & ERROR_PERMISSION_DENIED) {
$tree = null;
} else {
return array($ret->wrap(__FILE__, __LINE__), null);
}
}//end error
list ($ret, $items) = GalleryCoreApi::loadEntitiesById(GalleryUtilities::arrayKeysRecursive($tree));
if ($ret->isError()) {
return array($ret->wrap(__FILE__, __LINE__), null);
}
foreach ($items as $item) {
$title = $item->getTitle() ? $item->getTitle() : $item->getPathComponent();
$titles[$item->getId()] = preg_replace('/\r\n/', ' ', $title);
//print "$title";
$itemId = $item->getId();
print ''.$title.'
';
}
GalleryEmbed::done();
[/code]
this is rough code and doesn't give depth of the album!!