Templating ... a simple guide

All style (template, theme and imageset) related questions for the new release; advice, feedback here please.
Post Reply
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 » Sat Dec 02, 2006 4:20 pm

profpete wrote:
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:

Nope, this is just what my prof told me at the uni... :mrgreen:

Actually I see that NAND gates are mentioned much more than NOR gates. But searching on Wikipedia (Wikipedia knows it all!) I read:
Wikipedia wrote: NAND and NOR logic gates are the two pillars of logic, in that all other types of Boolean logic gates (i.e., AND, OR, NOT, XOR, XNOR) can be created from a suitable network of just NAND or just NOR gate(s). They can be built from relays or transistors, or any other technology that can create an inverter and a two-input AND or OR gate. Hence the NAND and NOR gates are called the universal gates.


PS: I notice that external links open in the same window... is this wanted? I mean, I'd like external links to open in new windows/tabs, instead of taking the place of the forum...

FawcettUniverse
Registered User
Posts: 2
Joined: Sat Dec 09, 2006 4:12 am

Re: Templating ... a simple guide

Post by FawcettUniverse » Sat Dec 09, 2006 4:17 am

I've read the entire thread and I'm confused. Could someone please tell me which files do you need to open and edit to create a new style for phpBB3?

User avatar
poyntesm
Registered User
Posts: 176
Joined: Fri May 13, 2005 4:08 pm
Location: Dublin, Ireland
Contact:

Re: Templating ... a simple guide

Post by poyntesm » Tue Dec 12, 2006 10:09 am

Code: Select all

			<!-- BEGIN block1 -->
			<table width="100%" cellpadding="1" cellspacing="1" border="0" class="tablebg">
				<tr>
	  				<th colspan="2">{L_TITLE}</th>
				</tr>
				<tr>
	  				<td class="cat" ><span class="gen">{L_TITLE}</span></td>
	  				<!-- IF block1.block2.U_DELETE || block1.block2.U_EDIT --><td class="cat" ></td><!-- ENDIF -->
				</tr>
				<!-- BEGIN block2 -->
				<tr>
	  				<td class="row1" align="center"><span class="gensmall">{block1.block2.TITLE}</span></td>
					<!-- IF block1.block2.U_DELETE || block1.block2.U_EDIT --><td class="row1" align="right"><span class="gensmall"><!-- ENDIF --><!-- IF block1.block2.U_EDIT --><a href="{block1.block2.U_EDIT}">{EDIT}</a><!-- ENDIF -->&nbsp;<!-- IF block1.block2.U_DELETE--><a href="{block1.block2.U_DELETE}">{DELETE}</a><!-- ENDIF --></span></td>
				</tr>
				<!-- END block2 -->
			</table>
			<br />
			<!-- END block1 -->
Question? Can you do a conditional IF on the second block before it begins? Like 'IF block1.block2.U_DELETE' where we have not started the block2.

I have one example of this working and one not working and I can not figure if its supported by the template engine.

User avatar
Acyd Burn
Posts: 1838
Joined: Tue Oct 08, 2002 5:18 pm
Location: Behind You
Contact:

Re: Templating ... a simple guide

Post by Acyd Burn » Tue Dec 12, 2006 1:45 pm

How could this be possible - you are not able to tell *which* value to use if you use it. What you can do is checking for the existence of block2 or using conditionals to lay out properly or (the complicate way) iterating through block2 once, defining a variable with <!-- DEFINE --> if you find any parameter and then using this defined var within the later block:

Code: Select all

<!-- BEGIN block1 -->
	<!-- BEGIN block2 -->
		<!-- IF block1.block2.U_DELETE || block1.block2.U_EDIT --><!-- DEFINE $ADD_COLUMN = 1 --><!-- ENDIF -->
	<!-- END block2 -->

	<table width="100%" cellpadding="1" cellspacing="1" border="0" class="tablebg">
	<tr>
		<th colspan="2">{L_TITLE}</th>
	</tr>
	<tr>
		<td class="cat"><span class="gen">{L_TITLE}</span></td>
		<!-- IF $ADD_COLUMN --><td class="cat"></td><!-- ENDIF -->
	</tr>
	<!-- BEGIN block2 -->
		<tr>
			<td class="row1" align="center"><span class="gensmall">{block1.block2.TITLE}</span></td>
		<!-- IF $ADD_COLUMN -->
			<td class="row1" align="right"><span class="gensmall">
				<!-- IF block1.block2.U_EDIT --><a href="{block1.block2.U_EDIT}">{EDIT}</a><!-- ENDIF -->&nbsp;
				<!-- IF block1.block2.U_DELETE--><a href="{block1.block2.U_DELETE}">{DELETE}</a><!-- ENDIF -->
			</span></td>
		<!-- ENDIF -->
		</tr>
	<!-- END block2 -->
	</table>
	<br />

<!-- END block1 -->

Image

User avatar
poyntesm
Registered User
Posts: 176
Joined: Fri May 13, 2005 4:08 pm
Location: Dublin, Ireland
Contact:

Re: Templating ... a simple guide

Post by poyntesm » Tue Dec 12, 2006 2:05 pm

Thanks. I did not think it would be possible, but what confused me is I have one working like that :? I am trying to narrow down why one is working and the other is not. I am guessing its a mistake on my part.

DimaX
Registered User
Posts: 2
Joined: Fri Dec 15, 2006 6:08 pm

Re: Templating ... a simple guide

Post by DimaX » Fri Dec 15, 2006 6:12 pm

good things here

shadow82x
Registered User
Posts: 3
Joined: Thu Jan 04, 2007 11:16 pm
Contact:

Re: Templating ... a simple guide

Post by shadow82x » Fri Jan 05, 2007 11:12 pm

How do you add a template im still confused after reading that
Image

BornToLag
Registered User
Posts: 2
Joined: Mon Nov 20, 2006 5:56 pm

Re: Templating ... a simple guide

Post by BornToLag » Mon Jan 22, 2007 10:47 pm

Has anyone figured out to include an indication of the logged-in user's 'Rank Title' on the index page?

I can't seem to find any reference to it apart from that in viewtopic, which isn't suitable. I haven't had a chance to look directly at the database structure to see where or how it is stored. Any help appreciated.

So far I've been able to include Member ID, joined date, posts and warnings.

User avatar
Highway of Life
Registered User
Posts: 1399
Joined: Tue Feb 08, 2005 10:18 pm
Location: I'd love to change the World, but they won't give me the Source Code
Contact:

Re: Templating ... a simple guide

Post by Highway of Life » Mon Jan 22, 2007 10:55 pm

Try adding...

Code: Select all

'USER_RANK'                => ($user->data['user_rank']) ? $user->data['user_rank'] : '',
to the functions file.
Image

BornToLag
Registered User
Posts: 2
Joined: Mon Nov 20, 2006 5:56 pm

Re: Templating ... a simple guide

Post by BornToLag » Mon Jan 22, 2007 11:11 pm

Ahhh! That should do the trick... Seems to return the rank ID - I should be able to set up IF statements to sort & display the title.

Thanks very much! :mrgreen:

Post Reply