The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I want to not allow a thread to be viewed (I will later add conditionals for certain usergroups). My problem is that EVERY thread cannot be viewed and I cannot figure it out. Any help would be appreciated, thanks.
I have this code in my SHOWTHREAD <if condition="$threadinfo['threadid'] == 1014"> $includedphp </if> And I have made a global_start plugin to include a file with print_no_permission ob_start(); include('test.php'); $includedphp = ob_get_contents(); ob_end_clean(); Here is my test.php file contents <?php print_no_permission(); ?> -------------------------------------------------------------------------------------------------------------------------------- Thing I don't understand is that when I do this code instead on my included test.php file, it does work for outputting the text on just that thread. <?php echo "hello"; ?> |
#2
|
|||
|
|||
![]()
I think the problem is that print_no_permissiion() doesn't just produce output that you can capture in a string, it has other side effects. I think what you'll want to do is create a plugin using a hook near the start of showthread.php and check the thread id there.
|
#3
|
|||
|
|||
![]()
Yes, it was actually breaking my forum using global_start. I tried a few different showthread hooks but it still gives me no permission on EVERY thread. Is there another call I should be using instead of print_no_permission?
|
#4
|
||||
|
||||
![]()
Just use a plugin at the top of the showthread page and check there:
if ($threadinfo['threadid'] == x) print_no_permission(); |
#5
|
|||
|
|||
![]()
Thank you both.
I ended up not using any plugins or includes. I just edited my showthread.php. That worked for me. If anyone sees anything wrong with doing it this way please let me know, thanks. ************************************************** ****************************** * // check forum permissions $forumperms = fetch_permissions($thread['forumid']); if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) OR !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']) OR ($threadinfo['threadid'] == 1014) ) { print_no_permission(); } if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) AND ($thread['postuserid'] != $vbulletin->userinfo['userid'] OR $vbulletin->userinfo['userid'] == 0)) { print_no_permission(); } // |
#6
|
||||
|
||||
![]()
The problem I see with that is that you now need to remember to edit that file every time you upgrade. Other than that, it's fine. We used to always have to remember which files we edited and edit them again and it worked for us back then (back when we walked six miles to school, in the snow, both ways.... ) .
![]() |
#7
|
||||
|
||||
![]()
Uphill with no shoes!
|
#8
|
||||
|
||||
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|