How do I make this IF statement?

Discuss phpBB 3.0.x in general.
Forum rules
Please post any phpBB 3.1.x related topics in the phpBB 3.1.x discussion forum.
Post Reply
Dan27
New member
New member
Posts: 15
Joined: 14 Apr 2009, 21:30
Real name: Dan
Location: A secret location in England
Contact:

How do I make this IF statement?

Post by Dan27 »

Hi, I am making a little mod for my site and I need an IF statement but I don't know what I
need to use.

This little mod would show an image on the viewtopic page in the list of profile information
and the images would be shown if a user has a certain username.

So something like this: (even though this one doesn't work)

Code: Select all

<!-- IF postrow.POST_AUTHOR_FULL == 'Dan27' -->


Any help please???
User avatar
MasterZ
Member
Member
Posts: 87
Joined: 07 Jul 2007, 23:46
Real name: Jon
Location: Colorado Springs, CO
Contact:

Re: How do I make this IF statement?

Post by MasterZ »

Change == to eq
Dan27
New member
New member
Posts: 15
Joined: 14 Apr 2009, 21:30
Real name: Dan
Location: A secret location in England
Contact:

Re: How do I make this IF statement?

Post by Dan27 »

What just "eq" or "equal"?

Thanks :)
User avatar
MasterZ
Member
Member
Posts: 87
Joined: 07 Jul 2007, 23:46
Real name: Jon
Location: Colorado Springs, CO
Contact:

Re: How do I make this IF statement?

Post by MasterZ »

eq
Dan27
New member
New member
Posts: 15
Joined: 14 Apr 2009, 21:30
Real name: Dan
Location: A secret location in England
Contact:

Re: How do I make this IF statement?

Post by Dan27 »

This is what I have so far and it wont show, can you provide the correct statement please?

Code: Select all

<!-- IF postrow.POST_AUTHOR_FULL eq 'Dan27' --><dd>This is just a test</dd><!--ENDIF -->


I have that in my viewtopic and it wont show up.

Thanks.
User avatar
Obsidian
Supporter
Supporter
Posts: 736
Joined: 13 May 2008, 15:20
Real name: Damian
Contact:

Re: How do I make this IF statement?

Post by Obsidian »

You're using the wrong template var. POST_AUTHOR_FULL also includes HTML with the usercolor as well -- I don't know what template var you need though, I couldn't say.

I should know, because I used template pranks way back in the old days to get the site admin on a site I worked on. :lol:
Some of the things I did...just beautiful.
User avatar
Mr. Bond
Member
Member
Posts: 89
Joined: 30 Mar 2008, 20:34
Real name: Bobby
Location: 127.0.0.1

Re: How do I make this IF statement?

Post by Mr. Bond »

I think POST_AUTHOR is the cleaned version of the username (no HTML etc.).

Code: Select all

<!-- IF postrow.POST_AUTHOR eq 'Dan27' --><dd>This is just a test</dd><!--ENDIF -->

Oh, btw, == and eq are the same thing ;)
Twitter • Ohloh • GitHub
User avatar
MasterZ
Member
Member
Posts: 87
Joined: 07 Jul 2007, 23:46
Real name: Jon
Location: Colorado Springs, CO
Contact:

Re: How do I make this IF statement?

Post by MasterZ »

Mr. Bond wrote:Oh, btw, == and eq are the same thing ;)


Good to know :)
User avatar
RMcGirr83
Supporter
Supporter
Posts: 6242
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Re: How do I make this IF statement?

Post by RMcGirr83 »

Mr. Bond wrote:Oh, btw, == and eq are the same thing ;)


FWIW, so are

or and ||

as well as

and and &&
igorw
Past Contributor
Past Contributor
Posts: 1967
Joined: 01 Jun 2006, 20:48
Real name: Igor

Re: How do I make this IF statement?

Post by igorw »

If something doesn't show try purging your cache and enabling debug.
comkid
New member
New member
Posts: 18
Joined: 28 Jun 2009, 11:32

Re: How do I make this IF statement?

Post by comkid »

You could also refresh the template ;)
User avatar
Obsidian
Supporter
Supporter
Posts: 736
Joined: 13 May 2008, 15:20
Real name: Damian
Contact:

Re: How do I make this IF statement?

Post by Obsidian »

comkid wrote:You could also refresh the template ;)


That was not the issue.
Post Reply