Example #1
0
        $catTitle = $myts->htmlSpecialChars($mainCatTitleArray[$catKey]['title']);
        $rankings[$catKey]['title'] = sprintf(_MD_MYLINKS_TOP10, $catTitle);
        $rank = 1;
        while (list($lid, $lcid, $ltitle, $hits, $rating, $votes) = $xoopsDB->fetchRow($result)) {
            $thisCatObj = $mylinksCatHandler->get($lcid);
            $homePath = "<a href='" . XOOPSMYLINKURL . "/index.php'>" . _MD_MYLINKS_MAIN . "</a>&nbsp;:&nbsp;";
            $itemPath = "<a href='" . XOOPSMYLINKURL . "/viewcat.php?cid={$lcid}'>" . $thisCatObj->getVar('title') . "</a>";
            $path = '';
            $myParent = $thisCatObj->getVar('pid');
            while ($myParent != 0) {
                $ancestorObj = $myCatTree->getByKey($myParent);
                $path = "<a href='" . XOOPSMYLINKURL . "/viewcat.php?cid=" . $ancestorObj->getVar('cid') . "'>" . $ancestorObj->getVar('title') . "</a>&nbsp;:&nbsp;{$path}";
                $myParent = $ancestorObj->getVar('pid');
            }
            $path = "{$path}{$itemPath}";
            $path = str_replace("&nbsp;:&nbsp;", " <img src='" . mylinksGetIconURL('arrow.gif') . "' style='border-width: 0px;' alt='' /> ", $path);
            $thisRanking = array('id' => $lid, 'cid' => $catKey, 'rank' => $rank, 'title' => $myts->htmlSpecialChars($ltitle), 'category' => $path, 'hits' => $hits, 'rating' => number_format($rating, 2), 'votes' => $votes);
            $rankings[$catKey]['links'][$rank] = $thisRanking;
            $rank++;
        }
    }
}
$rankings = empty($rankings) ? '' : $rankings;
$xoopsTpl->assign('rankings', $rankings);
unset($rankings);
//wanikoo theme changer
$xoopsTpl->assign('lang_themechanger', _MD_MYLINKS_THEMECHANGER);
$mymylinkstheme_options = '';
foreach ($GLOBALS['mylinks_allowed_theme'] as $mymylinkstheme) {
    $mymylinkstheme_options .= "<option value='{$mymylinkstheme}'";
    if ($mymylinkstheme == $GLOBALS['mylinks_theme']) {
$nicePathFromId = '';
$pathFromId = '';
$myParent = $thisCatObj->getVar('pid');
while ($myParent != 0) {
    $ancestorObj = $myCatTree->getByKey($myParent);
    $nicePathFromId = "<a href='" . XOOPSMYLINKURL . "/viewcat.php?cid=" . $ancestorObj->getVar('cid') . "'>" . $ancestorObj->getVar('title') . "</a>&nbsp;:&nbsp;{$nicePathFromId}";
    $pathFromId = $ancestorObj->getVar('title') . "/{$pathFromId}";
    $myParent = $ancestorObj->getVar('pid');
}
$nicePathFromId = "{$homePath}{$nicePathFromId}{$niceItemPath}";
$nicePathFromId = str_replace("&nbsp;:&nbsp;", " <img src='" . mylinksGetIconURL('arrow.gif') . "' style='border-width: 0px;' alt='' /> ", $nicePathFromId);
$pathFromId = _MD_MYLINKS_MAIN . "/{$pathFromId}{$itemPath}";
$pathFromId = str_replace("/", " <img src='" . mylinksGetIconURL('arrow.gif') . "' style='border-width: 0px;' alt='' /> ", $pathFromId);
$xoopsTpl->assign('category_path', $nicePathFromId);
if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->mid())) {
    $adminlink = "<a href='" . XOOPSMYLINKURL . "/admin/index.php?op=modLink&amp;lid={$lid}'><img src='" . mylinksGetIconURL("edit.png") . "' style='border-width: 0px;' alt='" . _MD_MYLINKS_EDITTHISLINK . "' /></a>";
} else {
    $adminlink = '';
}
$votestring = 1 == $votes ? _MD_MYLINKS_ONEVOTE : sprintf(_MD_MYLINKS_NUMVOTES, $votes);
if (1 == $xoopsModuleConfig['useshots']) {
    $xoopsTpl->assign('shotwidth', $xoopsModuleConfig['shotwidth']);
    $xoopsTpl->assign('tablewidth', $xoopsModuleConfig['shotwidth'] + 10);
    $xoopsTpl->assign('show_screenshot', true);
    $xoopsTpl->assign('lang_noscreenshot', _MD_MYLINKS_NOSHOTS);
}
$new = newlinkgraphic($time, $status);
$pop = popgraphic($hits);
//$xoopsTpl->assign('link', array('id' => $lid, 'cid' => $cid, 'rating' => number_format($rating, 2), 'title' => $myts->htmlSpecialChars($ltitle).$new.$pop, 'category' => $path, 'logourl' => $myts->htmlSpecialChars($logourl), 'updated' => formatTimestamp($time,"m"), 'description' => $myts->displayTarea($description,0), 'adminlink' => $adminlink, 'hits' => $hits, 'votes' => $votestring, 'comments' => $comments, 'mail_subject' => rawurlencode(sprintf(_MD_MYLINKS_INTRESTLINK,$xoopsConfig['sitename'])), 'mail_body' => rawurlencode(sprintf(_MD_MYLINKS_INTLINKFOUND,$xoopsConfig['sitename']).':  '.XOOPSMYLINKURL.'/singlelink.php?lid='.$lid)));
//by wanikoo
$xoopsTpl->assign('link', array('url' => $myts->htmlSpecialChars($url), 'id' => $lid, 'cid' => $cid, 'rating' => number_format($rating, 2), 'ltitle' => $myts->htmlSpecialChars($ltitle), 'title' => $myts->htmlSpecialChars($ltitle) . $new . $pop, 'category' => $pathFromId, 'logourl' => $myts->htmlSpecialChars(trim($logourl)), 'updated' => formatTimestamp($time, "m"), 'description' => $myts->displayTarea($description, 0), 'adminlink' => $adminlink, 'hits' => $hits, 'votes' => $votestring, 'comments' => $comments, 'mail_subject' => rawurlencode(sprintf(_MD_MYLINKS_INTRESTLINK, $xoopsConfig['sitename'])), 'mail_body' => rawurlencode(sprintf(_MD_MYLINKS_INTLINKFOUND, $xoopsConfig['sitename']) . ":  " . XOOPSMYLINKURL . "/singlelink.php?lid={$lid}")));