Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Apostrophes Details »»
Apostrophes
Version: , by Boofo Boofo is offline
Developer Last Online: Jun 2012 Show Printable Version Email this Page

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.

Comments
  #12  
Old 08-29-2002, 12:09 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a way to have this variable:

$a

check whether there is a

'
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.
Reply With Quote
  #13  
Old 08-29-2002, 01:15 AM
Scott MacVicar Scott MacVicar is offline
 
Join Date: Oct 2001
Location: Glasgow, Scotland
Posts: 1,199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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']
Reply With Quote
  #14  
Old 08-29-2002, 01:25 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I really appreciate this, Scott, thank you!

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']
Reply With Quote
  #15  
Old 08-29-2002, 08:59 AM
Scott MacVicar Scott MacVicar is offline
 
Join Date: Oct 2001
Location: Glasgow, Scotland
Posts: 1,199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #16  
Old 08-29-2002, 09:05 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #17  
Old 08-29-2002, 09:29 AM
Scott MacVicar Scott MacVicar is offline
 
Join Date: Oct 2001
Location: Glasgow, Scotland
Posts: 1,199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #18  
Old 08-29-2002, 09:35 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:25 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07578 seconds
  • Memory Usage 2,272KB
  • Queries Executed 22 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete