The MU forums have moved to WordPress.org

Trim blog name length? (13 posts)

  1. Konstan
    Member
    Posted 10 years ago #

    I am using this code:

    [Deleted code - drmike]

    But some blog names are way too long, and I'd like to shorten them. How can I do that?

  2. lunabyte
    Member
    Posted 10 years ago #

    Use php's trim function.

  3. Konstan
    Member
    Posted 10 years ago #

    I dont know much about php, I tried but it didnt work.

  4. drmike
    Member
    Posted 10 years ago #

    Need to explain please as to what you did try so we can help you.

  5. lunabyte
    Member
    Posted 10 years ago #

    The function is pretty self-explanatory over on php.net.

  6. Konstan
    Member
    Posted 10 years ago #

    I am telling you I tried and it didnt work. I dont know how to code php, thats why I asked here.

    I dont know where to add the function. I am using fimii_wpmu_last_updated code.

  7. lunabyte
    Member
    Posted 10 years ago #

    Well, no better time than the present to learn.

  8. Konstan
    Member
    Posted 9 years ago #

    Maybe I should code my own blog software while I am at it?

  9. drmike
    Member
    Posted 9 years ago #

    I think the issue that they're hinting at is this is basic PHP and you should have an understanding of it. Please remember that WordPress Multiuser is server level software. Basic skills are required.

    Gotta admit that if you don't understand trim, I highly doubt you'll be writing your own blog software any time soon.

    You might want to list the specific code that you're using so we can see if there's an error in how you're using it.

  10. lunabyte
    Member
    Posted 9 years ago #

    Well, might as well.

    Last I checked, there wasn't a Gerber label up there at the top.

    Shall we type your url's, click your mouse, and turn on your computer for you as well?

    Your shortcomings are only a problem when you fail to choose to overcome them. So yeah, go code your own and maybe you'll learn something.

    <roll eyes>

  11. Konstan
    Member
    Posted 9 years ago #

    Well, I guess this is what a community is all about.

    All I asked was how to make that thing work because I was in a hury, I am currently in the middle of nowhere with an ancient computer and using a 56k modem, which I have to reconnect every 2 minutes because its just that bad. I have no tools nor time to do it myself, whats why I asked somewhere where I thought was the right place to ask for help.

    Seems like its not.

  12. lunabyte
    Member
    Posted 9 years ago #

    Yep, and then when pointed in the right direction, ala php.net where you could have plugged in the function name, and found it was pretty simple to use, you decided to be "cute" or "funny". Well, as I'm sure some folks around here can attest to, I can be quite the smart ass. So, an eye for an eye, or so they say.

  13. bradmkjr
    Blocked
    Posted 9 years ago #

    As a side note, related to the original post topic which was lost in a discussion of requirements to be here argument, I would like to bring to the attention of anyone trying to use the suggested function, that it run prior to validating if the blog name is already taken.

    For example if someone is trying to signup with a very long blog name, Bradmkjristhenewgodofwordpress, and you decide this is too long, and use trim to cut it down to 19 characters you would have Bradmkjristhenewgod and that blog may already be taken, and cause a huge headache if it is trimed after being approved, because you would then have 2 blogs with the same name, and it may try to create duplicate tables, etc. So just make sure you understand where in the flow of signup you are putting this code, and it may be safer if someone just wrote a "new blog criteria" plugin, that would allow people to set criteria for a new blog, such as min/max length, banned words, etc.

    Ok, you can go back to throwing sticks and name calling, I'm done for now.

    Bradmkjr

About this Topic

  • Started 10 years ago by Konstan
  • Latest reply from bradmkjr