1 salgonza Feb 12, 2008 09:59
3 salgonza Feb 13, 2008 08:03
Damn, i apologize i didn't even realize that i hadn't put it.
It's the newest version. 2.4.0 "Venetian"
4 john Feb 13, 2008 08:13
Ok, you can use the FreeHTML widget to add it where ever you wish in the sidebar or you can open open .index.main.php and simply hard code it into the sidebar with something like...
div class="bSideItem">
<h3>Welcome</h3>
<p>Wecome to adda yadda yadda.......
hope you have a nice stay.
etc etc</p>
</div>
5 salgonza Feb 13, 2008 10:37
I meant like Dynamic, so if i were to login as Admin it would say, "Hello Admin" or Joe logs in it says "Hello Joe" that type of thing.
6 john Feb 13, 2008 10:41
You will have to leave that to some B2 guru to come up with the user_ID solution and related "if then else" mumbo jumbo.
Sorry I missed your point
7 yabba Feb 13, 2008 10:45
<?php
if( is_logged_in() )
{
$greetings = array( 'god', 'morning', 'afternoon', 'evening' );
echo 'Good '.$greetings[ intval( date( 'h' ) / 6 ) ].' '.$current_User->get_preferred_name();
}
?>
ish ;)
¥
8 harishankar Feb 13, 2008 14:07
That's a clever bit of code, ¥åßßå. Thanks for sharing :)
9 yabba Feb 13, 2008 18:28
I have my moments ;)
¥
10 edb Feb 20, 2008 15:27
Just started using this and have a little question. Shouldn't it be using the 24 hour clock instead of 12? Cuz like with a 12 hour clock 2 in the afternoon would be 2 and would therefore intval to 0 after dividing by 6.
intval( date( 'H' ) / 6 ) instead of intval( date( 'h' ) / 6 ) ?
11 yabba Feb 20, 2008 15:54
It should ;)
¥
12 brandonh Feb 22, 2008 01:15
what is the get-login-name equivalent of $current_User->get_preferred_name()?
i'd like to use mine in if statements so i'll use something that my users can't change.
13 tosca Mar 10, 2008 21:38
Hi....
Hate to ask one of the dumbest questions about this, but WHAT file should this code be in? There seems to be an assumption that everyone knows which or what file to go into. If at all possible, I'd like to use the below.
PHP:
<?php
if( is_logged_in() )
{
$greetings = array( 'god', 'morning', 'afternoon', 'evening' );
echo 'Good '.$greetings[ intval( date( 'h' ) / 6 ) ].' '.$current_User->get_preferred_name();
}
?>
Also, I'd like to personalize the Log In page (with name/password). Where is this file? As well as the email confirmation for blogging.
Many thanks,
Tosca
14 edb Mar 11, 2008 16:01
This bit of code would typically go in your skins/yourskin/index.main.php file, but it's really hard to say for sure because some skins use different file structures to build the page. Like for example look at the files in evopress and custom to see how different files can get used to make the pages.
The next question I have no idea. I never log out so I don't ever think about what the login page looks like.
15 brandonh Mar 11, 2008 16:07
mine is in htsrv/login.php. difficult to play with though. back it up or if you make a couple wrong keystrokes or your cat walks on your keyboard when you aren't looking, you won't be able to login (nor will your users!),
16 edb Mar 11, 2008 16:15
brandonh wrote:
mine is in htsrv/login.php. difficult to play with though. ...
Um... on a page that a logged in person doesn't need you have a greeting to a logged in person? I think I'm missing the point of that. Maybe I should go do my laundry and code something yah?
17 brandonh Mar 11, 2008 17:29
Also, I'd like to personalize the Log In page (with name/password). Where is this file? As well as the email confirmation for blogging.
Sorry. I should have quoted this in my message. I was pointing out where the login page was. htsrv/login.php
18 tosca Mar 11, 2008 20:11
Thank you for pointing me in the right direction....
As for the cat thing ... :'( oh, boy! Thanks for the heads up.
:D Tosca
19 edb Mar 12, 2008 00:02
Ah that makes more sense :)
This can be easily done, however the way you do does depend on what version of B2 you have installed.