Register to Reply
Results 1 to 9 of 9

Thread: vB3 plugin testing if the thread starter is a member of a group

  1. Thread Starter #1
    Junior Member webdjoe's Avatar
    Click to Expand
    Join Date
    May 2019
    Posts
    4
    vB Version
    3.8.x
    Likes
    5
    Liked 0 Times in 0 Posts
    Gender
    Male

    vB3 plugin testing if the thread starter is a member of a group

    So I found a vb4 plugin that tests to see if the threadstarter is a member of a group in the threadbit. The code is:

    PHP Code:
    Only registered members can view PHP Code
    Inside the template I have:

    PHP Code:
    Only registered members can view PHP Code
    When I use it in vb 3.8.9, the threadbit display page loads a blank screen. Any ideas?

  2. #2
    Administrator Tempus's Avatar
    Click to Expand
    Join Date
    Oct 2011
    Posts
    6,379
    vB Version
    4.2.x
    Likes
    2,056
    Liked 5,884 Times in 1,834 Posts
    Gender
    Male
    Do you get any errors? If not, enable the errors in the config.php file.
    The Small Print
    Our staff assume members have read the rules and will not accept ignorance as an excuse for not following the them.
    The breaking of any rule WILL lead to you being warned or even banned without notice so don't risk it!


  3. Thread Starter #3
    Junior Member webdjoe's Avatar
    Click to Expand
    Join Date
    May 2019
    Posts
    4
    vB Version
    3.8.x
    Likes
    5
    Liked 0 Times in 0 Posts
    Gender
    Male
    There are no errors, nothing shows up. It is an empty table cell. Is the query correct? Would it be better to use $thread[postuserid] and query the table with that instead?

  4. #4
    Administrator Tempus's Avatar
    Click to Expand
    Join Date
    Oct 2011
    Posts
    6,379
    vB Version
    4.2.x
    Likes
    2,056
    Liked 5,884 Times in 1,834 Posts
    Gender
    Male
    What hook location are you using?

    That code will only show in forumdisplay, not showthread.
    The Small Print
    Our staff assume members have read the rules and will not accept ignorance as an excuse for not following the them.
    The breaking of any rule WILL lead to you being warned or even banned without notice so don't risk it!


  5. #5
    Administrator Tempus's Avatar
    Click to Expand
    Join Date
    Oct 2011
    Posts
    6,379
    vB Version
    4.2.x
    Likes
    2,056
    Liked 5,884 Times in 1,834 Posts
    Gender
    Male
    You sql query should be:
    Code:
    Only registered members can view code.
    The Small Print
    Our staff assume members have read the rules and will not accept ignorance as an excuse for not following the them.
    The breaking of any rule WILL lead to you being warned or even banned without notice so don't risk it!


  6. #6
    Administrator Tempus's Avatar
    Click to Expand
    Join Date
    Oct 2011
    Posts
    6,379
    vB Version
    4.2.x
    Likes
    2,056
    Liked 5,884 Times in 1,834 Posts
    Gender
    Male
    OK, I've spent all day on this because it was annoying me and finally got it working, for vB4.

    Hook: threadbit_display
    Plugin:
    Code:
    Only registered members can view code.
    Template usage:
    Code:
    Only registered members can view code.

    For vB3, you should use this:
    Code:
    Only registered members can view code.
    Please note, I don't use vB3 so it's untested.

    I have included the plugin as an attachment so you can just import it.
    Attached Files Attached Files
      You can't view or download attachments from this post before you Like it.
    The Small Print
    Our staff assume members have read the rules and will not accept ignorance as an excuse for not following the them.
    The breaking of any rule WILL lead to you being warned or even banned without notice so don't risk it!


  7. #7
    Administrator Tempus's Avatar
    Click to Expand
    Join Date
    Oct 2011
    Posts
    6,379
    vB Version
    4.2.x
    Likes
    2,056
    Liked 5,884 Times in 1,834 Posts
    Gender
    Male
    webdjoe, did that solve your issue?
    The Small Print
    Our staff assume members have read the rules and will not accept ignorance as an excuse for not following the them.
    The breaking of any rule WILL lead to you being warned or even banned without notice so don't risk it!


  8. Thread Starter #8
    Junior Member webdjoe's Avatar
    Click to Expand
    Join Date
    May 2019
    Posts
    4
    vB Version
    3.8.x
    Likes
    5
    Liked 0 Times in 0 Posts
    Gender
    Male
    I'm out of the office until later this afternoon, so I haven't had a chance to test it. I'll let you know as soon as I'm back in.

    A quick question on
    Code:
    Only registered members can view code.
    . I'm guessing this allows vbm_found to be available in the threadbit template. I know that vb3 does not have the vb_template::preRegister function but variables from plugins with the threadbit_display hook are available in the threadbit templates. Is there a specific reason that you used preRegister? What exactly is it's function?

  9. #9
    Administrator Tempus's Avatar
    Click to Expand
    Join Date
    Oct 2011
    Posts
    6,379
    vB Version
    4.2.x
    Likes
    2,056
    Liked 5,884 Times in 1,834 Posts
    Gender
    Male
    Yes, in vB4 tou have to register variables in new templates and pre-register in existing ones
    The Small Print
    Our staff assume members have read the rules and will not accept ignorance as an excuse for not following the them.
    The breaking of any rule WILL lead to you being warned or even banned without notice so don't risk it!


Register to Reply

Similar Threads

  1. XF
    TMDb Movie Thread Starter 2.1.3
    By Zombie_Nation in forum XF Addons
    Replies: 4
    Last Post: 27th Jun 2017, 12:16
  2. Tag OP on thread starter's postbit
    By Tempus in forum vBulletin 4.x Template Modifications
    Replies: 1
    Last Post: 5th Oct 2016, 10:12
  3. SOLVED
    thread starter in postbit for vb 3.8.x
    By Mehtab in forum Solved Requests
    Replies: 2
    Last Post: 31st May 2016, 09:32
  4. Today's Top Thread Starter(s) 4.2.2
    By Tempus in forum vBulletin 4.x Add-ons
    Replies: 0
    Last Post: 26th Feb 2015, 23:10
  5. Thread Starter In Postbit For vB4
    By Tempus in forum vBulletin 4.x Add-ons
    Replies: 0
    Last Post: 21st Oct 2011, 14:05

Tags for this Thread

Posting Permissions

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