Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#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

#23 2005-01-04 20:01:26

jjeff
Member
From: Massachusettes, USA
Registered: 2005-01-03
Posts: 11
Website

Re: Txp Plugin Template for Developers

Both of the templates (Dean’s and Zem’s) could use a

header(‘Content-type: text/plain’);

line before the echo line.

This will make it so that browsers treat the code as text and display it, rather than treating it as source and not. Easier cut and paste.

Offline

#24 2005-01-08 11:52:11

freaky
Member
From: Austria
Registered: 2004-10-14
Posts: 55
Website

Re: Txp Plugin Template for Developers

Example:

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

write this:
<pre>
$plugin[‘code’] = <<<eod function xxx_myplugin(\$atts) { // <= notice the \ char ! }
eod;
</pre>

I don’t know if this is already known — it just took me more than an hour to figure this out, so I thought maybe others encounter the same behaviour.

Great!!!! Thank you!!! :)

Offline

#25 2005-01-19 23:25:05

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

Re: Txp Plugin Template for Developers

There’s a new version of zem_tpl available here.

This one separates the template from the “compiler”, and produces plugins in the 1.0 format.


Alex

Offline

#26 2005-05-24 13:19:37

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: Txp Plugin Template for Developers

I am not sure if there is already a forum/thread(s) where developers can exchange information, so I’ll just write it here:

It speeds up development tremendously if you do the following:

1. Use zem’s tamplate.
2. edit admin_config.php and in the array add: <b><notextile>‘plugin_cache_dir’ => ‘/full/path/www/textpattern/myplugins’,</notextile></b>
3. create a directory /full/path/www/textpattern/myplugins [edit: changed path to be different from tmp]
4. drop your plugins (uncompiled) in that directory (make sure plugin name and plugin-filename correspond, e.g. zem_test should be in zem_test.php)

(Note: do not put zem_tpl.php in the same directory)

Now during development you can skip the compile, upload, activate steps (and you’re not confined to editing in the admin-panel or copy&paste). Simply edit the file in the tmp dir, it will be included on each run.

Thanks to zem for the tip. :)

Last edited by Sencer (2005-05-25 09:44:57)

Offline

#27 2005-05-24 16:55:02

wilshire
Plugin Author
From: Akron, Ohio
Registered: 2004-08-27
Posts: 656
Website

Re: Txp Plugin Template for Developers

Excellent tip. I had always just pasted my code into taghandlers.php while I was working on it.

Will this work with admin side code as well? I don’t seem to be able to get my admin side code to execute although my regular plugin code works fine on the external site.

Offline

#28 2005-05-24 18:40:03

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: Txp Plugin Template for Developers

Oops, my bad. You have to enter the full (not the relative) path to the directory in admin_config. I’ll update my above post.

Actually with the cache directory, txp will always include your plugin backside, and frontside. So with admin-side plugins you have to remember to set $plugin[‘type’] to 1 before distributing (you may forget it, but it would still work for you, but not other people).

Offline

Board footer

Powered by FluxBB