Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#13 2012-01-13 20:29:43
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: [textile] Textile v2.3 now available.
stephan wrote:
Any plans for an updated Textpattern 4 on the horizon that includes newer textile?
You’ll need to wait from a word from the development team about that — I don’t know.
jpdupont wrote:
Steve, the problem is not to upgrade from 2.2 to 2.3, but from 2.0 to 2.2 or 2.3 !
I have many articles ( > 200) with bugs in lists (ul / h3 / ul / h3 …) in previous textile version. Alls bugs corrected now in 2.2/2.3, but we need to rebuild all the “body html” field of the database…
Ah, I see. Ok, having a batch convertor to do that would be pretty useful. I’ll see if I can get a plugin together for you and others in the same situation. Watch this space.
— Steve
Offline
Re: [textile] Textile v2.3 now available.
net-carver wrote:
Ah, I see. Ok, having a batch convertor to do that would be pretty useful. I’ll see if I can get a plugin together for you and others in the same situation. Watch this space.
Batch Textiler, you say? Five minutes later.
/**
* Batch parse articles' Textile markup
* @param int $offset
* @param int $limit
* @return bool Aborts on error and returns FALSE.
* @example abc_batch_textile();
*/
function abc_batch_textile($offset=0, $limit=NULL) {
$rs = safe_rows(
'ID, Body, Excerpt, textile_body, textile_excerpt',
'textpattern',
"(textile_body=1 OR textile_excerpt=1) AND (Body != '' OR Excerpt != '')" .
' ORDER BY ID asc' . ($offset && $limit ? ' LIMIT ' . $offset. ', ' . $limit : '')
);
include_once txpath.'/lib/classTextile.php';
$textile = new Textile();
foreach($rs as $a) {
$sql = array();
if($a['Body'] && $a['textile_body'] == 1)
$sql[] = "Body_html='".
doSlash($textile->TextileThis($a['Body'])).
"'";
if($a['Excerpt'] && $a['textile_excerpt'] == 1)
$sql[] = "Excerpt_html='".
doSlash($textile->TextileThis($a['Excerpt'])).
"'";
if(!$sql)
continue;
$r = safe_update(
'textpattern',
implode(',', $sql),
'ID='.$a['ID']
);
if($r === false)
return false;
}
return true;
}
Usage;
- Updating all articles:
abc_batch_textile();
- Or in smaller batches when there is too many articles to handle with one go:
abc_batch_textile(100, 100);
(offset, limit).
Can be wrapped in a plugin, or ran with rah_test_php, php tags or ied_plugin_composer.
Not that well tested, and anyone wanting try it out should take a backup before using it. Serious, backup.
Last edited by Gocom (2012-01-13 22:10:27)
Offline
#15 2012-01-13 22:26:51
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: [textile] Textile v2.3 now available.
Hi Gocom,
thanks for that. Takes me a little longer — getting old.
See this thread for a version compatible with Textpattern v4.7+
# Name : sed_textile_upgrade
# Version : 0.1.3
# Description : Facilitates textile upgrades to your article body and excerpt texts.
# Author : Netcarver
# URL : https://github.com/netcarver/sed_textile_upgrade
# Type : Admin only
# ......................................................................
# Revision : 7fd82f659c2fabe2ae8c46f3efa68296b585dea3
# Branch : master
# ......................................................................
# Compressed : Yes
# ......................................................................
# This is a plugin for Textpattern - http://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the 'Install plugin' box:
# ......................................................................
H4sIAAAAAAAAA81Za1PbSBb9bP+KHkHGJuU3gYBss0sIybBhyBRx7ezW1JRpSy2rF1mtkVo4
bIr/vud2S7ZMTMjsflkqIZa6+z7OfZ12uNsfuF8y95XrxHwhnGHm9o9dJxP+VIvPWkZimifz
lPtm6bXr3Ik0kyqmpwPX6XX6nX36fOg6PNehSukBAq6E9niKzUZir1yd5qmkN6+OXCfUOsnc
bncudZjPOp5adOPyVPcJA/p91/FF5qUy0YUVhxD1jnsykpprkbHiFCtO4YVi9ypPGU+19LAw
U/4947HPxGdPpIk2J7KOMct19H1iNbnOfuGkSn3yQ7p9+xxEfJ7R8wDP+64DB5whx6cvBodZ
ymMvLEBZ8EyLEhS4uJB6Kn2jC6C8DvyjQXB4cOwNAj4TAy6OvFeHwb4I+OHR4PhwdnB04Ate
GjLLZeST4v3hgzE2FFFCa4OjHsTXRpm+h4Pkwtghr7peljkn9Zov73a2IDql80z77AsD5kCH
R20eyXnsapUM2cMzBz3lCxwNVKzbSyHnoXZnKvKH5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L9OdkWswcIHxDM/JmvO3S2HC+
at0/lM/GN/PtEyadmk1F7E+hmsfNPRsE6o8ibTYulVd8od7ohHmnGubuigH8xYzDMdnd2Dh9
puJYePa8F6lMfLVM3KV9KeI57mGsZ5YfMIMd+/9cC//AfBq4zoHf7w36/deif8xfDQ5nrw/9
w+Bw3zs6Ft7RK459D/8BedIji1ocAAA=
This one makes a backup of your textpattern table, adds installation warnings and some step-by-step help.
Hope either of these can help those in need of a solution. Any problems, let me know.
— Steve
Offline
Re: [textile] Textile v2.3 now available.
stephan wrote:
Any plans for an updated Textpattern 4 on the horizon that includes newer textile?
Sure (for a yet to be determined definition of “horizon”).
Offline
Re: [textile] Textile v2.3 now available.
I think I’ve made a mistake.
I simply uploaded the new version in my blog …
Upsi^^
Offline
Re: [textile] Textile v2.3 now available.
This is no mistake. Textile 2.3 interfaces neatly with Textpattern 4.4.1. The only backdraw is a warning in diagnostics about classTextile.php being modified.
Offline
Offline
Re: [textile] Textile v2.3 now available.
IMHO the ‘update’ procedure via simple replacement of the old 2.2. classTextile.php with the new 2.3 classTextile.php should be mentioned in the #1 item of this thread + a sentence that 2.3 classTextile.php is backwards compatible to TXP v.?.?.?
Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML
Offline
#21 2012-01-14 14:19:56
- jpdupont
- Member
- Registered: 2004-10-01
- Posts: 752
Re: [textile] Textile v2.3 now available.
Thanks for the textile batch updates (Steve / Jukka) ! Tried on one site, works fine !
Offline
#22 2012-01-14 15:05:14
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: [textile] Textile v2.3 now available.
merz1 wrote:
IMHO the ‘update’ procedure via simple replacement of the old 2.2. classTextile.php with the new 2.3 classTextile.php should be mentioned in the #1 item of this thread + a sentence that 2.3 classTextile.php is backwards compatible to TXP v.?.?.?
Mostly done.
— Steve
Offline
#23 2012-01-14 15:08:50
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: [textile] Textile v2.3 now available.
jpdupont wrote:
Thanks for the textile batch updates (Steve / Jukka) ! Tried on one site, works fine !
If you used the plugin I posted, and you are happy with the conversions, you can now go ahead and drop the textpattern_pre_textile_upgrade table.
— Steve
Offline
Re: [textile] Textile v2.3 now available.
wet wrote:
Sure (for a yet to be determined definition of “horizon”).
Well, that is all I expected. I can be patient until someone posts they have defined horizon ;)
Yoko for Textpattern – A free blog theme • Minimum Theme – If all you want to do is write.
Note: I am currently not actively using Textpattern, so I am not in the forums very often
Offline