2 amoun Nov 25, 2020 09:03

@amoun thx! does this also work in 6.11.5 or only in 7.x?
Both :) as it's just basic javascript and php
@amoun
My challenge: In my instances there is no "skin" folder, only "skins" and in the root of this folder there is no "_html_header.php" file, neither in that folder containing my actual skin.
Only in fallbacks and in skins_admin I can find a "_html_header.inc.php".
So, what is to do?
Sorry I'm a bit careless as I'm always in a hurry
<script>
var uid = "<?php echo $current_User->ID; ?>";
</script>
to the
Custom meta tag/css section (before </head>):
@amoun
sorry, thats not what I have meant.
In this page I use several different Content Blocks (saved as for members only) and included those into a public page.
So publicly those content (from content blocks) should not be visible, but for me and memebers it should.
For me as admin the content block is just as invisible as for anonymus user. The visiblity level should be sufficient, but nevertheless it does not work (See next screenshot)
Excuse my errors etc. and I'm halfway through a bottle of organic Spanish 14.5% Pacheo, Monastrell, having not had a drink for a couple of months, so slowly ig will go :)
There are two issues I have to consider a) that you want this to apply to multiple [div]s and b) the visibility level is not working out.
The visibility is not just set by the user being logged in i.e if usrID > 0 but by what level and permissions have been set for groups etc.
I will have to look more closely at your site and what you have set up to think further especially given my alcohol intake :) will be back to tomorrow.
You can code into a widget and place your content there or use the same sort of thing directly in a skin page by setting a div to be invisible unless the user is logged in or with a certain status
I made a freeHTML widget that checks if the user is registered by adding a variable [uid] to the header of my site the then added content via a widget.
In the skin/_html_header.php I added this
var uid = "<?php echo $current_User->ID; ?>";
then added a widget for the container
You could also add a back office option so add the widget and each time add different content.