Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#31 2004-09-14 18:52:00

obeewan
Archived Plugin Author
From: Stockholm, Sweden
Registered: 2004-08-12
Posts: 319
Website

Re: TextilePHP -- port of Choate's "Textile 2" available

hafnius,

Didn’t we say you should use utf-8? (since the whole system is built with it, the data gets stored in the db in that format etc etc etc).
Thinking of this line you wrote above:
<code>header(“Content-type: text/html; charset=iso-8859-1 Content-language: da


Plugins: ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1

“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu

Offline

#32 2004-09-14 18:54:16

obeewan
Archived Plugin Author
From: Stockholm, Sweden
Registered: 2004-08-12
Posts: 319
Website

Re: TextilePHP -- port of Choate's "Textile 2" available

Regarding txp tags getting parsed, this problem does not pop up on my site allthough I am using TextilePHP.

Just to be sure. Are we all using the one greenrift have released or is someone using the one that that release is based on? (Allthough I do not know if they differ)


Plugins: ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1

“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu

Offline

#33 2004-09-14 21:38:51

hafnius
Archived Plugin Author
From: DK
Registered: 2004-09-02
Posts: 47

Re: TextilePHP -- port of Choate's "Textile 2" available

Obeewan wrote:
Didn’t we say you should use utf-8?
Are we all using the one greenrift have released?

- After extensive testing the tho only way i can have my danish characters dispayed right and stored right in the db is by using the iso-8859-1. The only problem with this as i can possibly see is that i may not be able to use all the predefined macros – but thats okey.

Yep i am using the Greenrift one – The other one cant be used since there is no function “Textilethis”.

Cantide wrote:
One thing I’ve noticed is that articles which have TXP tags as part of them, well they’re just getting ignored…

- That was my prob. I see your are using UTF-8 encoding so that cant be the reason for the difference, Since i am using iso-8859-1 and also having the prob.

I found a solution -but brace yourself its i hack ! I would love to get some feedback on this one, since i am not that ggod with either php or Textpattern yet, but here it goes:

In classtextile.php there is a function called fixEntities:

<code>
function fixEntities($text) { /* de-entify any remaining angle brackets or ampersands */ return str_replace(array(“&gt;”, “&lt;”, “&amp;”), array(“>”, “<”, “&”), $text); }
</code>

And it is referenced in the function TextileThis:

<code>
$text = $this->fixEntities($text);
</code>

This function is not in the Greenrift version so i put it there and it seems to solve the prob. now i can have txp tags in my files again.

Last edited by hafnius (2004-09-14 21:39:52)


– Nobody puts Baby in the corner !
Johnny Castle, Dirty Dancing

Offline

#34 2004-09-14 23:04:36

Cantide
Member
From: Wellington, New Zealand
Registered: 2004-03-03
Posts: 27
Website

Re: TextilePHP -- port of Choate's "Textile 2" available

Hey that’s not that much of a hack!:) More of a… a consolidation!

Offline

#35 2004-09-14 23:28:31

hafnius
Archived Plugin Author
From: DK
Registered: 2004-09-02
Posts: 47

Re: TextilePHP -- port of Choate's "Textile 2" available

Cantide

I would be much interested to know if this works in your context. And maybe youre right about the consolidation :)

/Hafnius


– Nobody puts Baby in the corner !
Johnny Castle, Dirty Dancing

Offline

#36 2004-09-15 01:21:00

Cantide
Member
From: Wellington, New Zealand
Registered: 2004-03-03
Posts: 27
Website

Re: TextilePHP -- port of Choate's "Textile 2" available

Yeah, it works sweet. I’m using UTF-8 if that matters at all ;)

For those who want to follow this hack, I suggest adding the fixEntities function at the end of the classTextile.textilephp.php file, just before:

<pre>} // class Textile</pre>

as it’s nice and clean that way. The other bit, function TextileThis, confused the hell out of me as I only do basic PHP. With a bit of poking around and a lot of luck, I found you can simply add:

<pre>if(!$strict) { $text = $this->fixEntities($text); }</pre>

between

<pre>$text = $this->process($text);</pre>

and

<pre>if(!empty($lite)) {</pre>

to get it to work. This I hope is exactly the same as hafnius’ hax. And that it doesn’t trigger a day-before-site-completion cascade resonance scenario, which results in total loss of data and also my computer exploding.

Last edited by Cantide (2004-09-15 01:48:06)

Offline

#37 2004-09-16 23:07:24

obeewan
Archived Plugin Author
From: Stockholm, Sweden
Registered: 2004-08-12
Posts: 319
Website

Re: TextilePHP -- port of Choate's "Textile 2" available

Wow!

Mayor issue. I have done my first article that when getting Textiled kicks the memory roof set for PHP.

There are some 76 rows of <ul>/<li> Textiletags, 77 headers and about the same number of paragraphs.

My host currently offers 8MB to PHP and I don’t know if this is standard or not .. But it’s an issue nontheless.

Have this happend to anyone else? Even interested in the ones using the vanilla Textile?


Plugins: ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1

“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu

Offline

#38 2004-10-06 22:42:55

greenrift
Archived Plugin Author
Registered: 2004-03-08
Posts: 186
Website

Re: TextilePHP -- port of Choate's "Textile 2" available

I’ve updated TextilePHP for TXP

It’s now the latest version of TextilePHP, some bug fixes, and I changed the way I went around actually adding TextilePHP so updates will be easier. I was hoping to add SmartyPants capabilities (and the code is in there to do it), but PHP kept telling that functions were being redeclared when they didn’t. So the next version should hopefully contain smarty pants support.

Offline

#39 2004-10-06 23:07:23

hafnius
Archived Plugin Author
From: DK
Registered: 2004-09-02
Posts: 47

Re: TextilePHP -- port of Choate's "Textile 2" available

Hey thats cool, Greenrift
Two things
1. theres a small and probably insignificant error on line 195 where it says “Preserve Spaaces”, notice the double (a). I dont even no if is implemented.

2. whats SmartyPants, what can it do for us?
/Hafnius


– Nobody puts Baby in the corner !
Johnny Castle, Dirty Dancing

Offline

#40 2004-10-07 03:29:20

greenrift
Archived Plugin Author
Registered: 2004-03-08
Posts: 186
Website

Re: TextilePHP -- port of Choate's "Textile 2" available

could you tell me a little more about the error? Like is it just a regular PHP error that is showing up, or something else? I thought I turned error reporting to a really low level (because there was a bunch of “variable undefinied” notices and stuff when report everything), but anyways.

“SmartyPants easily translates plain ASCII punctuation characters into “smart

Offline

#41 2004-10-07 14:45:36

hafnius
Archived Plugin Author
From: DK
Registered: 2004-09-02
Posts: 47

Re: TextilePHP -- port of Choate's "Textile 2" available

i should have explained this more carefully, Greenrift. I am not getting any errors – i am merely pointing out the typo. Thats way i thougt it was not implemented cuz typos normally cause php errors. Hope this is clear. Sorry if i scared you ;)
And thanx for the link on Smartypants
/Hafnius


– Nobody puts Baby in the corner !
Johnny Castle, Dirty Dancing

Offline

#42 2004-10-08 03:18:00

Cantide
Member
From: Wellington, New Zealand
Registered: 2004-03-03
Posts: 27
Website

Re: TextilePHP -- port of Choate's "Textile 2" available

Rockin’ update greenrift!:)

Offline

#43 2004-10-08 21:01:44

backspaces
Member
From: Santa Fe, NM
Registered: 2004-09-10
Posts: 15
Website

Re: TextilePHP -- port of Choate's "Textile 2" available

Greenrift: Thanks a bundle! Very clean design too.

I had almost decided to give up on textile .. great idea but I kept finding cases where it failed. I was getting ready to use pure html instead!

So stumbled upon your stunt and wow! Works really well and textilePHP is a very nicely thought out upgrade.

Owen

Offline

#44 2004-10-08 22:07:28

greenrift
Archived Plugin Author
Registered: 2004-03-08
Posts: 186
Website

Re: TextilePHP -- port of Choate's "Textile 2" available

I added SmartyPants support

That’s the only thing that has changed though. The support is optional, so if you want to remove SmartyPants just delete smartypants.php.

PHP SmartyPants is what I’m using, original SmartyPants info is available here.

Offline

#45 2004-10-14 18:33:21

hafnius
Archived Plugin Author
From: DK
Registered: 2004-09-02
Posts: 47

Re: TextilePHP -- port of Choate's "Textile 2" available

I cant seem to make the smartypants to work. Word ads some quotes that are not getting transformed by the smartypants. Dont i have to inc. the file somehow to make it work?
/Hafnius


– Nobody puts Baby in the corner !
Johnny Castle, Dirty Dancing

Offline

Board footer

Powered by FluxBB