Conditional or variable for postbit info

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bryan Ex
    Member
    • Feb 2004
    • 88
    • 3.0.1

    Conditional or variable for postbit info

    I've added a tiny mod that includes the number of photos a user has posted and made it a link to their galleries and that part is working fine. What I have noticed is that while the info is correct in a forum post the stats and link change to my own user ID stats instead of the sender in PMs. Is there a way to change that depending on whether it's a post or PM? I would be fine with adding a conditional not to show the stats at all unless it is a post to the message board if that's easier. I'm just not familiar enough with vb condition statements to figure out how to switch between PM and message postbit data. What I am using to call the user ID is the following...
    Code:
    if ($this->post['userid'])
    ... and I use the following in the actual template link;
    Code:
    =$post[userid]"
  • Bryan Ex
    Member
    • Feb 2004
    • 88
    • 3.0.1

    #2
    Thought I'd try one more time just in case new eyes find this post and can point me in the right direction.

    Comment

    • BirdOPrey5
      Senior Member
      • Jul 2008
      • 9613
      • 5.6.3

      #3
      You can use:

      Code:
      if (THIS_SCRIPT == 'private')
      {
        // Postbit in a PM
      }
      else
      {
        //Postbit in a post
      }

      Comment

      • Bryan Ex
        Member
        • Feb 2004
        • 88
        • 3.0.1

        #4
        Of course... thanks. I forgot all about using THIS_SCRIPT to help change things but post['userid'] will still call for the id of the PM mail box and not the message author will it not? As I have things now my post bit data displays correctly on the message board but if I view a PM from BirdOPrey5, your post bit info contains my stats. If I define this script as a PM will it call the correct userid for post bit?

        Comment

        • BirdOPrey5
          Senior Member
          • Jul 2008
          • 9613
          • 5.6.3

          #5
          $post['userid'] / $post['username'] should show the info of whoever created the post or PM. You can see they are used in the template so they should contain the correct value in either case.

          For help with custom coding modifications you can find more support on www.vbulletin.org.

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...