vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=327871

Hide [code] content from guests
by Zweeper
10 Mar 2020 09:11

Hey, I was using this template modification to hide [code] content from guests:
https://www.vbulletin.org/forum/showthread.php?p=2602245


unfortunately it is suddenly not working anymore with 5.6.0 (didnt do any changes, just the update).



Can anybody help me to modify the code in a way, so that it is working again?





I was using this code before:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

The problem seems to be a trouble with the group parts. When I enter the group for guests, it shows the content to everybody (of course). If I enter the groups for registered users, admins and mods, it is hidden from everybody. :(


Would appreciate any help!




Greetings!

--------------- Added 10 Mar 2020 at 20:42 ---------------

It only works if I add usergroup "1" to the code (guests). Then its shown to all.
Otherwise its hidden for all. Strange...

shka 10 Mar 2020 22:34

I dont know if it is an error or a feature. Add debugvardump (! in test environment)


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Test in 5.5.3:
You get the vardump of the current logged in user (and also null info of not logged in) - and only then your bbcode_code makes sense

Test in fresh 5.6.0 with first post by admin and answer by registered user
In all situations (admin logged in, reg user logged in, no one logged in) I see in first post "admin-user-object" and in second post "reg-user-object".

So error in 5.6.0 or you have to use another object.

Zweeper 11 Mar 2020 06:08

Many thanks for your help so far.

I am also discussing this on vbulletin.com because I couldn't solve it on my own so far.

https://forum.vbulletin.com/forum/vb...nt-from-guests

shka 11 Mar 2020 19:52

Versuche mal /Try


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Da ich auch auf vB.com mitgelesen habe und Risiko nicht einschätzen kann - $currentUser enthält die gleichen Infos wie $user (nur protected), könnte man ja am Ende vom Template die Variable $currentUser wieder unsetten. Das müsste aber jemand Profunderer entscheiden.

Zweeper 11 Mar 2020 20:08

Hey, danke für das Update, aber da tut sich leider auch nichts. Führt zum gleichen Ergebnis dass entweder allen Usern der Code verwährt wird, oder eben allen angezeigt wird. Schade, aber trotzdem danke!


All times are GMT. The time now is 05:59.

Powered by vBulletin® Version 3.8.14
Copyright © 2020, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.