a simple coding needed

Discussion in 'PHP' started by vic_msn, May 21, 2006.

  1. #1
    i need to convert to i can make use of some replace functions to remove spaces in category names and add _ so no need to worry about that just please do the above modification
    in general
    to
    please post here and i will give you the necessay files please post if you are interested
    i did some editing but i got 404 not found pages so the link should work please
    in brief i want to display categoryname instead of category id
    thank you
     
    vic_msn, May 21, 2006 IP
  2. Daniel

    Daniel Peon

    Messages:
    1,453
    Likes Received:
    70
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hey vic_msn there is a PERL app called "Hconvert" look it up on freshmeat.net or google.

    I think I ahve the hconvert.pl file if youd like me to send it to you or attach it here :D

    you can install this script into your space log in through SSH and run it through the shell.

    Its a find and replace tool that will look through thousands of lines of code in a file and fidn and replace whatever you want.

    run it on each file and your good to go :)

    Hope this helps!
     
    Daniel, May 21, 2006 IP
  3. vic_msn

    vic_msn Well-Known Member

    Messages:
    2,233
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    155
    #3
    but i use a php script
     
    vic_msn, May 21, 2006 IP
  4. Daniel

    Daniel Peon

    Messages:
    1,453
    Likes Received:
    70
    Best Answers:
    0
    Trophy Points:
    0
    #4
    It doesnt matter if your looking into a php file a perl file a txt file whatever the file if it has text in it the hconvert.pl script will convert whatever you want to have converted.

    Here is the file I have on my server I actually renamed it to convert.pl

    I just ran the help for you and some examples.

    [root@thor cgi-bin]# ./convert.pl --help
    hconvert 0.32: Change text in files and/or convert it to html-format.
    USAGE: hconvert [options]
    -b, -backup Make a backup of the edited file.
    -c, -cat text Concatenate an html-head and -end where text is the title.
    -d end Process all files that ends with "end".
    -e, -examples Show some examples.
    -f, -file file File with the replacing text.
    -h, -help This help.
    -n, -n end The ending of the new files will be "end".
    -o, -only file Only one file to change.
    -r, -replace text The replace text, if -f not defined.
    -rec Dive into subdirectories
    -s, -search text The text to search (you can use Tags like \n, \t or else).
    -v, -version Print the version and exit.

    [root@thor cgi-bin]# ./convert.pl -e
    hconvert 0.32: Change text in files and/or convert it to html-format.
    EXAMPLES:
    hconvert -o test.html -s styles.css -r format.css
    Simply search in "test.html" for "styles.css" and replace
    it with "format.css".

    hconvert -d html -n shtml -s styles.css -r format.css
    Take all files with ".html", search for "styles.css",
    replace it with "format.css" and save the files with
    ".shtml"

    hconvert -c Homepage -d txt -e html
    Take all files with ".txt", convert it to html with
    title "Homepage" and save the files with ".html".


    The first example is the one you would need to use.

    Hope it helps :)
     
    Daniel, May 21, 2006 IP
  5. vic_msn

    vic_msn Well-Known Member

    Messages:
    2,233
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    155
    #5
    but my host does not support perl
     
    vic_msn, May 21, 2006 IP
  6. Colleen

    Colleen Illustrious Member

    Messages:
    6,777
    Likes Received:
    725
    Best Answers:
    1
    Trophy Points:
    430
    #6
    Dan, quick, learn PHP!
     
    Colleen, May 21, 2006 IP
  7. Daniel

    Daniel Peon

    Messages:
    1,453
    Likes Received:
    70
    Best Answers:
    0
    Trophy Points:
    0
    #7
    WTF What has this world come to ?!?!?!?! A server NOT supporting PERL ?!?!?!?

    Dooooood you know PERL comes for free with every free install of linux ! Are you hosted from a crappy MS box ?

    I seem to recall learning a little it of PHP with you my dear :p damn classified script :D
     
    Daniel, May 21, 2006 IP