Results 1 to 8 of 8
  1. #1
    New Pligger rebel's Avatar
    Joined
    May 2006
    Posts
    12

    Replace underscore in URL with a hyphen

    using Pligg 9.5 i am able to get stage one working fine, replacing the underscore in libs/utils.php file in line 243.

    $output = preg_replace("/\s/e" , "_" , $output); with a "-" hyphen.

    however, when submitting new stories the "link_url_title" field in the links table is not updated.

    any ideas?

    where should i be looking and what files should i be looking at to fix this?

  2. #2
    New Pligger rebel's Avatar
    Joined
    May 2006
    Posts
    12
    anyone with an idea on this please?

  3. #3
    Constant Pligger Simon's Avatar
    Joined
    Mar 2006
    Posts
    537
    How about - in the same function you referened above, makeUrlFriendly() - adding a line like this to the end of the function:

    Code:
    $output = str_replace("_", "-", $output);
    You might also want to replace any resulting double dashes with a single dash.

  4. #4
    New Pligger rebel's Avatar
    Joined
    May 2006
    Posts
    12
    that did the trick - thanks Simon

  5. #5
    Constant Pligger P1mpPanther's Avatar
    Joined
    Feb 2007
    Posts
    277
    Just to clarify for those reading this thread from the top - ONLY add Simons bit of code (not the code in the first post) to get this to work.

  6. #6
    Casual Pligger wanderingmind's Avatar
    Joined
    Mar 2007
    Posts
    57
    Is this something I can do once and forget it, or will this need to be repeated in some other way with every release of pligg?

    thanks

  7. #7
    Constant Pligger P1mpPanther's Avatar
    Joined
    Feb 2007
    Posts
    277
    Hmm, not sure what files are going to be changing in the next version of Pligg (perhaps someone can answer that directly) but it's probably good practice to keep a log of what files you modify just in case.

  8. #8
    Casual Pligger wanderingmind's Avatar
    Joined
    Mar 2007
    Posts
    57
    Is that possible - to maintain the integrity of the new version while keeping the old libs/util.php?

    Sorry for the questions - I am not a programmer and has to follow suggestions blindly without knowing its consequences, hence the pestering

Similar Threads

  1. Hyphen in username gives 404
    By ditto in forum Questions & Comments
    Replies: 13
    Last Post: 07-05-2008, 10:40 PM
  2. Changing underscore to dash in URLs
    By brandondrury in forum Questions & Comments
    Replies: 0
    Last Post: 09-30-2007, 09:03 AM
  3. dashes instead of underscore
    By schakal in forum Questions & Comments
    Replies: 1
    Last Post: 07-07-2007, 11:27 AM
  4. Better SEO URL rewrite- Dashes instead of underscore...
    By SoapTaco in forum Questions & Comments
    Replies: 0
    Last Post: 05-29-2007, 12:06 PM
  5. 7.1 Bug Report: Category names with space or underscore
    By Linlay in forum Questions & Comments
    Replies: 1
    Last Post: 04-30-2006, 08:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Pligg Modules and Pligg Templates from Pligg Pro Donate to Pligg CMS Dreamhost Web Hosting Host Gator Web Hosting