Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Offline
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
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
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
Re: rah_post_versions: Revision control for articles, forms and pages
Throw in a diff mechanism and this would change everything.
Offline
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.
Offline
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 ofid
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
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
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
Re: rah_post_versions: Revision control for articles, forms and pages
Jukka,
Seriously mate – this is killer. Thank you!
:)
—
Tom
Offline
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.
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.
renobird wrote:
Seriously mate – this is killer. Thank you!
Thanks Tom :-)
Offline
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?
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