Post by jeffreyye on Dec 7, 2014 20:16:11 GMT 10
Hi! I wonder how did you create such code in this forum. When a user is not logged in, the HTML box at the start page asked us to 'sign up', when a user is registered, the information of the username pops up. Can you please send me the code? Thanks!
|
|
Post by Prezence on Dec 8, 2014 7:09:09 GMT 10
The webpage is probably using cookies or localStorage to remember the username.
Check out our website here. Check out AirBrowse here. Follow us on GitHub here.
|
|
Post by Nathan Lecompte on Dec 8, 2014 15:13:38 GMT 10
Hey jeffreyye, This forum is hosted by ProBoards, the login system is all built-in so I can't see the code for it and therefore can't really explain how the forum login system works exactly. But (as Prezence mentioned) it's basically a database of details on a server which stores usernames, passwords and other information for the user. A form basically contacts that database and checks the match (username and password) in return for the information and finally stores a cookie into your browser to show that the following user is logged on or not.
|
|
Post by Nathan Lecompte on Dec 8, 2014 15:21:14 GMT 10
|
|
Post by jeffreyye on Dec 11, 2014 23:20:04 GMT 10
Alright Thanks!
|
|
Post by jeffreyye on Dec 11, 2014 23:22:46 GMT 10
By the way, I am also hosting a proboards forum. What options did you set so that the HTML box would change once we are logged in.
|
|
Post by Nathan Lecompte on Dec 12, 2014 15:03:16 GMT 10
I used this:
{if !$[current_user.is_member]} <div class="signupbox">Sign Up Here</div> {else} <div class="userbox">$[current_user.name]</div> {/if}
|
|
Post by jeffreyye on Dec 12, 2014 23:05:25 GMT 10
Alright, thanks mate!
|
|
Post by jeffreyye on Dec 12, 2014 23:22:17 GMT 10
Sorry, I am having troubles coding with JavaScript. Please help me to code this in HTML.
|
|
Post by Nathan Lecompte on Dec 13, 2014 10:24:36 GMT 10
Oh that's not javascript, that's just stuff you can include in your ProBoards HTML. It's sort of their own style of language to make it easier to access proboards sections and so on. BTW: If your question has been answered please click the Accept button next to the post which answered your question.
|
|