Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-06-19 02:53:47

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

[plugin] [ORPHAN] cnk_versioning

cnk_versioning for txp 4.41 can be found here

This plugin exports your pages, forms and styles to a specified folder and autoloads modified files into the database on a front-end page refresh. Autoloading is only enabled when Production Status is not LIVE.

Please use this with care! Your pages/forms/css will be deleted from the database, when you delete the corresponding files.

Before installation, you have to create a php-writable “forms”, “pages” and a “css” directory in the textpattern root directory.

On a Unix server, you may have to make the directory “world writable” by setting its permissions to 777, but before you do this, always consult your webhost, because 777 permissions are a serious security risk on shared webhosts and frowned upon in other hosting setups, so it’s safer to first try 700 or (if that fails) 711 or 755 permissions.

Then go to “presentation” > “versioning” and click install. After that just click “write pages and forms to files”.

Everytime a front-end page is viewed with production_status != ‘live’, the plugin loads all files to the database, which have a modification timestamp greater than the one stored in the database. Deleted files will also delete forms/pages/css from database. New files will create new pages/forms/css.

The filename-pattern works as following:

for forms: <form_name>.<form_type>.txp
pages: <page_name>.txp
styles: <css_name>.css

You can change the output folder and file extension by altering the globals ($CNK_VER_OUTPUT_PATH, $CNK_VER_EXT and $CNK_VER_EXT_CSS) in the source code.

Download version 0.1.7 .

Have fun with it!

Note:

*Works with PHP 4.3.0 now.

Users updating from 0.1.2 have to alter either the global $CNK_VER_EXT_CSS or the css file extension from .txp to .css, otherwise styles will be deleted from the db!

If you find this plugin useful, please consider a donation. It will help ensure further development of this and yet unreleased plugins.

Last edited by maniqui (2013-08-24 13:43:38)

Offline

#2 2008-06-19 06:10:20

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: [plugin] [ORPHAN] cnk_versioning

you have to create a “forms” and a “pages” directory with chmod 777

From a security point of view that is a very bad idea in many hosting setups.

Offline

#3 2008-06-19 06:43:54

sthmtc
Member
From: CGN, GER
Registered: 2005-01-17
Posts: 586
Website

Re: [plugin] [ORPHAN] cnk_versioning

textmate + textpattern bundle + this == super awesome.

Offline

#4 2008-06-19 07:19:21

sthmtc
Member
From: CGN, GER
Registered: 2005-01-17
Posts: 586
Website

Re: [plugin] [ORPHAN] cnk_versioning

ruud wrote:

From a security point of view that is a very bad idea in many hosting setups.

is there a way to make it more secure? or: would it be possible to move the folders outside the web root? the folders only have to be accessible when we’re writing the files for the first time, from then on it would probably work with other permissions too, i guess?

Offline

#5 2008-06-19 07:33:50

sthmtc
Member
From: CGN, GER
Registered: 2005-01-17
Posts: 586
Website

Re: [plugin] [ORPHAN] cnk_versioning

i’m having a major issue with this new version. after installing the plugin and exporting everything to files, all i get on the frontend is an error 404, “Unkown section”. when deactivating the plugin the problem remains and no pages, forms, etc are left in the backend (the db). maybe you have an idea, if not, i’ll start from scratch later (maybe updating the plugin was causing issues) to provide more details.

Offline

#6 2008-06-19 08:15:04

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: [plugin] [ORPHAN] cnk_versioning

sthmtc wrote:

is there a way to make it more secure? or: would it be possible to move the folders outside the web root? the folders only have to be accessible when we’re writing the files for the first time, from then on it would probably work with other permissions too, i guess?

Use more restrictive permissions. Hmm… didn’t we have a FAQ with info on that? (can’t find it).

Offline

#7 2008-06-19 08:23:52

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: [plugin] [ORPHAN] cnk_versioning

This one, maybe?

On a Unix server, you may have to make the directory “world writable” by setting its permissions to 777, but before you do this, always consult your webhost, because 777 permissions are a serious security risk on shared webhosts and frowned upon in other hosting setups, so it’s safer to first try 700 or (if that fails) 711 or 755 permissions.

Offline

#8 2008-06-19 08:27:40

sthmtc
Member
From: CGN, GER
Registered: 2005-01-17
Posts: 586
Website

Re: [plugin] [ORPHAN] cnk_versioning

thanks wet, i wasn’t really aware of these possibilities.

Offline

#9 2008-06-19 13:03:54

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

Re: [plugin] [ORPHAN] cnk_versioning

Sven, I hope you still have all the content in your copies…

Please check if a column “file_mod_time” was added to the textpattern table txp_css.

Did you create the css folder with proper permissions?

Did you alter the constants in the source code?

I can’t reproduce it here. Everything is fine on my end.

Offline

#10 2008-06-19 13:19:48

sthmtc
Member
From: CGN, GER
Registered: 2005-01-17
Posts: 586
Website

Re: [plugin] [ORPHAN] cnk_versioning

yeah, no worries, it’s just a vanilla txp install on the local test server.
the column in question was added, just checked it, it’s there for txp_pages, _css and _forms. all folders have the 777 permission at the moment. the files we’re successfully exported to the folders.

i’ve altered the path in the source code like so:
define('CNK_VER_OUTPUT_PATH', '/_templates/');

Offline

#11 2008-06-19 13:27:24

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

Re: [plugin] [ORPHAN] cnk_versioning

Change it to define('CNK_VER_OUTPUT_PATH', 'textpattern/_templates/');

Offline

#12 2008-06-19 13:32:17

sthmtc
Member
From: CGN, GER
Registered: 2005-01-17
Posts: 586
Website

Re: [plugin] [ORPHAN] cnk_versioning

why textpattern? it’s not there, my _templates folder is in the root… ?!

edit: ok i got it, guess the trailing slash was the problem. it’s working now.

Last edited by sthmtc (2008-06-19 13:37:57)

Offline

Board footer

Powered by FluxBB