How to display or not diaplay something depending on value?

Discussion in 'PHP' started by GloBleeOne, May 28, 2008.

  1. #1
    Ok, I own www.photosales.co.nz and need to work out the following:

    We have different membership levels for our photographers. Normal and Professional.

    Now we can use the following code:
    <?php if (!isset($member->professional) || !$member->professional) { ?><li id="navlogin"><a href="http://www.photosales.co.nz/pro.php">Gold Membership</a></li><?php } ?>
    Code (markup):
    What that part does is, if the person is flagged as a professional, then do not display that part of the menu.

    We also have:
     <?php if ($photogl->professional == 1) { ?><font color="#FF0000"><b><i>Gold</i></b></font><?php } ?>
    Code (markup):
    That part is in our navigation section, and if the photographer is a professional, then it displays Gold next to their name.

    Now, what I am wanting to do, is on the actual pages that show the photos, I want to display adverts for non professional members, but not on the pages where the photographers are paying members.

    I have tried to wrap the Google Ads in the sames code as the first lot I put in, but that did not work.... Any thoughts?
     
    GloBleeOne, May 28, 2008 IP
  2. GloBleeOne

    GloBleeOne Peon

    Messages:
    286
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Willing to flick someone some $$ via PayPal if we can get this working ;-)
     
    GloBleeOne, May 28, 2008 IP
  3. Greg-J

    Greg-J I humbly return to you.

    Messages:
    1,844
    Likes Received:
    153
    Best Answers:
    0
    Trophy Points:
    135
    #3
    Using that same code will work if it's done properly. I can help out, but I'd need to see the code for the entire page. Feel free to PM me.
     
    Greg-J, May 28, 2008 IP
  4. GloBleeOne

    GloBleeOne Peon

    Messages:
    286
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Sent a PM - waiting to hear back.
     
    GloBleeOne, May 28, 2008 IP
  5. GloBleeOne

    GloBleeOne Peon

    Messages:
    286
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hay there Greg-J or anyone else - willing to pay via PayPal to get this nutted out.
     
    GloBleeOne, May 29, 2008 IP
  6. Normac

    Normac Peon

    Messages:
    40
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Well I haven't seen the page but this should work.

    
    if ($photogl->professional != 1)
    {
    Add ad stuff here.
    }
    
    Code (markup):
    Though You might want to use if the $photogl->professional is a bool (So either true or false.)
    
    if ($photogl->professional === false)
    {
    Add ad stuff here.
    }
    
    Code (markup):
    Give me a PM if you still need any help.
     
    Normac, May 29, 2008 IP