PhotoPost Photo Gallery Sales PhotoPost Sales Toll Free Phone Number
Mon-Fri 9am-4pm EST
  PhotoPost Photo Sharing Photo Gallery    Visualize community tm
| | | | | | | | |

Go Back   PhotoPost Community > PhotoPost Support > PhotoPost Pro Support Forums > Photopost Pro How Do I...?

Photopost Pro How Do I...? Wondering how to do things in PhotoPost?

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old May 29th, 2011, 08:45 AM   #1 (permalink)
Member
Verified Customer
 
Join Date: Feb 2007
Posts: 297
Question Need if statement for showing ads conditionally based upon style

I'm trying to use an if statement in photopost to show certain ads under photos if a user has selected Style ID 4 and another (with a different background) if a user has selected Style ID 7.

I created this statement and put it around the ad code in showphoto.tmpl:

Code:
Content visible to verified customers only.
However, this if statement does nothing. The ads show regardless of which style the user has selected.

How would I implement what I am trying to achieve?

Originally I thought this would work:

Code:
Content visible to verified customers only.
However, the above statement simply results in *both* ads showing on both styles.

Help would be appreciated. Thanks.
jdougher is offline   Reply With Quote
Old May 29th, 2011, 09:10 AM   #2 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,070
Of course that would do nothing that I am aware of. You can not use vbulletin conditonals in Photopost templates. They use a function to define an html if clause which of course they decode into php and analyse. Now regular conditionals would work but also you need to verify your actual variables to see if they are present. Is the bbuserinfo styleid variable present on the page your using? If it isn't you will not get any type of code to work.

a proper php conditional would look like this. Now note I also put in the print statements to bypass between html and php so you can drop the whole thing right where you want it to print.

Code:
Content visible to verified customers only.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old May 29th, 2011, 09:30 AM   #3 (permalink)
Member
Verified Customer
 
Join Date: Feb 2007
Posts: 297
Quote:
Originally Posted by Chuck S View Post
Of course that would do nothing that I am aware of. You can not use vbulletin conditonals in Photopost templates. They use a function to define an html if clause which of course they decode into php and analyse. Now regular conditionals would work but also you need to verify your actual variables to see if they are present. Is the bbuserinfo styleid variable present on the page your using? If it isn't you will not get any type of code to work.

a proper php conditional would look like this. Now note I also put in the print statements to bypass between html and php so you can drop the whole thing right where you want it to print.

Code:
Content visible to verified customers only.


Thanks, but that did not work. I insert the code exactly as you wrote, and it simply removed the ad altogether. I checked the Style ID twice, too, and 4 is the ID listed in the VB control panel.

Here's the larger context of where this code is going. Maybe there are some hints here:

Code:
Content visible to verified customers only.
Any ideas? Thanks.
jdougher is offline   Reply With Quote
Old May 29th, 2011, 10:01 AM   #4 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,070
My code is valid so as stated your variable is not

$bbuserinfo['styleid']

I beleive I suggested you debug that and test it. maybe try using $vbstyleid

also please post in the MOD FORUMS from now on.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old May 29th, 2011, 10:13 AM   #5 (permalink)
Member
Verified Customer
 
Join Date: Feb 2007
Posts: 297
Quote:
Originally Posted by Chuck S View Post
My code is valid so as stated your variable is not

$bbuserinfo['styleid']

I beleive I suggested you debug that and test it. maybe try using $vbstyleid

also please post in the MOD FORUMS from now on.
Okay, thanks. Just to clarify, you mean I should try this instead? Bear with me. I'm not a programmer.

PPPRINT;

if ( $bbuserinfo['vbstyleid'] == 4 )
{
echo <<<PPPRINT
AD CODE HERE
PPPRINT;
}

echo <<<PPPRINT

Last edited by jdougher; May 29th, 2011 at 10:22 AM.
jdougher is offline   Reply With Quote
Old May 29th, 2011, 07:01 PM   #6 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,070
What I am saying is your not using a valid variable if your code does not work. maybe this but again this is nothing I have tried so I can not say what the proper variable would be. Obviously $bbuserinfo['styleid'] is not correct.

Code:
Content visible to verified customers only.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old July 19th, 2011, 05:56 PM   #7 (permalink)
Member
Verified Customer
 
Join Date: Feb 2007
Posts: 297
Quote:
Originally Posted by Chuck S View Post
What I am saying is your not using a valid variable if your code does not work. maybe this but again this is nothing I have tried so I can not say what the proper variable would be. Obviously $bbuserinfo['styleid'] is not correct.

Code:
Content visible to verified customers only.
Hmm. I tried this, too, and it didn't work.

Shouldn't I be able to string a bunch of these if clauses, one after the other, to provide different adsense code for different styles? When I try to do that, I get an adense code for each instance of the "if" statement that I provide.
jdougher is offline   Reply With Quote
Old July 19th, 2011, 08:06 PM   #8 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,070
You can do whatever you wish as long as you define or use the proper variables. I can not tell what they are as your talking about something outside our application so I would not know what vb variables are correct.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Style Vbulletin lost ads jorgejgm Classifieds Bug Reports 5 January 17th, 2011 03:25 PM
Photopost classifieds - limit number of ads based on usergroup? ~kev~ Before You Buy 14 October 29th, 2009 09:22 PM
How to change Forum location statement and not get distorted style? TC Topps Classifieds How do I...? 5 May 22nd, 2009 09:25 PM
Import forum based ads to PhotoPost Classified titusc Before You Buy 1 December 6th, 2008 10:03 AM


All times are GMT -5. The time now is 02:37 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0