Announcement

Collapse
No announcement yet.

What is the proper variable for this: $threadStarterUserId

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • What is the proper variable for this: $threadStarterUserId

    I am trying to make a conditional statement but I dont know which variable name I should be using. Here is what the statement looks like in php.
    PHP Code:
    if ( ($bbuserinfo['usergroupid'] == "12") || ($bbuserinfo['userid'] == $threadStarterUserId) ) {
    // Show thread
    } else {
    // Show a permission denied Error

    Basically I am trying to limit the viewer of a thread to one single usergroup OR the person who started the thread. The person who starts the thread will most certainly NOT be a member of the usergroup allowed to view all threads. Does that make sense.

    I know how to write the template conditional and i know how to access the usergroup and userid info. I just need to know how to access the userid for the person who started a thread ($threadStarterUserId).

    Thanks
    Websites For Sale | Adsense Ready Blogs For Sale

  • #2
    Isn't this a default vBulletin permission?

    You can edit the usergroup permissions for a usergroup to view all the threads made by self and/or others. Swap between the two permissions to get what you want.

    Comment


    • #3
      I didn't know that. I will check it out. I just figured if an entire usergroup didn't have permission to view threads then the thread starter wouldn't. i'll post my findings.

      thanks for the info.
      Websites For Sale | Adsense Ready Blogs For Sale

      Comment


      • #4
        That didn't work, or at least I wasn't able to do it.

        Supposedly what I am trying to do (allow thread lists to be viewable but only allow specific usergroup to view each thread) can not be accomplished using usergroup permissions as noted here http://www.vbulletin.com/forum/showthread.php?t=110119

        I was also unable to allow the thread starter to view his/her own post using usergroup permissions. The following code was the only way I could do what I wanted to do.
        HTML Code:
        <if condition="($bbuserinfo['usergroupid'] == 9 OR $bbuserinfo['usergroupid'] == 6) OR ($bbuserinfo['userid']  == $threadinfo['postuserid'])">
        
        <if condition="$show['threadedmode'] OR $show['hybridmode']">
        <!-- thread posts list -->
        $threadlist
        <!-- /thread posts list -->
        </if>
        
        <div id="posts">$postbits</div>
        
        <else />
        
        $spacer_open
        
        <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
        <tr>
        	<td class="alt1" style="color: red; padding: 100px;">
        	<div>You do not have permission to view resumes.  If you would like to view the resumes you can visit the <a href="subscriptions.php">Subscription page</a> within your control panel to view payment plans.</div>
        	</td>
        </tr>
        </table>
        
        $spacer_close
        
        </if>
        Does anyone have any ideas on how to accomplish this without using template conditionals?
        Websites For Sale | Adsense Ready Blogs For Sale

        Comment

        Loading...
        Working...
        X