Anyone know how to display a users name and avatar if they have one are are logged in on a template,
eg.
Welcome username,
--Avatar Here-
Your last visit was:
This would be for a mod i am writing, the "TOP PANEL MOD"
25% COMPLETE.
Templating ... a simple guide
- EXreaction
- Registered User
- Posts: 1555
- Joined: Sat Sep 10, 2005 2:15 am
Re: Templating ... a simple guide
Aden wrote: Anyone know how to display a users name and avatar if they have one are are logged in on a template,
eg.
Welcome username,
--Avatar Here-
Your last visit was:
This would be for a mod i am writing, the "TOP PANEL MOD"
25% COMPLETE.
You have to do an SQL query to get that info from the DB.
- jojobarjo32
- Registered User
- Posts: 164
- Joined: Wed Jun 22, 2005 7:38 pm
- Location: France
Re: Templating ... a simple guide
EXreaction wrote: You have to do an SQL query to get that info from the DB.![]()
Er... why that ?
All user's informations are stored in the $user->data array
You only need to add (if it is not already there) template variables (maybe in page_header function to have the variables in every pages) to display them in the template
- EXreaction
- Registered User
- Posts: 1555
- Joined: Sat Sep 10, 2005 2:15 am
Re: Templating ... a simple guide
jojobarjo32 wrote:EXreaction wrote: You have to do an SQL query to get that info from the DB.![]()
Er... why that ?
All user's informations are stored in the $user->data array
You only need to add (if it is not already there) template variables (maybe in page_header function to have the variables in every pages) to display them in the template![]()
Very nice!
I keep getting mixed up with phpbb2's and phpbb3's capabilities and I forget all the nice things that are already done in phpbb3.
Re: Templating ... a simple guide
Domos wrote: There isn't Xor![]()
xor can easily be replaced by a combination of other logical expressions or by a simple != of boolean values.
Re: Templating ... a simple guide
xor can easily be replaced by a combination of other logical expressions
a XOR b = (a OR b) AND (NOT(a AND b))
Last edited by luvme2tms on Wed Nov 29, 2006 5:45 pm, edited 1 time in total.
Re: Templating ... a simple guide
Or, alternatively, you can make every logical operation by using solely NAND 8)
- Nicholas the Italian
- Registered User
- Posts: 659
- Joined: Mon Nov 20, 2006 11:19 pm
- Location: 46°8' N, 12°13' E
- Contact:
Re: Templating ... a simple guide
luvme2tms wrote: a XOR b = (a OR b) AND (NOT(a AND b))
(a AND NOT b) OR (b AND NOT a)
Same thing, but more readable...
Or, alternatively, you can make every logical operation by using solely NAND 8)
Or NOR!
Re: Templating ... a simple guide
Nicholas the Italian wrote:Or, alternatively, you can make every logical operation by using solely NAND 8)
Or NOR!![]()
I'm going to regret this... are you sure?