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.
Dan27
New member
New member
Posts: 15
Joined: 14 Apr 2009, 21:30
Real name: Dan
Location: A secret location in England

How do I make this IF statement?

Postby Dan27 » 27 Jul 2009, 17:50

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

Re: How do I make this IF statement?

Postby MasterZ » 27 Jul 2009, 17:51

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

Re: How do I make this IF statement?

Postby Dan27 » 27 Jul 2009, 17:54

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

Re: How do I make this IF statement?

Postby MasterZ » 27 Jul 2009, 17:56

eq

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

Re: How do I make this IF statement?

Postby Dan27 » 27 Jul 2009, 17:58

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

Re: How do I make this IF statement?

Postby Obsidian » 27 Jul 2009, 20:03

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?

Postby Mr. Bond » 27 Jul 2009, 21:44

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

Re: How do I make this IF statement?

Postby MasterZ » 27 Jul 2009, 21:47

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


Good to know :)

User avatar
RMcGirr83
Past Contributor
Past Contributor
Posts: 6243
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Re: How do I make this IF statement?

Postby RMcGirr83 » 28 Jul 2009, 11:26

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


FWIW, so are

or and ||

as well as

and and &&

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

Re: How do I make this IF statement?

Postby igorw » 05 Aug 2009, 00:03

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?

Postby comkid » 12 Sep 2009, 05:23

You could also refresh the template ;)

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

Re: How do I make this IF statement?

Postby Obsidian » 12 Sep 2009, 06:39

comkid wrote:You could also refresh the template ;)


That was not the issue.


Return to “phpBB 3.0.x "Olympus" discussion”

Who is online

Users browsing this forum: Bing [Bot], CommonCrawl [Bot] and 1 guest