Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2005-09-11 21:44:55

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Textpattern Plugin Template

No, if you use both files in their correct places, it works perfectly:
“(Note: do not put zem_tpl.php in the same directory)”

zem_tpl.php is for the compiling. You put it somewhere else. You put your plugin in whatever your plugin cache dir is, and it gets executed. Put it in the same folder as zem_tpl and it gets compiled. All the work has already been done for you.

Offline

#17 2005-09-11 22:18:30

aba
Plugin Author
Registered: 2004-04-14
Posts: 119

Re: Textpattern Plugin Template

zem_tpl.php is not in the same directory (I use textpattern/lib).
I don’t know why Rob decided to put a check for $test into it, but it is there (check the first lines of it). I don’t copy the plugin where I want to compile it, it just has a $test=‘1’; at the beginning and whenever I want to compile it I change this to $test=‘0’;

Works for me – and it has to have a purpose. ;)

Offline

#18 2006-04-08 00:32:53

baby
Plugin Author
From: Buenos Aires, Argentina
Registered: 2005-10-16
Posts: 95
Website

Re: Textpattern Plugin Template

Hi zem…

I noticed a problem (mostly an annoyance rather than a problem)… I dowloaded zem_tpl-0.4.tar.gz and gave it a quick try… it works OK, but if I run from the command line in a unix machine, the line endings come out with a mixture of \n and \r\n… I guess it must work OK in windows…

Now, I’m not a PHP expert, but I can’t find an equivalent to Perl’s $\ (or $OUTPUT_RECORD_SEPARATOR)… anyway, I don’t think you could solve it with this either.

I guess the problem comes from the fact that zem_tpl.php is windows formatted (i.e. it has \r\n as end of line markers), and since the program uses here-documents for some lines (the <<< EOF trick), they come out as \r\n, whereas the simple \n’s printed within the program, come out as, well, only \n’s in unix.

Also, the chunk_split() function defaults to \r\n

Maybe you could package the .tar.gz version withount the \r’s and with the last line like this:

return $header . "\n\n" . trim(chunk_split(base64_encode(serialize($plugin)), 72,"\n")). "\n";

(note the extra ,"\n" in the call to chunk_split()), and leave the .zip version as is… that is, most windows people will download the .zip and most unix people will download the .tar.gz…

maybe there’s an elegant solution to this?

maybe it just doesn’t matter?


Mariano AbsatzEl Baby

I don’t suffer from insanity. I enjoy every minute of it.

Offline

#19 2006-09-01 17:11:05

baby
Plugin Author
From: Buenos Aires, Argentina
Registered: 2005-10-16
Posts: 95
Website

Re: Textpattern Plugin Template

Hi zem…

Shouldn’t it be noted here that the plugin template is now maintained in the svn repo ?


Mariano AbsatzEl Baby

I don’t suffer from insanity. I enjoy every minute of it.

Offline

#20 2007-03-16 03:59:57

placenamehere
Archived Plugin Author
Registered: 2004-11-21
Posts: 88
Website

Re: Textpattern Plugin Template

Was looking at this template again tonight and was thinking that perhaps in addition to an author_uri it might be useful to add a plugin_uri to the metadata list.


Site: placenamehere.com
Microformat Plugin: pnh_mf

Offline

Board footer

Powered by FluxBB