1
I recently read a question asking if the 'upload' and 'user album' links could be added to the main page of Extgallery instead of it being visible only in the main menu block. I had a requirement to do this myself recently, so I hope this may help someone else. It's pretty easy (this is for Extgallery version 1.11 updated by Zoullou + Xoops 2.5.5). Obviously, create backups first.
Firstly, in 'extgallery/index.php' add the following, before the footer include line:
// pk add upload and view-my-album links to main page
if(isset($GLOBALS['xoopsModule']) && $GLOBALS['xoopsModule']->getVar('dirname') == "extgallery") {
if($GLOBALS['xoopsUser'] != null) {
$albumlinkname = _MD_EXTGALLERY_USERALBUM;
$albumurl = "public-useralbum.php?id=".$GLOBALS['xoopsUser']->uid();
}
include_once XOOPS_ROOT_PATH.'/modules/extgallery/class/publicPerm.php';
$permHandler = ExtgalleryPublicPermHandler::getHandler();
if(count($permHandler->getAuthorizedPublicCat($GLOBALS['xoopsUser'], 'public_upload')) > 0) {
$uploadlinkname = _MD_EXTGALLERY_PUBLIC_UPLOAD;
if($GLOBALS['xoopsModuleConfig']['use_extended_upload'] == 'html') {
$uploadurl = "public-upload.php";
} else {
$uploadurl = "public-upload-extended.php";
}
}
}
$xoopsTpl->assign('albumlinkname', $albumlinkname);
$xoopsTpl->assign('albumurl', $albumurl);
$xoopsTpl->assign('uploadlinkname', $uploadlinkname);
$xoopsTpl->assign('uploadurl', $uploadurl);
// end pk mod
Next, add the links to 'templates\extgallery_index.html'. You can style these links as required, or turn them into buttons.
<div>
<a title="<{$albumlinkname}>" href="<{xoAppUrl modules/extgallery/}><{$albumurl}>"><{$albumlinkname}>a> <br />
<a title="<{$uploadlinkname}>" href="<{xoAppUrl modules/extgallery/}><{$uploadurl}>"><{$uploadlinkname}>a>
div>
Finally, add a new language definition to 'language\english\main.php':
// pk add my user def for new album link
define("_MD_EXTGALLERY_USERALBUM","View my album");
HTH