本文整理汇总了PHP中JFilterOutput::stringURLUnicodeSlug方法的典型用法代码示例。如果您正苦于以下问题:PHP JFilterOutput::stringURLUnicodeSlug方法的具体用法?PHP JFilterOutput::stringURLUnicodeSlug怎么用?PHP JFilterOutput::stringURLUnicodeSlug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JFilterOutput
的用法示例。
在下文中一共展示了JFilterOutput::stringURLUnicodeSlug方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check
public function check()
{
if (JString::trim($this->name) == '') {
$this->setError(JText::_('K2_TAG_MUST_HAVE_A_NAME'));
return false;
}
$this->normalize();
$this->alias = $this->name;
if (JFactory::getConfig()->get('unicodeslugs') == 1) {
$this->alias = JFilterOutput::stringURLUnicodeSlug($this->alias);
} else {
$this->alias = JFilterOutput::stringURLSafe($this->alias);
}
$db = $this->getDbo();
$query = $db->getQuery(true);
$query->select($db->quoteName('id'))->from($db->quoteName('#__k2_tags'))->where($db->quoteName('alias') . ' = ' . $db->quote($this->alias));
if ($this->id) {
$query->where($db->quoteName('id') . ' != ' . (int) $this->id);
}
$db->setQuery($query);
if ($db->loadResult()) {
$this->alias .= '-' . uniqid();
}
return true;
}
示例2: testStringURLUnicodeSlug
/**
* Tests converting strings to URL unicoded slugs.
*
* @return void
*
* @since 11.3
*/
public function testStringURLUnicodeSlug()
{
$this->assertEquals(
'what-if-i-do-not-get_this-right',
$this->object->stringURLUnicodeSlug('What-if I do.not get_this right?'),
'Should be URL unicoded'
);
}
示例3: stringURLSafe
/**
* This method transliterates a string into an URL
* safe string or returns a URL safe UTF-8 string
* based on the global configuration
*
* @param string $string String to process
*
* @return string Processed string
*
* @since 3.2
*/
public static function stringURLSafe($string)
{
if (JFactory::getConfig()->get('unicodeslugs') == 1) {
$output = JFilterOutput::stringURLUnicodeSlug($string);
} else {
$output = JFilterOutput::stringURLSafe($string);
}
return $output;
}
示例4: stringURLSafe
/**
* This method transliterates a string into a URL
* safe string or returns a URL safe UTF-8 string
* based on the global configuration
*
* @param string $string String to process
* @param string $language Language to transliterate to if unicode slugs are disabled
*
* @return string Processed string
*
* @since 3.2
*/
public static function stringURLSafe($string, $language = '')
{
if (JFactory::getConfig()->get('unicodeslugs') == 1) {
$output = JFilterOutput::stringURLUnicodeSlug($string);
} else {
if ($language == '*' || $language == '') {
$languageParams = JComponentHelper::getParams('com_languages');
$language = $languageParams->get('site');
}
$output = JFilterOutput::stringURLSafe($string, $language);
}
return $output;
}
示例5: check
/**
* Overloaded check function
* @since 3.4.0
*/
public function check()
{
// Import Joomla 2.5
jimport('joomla.filter.output');
// If there is an ordering column and this is a new row then get the next ordering value
if (property_exists($this, 'ordering') && $this->id == 0) {
$this->ordering = self::getNextOrder();
}
// URL alias
if (empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = JFilterOutput::stringURLSafe($this->alias);
// Alias is not generated if non-latin characters, so we fix it by using created date, or title if unicode is activated, as alias
if ($this->alias == null || empty($this->alias)) {
if (JFactory::getConfig()->get('unicodeslugs') == 1) {
$this->alias = JFilterOutput::stringURLUnicodeSlug($this->title);
} else {
$this->alias = JFilterOutput::stringURLSafe($this->created);
}
}
// Slug auto-create
$slug_empty = empty($this->slug) ? true : false;
if ($slug_empty) {
$this->slug = $this->title;
}
$this->slug = iCFilterOutput::stringToSlug($this->slug);
// Slug is not generated if non-latin characters, so we fix it by using created date as a slug
if ($this->slug == null) {
$this->slug = iCFilterOutput::stringToSlug($this->created);
}
// Check if Slug already exists
$db = JFactory::getDbo();
$query = $db->getQuery(true)->select('slug')->from($db->qn('#__icagenda_customfields'))->where($db->qn('slug') . ' = ' . $db->q($this->slug));
if (!empty($this->id)) {
$query->where('id <> ' . (int) $this->id);
}
$db->setQuery($query);
$slug_exists = $db->loadResult();
if ($slug_exists) {
$error_slug = $slug_empty ? JText::sprintf('COM_ICAGENDA_CUSTOMFIELD_DATABASE_ERROR_AUTO_SLUG', '<strong>' . $this->title . '</strong>', '<strong>' . $this->slug . '</strong>') : '<strong>' . JText::_('COM_ICAGENDA_CUSTOMFIELD_DATABASE_ERROR_UNIQUE_SLUG') . '</strong>';
$this->setError($error_slug . '<br /><br /><span class="iCicon-info-circle"></span> <i>' . JTEXT::_('COM_ICAGENDA_CUSTOMFIELD_SLUG_DESC') . '</i>');
return false;
}
return parent::check();
}
示例6: permalinkUnicodeSlug
public static function permalinkUnicodeSlug($string)
{
$str = '';
if (EasyBlogHelper::getJoomlaVersion() >= '1.6') {
$str = JFilterOutput::stringURLUnicodeSlug($string);
} else {
//replace double byte whitespaces by single byte (Far-East languages)
$str = preg_replace('/\\xE3\\x80\\x80/', ' ', $string);
// remove any '-' from the string as they will be used as concatenator.
// Would be great to let the spaces in but only Firefox is friendly with this
$str = str_replace('-', ' ', $str);
// replace forbidden characters by whitespaces
$str = preg_replace('#[:\\#\\*"@+=;!&\\.%()\\]\\/\'\\\\|\\[]#', " ", $str);
//delete all '?'
$str = str_replace('?', '', $str);
//trim white spaces at beginning and end of alias, make lowercase
$str = trim(JString::strtolower($str));
// remove any duplicate whitespace and replace whitespaces by hyphens
$str = preg_replace('#\\x20+#', '-', $str);
}
return $str;
}
示例7: addAlias
function addAlias(&$element)
{
if (empty($element)) {
return;
}
if (empty($element->category_alias)) {
$element->alias = $element->category_name;
} else {
$element->alias = $element->category_alias;
}
$jconfig = JFactory::getConfig();
if (!$jconfig->get('unicodeslugs')) {
$lang = JFactory::getLanguage();
$element->alias = $lang->transliterate($element->alias);
}
$app = JFactory::getApplication();
if (method_exists($app, 'stringURLSafe')) {
$element->alias = $app->stringURLSafe(strip_tags($element->alias));
} elseif (method_exists('JFilterOutput', 'stringURLUnicodeSlug')) {
$element->alias = JFilterOutput::stringURLUnicodeSlug(strip_tags($element->alias));
} else {
$element->alias = JFilterOutput::stringURLSafe(strip_tags($element->alias));
}
}
示例8: store
/**
* Overload the store method for the license table.
*
* @param boolean Toggle whether null values should be updated.
* @return boolean True on success, false on failure.
*/
public function store($updateNulls = false)
{
$date = JFactory::getDate();
/* @var $date JDate current date */
$currentDate = $date->toSql();
/* @var $currentDate string current date as MySQL datetime in GMT0 */
$user = JFactory::getUser();
/* @var $user JUser current logged user */
$app = JFactory::getApplication();
/* @var $app JApplication */
if ($this->id) {
$this->modified = $currentDate;
$this->modified_by = $user->get('id');
} else {
$this->created = $currentDate;
$this->created_by = $user->get('id');
}
// if user doesn't set alias use title
if (!JString::trim($this->alias)) {
$this->alias = $this->title;
}
// convert alias to safe string
if ($app->getCfg('unicodeslugs') == 1) {
$this->alias = JFilterOutput::stringURLUnicodeSlug($this->alias);
} else {
$this->alias = JFilterOutput::stringURLSafe($this->alias);
}
if (parent::store($updateNulls)) {
if ($this->default) {
$this->_db->setQuery('UPDATE `#__joomdoc_license` SET `default` = ' . JOOMDOC_STATE_UNDEFAULT . ' WHERE `id` <> ' . $this->id);
$this->_db->query();
}
return true;
}
return false;
}
示例9: getAlias
/**
* Retrieves the alias of the profile type
*
* @since 1.3
* @access public
* @param string
* @return
*/
public function getAlias()
{
$alias = $this->alias ? JFilterOutput::stringURLUnicodeSlug($this->alias) : JFilterOutput::stringURLUnicodeSlug($this->title);
$alias = $this->id . ':' . $alias;
return $alias;
}
示例10: check
function check()
{
jimport('joomla.filter.output');
$params = JComponentHelper::getParams('com_k2');
// $this->params->fabrics = 'kuku';
$this->title = JString::trim($this->title);
if ($this->title == '') {
$this->setError(JText::_('K2_ITEM_MUST_HAVE_A_TITLE'));
return false;
}
if (!$this->catid) {
$this->setError(JText::_('K2_ITEM_MUST_HAVE_A_CATEGORY'));
return false;
}
if (empty($this->alias)) {
$this->alias = $this->title;
}
if (K2_JVERSION == '15') {
if (JPluginHelper::isEnabled('system', 'unicodeslug') || JPluginHelper::isEnabled('system', 'jw_unicodeSlugsExtended')) {
$this->alias = JFilterOutput::stringURLSafe($this->alias);
} else {
mb_internal_encoding("UTF-8");
mb_regex_encoding("UTF-8");
$this->alias = trim(mb_strtolower($this->alias));
$this->alias = str_replace('-', ' ', $this->alias);
$this->alias = str_replace('/', '-', $this->alias);
$this->alias = mb_ereg_replace('[[:space:]]+', ' ', $this->alias);
$this->alias = trim(str_replace(' ', '-', $this->alias));
$this->alias = str_replace('.', '', $this->alias);
$this->alias = str_replace('"', '', $this->alias);
$this->alias = str_replace("'", '', $this->alias);
$stripthese = ',|~|!|@|%|^|(|)|<|>|:|;|{|}|[|]|&|`|„|‹|’|‘|“|â€�|•|›|«|´|»|°|«|»|…';
$strips = explode('|', $stripthese);
foreach ($strips as $strip) {
$this->alias = str_replace($strip, '', $this->alias);
}
if (trim(str_replace('-', '', $this->alias)) == '') {
$datenow = JFactory::getDate();
$this->alias = $datenow->toFormat("%Y-%m-%d-%H-%M-%S");
}
$this->alias = trim($this->alias, '-.');
}
} else {
if (JFactory::getConfig()->get('unicodeslugs') == 1) {
$this->alias = JFilterOutput::stringURLUnicodeSlug($this->alias);
} else {
// Detect the site language we will transliterate
if ($this->language == '*') {
$langParams = JComponentHelper::getParams('com_languages');
$languageTag = $langParams->get('site');
} else {
$languageTag = $this->language;
}
$language = JLanguage::getInstance($languageTag);
$this->alias = $language->transliterate($this->alias);
$this->alias = JFilterOutput::stringURLSafe($this->alias);
if (trim(str_replace('-', '', $this->alias)) == '') {
$this->alias = JFactory::getDate()->format('Y-m-d-H-i-s');
}
}
}
if (K2_JVERSION == '15' || $params->get('enforceSEFReplacements')) {
$SEFReplacements = array();
$items = explode(',', $params->get('SEFReplacements'));
foreach ($items as $item) {
if (!empty($item)) {
@(list($src, $dst) = explode('|', trim($item)));
$SEFReplacements[trim($src)] = trim($dst);
}
}
foreach ($SEFReplacements as $key => $value) {
$this->alias = str_replace($key, $value, $this->alias);
}
$this->alias = trim($this->alias, '-.');
}
if (K2_JVERSION == '15') {
if (trim(str_replace('-', '', $this->alias)) == '') {
$datenow = JFactory::getDate();
$this->alias = $datenow->toFormat("%Y-%m-%d-%H-%M-%S");
}
}
// Check if alias already exists. If so warn the user
$params = JComponentHelper::getParams('com_k2');
if ($params->get('k2Sef') && !$params->get('k2SefInsertItemId')) {
$db = JFactory::getDBO();
$db->setQuery("SELECT id FROM #__k2_items WHERE alias = " . $db->quote($this->alias) . " AND id != " . (int) $this->id);
$result = count($db->loadObjectList());
if ($result > 1) {
$this->alias .= '-' . (int) $result + 1;
$application = JFactory::getApplication();
$application->enqueueMessage(JText::_('K2_WARNING_DUPLICATE_TITLE_ALIAS_DETECTED'), 'notice');
}
}
return true;
}
示例11: save
/**
* Method to save the form data.
*
* @param array $data The form data.
*
* @return boolean True on success.
*
* @since 1.6
*/
public function save($data)
{
$input = JFactory::getApplication()->input;
$filter = JFilterInput::getInstance();
// set the metadata to the Item Data
if (isset($data['metadata']) && isset($data['metadata']['author'])) {
$data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
$metadata = new JRegistry();
$metadata->loadArray($data['metadata']);
$data['metadata'] = (string) $metadata;
}
// Set the custom_get items to data.
if (isset($data['custom_get']) && is_array($data['custom_get'])) {
$custom_get = new JRegistry();
$custom_get->loadArray($data['custom_get']);
$data['custom_get'] = (string) $custom_get;
} elseif (!isset($data['custom_get'])) {
// Set the empty custom_get to data
$data['custom_get'] = '';
}
// Set the php_model string to base64 string.
if (isset($data['php_model'])) {
$data['php_model'] = base64_encode($data['php_model']);
}
// Set the css_document string to base64 string.
if (isset($data['css_document'])) {
$data['css_document'] = base64_encode($data['css_document']);
}
// Set the php_jview string to base64 string.
if (isset($data['php_jview'])) {
$data['php_jview'] = base64_encode($data['php_jview']);
}
// Set the php_view string to base64 string.
if (isset($data['php_view'])) {
$data['php_view'] = base64_encode($data['php_view']);
}
// Set the php_document string to base64 string.
if (isset($data['php_document'])) {
$data['php_document'] = base64_encode($data['php_document']);
}
// Set the php_jview_display string to base64 string.
if (isset($data['php_jview_display'])) {
$data['php_jview_display'] = base64_encode($data['php_jview_display']);
}
// Set the js_document string to base64 string.
if (isset($data['js_document'])) {
$data['js_document'] = base64_encode($data['js_document']);
}
// Set the css string to base64 string.
if (isset($data['css'])) {
$data['css'] = base64_encode($data['css']);
}
// Set the default string to base64 string.
if (isset($data['default'])) {
$data['default'] = base64_encode($data['default']);
}
// Set the php_controller string to base64 string.
if (isset($data['php_controller'])) {
$data['php_controller'] = base64_encode($data['php_controller']);
}
// Set the Params Items to data
if (isset($data['params']) && is_array($data['params'])) {
$params = new JRegistry();
$params->loadArray($data['params']);
$data['params'] = (string) $params;
}
// Alter the name for save as copy
if ($input->get('task') == 'save2copy') {
$origTable = clone $this->getTable();
$origTable->load($input->getInt('id'));
if ($data['name'] == $origTable->name) {
list($name, $alias) = $this->_generateNewTitle($data['alias'], $data['name']);
$data['name'] = $name;
$data['alias'] = $alias;
} else {
if ($data['alias'] == $origTable->alias) {
$data['alias'] = '';
}
}
$data['published'] = 0;
}
// Automatic handling of alias for empty fields
if (in_array($input->get('task'), array('apply', 'save', 'save2new')) && (int) $input->get('id') == 0) {
if ($data['alias'] == null) {
if (JFactory::getConfig()->get('unicodeslugs') == 1) {
$data['alias'] = JFilterOutput::stringURLUnicodeSlug($data['name']);
} else {
$data['alias'] = JFilterOutput::stringURLSafe($data['name']);
}
$table = JTable::getInstance('custom_admin_view', 'componentbuilderTable');
if ($table->load(array('alias' => $data['alias'])) && ($table->id != $data['id'] || $data['id'] == 0)) {
//.........这里部分代码省略.........
示例12: create_edit_survey
function create_edit_survey()
{
$config = JComponentHelper::getParams(S_APP_NAME);
$app = JFactory::getApplication();
$user = JFactory::getUser();
$survey = new stdClass();
$html = $user->authorise('core.wysiwyg', S_APP_NAME) && $config->get('default_editor', 'bbcode') == 'wysiwyg';
$survey->id = $app->input->post->getInt('id', 0);
$survey->title = $app->input->post->getString('title', null);
$survey->alias = $app->input->post->getString('alias', null);
$survey->catid = $app->input->post->getInt('catid', 0);
$survey->created_by = $app->input->post->getInt('userid', 0);
$survey->private_survey = $app->input->post->getInt('survey-type', 1);
$survey->anonymous = $app->input->post->getInt('response-type', 1);
$survey->public_permissions = $app->input->post->getInt('show-result', 0);
$survey->display_template = $app->input->post->getInt('show-template', 1);
$survey->skip_intro = $app->input->post->getInt('skip-intro', 0);
$survey->display_notice = $app->input->post->getInt('display-notice', 1);
$survey->display_progress = $app->input->post->getInt('display-progress', 1);
$survey->notification = $app->input->post->getInt('notification', 1);
$survey->backward_navigation = $app->input->post->getInt('backward-navigation', 1);
$survey->publish_up = $app->input->post->getString('publish-up', '0000-00-00 00:00:00');
$survey->publish_down = $app->input->post->getString('publish-down', '0000-00-00 00:00:00');
$survey->max_responses = $app->input->post->getInt('max-responses', 1);
$survey->enable_save_btn = $app->input->post->getInt('enable-save-btn', 1);
$survey->redirect_url = $app->input->post->getString('redirect-url', '');
$survey->introtext = CJFunctions::get_clean_var('introtext', $html);
$survey->endtext = CJFunctions::get_clean_var('endtext', $html);
$survey->custom_header = CJFunctions::get_clean_var('custom_header', $html);
$survey->restriction = $app->input->post->get('restriction', array(), 'array');
$survey->restriction = implode(',', $survey->restriction);
$created_by = $app->isAdmin() ? $survey->created_by > 0 ? $survey->created_by : $user->id : $user->id;
$survey->username = JFactory::getUser($created_by)->username;
$survey->alias = empty($survey->alias) ? JFilterOutput::stringURLUnicodeSlug($survey->title) : JFilterOutput::stringURLUnicodeSlug($survey->alias);
if (empty($survey->title)) {
$survey->error = JText::_('MSG_REQUIRED_FIELDS_MISSING');
return $survey;
}
$publish_up = !empty($survey->publish_up) && $survey->publish_up != '0000-00-00 00:00:00' ? JFactory::getDate($survey->publish_up, $app->getCfg('offset'))->toSql() : '0000-00-00 00:00:00';
$publish_down = !empty($survey->publish_down) && $survey->publish_down != '0000-00-00 00:00:00' ? JFactory::getDate($survey->publish_down, $app->getCfg('offset'))->toSql() : '0000-00-00 00:00:00';
$mySqlRedirectUrl = empty($survey->redirect_url) ? 'null' : $this->_db->quote($survey->redirect_url);
if ($survey->id > 0) {
if (!$user->authorise('core.edit.own', S_APP_NAME . '.category.' . $survey->catid)) {
$survey->error = JText::_('JERROR_ALERTNOAUTH');
return $survey;
}
$query = '
update
#__survey
set
title=' . $this->_db->quote($survey->title) . ',
alias=' . $this->_db->quote($survey->alias) . ',
catid=' . $survey->catid . ',
' . ($app->isAdmin() ? 'created_by=' . $created_by . ',' : '') . '
introtext=' . $this->_db->quote($survey->introtext) . ',
endtext=' . $this->_db->quote($survey->endtext) . ',
custom_header=' . $this->_db->quote($survey->custom_header) . ',
private_survey=' . $survey->private_survey . ',
anonymous=' . $survey->anonymous . ',
public_permissions=' . $survey->public_permissions . ',
skip_intro=' . $survey->skip_intro . ',
display_notice=' . $survey->display_notice . ',
display_progress=' . $survey->display_progress . ',
notification=' . $survey->notification . ',
backward_navigation=' . $survey->backward_navigation . ',
publish_up=' . $this->_db->quote($publish_up) . ',
publish_down=' . $this->_db->quote($publish_down) . ',
max_responses=' . $survey->max_responses . ',
redirect_url=' . $mySqlRedirectUrl . ',
restriction=' . $this->_db->quote($survey->restriction) . ',
enable_save_btn=' . $survey->enable_save_btn . '.,
display_template=' . $survey->display_template . '
where
id=' . $survey->id;
$this->_db->setQuery($query);
if (!$this->_db->query()) {
$this->setError($this->_db->getErrorMsg());
$survey->error = JText::_('MSG_ERROR_PROCESSING');
}
} else {
if (!$user->authorise('core.create', S_APP_NAME . '.category.' . $survey->catid)) {
$survey->error = JText::_('JERROR_ALERTNOAUTH');
return $survey;
}
$survey->key = CJFunctions::generate_random_key();
$createdate = JFactory::getDate()->toSql();
$query = '
insert into
#__survey
(
title, alias, introtext, endtext, custom_header, catid, created_by, created, publish_up, publish_down, max_responses, display_notice, display_progress, enable_save_btn,
anonymous, private_survey, public_permissions, survey_key, redirect_url, display_template, skip_intro, backward_navigation, notification, restriction, published
)
values
(
' . $this->_db->quote($survey->title) . ',
' . $this->_db->quote($survey->alias) . ',
' . $this->_db->quote($survey->introtext) . ',
' . $this->_db->quote($survey->endtext) . ',
' . $this->_db->quote($survey->custom_header) . ',
//.........这里部分代码省略.........
示例13: tags
private function tags($id)
{
$this->response->status = 'Processing Tags';
$step = 10;
$session = JFactory::getSession();
$db = JFactory::getDbo();
if ($id == 0) {
$query = $db->getQuery(true);
$query->select('COUNT(*)')->from($db->quoteName('#__k2_v2_tags'));
$db->setQuery($query);
$total = $db->loadResult();
$session->set('k2.upgrade.tags.total', $total);
$session->set('k2.upgrade.tags.processed', 0);
}
$query = $db->getQuery(true);
$query->select('*')->from($db->quoteName('#__k2_v2_tags'))->where($db->quoteName('id') . ' > ' . $id)->order($db->quoteName('id'));
$db->setQuery($query, 0, $step);
$tags = $db->loadObjectList();
foreach ($tags as $tag) {
$alias = $tag->name;
if (JFactory::getConfig()->get('unicodeslugs') == 1) {
$alias = JFilterOutput::stringURLUnicodeSlug($alias);
} else {
$alias = JFilterOutput::stringURLSafe($alias);
}
if (trim($alias) == '') {
$alias = uniqid();
}
$query = $db->getQuery(true);
$query->select($db->quoteName('id'))->from($db->quoteName('#__k2_tags'))->where($db->quoteName('alias') . ' = ' . $db->quote($alias));
$db->setQuery($query);
if ($db->loadResult()) {
$alias .= '-' . uniqid();
}
$query = $db->getQuery(true);
$query->insert($db->quoteName('#__k2_tags'));
$query->values((int) $tag->id . ',' . $db->quote($tag->name) . ',' . $db->quote($alias) . ',' . (int) $tag->published . ',' . $db->quote(''));
$db->setQuery($query);
$db->execute();
$this->response->id = $tag->id;
}
$this->response->total = $session->get('k2.upgrade.tags.total');
$session->set('k2.upgrade.tags.processed', (int) $session->get('k2.upgrade.tags.processed') + count($tags));
$this->response->processed = $session->get('k2.upgrade.tags.processed');
if (count($tags) == 0) {
$this->response->id = 0;
$this->response->type = 'tagsxref';
}
}
示例14: stringURLUnicodeSlug
/**
* Helper wrapper method for stringURLUnicodeSlug
*
* @param string $string String to process.
*
* @return string Processed string.
*
* @see JFilterOutput::stringURLUnicodeSlug()
* @since 3.4
*/
public function stringURLUnicodeSlug($string)
{
return JFilterOutput::stringURLUnicodeSlug($string);
}
示例15: getAliasName
public static function getAliasName($name = '')
{
$par = JComponentHelper::getParams('com_djclassifieds');
$alias = mb_strtolower($name, "UTF-8");
$alias = strip_tags($alias);
if ($par->get('seo_alias_urlsafe', '1')) {
$alias = JFilterOutput::stringURLSafe($alias);
} else {
$alias = JFilterOutput::stringURLUnicodeSlug($alias);
}
$alias = str_ireplace(' ', '_', $alias);
return $alias;
}