1
Original code:
function PDd_letters()
{
global $xoopsModule;
if (empty($mydirname)){
include 'mydirname.php';
}
$letterchoice = "<div>" . _MD_PDD_BROWSETOTOPIC . "</div>";
$letterchoice .= "[ ";
$alphabet = PDd_getLetters();
$num = count($alphabet) - 1;
$counter = 0;
while (list(, $ltr) = each($alphabet))
{
$letterchoice .= "<a href='" . XOOPS_URL . "/modules/[b]$mydirname[/b]/viewcat.php?list=$ltr'>$ltr</a>";
if ($counter == round($num / 2))
$letterchoice .= " ]<br />[ ";
elseif ($counter != $num)
$letterchoice .= " | ";
$counter++;
}
$letterchoice .= " ]";
return $letterchoice;
}
Link on alphabet shows:
http://www.mydomain.com/modules//viewcat.php?list=alphabet
The module name does not show.
So I have to hardcode in the module name PDdownloads to make it work.
$letterchoice .= "<a href='" . XOOPS_URL . "/modules/[b]PDdownloads[/b]/viewcat.php?list=$ltr'>$ltr</a>";
Any other idea on how to fix this?