Templating ... a simple guide

All style (template, theme and imageset) related questions for the new release; advice, feedback here please.
Post Reply
Aden
Registered User
Posts: 29
Joined: Sun Sep 17, 2006 8:17 am

Re: Templating ... a simple guide

Post by Aden »

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.

User avatar
EXreaction
Registered User
Posts: 1555
Joined: Sat Sep 10, 2005 2:15 am

Re: Templating ... a simple guide

Post by EXreaction »

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. ;)

User avatar
jojobarjo32
Registered User
Posts: 164
Joined: Wed Jun 22, 2005 7:38 pm
Location: France

Re: Templating ... a simple guide

Post by jojobarjo32 »

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 ;)

User avatar
EXreaction
Registered User
Posts: 1555
Joined: Sat Sep 10, 2005 2:15 am

Re: Templating ... a simple guide

Post by EXreaction »

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! :P

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. :(

User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Berlin, Germany
Contact:

Re: Templating ... a simple guide

Post by naderman »

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.

luvme2tms
Registered User
Posts: 1
Joined: Wed Nov 29, 2006 9:50 am
Contact:

Re: Templating ... a simple guide

Post by luvme2tms »

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.

profpete
Registered User
Posts: 140
Joined: Wed Dec 08, 2004 10:49 pm
Location: Wales, UK

Re: Templating ... a simple guide

Post by profpete »

Or, alternatively, you can make every logical operation by using solely NAND 8)

User avatar
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

Post by Nicholas the Italian »

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! :P

profpete
Registered User
Posts: 140
Joined: Wed Dec 08, 2004 10:49 pm
Location: Wales, UK

Re: Templating ... a simple guide

Post by profpete »

Nicholas the Italian wrote:
Or, alternatively, you can make every logical operation by using solely NAND 8)

Or NOR! :P

I'm going to regret this... are you sure? :mrgreen:

User avatar
robertmf
Registered User
Posts: 52
Joined: Wed Jul 23, 2003 5:20 pm
Location: In PA, 55 min. via commuter RR outside Filthadelphia
Contact:

php logical operators

Post by robertmf »


Post Reply