phpBB

Development Discussion Board

phpBB's testing ground of bleeding edge code
Advanced search

Templating ... a simple guide

All style (template, theme and imageset) related questions for the new release; advice, feedback here please.

Re: Templating ... a simple guide

Postby Aden » Sun Sep 24, 2006 10:13 am

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.
Aden
Registered User
 
Posts: 29
Joined: Sun Sep 17, 2006 8:17 am

Re: Templating ... a simple guide

Postby EXreaction » Sun Sep 24, 2006 6:48 pm

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. Wink
My phpBB3 Mods: Advertisement Management | User Blog Mod | Anti-Spam ACP | Advanced Subscriptions | One Click Ban | From Author PM List | FAQ Manager | Forum Sponsors | Soft Delete | Auto Database Backup | Drag 'n Drop Forum List | HTML Ranks | Enable HTML
User avatar
EXreaction
Development Team
Development Team
 
Posts: 1259
Joined: Sat Sep 10, 2005 2:15 am

Re: Templating ... a simple guide

Postby jojobarjo32 » Sun Sep 24, 2006 7:26 pm

EXreaction wrote:You have to do an SQL query to get that info from the DB. Wink

Er... why that ?
All user's informations are stored in the $user->data array Wink
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 Wink
User avatar
jojobarjo32
Registered User
 
Posts: 164
Joined: Wed Jun 22, 2005 7:38 pm
Location: France

Re: Templating ... a simple guide

Postby EXreaction » Sun Sep 24, 2006 9:02 pm

jojobarjo32 wrote:
EXreaction wrote:You have to do an SQL query to get that info from the DB. Wink

Er... why that ?
All user's informations are stored in the $user->data array Wink
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 Wink


Very nice! Razz

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. Sad
My phpBB3 Mods: Advertisement Management | User Blog Mod | Anti-Spam ACP | Advanced Subscriptions | One Click Ban | From Author PM List | FAQ Manager | Forum Sponsors | Soft Delete | Auto Database Backup | Drag 'n Drop Forum List | HTML Ranks | Enable HTML
User avatar
EXreaction
Development Team
Development Team
 
Posts: 1259
Joined: Sat Sep 10, 2005 2:15 am

Re: Templating ... a simple guide

Postby naderman » Tue Nov 07, 2006 9:18 pm

Domos wrote:There isn't Xor Sad


xor can easily be replaced by a combination of other logical expressions or by a simple != of boolean values.
www.naderman.de
Move your forum to Forumatic - we'll take care of maintenance & spam
User avatar
naderman
Development Team Leader
Development Team Leader
 
Posts: 1649
Joined: Sun Jan 11, 2004 2:11 am
Location: Karlsruhe, Germany

Re: Templating ... a simple guide

Postby luvme2tms » Wed Nov 29, 2006 5:01 pm

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.
luvme2tms
Registered User
 
Posts: 1
Joined: Wed Nov 29, 2006 9:50 am

Re: Templating ... a simple guide

Postby profpete » Wed Nov 29, 2006 5:24 pm

Or, alternatively, you can make every logical operation by using solely NAND Cool
profpete
Registered User
 
Posts: 140
Joined: Wed Dec 08, 2004 10:49 pm
Location: Wales, UK

Re: Templating ... a simple guide

Postby Nicholas the Italian » Fri Dec 01, 2006 11:00 pm

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... Smile

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

Or NOR! Razz
User avatar
Nicholas the Italian
Registered User
 
Posts: 659
Joined: Mon Nov 20, 2006 11:19 pm
Location: 46°8' N, 12°13' E

Re: Templating ... a simple guide

Postby profpete » Fri Dec 01, 2006 11:32 pm

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

Or NOR! Razz

I'm going to regret this... are you sure? Mr. Green
profpete
Registered User
 
Posts: 140
Joined: Wed Dec 08, 2004 10:49 pm
Location: Wales, UK

php logical operators

Postby robertmf » Sat Dec 02, 2006 12:21 am

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

Previous Next

Return to [3.0/Olympus] Styling

Who is online

Users browsing this forum: No registered users and 5 guests