The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
MySQL Help - How Would I Optimize this?
When folks register to my site, they have to go through an approval process by me before I Will allow them to post. I Also have it setup when they register, and they are in the "Awaiting E-Mail COnfirmation" group, they receive a special message stating they need to activate their account before they can post, etc. How would I go abouts optimizing this query instead of having three different ones in one pop? Anyone who is able to help is greatly appreciated!
PHP Code:
|
#2
|
||||
|
||||
erm, there is no mysql query in your post.
there are just php if clauses, but nothing to optimize. |
#3
|
|||
|
|||
Quote:
That code isn't going to cause any server load issues, will it? I like keeping my users informed when they're in certain usergroups of their status.. Thanks Xenon!! Glad you caught my goof :ermm: :nervous: |
#4
|
||||
|
||||
Quote:
|
#5
|
||||
|
||||
there is still no mysql query in the code itself
@hurrican: well, each line of code let the server work a bit, but it's not noticable, so nothing to do for ya. But Kirby is right, make sure the templates you are calling are added to the template chache string on the beginning of the script |
#6
|
|||
|
|||
ok, I don't remember if I did that or not, I'll go back and double check. You guys are great!! I Appreciate your help, and still feel like a dummy, lol!! Hopefully someday i'll be good enough at this stuff to contibute to people like me too lol.. Ya'll have a great 4th!! Thanks Again!!
|
#7
|
||||
|
||||
you're welcome. |
#8
|
|||
|
|||
it can be optimized by using elseif's or even a switch statement, but it's not really that big of an issue with only 3 if statements...we're talking like pinching a couple bytes of cpu instructions here
|
#9
|
||||
|
||||
Quote:
|
#10
|
|||
|
|||
Like so
Code:
switch ($bbuserinfo['usergroupid']) { case 0: eval("\$unregwelcomemessage = \"".gettemplate('forumhome_unregmessage')."\";"); break; case 3: eval("\$nonactivatedmessage = \"".gettemplate('awaitconfmessage')."\";"); break; case 4: eval("\$activatedwaitingapproval = \"".gettemplate('awtngadmapprvl')."\";"); } |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|