Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Archives
  3. » Txp Plugin Template for Developers

#61 2005-12-01 22:48:01

Souljacker
Member
From: Terra Brasilis
Registered: 2005-06-20
Posts: 47
Website

Re: Txp Plugin Template for Developers

Oh gosh … it just won’t work. I’ll put here everthing I’ve done:

– My plugin_cache_dir has the full path is set to localhost full location: http://localhost/caco/textpattern/tmp

- I’ve downloaded the template file and edit it as this:

<?php

$plugin[‘version’] = ‘0.1’;
$plugin[‘author’] = ‘My Name’;
$plugin[‘author_uri’] = ‘http://example.com/’;
$plugin[‘description’] = ‘Short description’;
$plugin[‘type’] = 0;

@include_once(‘zem_tpl.php’);

if (0) {
?>
h1. Textile-formatted help goes here

<?php
}

// Plugin code goes here. No need to escape quotes.

function gcj_camara($atts) { extract(lAtts(array( ‘name’ => ‘Alice’, ),$atts));

return ‘Hello, ‘.$name; }

?>

The file is saved as gcj_camara.php

I’ve also tried to include $plugin[‘name’] = ‘gcj_camara’; in the code.

- I put <txp:gcj_camara /> at the code

When I run it I have this error message:

tag_error <txp:gcj_camara/> -> Textpattern Warning: unknown_tag

Last edited by Souljacker (2005-12-01 22:49:15)

Offline

#62 2005-12-01 23:18:39

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: Txp Plugin Template for Developers

I think your plugin_cache_dir setting is the problem. It shouldn’t point to URL but the physical address on the drive. In the Diagnostics tab check the results for Textpattern path and build from there. From your URL it seems that you would want /_Textpattern path_/tmp

Last edited by hakjoon (2005-12-01 23:18:53)


Shoving is the answer – pusher robot

Offline

#63 2005-12-01 23:22:00

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

Re: Txp Plugin Template for Developers

Can also use the tmp folder path as a guide.

Offline

#64 2005-12-01 23:23:38

Souljacker
Member
From: Terra Brasilis
Registered: 2005-06-20
Posts: 47
Website

Re: Txp Plugin Template for Developers

Hakjoon you’re right, I just figured it out.

But it wasn’t showing in Diagnostics. I figured it out because the patch to files was also giving me the same problem.

Thanks a lot everyone, specially mary, for the help and patience.

I said it was a stupid thing :)

Offline

#65 2006-01-24 13:23:23

Manfred Kooistra
New Member
From: Reutlingen, Germany
Registered: 2006-01-24
Posts: 4
Website

Re: Txp Plugin Template for Developers

Okay, I have a plugin called “choose_language”. It is in a plugins folder and I set the plugins path in the admin area. Now I try to pass my articles to this plugin.

It works fine with
<code><?php choose_language(‘<txp:article />’); ?></code>
and my articles are processed as planned,

but if I use
<code><txp:choose_language><txp:article /></txp:choose_language></code>
the array (any argument) is empty.

Anyone know what I do wrong?

Offline

  1. Index
  2. » Archives
  3. » Txp Plugin Template for Developers

Board footer

Powered by FluxBB