Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2008
    Location
    Brampton, Cumbria, United Kingdom, United Kingdom
    Posts
    816
    Plugin Contributions
    2

    help question change Welcome Guest

    I would like to change "Welcome Guest" in to a 'Time of Greeting and Guest'. I have a javascript ready to go, however, I cannot work out how to and where to put it. File location is

    /includes/languages/english/index.php


    and the command line 27 reads

    define('TEXT_GREETING_GUEST', 'Welcome <span class="greetUser">Guest!</span> please <a href="%s">log yourself in</a>?');

    The java script is;

    <script language="JavaScript" type="text/javascript">
    <!--
    var day = new Date();
    var hr = day.getHours();

    if (hr <= 11)
    {
    document.write("Good Morning!");
    }
    else if (hr > 11 && hr < 17)
    {
    document.write("Good Afternoon!");
    }
    else
    {
    document.write("Good Evening!");
    }

    //-->
    </script>

  2. #2
    Join Date
    May 2010
    Location
    Cyberspace
    Posts
    376
    Plugin Contributions
    0

    Default Re: change Welcome Guest

    Ok. Here's what I did. Find this part
    <!-- eof breadcrumb -->
    located in your tpl_main_page.php file, under includes/templates/YOUR_TEMPLATE/common/. Directly after this part paste this into your file
    <!--<div id="greetingScript">
    <script type="text/javascript" src="welcome.js"></script>
    <script type="text/javascript">
    var day = new Date();
    var hr = day.getHours();
    if (hr <= 11)
    {document.write("Good Morning!");}
    else if (hr > 11 && hr < 17)
    {document.write("Good Afternoon!");}
    else {document.write("Good Evening!");}
    </script>
    </div>
    You have to do a bit of CSS in order for it to display the way you want. I you want the file to display the greeting in your index.php file you could simply paste the entire message into the script file, like this:
    document.write("Good Morning! Welcome Guest");

    I'm sure there are also other ways to do this..

    Thanks

  3. #3
    Join Date
    Mar 2008
    Location
    Brampton, Cumbria, United Kingdom, United Kingdom
    Posts
    816
    Plugin Contributions
    2

    Default Re: change Welcome Guest

    Thanks for the info.

    You are talking about css but you mention index.php could you please expain this bit and could you please let me know where abouts the new line is to go.

    Thank you

  4. #4
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    6,196
    Plugin Contributions
    0

    Default Re: change Welcome Guest

    Locate this file:
    includes/ templates/ YOUR_TEMPLATE/ common/ tpl_main_page.php
    You will find this coding:
    PHP Code:
    <!-- bof  breadcrumb -->
    <?php if (DEFINE_BREADCRUMB_STATUS == '1' || (DEFINE_BREADCRUMB_STATUS == '2' && !$this_is_home_page) ) { ?>
        <div id="navBreadCrumb"><?php echo $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR); ?></div>
    <?php ?>
    <!-- eof breadcrumb -->
    Add this below right after the <!-- eof breadcrumb -->
    PHP Code:
    <div id="greetingScript">
    <
    script type="text/javascript" src="welcome.js"></script>
    <script type="text/javascript">
    var day = new Date();
    var hr = day.getHours();
    if (hr <= 11)
    {document.write("Good Morning!");}
    else if (hr > 11 && hr < 17)
    {document.write("Good Afternoon!");}
    else {document.write("Good Evening!");}
    </script>
    </div> 

  5. #5
    Join Date
    Mar 2008
    Location
    Brampton, Cumbria, United Kingdom, United Kingdom
    Posts
    816
    Plugin Contributions
    2

    Default Re: change Welcome Guest

    Thanks for the info I now have at this moment in time Good Morning, however it is in the wrong place (sorry).

    I would like to replace the wording that is currently

    say "Welcome Guest" to say that '[time day greeting] Guest',

    then when you are logged to say '[time day greeting] [your first name]'

    then after that I do not wish it to appear


    www.edencraftsupplies.co.uk/shop

 

 

Similar Threads

  1. Welcome Guest!
    By marketimpact in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 2 Mar 2010, 12:03 AM
  2. Welcome Guest Message
    By ronron in forum Installing on a Linux/Unix Server
    Replies: 5
    Last Post: 14 Mar 2009, 08:10 AM
  3. Welcome Guest Message
    By hamburgler100 in forum Basic Configuration
    Replies: 0
    Last Post: 14 Nov 2007, 04:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg