Example #1
0
require_once JPATH_ROOT . DS . 'components' . DS . 'com_jdownloads' . DS . 'helpers' . DS . 'jdownloadshelper.php';
global $cat_link_itemidsPlg;
$db = JFactory::getDBO();
$app = JFactory::getApplication();
if ($app->isSite()) {
    // get all published single category menu links
    $db->setQuery("SELECT id, link from #__menu WHERE link LIKE 'index.php?option=com_jdownloads&view=category%' AND published = 1");
    $cat_link_itemidsPlg = $db->loadAssocList();
    if ($cat_link_itemidsPlg) {
        for ($i = 0; $i < count($cat_link_itemidsPlg); $i++) {
            $cat_link_itemidsPlg[$i]['catid'] = substr(strrchr($cat_link_itemidsPlg[$i]['link'], '='), 1);
        }
    }
    // get current category menu ID when exist and all needed menu IDs for the header links
    global $menuItemids;
    $menuItemids = JDHelper::getMenuItemids();
    // get all other menu category IDs so we can use it when we needs it
    global $cat_link_itemids;
    $cat_link_itemids = JDHelper::getAllJDCategoryMenuIDs();
    // "Home" menu link itemid
    global $root_itemid;
    $root_itemid = $menuItemids['root'];
    global $date_format;
    $date_format = JDHelper::getDateFormat();
    //Globals definition
    $GLOBALS['jDFPitemid'] = jd_CalcItemid();
    $GLOBALS['jDFPOnlineLayout'] = '';
    $GLOBALS['jlistConfigM'] = buildjlistConfigM();
    $GLOBALS['jDownloadsMessage'] = 0;
    $GLOBALS['jDownloadsTested'] = 0;
    $GLOBALS['jDownloadsInstalled'] = 0;
Example #2
0
$menuItemids = JDHelper::getMenuItemids($catid);
// get all other menu category IDs so we can use it when we needs it
$cat_link_itemids = JDHelper::getAllJDCategoryMenuIDs();
// "Home" menu link itemid
$root_itemid = $menuItemids['root'];
// make sure, that we have a valid menu itemid for the here viewed base category
// if (!$this->category->menu_itemid) $this->category->menu_itemid = $root_itemid;
$html = '<div class="jd-item-page' . $this->pageclass_sfx . '">';
if ($this->params->get('show_page_heading')) {
    $html .= '<h1>' . $this->escape($this->params->get('page_heading')) . '</h1>';
}
// ==========================================
// HEADER SECTION
// ==========================================
if ($header != '') {
    $menuItemids = JDHelper::getMenuItemids($catid);
    // component title - not more used. So we must replace the placeholder from layout with spaces!
    $header = str_replace('{component_title}', '', $header);
    // replace google adsense placeholder with script when active (also for header tab)
    if ($jlistConfig['google.adsense.active'] && $jlistConfig['google.adsense.code'] != '') {
        $header = str_replace('{google_adsense}', stripslashes($jlistConfig['google.adsense.code']), $header);
    } else {
        $header = str_replace('{google_adsense}', '', $header);
    }
    // components description
    if ($jlistConfig['downloads.titletext'] != '') {
        $header_text = stripslashes(JDHelper::getOnlyLanguageSubstring($jlistConfig['downloads.titletext']));
        if ($jlistConfig['google.adsense.active'] && $jlistConfig['google.adsense.code'] != '') {
            $header_text = str_replace('{google_adsense}', stripslashes($jlistConfig['google.adsense.code']), $header_text);
        } else {
            $header_text = str_replace('{google_adsense}', '', $header_text);