Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2004-09-17 13:17:05

DougBTX
Archived Plugin Author
Registered: 2004-05-23
Posts: 22

Re: Txp Plugin Template for Developers

Instead of doing this to add code:

<pre>$plugin[‘code’] = ‘
function xxx_myplugin($atts) {
}
‘;</pre>

Why not do this instead?

<pre>
$plugin[‘code’] = <<<END
function xxx_myplugin($atts) {
}
END;</pre>

That would mean that you don’t need to escape your plugins anymore.

Douglas

Last edited by DougBTX (2004-09-17 13:19:18)

Offline

#14 2004-09-20 12:23:45

Dean
Founder (Gone, but not forgotten)
From: Languedoc
Registered: 2004-02-14
Posts: 235
Website

Re: Txp Plugin Template for Developers

The plugin distribution template has been updated.

As of 1.0rc1, plugins no longer need to be installed via browser file upload from a text file. The base64 string that was previously passed to Txp via upload can now be simply pasted in to the plugin editing tab. This I believe removes some unnecessary clumsy steps.

For the next couple of releases, the depracated plugin file upload form will remain, but if plugin developers would be willing to release in the new format, that would be supah.

Since the question was posed above, the reason base64 is used to encode the (already seralize()’d plugin array) is; to allow for any linebreaks and other white space that might slip into the plugin distro. Base64 would be very forgiving, for example, to plugin code that was sent as email text.


text*

Offline

#15 2004-09-20 23:20:58

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

Re: Txp Plugin Template for Developers

I want to make sure I understand this correctly:
the plugin format is still the same it was, only now instead of the end result of

<code>
<?php
$plugin = ‘longbase64encodedstring’
?>
</code>

its just
longbase64encodedstring

and we just c&p it into the plugin ui. Correct? Or is there something else I’m missing?

Offline

#16 2004-09-21 07:24:17

Dean
Founder (Gone, but not forgotten)
From: Languedoc
Registered: 2004-02-14
Posts: 235
Website

Re: Txp Plugin Template for Developers

It is as you have written, my child. Blessings unto you.


text*

Offline

#17 2004-09-21 22:32:55

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Txp Plugin Template for Developers

There’s an improved plugin template here. It eliminates the need for escaping characters.


Alex

Offline

#18 2004-09-30 00:52:44

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

Re: Txp Plugin Template for Developers

“It is as you have written, my child. Blessings unto you.”

lol, thanks.

Offline

#19 2004-09-30 17:12:07

mdm
New Member
From: Seattle
Registered: 2004-05-24
Posts: 4
Website

Re: Txp Plugin Template for Developers

I’d like to write a plugin to email entries to a list of subscribers (mostly family members who don’t understand rss). I know that plugins let you create <txp:function /> tags, but how can a plugin get into the message posting or pinging mechanism?

Thanks!
Michael

Offline

#20 2004-09-30 17:34:15

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

Re: Txp Plugin Template for Developers

That plugin needs to tap into the admin area and currently you can not write plugins for the admin area of the site. It is in the works though ..


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

#21 2004-10-13 11:47:31

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

Re: Txp Plugin Template for Developers

I think people have winged it for now. Before you select any check the plugin list and the forum to see if there are anyone with the same identifier ..


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

#22 2004-10-23 02:35:21

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: Txp Plugin Template for Developers

btw… thanks for the little “<code><<<</code><code>eod</code>” mod; makes life a little bit easier.

However, there really needs to be a louder disclaimer on the template about needing to escape variables like \$so.

Last edited by compooter (2004-10-23 03:14:28)

Offline

Board footer

Powered by FluxBB