Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
[plugin] [ORPHAN] cno_replace_file
Hi there,
here is my very first (and simple) textpattern plugin: cno_replace_file .
With Textpattern version 4.0.6 file replacing is built in, so there is no need to use my plugin!
It’s just adding a replace function to the file edit view. There’s no file versioning yet.
I’m looking forward to implement a little document management system. Any comments are welcome.
Cheers,
Christian
Last edited by chriloi (2008-03-01 21:17:57)
Offline
#2 2006-01-18 21:06:32
- marvincooper
- Member
- Registered: 2004-10-13
- Posts: 43
Re: [plugin] [ORPHAN] cno_replace_file
I was wishing for this just the other day, and now here it is :)
Thank you!
Offline
#3 2006-01-19 07:02:01
- Niconemo
- Member

- From: Rhône-Alpes, France
- Registered: 2005-04-18
- Posts: 557
Re: [plugin] [ORPHAN] cno_replace_file
It’s helpful :-)
Should be a built-in… but so much to do !
Thank you.
Textpattern rules ! So do plugin developpers !
Last edited by Niconemo (2006-01-19 07:05:48)
Nico
Offline
Re: [plugin] [ORPHAN] cno_replace_file
Many thanks !!!!
françois
Offline
Offline
Re: [plugin] [ORPHAN] cno_replace_file
// First receive PHP Output Buffer into $buffer, clean the output buffer and disable PHP output buffering.
// None of the output generated before this function was called will be send to the browser!!
$buffer = ob_end_clean();
// Restart buffering to make sure that other functions can use the buffer too.
// All content that will be generated by PHP after this point will be send to the output buffer before it’s send to the browser.
ob_start();
// Do some string operations on the output generated before this function was called
$insertPlugin = ‘form action=“index.php” method=“post”’;
$pluginCode = $form.$insertPlugin;
$buffer = str_replace($insertPlugin,$pluginCode,$buffer);
// Return the whole buffer. All content will be in the buffer again.
echo $buffer;
I hope that’s clear now. For more information go to http://www.php.net/ob_end_clean .
Last edited by chriloi (2006-01-20 09:25:18)
Offline
#7 2006-03-01 19:53:38
- Andrew
- Plugin Author

- Registered: 2004-02-23
- Posts: 730
Re: [plugin] [ORPHAN] cno_replace_file
Brilliant. Thanks, chriloi!
Offline
Re: [plugin] [ORPHAN] cno_replace_file
Thanks I was just wondering when this would show up. Much appreciation!
Offline
Re: [plugin] [ORPHAN] cno_replace_file
Suddenly this brilliant plugin stopped working in 4.0.4 (I’m now on r2238) — or is it just me?
Offline
Re: [plugin] [ORPHAN] cno_replace_file
It works fine for me on a fresh installed 4.0.4…
Offline
Re: [plugin] [ORPHAN] cno_replace_file
I’ve been actively using it on 4.0.4 with zero problems.
Shoving is the answer – pusher robot
Offline
Re: [plugin] [ORPHAN] cno_replace_file
Doesn’t seem to work for me either, I am using a lot of other plugins, though none that mess with the file area… Well perhaps the admin facelift?
Offline
Re: [plugin] [ORPHAN] cno_replace_file
First check if you have enabled output buffering for textpattern.
If it’s on then search for <form action="index.php" method="post"> in the HTML output of your textpattern’s file admin view. If this line doesn’t exist, there might be a problem with the admin facelift.
Offline
Re: [plugin] [ORPHAN] cno_replace_file
First check if you have enabled output buffering for textpattern.
I’m sorry if I ask dumb questions, but how?
On a side note, plugin’s replace upload form appears when the file’s status is ‘missing’ (the file is removed from the files directory, entry still in the database).
Last edited by ChrisJ (2007-02-28 23:19:42)
Offline
Re: [plugin] [ORPHAN] cno_replace_file
Can you check the second condition please. If this line doesn’t exist just post the HTML output here and I’ll find a solution.
Offline