Important: This page is using cookies (cookies). Using this website without turning off cookies in browser, means that you agree for using it.
Buy Now! Features Downloads

Earn with us!

If you would like to start earning money with vBET join to Affiliate Program.
Results 1 to 5 of 5

Thread: Remove some single special character in url, like [, ], *, and others

  1. #1

    Default Remove some single special character in url, like [, ], *, and others

    Hi guys, need some help here


    in vbseocp.php --> Character Replacement --> i set Replace Non-English Characters in URLs?, to Keep Non-English Characters in URLS like the vbet installation instruction


    in the default language (english) i need to remove some characters that dont needed in urls, like [, ], * and other single character, because i am not comfort with these single character in the default language (english)



    please help guys how to remove these single characters in url in the default language (english), but still using "Keep Non-English Characters in URLS" option






    i tried to add [ and ] and * character in vbseocp.php --> Define Stopwords but its not working, or can its removed from vbseocp.php --> Define your Custom Character Replacements?

    OR

    if there is conditional code to "Replace Non-English Characters in URLs?" for default language only and "Keep Non-English Characters in URLS" for other languages" for other languages, maybe we can set the conditional code in vbseo/resources/xml/config.xml something like this just for example
    if ($vbetlang==default)
    {
    Replace Non-English Characters in URLs?
    }
    if ($vbetlang!=default)
    {
    Keep Non-English Characters in URLS for other languages
    }

  2. #2

    Default

    for the first way i already know how to do it, thanks for Andrés Durán Hewitt in vbseo forum :

    Hello,

    You still can define character replacements regardless the 'Keep Non-English Characters in URLs' option. Please try to define the following custom characters replacements:

    Code:
    '['=>''
    ']'=>''
    '*'=>''
    And let me know how it goes.

    Best regards.





    but it is better if we can using the second way above, please let us know if anyone have information about that conditional, and i suggest you using the first way above if you using english/latin as default language (as almost we all use it)

  3. #3
    Michał Podbielski (vBET Staff) vBET's Avatar
    Join Date
    Oct 2009
    Posts
    3,037

    Default

    I'm reading it carefully now and give you answer soon

  4. #4

    Default

    the example like this thread self url


    Code:
    http://www.vbenterprisetranslator.com/forum/general-discussions/1158-remove-some-single-special-character-url-like-%5B-%5D-%2A-others.html
    it is better the url like this, Removed the special character [, ], and * in bold above, better for english forum

    Code:
    http://www.vbenterprisetranslator.com/forum/general-discussions/1158-remove-some-single-special-character-url-like-others.html



    other urls example, that have some special character in the title and in the url
    [Language: $language Do not add language BBCodes] in Quick Reply
    &goto=newpost links don't redirect properly
    langtitle=sk]F.. bug?
    Showthread.php?p=x not rewritten
    "vbet_ flag-" issue
    Having 2 lang= bbcode...
    Last edited by basketmen; 04-11-10 at 20:21.

  5. #5
    Michał Podbielski (vBET Staff) vBET's Avatar
    Join Date
    Oct 2009
    Posts
    3,037

    Default

    OK so - you can do that also by vBET file:
    1. Open vbenterprisetranslator_seo.php
    2. Find:
    Code:
    $vbet_custom_char_replacement = array(
    '"' => '', 
    '[langtitle=' => '', 
    '[/langtitle]' => '', 
    ']' => '-'
    );
    3. Add there pairs similarly to vBSEO

    You will have to add it again after each update, since your changes will be overwritten. So keeping it in vBSEO custom replacements seems to be better idea.

    About your 2nd proposition. Such condition would look like this:
    Code:
    if ($_REQUEST['language'])
    {
    Keep Non-English Characters in URLS for other languages
    } else {
    Replace Non-English Characters in URLs?
    }
    We didn't test such solution so we advice to do this on some test instance not on real forum and check how it behaves. I do not believe it will work - I suppose that from config it taken simply value and attached to variable, so variable would treat this just as string value. I suppose - not tested. So such change should be tone in other place in place where variable takes value you could do:
    Code:
    $theVariable = $_REQUEST['language'] ? value for Keep Non-English : value for Replace Non-English
    If variable is global (and if it is variable not constant) then you can overwrite it in /includes/vbenterprisetranslator_functions_seo.php file. There are 2 places where you have code like this:
    Code:
    if ($language) {
    $text = vbet_filter_replace_text($text, VBSEO_SPACER, VBSEO_APPEND_CHAR);
    } else {
    $text = vbseo_filter_text($text, $allowcharsl, $filter_stop_words, $reversablee, $keep_tailspaces);
    }
    So you can change global variable value in else statement, before text is evaluated.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •