FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Suggestions » How about Chat
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: How about Chat [message #40478 is a reply to message #22680] Sun, 09 March 2008 10:42 Go to previous messageGo to previous message
Ernesto is currently offline  Ernesto   Sweden
Messages: 413
Registered: August 2005
Karma:
Senior Member
I will not test this, so unsure if it will work.

Here is the code for the input boxes in your chatbox thingy:
<td valign="center" height="100%" align="center" id="tblmid" colspan="2">
<input type="hidden" value="" name="key"/>
<input type="text" onblur="frmblur(this, 'name');" onfocus="frmfocus(this, 'name');nme_warn()" class="frmtb" value="name" size="9" name="nme" maxlength="25" style="width: 577px;"/>
<input type="text" onblur="frmblur(this, 'message')" onfocus="frmfocus(this, 'message')" class="frmtb" value="message" size="9" name="pst" maxlength="200" style="width: 544px;"/><input type="submit" class="frmbtn" name="sub" value="Go" style="height: 20px; width: 29px;"/></td>


The one that looks like this, is what stores the username:
<input type="text" onblur="frmblur(this, 'name');" onfocus="frmfocus(this, 'name');nme_warn()" class="frmtb" value="name" size="9" name="nme" maxlength="25" style="width: 577px;"/>


Let's now write a FUD template code to check if a user is logged in, and if the user is logged in, we will not display this input box, but rather just type out the username of the forum user. Great idea batman!

So, we wrap this code around the username field:
{IF: _uid}
<input type="hidden" value="{VAR: usr->alias}" name="nme"/>
{VAR: usr->alias}<br />
{ELSE}
<input type="text" onblur="frmblur(this, 'name');" onfocus="frmfocus(this, 'name');nme_warn()" class="frmtb" value="name" size="9" name="nme" maxlength="25" style="width: 577px;"/>
{END}


See what I did there?
First i checked if the user was logged in with {IF: _uid}.
If he was, I placed his alias as the value of the input field, and then typed out his alias on the screen.

Then we did ELSE (if not logged in) we wrote the old regular input field and then we ENDED the IF check.

Perhaps the IF and END wont work in that locating since it could be wrappen in some other IF thingies, but I think it should work fine in the footer.


[Updated on: Sun, 09 March 2008 10:43]

Report message to a moderator

[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message icon13.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Anchors
Next Topic: Blocking User PM's
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 29 18:44:56 GMT 2024

Total time taken to generate the page: 0.04267 seconds