Results 1 to 3 of 3

Help with Conditional in plugin

This is a discussion on Help with Conditional in plugin within the Template Modifications forums, part of the vBulletin SEO Discussion category; I have a field that I want to hide from guests (search engines) on my postbit. My plugin puts the ...

  1. #1
    Senior Member Brutal_Dreamer's Avatar
    Real Name
    Bruce
    Join Date
    Jan 2007
    Location
    Arkansas
    Posts
    136
    Liked
    0 times

    Help with Conditional in plugin

    I have a field that I want to hide from guests (search engines) on my postbit. My plugin puts the field in place in the postbit, but I cannot get the conditional correct to display it only to members of the site. Can someone offer advice?

    Here is what I have so far:
    Code:
    if (!empty($post["field{$this->registry->options['grow_comp_profile_field']}"]))
    {
        $template_hook['postbit_my_comp'] .= '<dt>' . $vbphrase['grow_comp'] . '</dt>  <dd>' . $post["field{$this->registry->options['grow_comp_profile_field']}"] . '</dd>';
    }
    I want this field answer to display only to members of the site. I know the template conditional would be:

    Code:
    <vb:if condition="$show['member']">xxx</vb:if>
    But this will not work in php. Any help would be appreciated!

    Also, if anyone has a list of conditionals that work in php for vb4, that would be great too.

    Thanks,
    Bruce
    RVO's OrchidTalk Orchid Forums - "Bringing People Together"

    We could learn a lot from crayons: some are sharp, some are pretty, some are dull, some have weird names, and all are different colors....but they all exist very nicely in the same box. ...Hmmm? ;)

  2. #2
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    Code:
    if(is_member_of($userinfo, 1, 2, 3, 4, 6, 7)) {
    echo "this user is in 1/2/3/4/6/7 usergroup"; }
    else {
    echo "this user is not in 1/2/3/4/6/7 usergroup";
    }
    depending on what script you are hooking to, you may need to use $bbuserinfo instead of $userinfo

  3. #3
    Senior Member Brutal_Dreamer's Avatar
    Real Name
    Bruce
    Join Date
    Jan 2007
    Location
    Arkansas
    Posts
    136
    Liked
    0 times
    Thank you, Brian! I appreciate the help. I will give it a go with this.

    Bruce
    RVO's OrchidTalk Orchid Forums - "Bringing People Together"

    We could learn a lot from crayons: some are sharp, some are pretty, some are dull, some have weird names, and all are different colors....but they all exist very nicely in the same box. ...Hmmm? ;)

Similar Threads

  1. Question about plugin or some plugin
    By Alexey in forum General Discussion
    Replies: 1
    Last Post: 02-25-2010, 04:35 PM
  2. Integrate Conditional Sigs into vBSEO plugin
    By webwizzy in forum vBSEO Features Archive
    Replies: 11
    Last Post: 01-28-2009, 08:55 PM
  3. Conditional help.
    By Notorious in forum Off-Topic & Chit Chat
    Replies: 6
    Last Post: 10-23-2006, 02:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •