Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2010-06-09 05:34:43

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: rah_post_versions: Revision control for articles, forms and pages

Natalya wrote:

Jukka, while I do not have to add much of substance to the discussion, I’d like to thank you a ton for building this immensly useful plugin!

Even not, I will thank you for your words, Natalya.

Offline

#26 2010-06-09 16:57:20

JanDW
Plugin Author
From: Providence, RI, USA
Registered: 2008-07-18
Posts: 327
Website

Re: rah_post_versions: Revision control for articles, forms and pages

Hello again – I’m creating a of personal wiki with textpattern. On individual article pages I have an edit link in place using rvm_if_priviliged.

<txp:rvm_if_privileged><a class="edit" href="/textpattern/index.php?event=article&step=edit&ID=<txp:article_id />">edit</a></txp:rvm_if_privileged>

Is there a way that I can similarly setup a link to that links the article to see all its versions?
I guess by retrieving the corresponding e rah_post_versions group_id to the article id?

http://wiki.dev/textpattern/index.php?event=rah_post_versions&step=rah_post_versions_group&group_id=3

Thanks!


TXPDream – A Textpattern Tag Library for Adobe Dreamweaver. (updated for 4.2.0) | jdw_if_ajax – Only serve certain parts of a page when requested with AJAX

Offline

#27 2010-06-09 19:29:44

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: rah_post_versions: Revision control for articles, forms and pages

JanDW wrote:

Is there a way that I can similarly setup a link to that links the article to see all its versions?

Maybe something like this returns the group_id. First version with rah_function:

<txp:rah_function call="safe_field" field="id" table="rah_post_versions_sets" where='grid=<txp:article_id /> and event="article"' />

Or <txp:php> alternative:

<txp:php>
	safe_field(
		'id',
		'rah_post_versions',
		'grid='.article_id(array()).' and event="article"'
	);
</txp:php>

Offline

#28 2010-06-09 21:39:10

JanDW
Plugin Author
From: Providence, RI, USA
Registered: 2008-07-18
Posts: 327
Website

Re: rah_post_versions: Revision control for articles, forms and pages

Swell… thanks again. I guess I needed setid instead of id though. In case anybody else wants to use this:

<txp:rvm_if_privileged><a class="edit" href="/textpattern/index.php?event=rah_post_versions&step=rah_post_versions_group&group_id=<txp:php>echo safe_field('setid','rah_post_versions','grid='.article_id(array()).' and event="article"');</txp:php>">See versions</a></txp:rvm_if_privileged>

TXPDream – A Textpattern Tag Library for Adobe Dreamweaver. (updated for 4.2.0) | jdw_if_ajax – Only serve certain parts of a page when requested with AJAX

Offline

#29 2010-06-10 02:41:23

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

Re: rah_post_versions: Revision control for articles, forms and pages

Throw in a diff mechanism and this would change everything.

Offline

#30 2010-06-10 03:10:14

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: rah_post_versions: Revision control for articles, forms and pages

Just chimed in to say: maybe Gocom can borrow some code from rvm_plugin_diff.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#31 2010-06-10 05:35:05

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: rah_post_versions: Revision control for articles, forms and pages

I will look what can be done about the diff feature. I’ve already started doing it, just still needs the code that compares the changes. Hopefully I have the time to do it during next week (or this, or today who knows).

JanDW wrote:

Swell… thanks again. I guess I needed setid instead of id though. In case anybody else wants to use this:

Oh, yes. Sorry about that :-)

Last edited by Gocom (2010-06-10 05:40:29)

Offline

#32 2010-06-10 21:54:25

JanDW
Plugin Author
From: Providence, RI, USA
Registered: 2008-07-18
Posts: 327
Website

Re: rah_post_versions: Revision control for articles, forms and pages

No problem – keeps me on my toes. :-)

I’ve noticed that each revision has an ID that increments based on the total number of revisions.
Since I’m using this txp as a wiki I’m having a lot of revisions. In just a few days I think I’m up to 150. I’m a little worried this number might get to be unwieldly soon or even max out?

Is that a reasonable fear? If so, couldn’t the revision id’s be per setid?

Last edited by JanDW (2010-06-10 21:54:49)


TXPDream – A Textpattern Tag Library for Adobe Dreamweaver. (updated for 4.2.0) | jdw_if_ajax – Only serve certain parts of a page when requested with AJAX

Offline

#33 2010-06-10 23:56:35

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: rah_post_versions: Revision control for articles, forms and pages

JanDW wrote:

Is that a reasonable fear?

I don’t know, is it? :-) I can say that the maximum value of INT is 4294967295. If you fear that it’s going run out, you can change the field type to BIGINT which can store values up to 18446744073709551615. If you end up changing the type, remember to chage the zerofill (padding) value to greater (or remove it) from the current 12.

Anyways, let’s say that every revision takes 2 KB of space. With 4294967295 revisions, you would have 8 terabytes of data stored. That’s a lot :-)

Last edited by Gocom (2010-06-11 00:07:27)

Offline

#34 2010-06-11 00:34:15

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: rah_post_versions: Revision control for articles, forms and pages

Jukka,

Seriously mate – this is killer. Thank you!

:)


Tom

Offline

#35 2010-06-11 01:01:59

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: rah_post_versions: Revision control for articles, forms and pages

Version 0.4 is out. It’s wild, and it likes to look revisions funny. I gave it markers. Results are colorful.

!http://www.rahinaa.biz/images/364t.png!
Red blocks for removed, greens for flower gardens.

Changelog:

  • Added diff tool. The feature is found from the list view’s multiedit: check two revisions and select “Diff” from the drop-down. The diff feature uses Paul Butler’s Simple Diff Algorithm.
  • Added Are you sure? checks to the multiedit.

More info and downloads

renobird wrote:

Seriously mate – this is killer. Thank you!

Thanks Tom :-)

Offline

#36 2010-06-11 06:26:40

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: rah_post_versions: Revision control for articles, forms and pages

In Diff tool when the first version of field didn’t contain anything it looks like i 2px line. Maybe it worth to add min-height to this blocks?
!http://clip2net.com/clip/m5759/1276237518-clip-636b.png!

Last edited by the_ghost (2010-06-11 06:26:55)


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

Board footer

Powered by FluxBB