Welcome to the new Customer Portal! We are still in the process of moving all our customers so please bear with us if you are temporarily unable to log in. You can still email support@vanillaforums.com!

I need php with pocket

edited March 2013 in Questions
I'm trying to set up an ad free option for memberships. My php code works everywhere on my site except for inside of the vanilla forums html pocket. Can you enable php there for me so that my code will work? Or is there some other way i can cue the html only to show when a member is NOT s2member_level1 (for exmample)?

This is the code as is works on my site but does not work in the pocket:

if ( user_role_check( 's2member_level1' )) { }
else echo 'Stuff here';


  • Tim GunterTim Gunter Administrator, Operations, Staff
    @TrevorLyman You can do this with Vanilla's roles. We don't support PHP in pockets for security reasons.
  • Can you offer some explanation here? I've tried and so far no luck.

    I created a new role that I do not want the pocket to show up on (s2member_level1).

    Then I created several conditions based on roles for the pocket I'm working on.

    I said "Limit the pocket to one or more roles or permissions." (your default and seemingly only option)

    I then created that rule for each role. Contributor, Applicant, and so on.

    I logged in as my test user which has the new role (not listed as an exception) and the ad still shows. The ad still shows for all user types.

    How do I make this work?
  • edited March 2013
    And maybe this isn't clear enough... I need for this to key off of my wordpress roles really. Why? Because someone can sign up for 'no ads' and not be logged into the forum or even be a member of the forum.

    I'm using embedded comments so the forum shows up on every post page and I need the ad that goes with the comments or there is no way the forum will generate the revenue to pay for itself.

    Will I need some custom code? Can you allow php on this one pocket somehow?

    If this doens't work it will either kill my ad free subscription offering or it will kill the revenue from the forums which is based mostly on the embedded comments right now.

    Please visit any post at http://libertycrier.com to see what I mean.

    Should I give you guys a call?
  • Just thought of a possible solution - Maybe I can bypass having the ads as a part of the forum but place them above the comment section outside the forum code. I have to run for now and will look into this more but please also let me know any options I can have on your end.
  • Tim GunterTim Gunter Administrator, Operations, Staff
    edited March 2013

    I took a look at your forum and I think trying to do this through Vanilla is going to be a tough one, given your configuration and requirements. In particular, since you're not doing SSO from wordpress (rather from Google, Facebook, Twitter, and OpenID), the roles do not automatically sync.

    I liked your idea of putting the ad in the actual wordpress page, as this dramatically simplifies the interactions and gives wordpress control over the ad display (which is correct, since wordpress has your user and role information).

    If I were you, I would pursue that second option.
  • I thought about that option but the problem is the forum page will no longer have an ad on it in that case. That means lost revenue for me. No thank you.

    What I need is for your system to check the user type from wordpress and then either run an ad or not based on that. That's it. I don't think this needs to be difficult at all. If wordpress use type is XXXX then this, else this.

    Without that I can't see a solution and I'm going to have to begin looking for another forum.

    I can resolve this issue if you will allow me to run php on this pocket. It's very simple code and it's working on the rest of my site. If I'm the only one with access to the pocket why can't I run php? I could give the code to you first and you could insert the code if that would help. I'm flexible.

    I've spent a lot of time trying to use your system and have over 500 members now and it would be a shame for me to have to leave because you can't help me with what I consider to be a very simple function but if you can't accommodate me I'm going to have no other choice.

    Please let me know what you can do.
  • edited March 2013
    As for me not using the correct SSO I'm very disappointed with how you guys handle things on set up. I followed the suggestion of one of your people on setting things up, they said it was fine, now it's not fine.

    I've said it before and I'll say it again, for paying customers (especially those that are paying $150 a month+) there needs to be someone who walks through the system with the customer to make sure everything is working correctly. The way you have the system now you do not do a good job of it. Your documentation is confusing and is not helpful.

    I've been told before that you could not help me with issues (by one associate) and then I find out everything that associate told me was incorrect. I almost left your service before. I'm beginning to feel like I should have.
  • This is not going to work out for us, for so many reasons. We may come back in the future (not likely) but for now please cancel this account.

    Thank you.
  • Hi @TrevorLyman,
    Your account has been cancelled.

This discussion has been closed.