Version: , by Boofo
Developer Last Online: Jun 2012
Version: Unknown
Rating:
Released: 08-28-2002
Last Update: Never
Installs: 0
No support by the author.
Can anyone please help me with the following problem?
I have a user whose name ends with an apostrophe (i.e Bonet'). I want to make the name with an s like this (for ownership) Bonet's instead of Bonet''s with 2 apostrophes. I am using $userinfo[username] to get the name and if I use an 's for ownership on all other names it appears fine. I need to have it not add an apostrophe after the name if one is already there, just the s, but still keep the 's for all other names. I know it sounds confusing. I'm not sure how to pull the information out of the username variable to do this. Can anybody help?
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
'
before it and if there is, just add an s and if there isn't, add an
's
That way, I can put it in any template where I need to and if the name (whether it be $bbuserinfo[username] or $post[username] or whatever else I use) ends in an apotrophe, it will only add an s and do the other if there is no apostrophe.
I'm hoping to be able to use this anywhere at any time.
Would involve a good bit of modification, i'll try to find all the times that the username is loaded and add the code which adds a usernames key to the array so instead of using $userinfo['username']$a you can use $userinfo['usernames']
How would that affect the places I have $bbuserinfo[usernames]and $post[username]? Would I just need to change all o0f those instances everywhere to $userinfo['username']? I want to be able to do this in the templates instead of having to go through all of the php files to find where I have those different variables. Because I don't need the 's or s after every instance of the username on the board. Just select areas. I started to modify each place last night and I gave up after getting confused with all of the different ways I call the username and the different places. That is why I thought using the $a would be easier because then I could just add it as I need it in the template and not have to re-write all of the code for each variable in the php files.
Quote:
Originally posted by PPN Would involve a good bit of modification, i'll try to find all the times that the username is loaded and add the code which adds a usernames key to the array so instead of using $userinfo['username']$a you can use $userinfo['usernames']
Great! That's even better than the $a idea. Will I be able to use those globally? I won't need a separate post[username] and userinfo[username] anymore then? That would be fantastic. Looking forward to it, my friend.
Quote:
Originally posted by PPN You will have two variables
$bbuserinfo['username'] and $bbuserinfo['usernames']
one without 's and one with so you just edit the template to use one or the other.
Yep just gotta modify a couple of functions where these arrays are derrived from
/admin/sessions.php for $bbuserinfo
verifyuser function for the other but someplaces might not get their array from any main functions, like getpostbit i believe.
The private messages, and the usercp should work with that though, don't you think? Along with the postbit and memberlist? If the getinfo is the only place I have to use something else to get the same results, I can live with that.