Not signed in (Sign In)

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorEmoWeb
    • CommentTimeApr 24th 2007
     
    Hi, im new here and with plogger. I find it really useful.
    I've been playing a little bit with it, and found that when I give an album a name with a special character like cumpleaños (birthday in spanish), the rewritten url's look like this /cumplea__os/

    is there a way to replace the "ñ" for an "n", and also the "á" for a "a", the "é" for an "e", etc.
    Thanks!
    •  
      CommentAuthormike
    • CommentTimeApr 25th 2007
     
    I don't think you can have special characters like that in a URL. I've never seen it before... I'm pretty sure Plogger explicitly converts the special characters to underscores in the URL rewriting system we have setup. There is a function called "sanitize_filename" in plog_functions.php that does this.


    function sanitize_filename($str) {
    // allow only alphanumeric characters, hyphen, [, ], dot and apostrophe in file names
    // the rest will be replaced
    return preg_replace("/[^\w|\.|'|\-|\[|\]]/","_",$str);
    }

    That nasty looking string is a regular expression. If you changed 'return preg_replace("/[^\w|\.|'|\-|\[|\]]/","_",$str);' with 'return $str;' it would let anything into the URL, but like I said I'm not sure that would work.
    • CommentAuthorEmoWeb
    • CommentTimeApr 30th 2007
     
    mmm, i think i didn't explain the problem correctly.
    Sorry, im not english native.

    The problem es with special characters. I would need to replace an ñ with an n. Also characters like á, é, í, ó, ú with the same character without the '.
    By default, the sanitizie filename function replaces this characters with an underscore. So i get some ugly url's.

    is it possible to replace this characters?

    á -> a
    é -> e
    í -> i
    ó -> 0
    ú -> u
    ñ -> n

    Thanks mike
    • CommentAuthorEmoWeb
    • CommentTimeMay 7th 2007
     
    is it possible to do this? Please! help ='(

    It's the only thing i need to use plogger
    • CommentAuthordmRy
    • CommentTimeJul 19th 2007
     
    Hi everybody :)

    I am from Turkey and I use Turkish characters on gallery names. But I saw that, special Turkish characters not seen correct and folder name seens so bad.. So I change Plogger "sanitize_filename" function with WordPress "sanitize_title" function.. So every special characters convert into correct character (into english) .. For example;

    I => i
    space => -
    ?=>i
    ?=>s
    ö=>o

    ...

    Applying fix
    -------------------------------------------------


    I want to create a new topic but forum give an error :) Than I want to add my commet bu it says tooo long message.. Last I want to uploade codes for attachments, but again I see "An error occured while creating a new attachment folder. Check your upload path permissions" notify :)

    So please read this patch on;
    http://www.dmry.net/plogger-30-beta-patch-for-special-characters-in-url-with-mod-rewrite
    •  
      CommentAuthormike
    • CommentTimeJul 19th 2007
     
    Thanks dmRy -- I'll check on the forum problems and look to integrate this fix into the next version.