*** SOLVED *** Add variable to Time Greeting ?

All WYSIWYG Web Builder support issues that are not covered in the forums below.
Forum rules
IMPORTANT NOTE!!

DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.



PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
Post Reply
MGD4me
 
 
Posts: 287
Joined: Tue May 02, 2017 11:56 pm
Location: British Columbia, Canada

*** SOLVED *** Add variable to Time Greeting ?

Post by MGD4me »

After a member logs in to the restricted area of the web site, I have set up the Time Greeting javascript function to show a "Good morning", or whatever greeting depending on the time of day. Since they have now logged on, I am able to retrieve their name from a database, and would like to know if it would be possible to include their name as part of the displayed Time Greeting, such as "Good morning " . $name . "!" ?? I realize the syntax here is incorrect, but where could I include $name along with the greeting?

Thanks.
Last edited by MGD4me on Tue Dec 17, 2019 5:56 am, edited 1 time in total.
User avatar
Pablo
 
Posts: 21574
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Add variable to Time Greeting ?

Post by Pablo »

There is no standard solution for this. This will require a custom script.
MGD4me
 
 
Posts: 287
Joined: Tue May 02, 2017 11:56 pm
Location: British Columbia, Canada

Re: Add variable to Time Greeting ?

Post by MGD4me »

I was afraid that might be the case, but I had to ask !! :wink:

Thanks
MGD4me
 
 
Posts: 287
Joined: Tue May 02, 2017 11:56 pm
Location: British Columbia, Canada

*** SOLVED *** Add variable to Time Greeting ?

Post by MGD4me »

Well, it wasn't as difficult as I thought !

I have the member's name stored in a variable "$name", pulled from the database once a member logs in, Then, in the each different Timed Greeting I can include their name by writing:

Good Morning <?php echo $name; ?>
Good Afternoon <?php echo $name; ?>
Good Evening <?php echo $name; ?>

Works like a charm! Just in case anyone else would like to do the same...
Post Reply