Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-01-18 10:00:10

chriloi
Plugin Author
From: Vienna, Austria
Registered: 2006-01-17
Posts: 120
Website

[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

#4 2006-01-19 22:46:25

fpradignac
Plugin Author
From: France near Cognac
Registered: 2005-01-29
Posts: 359
Website

Re: [plugin] [ORPHAN] cno_replace_file

Many thanks !!!!


françois

Offline

#5 2006-01-20 03:29:45

variaas
Plugin Author
From: Chicago
Registered: 2005-01-16
Posts: 402
Website

Re: [plugin] [ORPHAN] cno_replace_file

chriloi,

can you explain the use of ob_start and ob_end? I know that it’s used for buffering, but to be honest I don’t know what that means.

Thanks!

Offline

#6 2006-01-20 09:22:04

chriloi
Plugin Author
From: Vienna, Austria
Registered: 2006-01-17
Posts: 120
Website

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

#8 2006-03-02 03:06:02

soulship
Member
From: Always Sunny Charleston
Registered: 2004-04-30
Posts: 669
Website

Re: [plugin] [ORPHAN] cno_replace_file

Thanks I was just wondering when this would show up. Much appreciation!

Offline

#9 2007-02-19 17:14:04

ChrisJ
Member
From: Vienna, Austria
Registered: 2004-03-30
Posts: 54
Website

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

#10 2007-02-22 01:08:58

chriloi
Plugin Author
From: Vienna, Austria
Registered: 2006-01-17
Posts: 120
Website

Re: [plugin] [ORPHAN] cno_replace_file

It works fine for me on a fresh installed 4.0.4…

Offline

#11 2007-02-22 15:01:35

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

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

#12 2007-02-22 16:26:48

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

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

Board footer

Powered by FluxBB