Firstly for all you code geniuses out there. I'm sorry. This is probably a really really basic and dumb question. But I'm going to ask it anyway as it'll help me understand some things more.
I have the following code in a block:
global $user;
if ($user->uid) {
print '<b>Welcome back '.$user->name.'!</b> ';
}
global $user;
print l("Go To Your Blog", "blog/" . $user->uid);
This basically puts in the block "Welcome back user! Go To Your Blog"
(User is obviously the actual user name and Go To Your Blog is a link to the users blog).
My question is how do I alter this code so that each section is on a distinct seperate line?
So rather than "Welcome back user! Go To Your Blog"
I want:
Welcome back user!
Go To Your Blog
Effectively there is a line break between the two messages.
It's just a matter of looking neater on the page but I have no clue how to do it.
Any guidance gratefully received.
Thanks
Comments
Erm, I'd use a line break :-)
Pete.
Thank you
Ha ha... Simple but effective... Damn it I feel foolish.
At least I know how to do it now :-)
Thanks Pete.
Support for families with children with medical conditions: http://www.parentsown.co.uk
Buy allergen free foods from http://www.freefromforkids.co.uk
global $user
You don't need to declare the variable twice. Only once is okay... at the top.
You mean...
...the variable?
Thanks. I should tidy it all up a bit really.
Support for families with children with medical conditions: http://www.parentsown.co.uk
Buy allergen free foods from http://www.freefromforkids.co.uk
I was referring to $user as the variable
Hope this helps
Tidied
Pete.
Nice
Thanks guys.
Support for families with children with medical conditions: http://www.parentsown.co.uk
Buy allergen free foods from http://www.freefromforkids.co.uk
Not quite right
The above code actually takes the user to the page with all blogs not the users specific blog.
I thought I could amend this myself, but when I tried it it didn't work!
So for now I'm sticking with my untidy version :-)
Support for families with children with medical conditions: http://www.parentsown.co.uk
Buy allergen free foods from http://www.freefromforkids.co.uk
Oops!
My mistake; try this :-
Pete.
Spot on
all works fine now. Thanks for posting, this whole thing has allowed me to understand some coding a little more. That's either a good thing, or a very dangerous thing :-)
Thanks again.
Support for families with children with medical conditions: http://www.parentsown.co.uk
Buy allergen free foods from http://www.freefromforkids.co.uk