Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2007-11-23 13:31:33
- sylverwillow
- New Member
- Registered: 2007-11-03
- Posts: 6
removing forced preview
How can I change the forced preview for comments to optional?
I saw a plugin in the plugin directory, but the link to download it gave an error page.
Offline
Re: removing forced preview
Hi sylverwillow,
Please read the FAQ
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#3 2007-11-23 14:26:49
- sylverwillow
- New Member
- Registered: 2007-11-03
- Posts: 6
Re: removing forced preview
I’ve already looked there. The only answer they give on removing the preview is that you shouldn’t.
Offline
Re: removing forced preview
Hi sylverwillow, They also say that “something else fails” as well if you do manage to disable it.
This has truly become a very FAQ. It’s been discussed here many times and was decided that the inconvenience of the ‘preview’ is a small price to pay if it means safeguarding the sites from spammers.
I understand how this behaviour might be unexpected for new txp users but legit site visitors would always want to preview their comments anyway…
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: removing forced preview
colak wrote:
legit site visitors would always want to preview their comments anyway…
There are some cases where this might not be true. If you have a membership system, and users are already logged in, and you want to make posting Twitter-simple.
IMO – Have it on by default, hide the switch in advanced preferences, but don’t hardwire it and veil it in mystery.
Could anyone give some pointers what might need changing in publish/comment.php
, if one were hypothetically interested in removing the forced preview ;)
(There are one or two hacks listed on textpattern.org, but these seem to have vanished into the ether.)
Offline
Re: removing forced preview
here you go. no idea if it still works though.
Offline
Re: removing forced preview
thanks iblastoff, why didn’t I think of that? :P
Offline
Re: removing forced preview
What might work is setting $preview to FALSE in the commentForm function, after the preview variable is extracted, but it would not surprise me if that breaks several other things so it’s definitely not recommended to do this.
Offline
Re: removing forced preview
Thanks for the hint ruud.
It seemed to be working, then it stopped. Hmm.
I had more success around line 350. Right now with the hacks below the comment is submitted/saved to the db, but none of it’s values are set (message, status).
Line 156
// by default, the submit button is visible but disabled
// $comment_submit_button = fInput('submit', 'submit', gTxt('submit'), 'button disabled', '', '', '', '', 'txpCommentSubmit', true);
// if all fields checkout, the submit button is active/clickable
// if ($preview) {
$comment_submit_button = fInput('submit', 'submit', gTxt('submit'), 'button', '', '', '', '', 'txpCommentSubmit', false);
// }
Line 349
if ( ($evaluator->get_result() == RELOAD) ) {
callback_event('comment.save');
$visible = $evaluator->get_result();
if ($visible == RELOAD) {
Last edited by milkshake (2007-11-24 13:38:32)
Offline
Re: removing forced preview
milkshake, yep that’s true, because:
- You ain’t outputting the
$secret
or neither thesafe_insert
– it’s still in theif preview
-conditionals at line 91-109. - Also remove line 398. You won’t be able to use it anymore, so why the heck you should worry that thing.
- Why you even edited line 349? Because the cows are flying?
And another point. If you remove commet-preview, none of the spam-productions won’t work. I mean, someone could just submit php-code inside comment just so easily. Comments could also overwrite them selves (the risk is one of the million, but even so). Error triggering will be also quite messed up then, because there ain’t any. Enjoy your cake, it tastes like a shit, but it’s yours :-)
So you should also add some own code there, like that the content would get textiled when comment is submitted. It would prevent some harms, but then all textile could be used inside the comments. It would turn all harming codesnippets in specialcharacter, until the bots or hackers submitted comment include textie-excuting :)
That’s also known risk of using TXPhorum, if you use it it’s your own risk. It also requires that all php inside articles is restricted – but that ain’t even said in TXPhorum’s documents – quite wierd ain’t it – but it won’t prevent all hacking – and neither none of the spam.
Cheers!
Last edited by Gocom (2007-11-24 14:35:23)
Offline
Re: removing forced preview
Just to clarify, I’m not suggesting anyone use this on a live site, I’m just trying to understand how the comment system works, and where the extra preview step is introduced.
From what I can tell, it seems the preview step is an intrinsic part of the comment system’s design, so would be non-trivial to disable. As has been said, it will break other stuff.
Last edited by milkshake (2007-11-25 20:09:49)
Offline
Pages: 1