function shGetJSVideoTitle($id, $option, $shLangName) { $sefConfig =& Sh404sefFactory::getConfig(); try { $result = ShlDbHelper::selectObject('#__community_videos', array('id', 'title', 'category_id'), array('id' => $id)); } catch (Exception $e) { ShlSystem_Log::error('sh404sef', '%s::%s::%d: %s', __CLASS__, __METHOD__, __LINE__, $e->getMessage()); } $videoName = ($sefConfig->shJSInsertVideoId ? $id . $sefConfig->replacement : '') . $result->title; // optionnally insert video category if ($sefConfig->shJSInsertVideoCat) { $title = array(shGetJSVideoCategoryTitle($result->category_id, $option, $shLangName), $videoName); } else { $title = array($videoName); } return $title; }
function shGetJSVideoTitle($id, $option, $shLangName) { $sefConfig =& Sh404sefFactory::getConfig(); $database =& JFactory::getDBO(); $query = 'SELECT id, title, category_id FROM #__community_videos WHERE id = ' . $database->Quote($id); $database->setQuery($query); if (!shTranslateUrl($option, $shLangName)) { $result = $database->loadObject(false); } else { $result = $database->loadObject(); } $videoName = ($sefConfig->shJSInsertVideoId ? $id . $sefConfig->replacement : '') . $result->title; // optionnally insert video category if ($sefConfig->shJSInsertVideoCat) { $title = array(shGetJSVideoCategoryTitle($result->category_id, $option, $shLangName), $videoName); } else { $title = array($videoName); } return $title; }