National chars in address

Discussion in 'PHP' started by old games & abandonware, Aug 21, 2008.

  1. #1
    Hi,
    I just bought a wallpaper script. The issue is that the script automatically generates categories from folders. The folders have special characters in filenames. And the script generates e.g.:

    category - příklad
    /příklad/wall.jpg

    I need to generate:

    /priklad/wall.jpg.

    Is there any easy way how to do that?
     
    old games & abandonware, Aug 21, 2008 IP
  2. nice.wallpapers

    nice.wallpapers Active Member

    Messages:
    142
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #2
    Hi,

    Yes you can edit the php code,

    Here is the best php function that can help you in this

    <?php
    $test="příklad";
    print $test=str_replace("Å™", "r", $test);
    // Out put will be "príklad"
    print $test=str_replace("í", "i", $test);
    // Out put will be "priklad"
    ?>

    Thanks :)
     
    nice.wallpapers, Aug 21, 2008 IP
  3. old games & abandonware

    old games & abandonware Active Member

    Messages:
    429
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    90
    #3
    Ok, I will give it a try.

    I have to find where to put this :).

    Thanks a lot so far
     
    old games & abandonware, Aug 21, 2008 IP
  4. nice.wallpapers

    nice.wallpapers Active Member

    Messages:
    142
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #4
    Hi ,


    If you tell me the script name i can help you that in fixing too as i am also running 4 wallpaper sites :)

    thanks :)
     
    nice.wallpapers, Aug 21, 2008 IP
  5. old games & abandonware

    old games & abandonware Active Member

    Messages:
    429
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    90
    #5
    Sure, its CollectPHP's website creator

    http://www.collectphp.com/products/wallpaper_site_creator/

    I need to translate it, but this is the first bigger problem :).

    Thanks
     
    old games & abandonware, Aug 21, 2008 IP
  6. nice.wallpapers

    nice.wallpapers Active Member

    Messages:
    142
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #6
    Hi,

    I think it is paid script and i am not using this system on any of my site.

    sorry i can't help , if you can send me the files may be i can see and let you know what changes required.


    Thanks :)
     
    nice.wallpapers, Aug 21, 2008 IP
  7. old games & abandonware

    old games & abandonware Active Member

    Messages:
    429
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    90
    #7
    I said "I bought". Yes, it is a paid script. 20 USD here on DP.

    PM me pls with scripts you are using.

    I will try to do it with the author. Thanks a lot ;-).
     
    old games & abandonware, Aug 21, 2008 IP
  8. ansi

    ansi Well-Known Member

    Messages:
    1,483
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    100
    #8
    if there's a lot of characters to be replaced i would recommend preg_replace over str_replace. ket it all out the way in one shot.

    
    $pattern = array("/i/",
                           "/r/",
                           "/t/");
    
    $replace = array(" eye",
                           " are",
                           " tee"); 
    
    echo preg_replace($pattern, $replace, "dirt");
    
    PHP:
     
    ansi, Aug 21, 2008 IP