Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-08-24 07:19:14

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

if_moderated/thank you message

The current project I’m working on needs a special “Thank you” message page for when a user submits a comment. The requirements go a little bit beyond editing the text in that a new background image will be used. All I really need is a class or id added on to the body, but it isn’t possible with TXP tags (hopefully I overlooked something).

Aside from an if_moderated tag, what PHP would work to find “&commented=0” in the URL (comments are moderated)? It seems like it’d be easy, but I get the following error using <txp:php>$uri = $_SERVER['REQUEST_URI'];</txp:php> (not that I know what to do after that!).

ob_start() [<a href=‘ref.outcontrol’>ref.outcontrol</a>]: Cannot use output buffering in output buffering display handlers in …taghandlers.php on line 1723

Thanks

Offline

#2 2006-08-24 08:37:31

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,393
Website GitHub Mastodon

Re: if_moderated/thank you message

Would chs_if_url_var help solve your problem?

Offline

#3 2006-08-25 06:02:14

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: if_moderated/thank you message

Why yes it would!

For anyone else in the same quandry, this is what I used:

<code>
<body class=“comments-form<txp:chs_if_urlvar var=“commented” value=“0”> commented</txp:chs_if_urlvar>”>
</code>

The CSS is something like this (simplified):

<pre>
body.comments-form #secondary { background: url(/img1.png) no-repeat;
} body.commented #secondary { background: url(/img2.png) no-repeat; }
</pre>

Offline

Board footer

Powered by FluxBB