Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-02-29 10:53:25

marios
Archived Plugin Author
Registered: 2005-03-12
Posts: 1,253

Protect a Page with Over 18 Years agreement

I have a set of two articles that contain a couple of censored images ( Still Not suitable for children under 18 Years ) that are part of a ducumentary about childabuse.

Due to legal reasons, I want to protect the two permlink locations with an agreement page with the respective Warning. Then only when a Visitor has read the agreement and presses the submit Button Visitor gets forwarded to the actual pagecontent.

I thought may be the simplest way to do this, is to set a cookie.

Is there any way I can do this with Textpattern?

regards, marios


⌃ ⇧ < ⌃ ⇧ >

Offline

#2 2008-02-29 11:49:42

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,609
Website

Re: Protect a Page with Over 18 Years agreement


TXP Builders – finely-crafted code, design and txp

Offline

#3 2008-02-29 15:16:35

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,026
Website GitHub Mastodon Twitter

Re: Protect a Page with Over 18 Years agreement

Can’t you have the content of that article in a javascript (this would make the article visible to only js enabled browsers) and then have an agreement (visible to all) which when clicked the content of the javascript loads?

Can’t do it myself but said it anyway:)

>Edit. I would also mask the faces for privacy/protection purposes and the parts of the pictures which would cause offense.

Last edited by colak (2008-02-29 15:20:16)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#4 2008-02-29 16:26:46

marios
Archived Plugin Author
Registered: 2005-03-12
Posts: 1,253

Re: Protect a Page with Over 18 Years agreement

colak wrote:

Can’t you have the content of that article in a javascript (this would make the article visible to only js enabled browsers) and then have an agreement (visible to all) which when clicked the content of the javascript loads?

I’ve thought about Javascript solutions as well. The problem with this is , that it would create problems for accessibility and Indexing in particular. ( Visitors with Javascript disabled )

Hopefully, I could get Jacobs solution working locally. The session cookies will get destroyed once the browser chrome is closed. ( I think that’s good enough to get away with it )

colak wrote:

I would also mask the faces for privacy/protection purposes and the parts of the pictures which would cause offense.

The Images where already masked. Just to be sure, I just went through all the material again, and indeed found one Image that was not properlery masked. ( Thanks for mentioning, as I wouldn’t have noticed this small detail )

jakob wrote:

chs_cookie

Thanks Jacob

regards, marios

Last edited by marios (2008-02-29 16:28:38)


⌃ ⇧ < ⌃ ⇧ >

Offline

#5 2008-02-29 22:33:39

marios
Archived Plugin Author
Registered: 2005-03-12
Posts: 1,253

Re: Protect a Page with Over 18 Years agreement

( Tried to add this at the Textbook Tutorial Section, but I can’t get in again and the How to Example forum is read only)
Here is what I did to get this working:

  • Install and activate the plugin chs_cookie
  • Install the Stef Dawson plugin and activate smd_if
  • ( I think you might need Stefs Function Library plugin as well)
  • In your page template (Above the Doctype declaration without whitespace) put the set_cookie tag like this: <txp:chs_set_cookie cookie="alistaport_terms" value="terms_understood" />
  • Then in your article form you can do something like this:
<!-- start all the protection hack -->

<txp:smd_if field="keywords"
     operator="begins, eq"
     value="protected">


<!-- protected stuff goes here -->


<txp:chs_cookie_default cookie="alistaport_terms" value="terms_understood">
<h3>Important: Please read this Message carefully, before you proceed</h3>
<h2>Warning</h2>

<ul><li>This Page contains content with extreme sexual violence against children, that is not suited for Visitors under 18 Years. The content of this Page is also not recommended for Persons of a sensible mental composure, or Persons with Health Problems of a nature that does not allow them to be confronted with the Information contained in this article. Such Health Problems include Heart diseases and  high Blood pressure.</li>

<li>If you are not certain about the above mentioned Cases, it is recommended that you don't read or view this material.</li>

<li>Please confirm below that you are over 18 Years old, that you have understood and recognized this Warning message using the Continue button.</li>


<li>I herby confirm, that I am  over 18 years old, and that I have been clearly informed, that this Page contains censored Material of extreme Violence against children.
I herby also confirm, that my psychological and physical composure is of such a nature, so that reading or studying this material will not cause any harm to me.
I have clearly understood, that alistaport.org , or the author and/or editor of this material can not be held responsible for any physical, mental or psychological harm that could occur to me, while reading and looking at this material, or thereafter.</li>

<li><form action="<txp:permlink />" method="get" accept-charset="utf-8">
	<input type="submit" value="Continue &rarr;" />
</form>	</li></ul>

</txp:chs_cookie_default>

<txp:chs_if_cookie cookie="alistaport_terms" value="terms_understood">

<txp:body />

</txp:chs_if_cookie> 	

<txp:else />

<!-- Unprotected Contend goes here -->

<txp:body />
</txp:smd_if>

Note: That I use smd_if in combination with the set_cookie conditionals for two reasons:

  1. The next time I need to protect an article, I can just insert the word protected in the keywords field, and it will be dummy protected
  2. All my custom_fields where already used up, so I thought to use the keywords, which smd_if provides the necessary conditional for. ( Alternatively you could use the native custom_field conditionals and then you don’t need the smd_if plugin )

regards, marios

Last edited by marios (2008-02-29 22:46:45)


⌃ ⇧ < ⌃ ⇧ >

Offline

Board footer

Powered by FluxBB