vBulletin Modifications

someone help me with an if statement please

Welcome to vBHackers.com! - vBHackers Updates:

Go Back   vBulletin Modifications > General vBulletin Section > General vBulletin Support

Reply
 
LinkBack Thread Tools
Old 07-27-2006, 01:19 PM   #1
Coder
BigJohnny's Avatar
Join Date: Jul 2006
BigJohnny is on a distinguished road

Default someone help me with an if statement please

My teamspeak module is malfunctioning slighty and i need a little help forming a proper if state to produce the proper url needed for logging in properly.

Basically this is the current code for the login button.
You must first be a registered member to view any code.
Well only 2 of the login boxes can be used at a time. with one being left blank. The problem is the blank one leaves an empty field in the url which causes you to login as guest1
so i need an if statement.

If the nickname box is left blank then the url should look like this
'teamspeak://IPORT'+ '?LoginName=' + TSLogin.lname.value + '?Password=' + TSLogin.servpw.value

And if the login name box is left blank then the url should look like this
location.href='teamspeak://IPORT'+ '?NickName=' + TSLogin.nname.value + '?Password=' + TSLogin.servpw.value

As you can see, the field from the blank box on the form shouldnt be shown in the url. So i need an if statement of some kind that says "if this box is left blank, then use this url syntax, or if the other box is left blank, then use this url syntax instead"

Anyone know what i need to do? cause i dont know the proper formations of this needed if statement




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 07-27-2006, 03:16 PM   #2
vBulletin Guru
Nick R's Avatar
Join Date: May 2006
Real Name: Nick
Location: Cyberspace, UK
Nick R is on a distinguished road

Default

<if condition="TSLogin.lname.value">
basically so thats if TSLogin.lname.value has a value then do this code....




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-27-2006, 05:30 PM   #3
Coder
BigJohnny's Avatar
Join Date: Jul 2006
BigJohnny is on a distinguished road

Default

so would i do this?
(EDIT)
Actually this didnt work..... why?
It shows 4 buttons.

You must first be a registered member to view any code.

Last edited by BigJohnny; 07-27-2006 at 05:33 PM.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-27-2006, 05:33 PM   #4
vBulletin Guru
Nick R's Avatar
Join Date: May 2006
Real Name: Nick
Location: Cyberspace, UK
Nick R is on a distinguished road

Default

yes, but i am not sure that would work. it looks like you using javascript variables which means your if will be useless.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-27-2006, 05:54 PM   #5
Coder
BigJohnny's Avatar
Join Date: Jul 2006
BigJohnny is on a distinguished road

Default

it doesnt work.....

do you know what would then?


Actually, how could i go about creating 2 radio buttons, "Registered" and "Unregistered"
and if they select registered, it shows the boxes it needs, and if they choose unregistered, it shows a different set.??

would that be hard and stupid? im sure just disabnling the box that isnt going to be used would work just as well if not better.

Last edited by BigJohnny; 07-27-2006 at 05:57 PM.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-27-2006, 05:55 PM   #6
vBulletin Guru
Nick R's Avatar
Join Date: May 2006
Real Name: Nick
Location: Cyberspace, UK
Nick R is on a distinguished road

Default

i am a bit rusty in javascript...

do:
You must first be a registered member to view any code.
but it'd have to be
You must first be a registered member to view any code.
You need to put <span id="logincode"></span> where the submit button normally goes and then.

of course that still may need adjustments but it's sleep time now :p

Last edited by Nick R; 07-27-2006 at 06:01 PM.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
php tcl eggdrop question DeadGaze General vBulletin Support 7 03-24-2006 10:32 AM


All times are GMT -3. The time now is 06:53 PM.


SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc. (Patent Pending)