news   ||   about   ||   download   ||   documentation   ||   development
edit
 tutorial-dynadev-hello-user
created by unknown
last edited by unknown

hello-user.r

This dynasnip presents a variation on the "hello world" dyna presented in tutorial-dynadev-hello. The tutorial was contributed by zippo.

If you copy the code below into a file, say "hello-user.r" and save it to your <path to vanilla>/apps directory you can have your vanilla create a nice welcome message for new users when they create their account.
context [
handle: func [ /local rank ] [
if none? user [ return "Hello Vanilloid!" ]

either users-is-master? user
[ rank: copy "master" ]
[ either users-is-associate? user
[ rank: copy "associate" ]
[ rank: copy "user" ] ]

return rejoin ["Hello " rank " " (user/get 'name)]
]
]
What we get here is by using the {!hello-user} dynasnip the message will be the generic "Hello Vanilloid!" for guests and for logged in users they will be greeted with, eg: "Hello user zippo" where 'user' is the member ranking the master has given the user.

From here if you put {!hello-user} in your vanilla-new-user.snip file the new personalized greeting will be inserted into each user page upon creation. :-)
  search
  go
  welcome, stranger!
you might want to
log in or
register.
  3 active users
  recent edits
  backlinks
no backlinks
Copyright © 1999-2009 International Society for the Advancement of Planet-wide Vanillization