Пример #1
0
 function getcategories($catid, $shLang = null, $section = '')
 {
     $sefConfig =& shRouter::shGetConfig();
     $catid = empty($catid) ? 0 : intval($catid);
     // get DB
     $database =& JFactory::getDBO();
     $title = '';
     // V 1.2.4.q
     $shLang = empty($shLang) ? $shMosConfig_locale : $shLang;
     if (isset($catid) && $catid != 0) {
         $query = 'SELECT title' . (shTranslateURL('com_content', $shLang) ? ',id' : '') . ' FROM #__categories WHERE id = "' . $catid . '"' . (empty($section) ? '' : ' AND section = \'' . $section . '\'');
         $database->setQuery($query);
         $rows = $database->loadObjectList();
         if ($database->getErrorNum()) {
             die($database->stderr());
         } elseif (@count($rows) > 0) {
             if (!empty($rows[0]->title)) {
                 $title = $rows[0]->title;
             }
         }
     }
     return $title;
 }
Пример #2
0
             }
         } else {
             $title[] = '/';
         }
         shMustCreatePageId('set', true);
     }
     // Remove the vars from the url
     if (!empty($cid)) {
         shRemoveFromGETVarsList('cid');
     }
     break;
 case 'tags':
     if (!empty($id)) {
         $query = 'SELECT id, name FROM #__flexicontent_tags' . ' WHERE id = ' . (int) $id;
         $database->setQuery($query);
         if (shTranslateURL($option, $shLangName) || !FLEXI_FISH) {
             $row = $database->loadObject();
         } else {
             $row = $database->loadObject(null, false);
         }
         if ($database->getErrorNum()) {
             die($database->stderr());
         } elseif ($row) {
             if ($row->name) {
                 $title[] = $sh_LANG[$shLangIso]['_SH404SEF_FLEXICONTENT_TAGS'] . '/';
                 $title[] = $row->name;
             }
         }
     } else {
         $title[] = '/';
     }
Пример #3
0
$shLangIso = shLoadPluginLanguage('com_poll', $shLangIso, 'COM_SH404SEF_POLL_VOTE');
// ------------------  load language file - adjust as needed ----------------------------------------
$task = isset($task) ? $task : null;
switch ($task) {
    case 'vote':
        $title[] = $sh_LANG[$shLangIso]['COM_SH404SEF_POLL_VOTE'];
        break;
    default:
        $title[] = $sh_LANG[$shLangIso]['COM_SH404SEF_POLL_RESULTS'];
        shMustCreatePageId('set', true);
        break;
}
if (!empty($id)) {
    $query = 'SELECT title, id FROM #__polls WHERE id = "' . $id . '"';
    $database->setQuery($query);
    if (shTranslateURL($option, $shLangName)) {
        $pollTitle = $database->loadObject();
    } else {
        $pollTitle = $database->loadObject(false);
    }
    if ($database->getErrorNum()) {
        JError::raiseError(500, $database->stderr());
    } else {
        $title[] = $pollTitle->title;
    }
} else {
    $title[] = '/';
}
// V 1.2.4.s
shRemoveFromGETVarsList('option');
shRemoveFromGETVarsList('Itemid');