, Guest!
Already a Member? Login or Register.





Menu



Clients



Showcase



Rate FlexCMS

ScriptSearch.com Rating:

Hotscripts Rating
Excellent!
Very Good
Good
Fair
Poor



FlexCMS eNews

To subscribe to our enewsletter, please enter your email address in the box below and click the "Subscribe" button.


Note:  You may easily remove yourself from the newsletter list at any time by following the instructions included with every mailing.

LATEST DEVELOPMENT NEWS:  FlexCMS 2.5 has been released!!! Click here to read the official announcement!

Home > FlexCMS Support Forum > User Help > Code Snippets > Greeting & Member Login

FlexCMS Support Forum


Greeting & Member Login
Started February 15, 2007 @ 11:27pm by otter
(This thread is currently Locked) 
otter
Administrator

Posts: 157
 
Greeting & Member LoginFebruary 15, 2007 @ 11:27pm
To add the Greeting and Member Login/Register code to a left or right menu block, simply follow these steps:

1) Create a new block

2) Cut and paste the following code into the Custom Block Contents area:


Code

if ($LoggedIn == 'y') {
$NamePrint = $UserDisplayName.'!</b><br><font size="1" color="'.$Colors['BText'].'"><A HREF="'.$MainURL.'/profile-edit.html" class="BlockColors"><font face="'.$FontFace.'" size="1">Edit Profile</font></A> | <A HREF="'.$MainURL.'/logout.html" class="BlockColors"><font face="'.$FontFace.'" size="1">Logout</font></A><br></font>';
}
else {
$NamePrint = 'Guest!</b><br><font face="'.$FontFace.'" size="1" color="'.$Colors['BText'].'">Already a Member?<br> <A HREF="'.$MainURL.'/login.html" class="BlockColors"><font face="'.$FontFace.'" size="1">Login</font></A> or <a href="'.$MainURL.'/register.html" class="BlockColors">Register</a>.<br></font>';
}

print '<font size="1" color="'.$Colors['BText'].'">
<script language="JavaScript"><!--
var Today = new Date();
var Days = new Array("Sun.","Mon.","Tues.", "Wed.","Thurs.","Fri.","Sat.");
var Months = new Array("January","February", "March","April","May","June","July","August", "September","October","November","December");
var Year = Today.getYear();
if (Year < 1000) { Year += 1900; }
var Day = Today.getDate();
var DateEnding = "th";
if (Day == 1 || Day == 21 || Day == 31) { DateEnding = "st"; }
else if (Day == 2 || Day == 22) { DateEnding = "nd"; }
else if (Day == 3 || Day == 23) { DateEnding = "rd"; }
document.write( Days[Today.getDay()] + ", " + Months[Today.getMonth()] + " " + Day + DateEnding + ", " + Year ); //--></script><noscript></noscript><br><br>
<b><script language="JavaScript"><!--
var Greeting = "Hello";
var Today = new Date();
var CurrentHour = Today.getHours();
if (CurrentHour < 12) { Greeting = "Good Morning"; }
if (CurrentHour >= 12 && CurrentHour < 17) { Greeting = "Good Afternoon"; } if (CurrentHour >= 17) { Greeting = "Good Evening"; } document.write(Greeting); //--></script><noscript>Hello</noscript>, '.$NamePrint.'
</div>';


3) Check the box next to Process PHP Code?

4) Save your block.
 

Last Edit: February 15, 2007 @ 11:28pm by DCSun

(This thread is currently Locked) 







All Contents, Code, Scripts and Technologies Copyright 2003-2007 FlexCMS.
All Rights Reserved. Software License Agreement

Processing Time: 0.09158 seconds.
 

Powered By FlexCMS
Powered By FlexCMS


Valid CSS!