The problem with the URL. If the post title is not in English

Support
  1. 4 months ago

    The problem with the URL. If the post title is not in English

    All welcome! Glad to see the updated esoTalk.

    Tell me, how and what to do. Necessary so that when you publish a post is not in English, URL: formed in the language of the post title, or in transliteration.
    Now, if the post is not in English, then post the URL looks in the form of figures, moreover, aims at "no such page."
    Prompt, where and how to fix it. Thank you in advance.

    A few examples:
    (wrong) example of the post written in Russian:
    http://example.org/4/0
    (right) A must:
    http://example.org/4-обновление-фреймворка
    or http://example.org/4-obnovlenie-freymvorka

    (ie the URL and is written in Russian, translated or transliterated)

    An example of the post written in English:
    http://example.org/2-pssst-want-a-few-tips

  2. 比如说输入中文呢?

  3. It's a preoblem

  4. I read the source code and now can not find what file is responsible for routing (URL). Like a forum based on the principles of the IEC. Where to look? In the controllers, views, or where?

    Below is an example of code that must go (need to modify). That's just not yet found the "where to insert and modify."

    // Add word separator '-' in the URL
     
    function my_str_split($string) {
    $slen=strlen($string);
    for($i=0; $i<$slen; $i++){
    $sArray[$i]=$string{$i};}
    return $sArray;}
     
    // Translating this link to translirt if it is not.
     
    function noDiacritics($string) {
    $cyrylicFrom = array('А', 'Б', 'В', 'Г', 'Д', 'Е', 'Ё', 'Ж', 'З', 'И', 'Й', 'К', 'Л', 'М', 'Н', 'О', 'П', 'Р', 'С', 'Т', 'У', 'Ф', 'Х', 'Ц', 'Ч', 'Ш', 'Щ', 'Ъ', 'Ы', 'Ь', 'Э', 'Ю', 'Я', 'а', 'б', 'в', 'г', 'д', 'е', 'ё', 'ж', 'з', 'и', 'й', 'к', 'л', 'м', 'н', 'о', 'п', 'р', 'с', 'т', 'у', 'ф', 'х', 'ц', 'ч', 'ш', 'щ', 'ъ', 'ы', 'ь', 'э', 'ю', 'я');
     
    $cyrylicTo   = array('A', 'B', 'W', 'G', 'D', 'Ie', 'Io', 'Z', 'Z', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'T', 'U', 'F', 'Ch', 'C', 'Tch', 'Sh', 'Shtch', '', 'Y', '', 'E', 'Iu', 'Ia', 'a', 'b', 'w', 'g', 'd', 'ie', 'io', 'z', 'z', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'r', 's', 't', 'u', 'f', 'ch', 'c', 'tch', 'sh', 'shtch', '', 'y', '', 'e', 'iu', 'ia');
     
    $from = array('A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', '?', 'C', 'C', 'C', 'C', 'C', 'D', 'D', '?', 'E', 'E', 'E', 'E', 'E', 'E', 'E', 'E', '?', 'G', 'G', 'G', 'G', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', '?', 'c', 'c', 'c', 'c', 'c', 'd', 'd', '?', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'e', '?', 'g', 'g', 'g', 'g', 'H', 'H', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', '?', 'J', 'K', 'L', 'L', 'N', 'N', 'N', 'N', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', '?', 'h', 'h', '?', 'i', 'i', 'i', 'i', 'i', 'i', 'i', '?', 'j', 'k', 'l', 'l', 'n', 'n', 'n', 'n', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', '?', 'R', 'R', 'S', 'S', 'S', 'S', 'T', 'T', '?', 'U', 'U', 'U', 'U', 'U', 'U', 'U', 'U', 'U', 'U', 'W', 'Y', 'Y', 'Y', 'Z', 'Z', 'Z', 'r', 'r', 's', 's', 's', 's', '?', 't', 't', '?', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'w', 'y', 'y', 'y', 'z', 'z', 'z');
     
    $to   = array('A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'AE', 'C', 'C', 'C', 'C', 'C', 'D', 'D', 'D', 'E', 'E', 'E', 'E', 'E', 'E', 'E', 'E', 'G', 'G', 'G', 'G', 'G', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'ae', 'c', 'c', 'c', 'c', 'c', 'd', 'd', 'd', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'g', 'g', 'g', 'g', 'g', 'H', 'H', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'I', 'IJ', 'J', 'K', 'L', 'L', 'N', 'N', 'N', 'N', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'CE', 'h', 'h', 'i', 'i', 'i', 'i', 'i', 'i', 'i', 'i', 'ij', 'j', 'k', 'l', 'l', 'n', 'n', 'n', 'n', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'R', 'R', 'S', 'S', 'S', 'S', 'T', 'T', 'T', 'U', 'U', 'U', 'U', 'U', 'U', 'U', 'U', 'U', 'U', 'W', 'Y', 'Y', 'Y', 'Z', 'Z', 'Z', 'r', 'r', 's', 's', 's', 's', 'B', 't', 't', 'b', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'w', 'y', 'y', 'y', 'z', 'z', 'z');
     
          $from = array_merge($from, $cyrylicFrom);
          $to   = array_merge($to, $cyrylicTo);
          $newstring = str_replace($from, $to, $string);
          return $newstring;
       }
     
    // Create a link. Text input parameters and the maximum length of the emergent value, if nothing is send, the length of the original remains.
     
    function makeSlugs($string, $maxlen=0){
    $newStringTab=array();
    $string=strtolower(noDiacritics($string));
     
    if(function_exists('str_split')){
    $stringTab=str_split($string);}
    else{
    $stringTab=my_str_split($string);}
     
    $numbers=array('0','1','2','3','4','5','6','7','8','9','-');
     
    foreach($stringTab as $letter){
    if(in_array($letter, range('a', 'z')) || in_array($letter, $numbers)){
    $newStringTab[]=$letter;}
    elseif($letter==' '){
    $newStringTab[]='-';}}
     
    if(count($newStringTab)){
    $newString=implode($newStringTab);
    if($maxlen>0){
    $newString=substr($newString, 0, $maxlen);}
    $newString = removeDuplicates('--', '-', $newString);}
    else {
    $newString='';}
    return rtrim($newString,'-') ;} // Удаляем лишние пробелы справа.
     
    // Check. Is the slug line.
     
    function checkSlug($sSlug){
    if(ereg ('^[a-zA-Z0-9]+[a-zA-Z0-9\_\-]*$', $sSlug)){
    return true;}
    return false;}
     
    // Removing duplicates.
     
    function removeDuplicates($sSearch, $sReplace, $sSubject){
    $i=0;
    do{
    $sSubject=str_replace($sSearch, $sReplace, $sSubject);
    $pos=strpos($sSubject, $sSearch);
    $i++;
    if($i>100){
    die('removeDuplicates() ошибка цикла');}}
    while($pos!==false);
    return $sSubject;}
  5. Help please understand with links. And one more thing. Why not make JUMPS form: name-position-{ID or serial number of the page}
    Example: http://google.googl/name-position-12345 or http://google.googl/name-position.12345

  6. check out this https://github.com/shidianxia/esoTalk
    I forked a chinese version of esotalk with my friend, you can diff these files and see which file has been modified.
    May help you with this problem.

  7. shidianxia

    You have a URL in the transliteration is formed or in your language?

  8. Edited 4 months ago by sofcom

    I made these changes:
    (file - controllers/ETConversationController.class.php)

    // If the slug in the URL is not the same as the actual slug, redirect.
    
         $slug = slug($conversation["title"]);

    - if ($slug and (strpos($conversationId, "-") === false or substr($conversationId, strpos($conversationId, "-") + 1) != $slug))

    +    if ($slug and (strpos($conversationId, "-") === false or slug(substr($conversationId, strpos($conversationId, "-") + 1)) != $slug)) {
    
           redirect(URL($url), 301);
           }

    And I have started working links where the posts are published in the Russian language. With one BUT. The post consists of only a single digit.
    http://site.loc/5

  9. Find this post shidianxia check out this https://github.com/shidianxia/esoTalk
    I forked a chinese version of esotalk with my friend, you can diff these files and see which file has been modified.
    May help you with this problem.

    Guess I'm getting closer to solving the problem. :-) Thanks to you.

  10. Downloaded and installed from here - https://github.com/shidianxia/esoTalk
    No problems in working with the Russian language (including the URL) no. Thank you very MUCH, friends! I will continue testing and translation.

  11. 3 months ago

    The problem with the URL part remained. With categories.

  12. 2 months ago

    Hi guys, I'm using the last version of the free forum script for my pubblic website. It's an italian one and I'm using SEO-integrated URLs plugin. Why do I get these kinds of links: http://mysite.com/index.php/name-of-the-discussion insted of getting this kind: http://mysite.com/name-of-the-discussion ?

  13. 7 weeks ago

    View file .htaccess

  14. 3 weeks ago

    lib/functions.general.php

    in function slug($string)

  15. last week

    The title of this post is misleading. My language is yoruba but we use the same characters as in the english language. The title should to corrected to indicate that the post title is not of a particular encoding

  16. bu bir denemedir...

or Sign Up to reply!