Recent Topics

1 Nov 28, 2017 15:48    

I'm running the latest release.

I have posts that consist of a bunch of text and a code block. Everything works fine, however I'd like to only show the code block segment if the user is logged in. If they aren't logged in I just want the text displayed (no code block). I just started looking into this but after a quick look I didn't see a good way to do this.

Any guidance would be appreciated!

2 Nov 29, 2017 01:36

You could make a separate collection for the code which is members only with links from the text posts

or

you could hack the skin single post files:
1.Give the code in the posts a div with an id id="DivCo"
2.via css make the div invisible #DivCo {visibility:none}
3.add code to the skin page that only shows the Div when logged in with something like this after the post
<?php


skin_include( '_item_content.inc.php', array(
'image_size' => 'fit-540x405',
) );

if (isset($current_User))
?>
<style type="text/css">
#DivCo {visibility:visible;}
</style>
<?php
}
?>

3 Nov 29, 2017 01:43

the code above is a bit off. More proper syntax below

if (isset($current_User)) {
?>
<style type="text/css">
#DivCo {visibility:visible;}
</style>
<?php
}


Form is loading...