Webmastersite.net
Register Log In

Need proper IF statement
PHP help

Comments on Need proper IF statement

zac439
Member

Usergroup: Customer
Joined: Mar 01, 2007

Total Topics: 14
Total Comments: 19
zac439
Posted Mar 07, 2007 - 8:40 AM:



Take a look at this code I use to display the WAV size of a file:


<div class="details"><span class="labels">Wav Size:</span>
{LINKWAV} - Download <a href="{LINKDLW}">WAV</a></div>

I need to select between this block of code, and one for a MIDI file, such as this:

<div class="details"><span class="labels">Mid Size:</span>
{LINKMIDI} - Download <a href="{LINKDLW}">MID</a></div>


I need to select the MIDI size based on the category. However, I am finding this very difficult to accomplish. I tried doing this with CATID without success.

Suggestions?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Mar 07, 2007 - 9:33 PM:

<IF {CATID} is x>midi<OTHERWISE>wav</IF>
zac439
Member

Usergroup: Customer
Joined: Mar 01, 2007

Total Topics: 14
Total Comments: 19
zac439
Posted Mar 08, 2007 - 9:51 PM:

I will be having many MIDI categories, thus, many category ID's to put in the code you gave me. Is there a better way, than to use CATID?

I have many WAV categories too, so it is about 50/50, and extra code size that is unnecessary. Sorry for the troubles confused
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Mar 09, 2007 - 12:19 AM:

Create a category field on the add fields page, say "midiwav" as a selector with the options midi and wav, and select the desired option by editing each category. Then use <IF {CATMIDIWAV} is midi>midi stuff<OTHERWISE>wav stuff</IF>
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.