Removing unwanted charactors from several areas

Discussion in 'PHP' started by blinkster, Sep 30, 2010.

  1. #1
    First thankyou in advance to any help i may receive.

    I run a vBulletin for latest version 4.07. I am not a coder as such but i am condifent in changing and altering code when instructed.

    point 1.
    Lots of members post new threads like this (examples below)

    digital.point.are.the.best
    digital-point-are-the-best

    What i am looking for is how do i change the internal code to remove charactors i choose at time of submitting to clean the title and make it digital point are the best ??

    point 2.

    Is similar problem as above but with adding attachment, can the same process be repeated to strip the attachment file name when it is uploading from digital-point-are-the-best.zip to digital point are the best.zip or even rename it to custom text?

    In vb3 this was done by altering the code but it was long time ago and cannot find the same fix for vb4 as i already tried vb3 way and it failed.


    Old style way in vb 3 in new post template (i think)

    $post['dname'] = str_replace('.', ' ', $post['dname']);
    $post['dname'] = str_replace('-', ' ', $post['dname']);
    $post['dname'] = str_replace('_', ' ', $post['dname']);
     
    Last edited: Sep 30, 2010
    blinkster, Sep 30, 2010 IP
  2. LyNHS

    LyNHS Peon

    Messages:
    57
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hmmm ... I know how to do this phpbb3 - I've never used vBulletin and I never want to, but what you're going to need to do is to

    1) Find a way to make sure specific characters are parsed as spaces within the title of the thread only

    2) Tell your members not to use those Characters, and have your Moderators and yourself edit them appropriately ....

    Hope that helps,
    Lynn.
     
    LyNHS, Oct 1, 2010 IP
  3. johneva

    johneva Well-Known Member

    Messages:
    1,480
    Likes Received:
    46
    Best Answers:
    1
    Trophy Points:
    170
    #3
    You use the same str_replace('.', ' ', $variable);

    But chances are they may have simpley changed the variable name in the newer version, you will need to just check that. But str_replace() is what you need for this fix still I would think.
     
    Last edited: Oct 1, 2010
    johneva, Oct 1, 2010 IP