Home Community Mys-Script Creative Off-Topic |
|
|
Thread Tools | Display Modes |
#1
|
||||
|
||||
Stripslashes and server time zone?
So I have a couple questions. First one is needing help with stripslashes in users bios. I found one post that helped fix some of the other areas with this same issue but I'm still stuck with the bio one.
I keeps running into things with the ' into having slashes. So I'm becomes I/'m. I found in accountview.php a bio section: Quote: $profileForm->add(new Comment("Name: ", FALSE)); $profileForm->add(new TextField("nickname", $profile->getNickname())); $profileForm->add(new Comment("")); $profileForm->add(new Comment("Gender: ", FALSE)); $profileForm->add(new TextField("gender", $profile->getGender())); $profileForm->add(new Comment("")); $profileForm->add(new Comment("Bio: ")); $profileForm->add(new TextArea("bio", $profile->getBio())); $profileForm->add(new Comment($lang->bio)); but I'm unsure if this is the area I need to use to fix it, or what code to even use. ________________ My next question is what is the time zone for the server? I'm trying to make a code that changes an image based on thy hour, and for some reason results are turning out weird lol like my time zone didn't match the server was my only guess. Any help would be really appreciated, thank you!
__________________
"You try you fail, you try you fail, but the only true failure is if you stop trying. So try again." - Haunted Mansion |
#2
|
||||
|
||||
I believe I fixed this in my own install once upon a time. In classes/class_userprofile.php, replace
PHP Code:
PHP Code:
Short of asking the hosting provider what timezone it is (or checking the php.ini file), you could try running this code to find that out? PHP Code:
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it. |
#3
|
||||
|
||||
Thank you so much! :D that worked, time zone is apparently UTC. Do you know how I would change it to EST? and the stripslashes worked! I appreciate you.
__________________
"You try you fail, you try you fail, but the only true failure is if you stop trying. So try again." - Haunted Mansion |
#4
|
||||
|
||||
Usually hosting providers can't or won't change the entire server's timezone, as its usually shared hosting, and they'd rather it be local to timezone the server is physically in.
You can change the default time zone for use in particular code on a particular page but don't expect it to carry between pages without specifically making sure its set. (And, of course, this makes the code local to whatever YOU set it to be, not whatever the timezone it currently is for any viewer, so it'll be off for anyone who doesn't share your timezone. Dynamically getting the appropriate timezone is not quite possible without a bit of hackery, which users will always be able to find ways around, anyway.) But if it helps your mental math to have things based around your own understanding of what time it is, I don't blame you! Since you're wanting to display code between particular hours, it's worth noting that hours can be checked between midnight 0000 and the minute just before midnight 2359 -- military time. I'm not sure what exactly you're up to, but I hope this can help! PHP Code:
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it. |
Tags |
slashes, stripslashes, time, timezone, zone |
|
|
What's New? |
What's Hot? |
What's Popular? |