Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2009-09-28 13:46:07

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: txp_plugininstaller: a convention for the TXP plugins update

Bloke wrote:

Though it doesn’t come under the banner of ‘obvious’ you might save some hassle by creating the feed directly instead of auto-adding articles to your own TXP.

Thanks for the very thoughtful reply. Actually that fits pretty well with ‘obvious’, if only I knew enough about feeds generally and Txp feeds particularly to have seen it. Exactly the sort of info I was looking for.

I’m certainly going to wait to see if anyone picks up the centralized-system ball and runs with it, before trying anything myself.


Code is topiary

Offline

#17 2009-09-28 14:05:10

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,440
Website GitHub

Re: txp_plugininstaller: a convention for the TXP plugins update

jsoo wrote:

if only I knew enough about feeds generally and Txp feeds particularly

Hehehe, it was a dark art to me at first! For the record, here’s an example of the sort of thing I knocked up for the admin themes. I put this in the Page Template for a section called update:

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Updates</title>
 <link href="http://textgarden.org/update" rel="self"/>
 <link href="http://textgarden.org/"/>
 <updated><txp:php>echo date("Y-m-d").'T'.date("H:i:s").'Z';</txp:php></updated>
 <author>
   <name>Admin Theme Updates</name>
   <email>someone@textgarden.org</email>
 </author>
 <id>textgarden-admin-theme-update</id>
 <txp:article_custom category='<txp:adi_gps name="category" />'>
  <entry>
   <name><txp:article_url_title /></name>
   <title><txp:title /></title>
   <link><txp:permlink /></link>
   <id><txp:article_id /></id>
   <updated><txp:modified format="%Y-%m-%dT%H:%M:%SZ"/></updated>
   <summary><txp:custom_field name="version" /></summary>
  </entry>
 </txp:article_custom>
</feed>

And that was it. Visiting textgarden.org/update sent the feed to the browser that listed all the themes on Textgarden and their version numbers. I cheated a bit because each theme had its own article so I used article_custom to grab them and format them in the container. But an smd_query or a simple bit of PHP would do the job equally well to get stuff from another DB table. It changed somewhat for the final version that Stuart put together, but essentially the feed above is what smd_admin_themes reads to determine which themes are newer than the ones you have installed.

EDIT: I used adi_gps here so the feed could work for different URL-supplied categories, but we didn’t use it in the final version.

Last edited by Bloke (2009-09-28 14:25:50)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#18 2009-09-28 18:19:28

JanDW
Plugin Author
From: Providence, RI, USA
Registered: 2008-07-18
Posts: 327
Website

Re: txp_plugininstaller: a convention for the TXP plugins update

Bloke wrote:

I also think that a standard plugin documentation directives should be decided too:

Manfre tried a while ago and I do try to stick to that convention though it didn’t specify style so they won’t all look the same.

Can I put this convention into textbook? Under Plugin Development Guidelines maybe?


TXPDream – A Textpattern Tag Library for Adobe Dreamweaver. (updated for 4.2.0) | jdw_if_ajax – Only serve certain parts of a page when requested with AJAX

Offline

#19 2009-09-28 18:40:11

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,440
Website GitHub

Re: txp_plugininstaller: a convention for the TXP plugins update

JanDW wrote:

Can I put this convention into textbook? Under Plugin Development Guidelines maybe?

Sure thing, good idea. Great place for it instead of being buried in the forum. And if while doing it you come up with any cool ideas for perhaps the ordering of the sections or anything that’d make it easier for people to use the docs, chuck them in there too!

Last edited by Bloke (2009-09-28 18:41:04)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#20 2009-09-29 00:11:16

JanDW
Plugin Author
From: Providence, RI, USA
Registered: 2008-07-18
Posts: 327
Website

Re: txp_plugininstaller: a convention for the TXP plugins update

Ok, just did a quick and dirty edit on textbook . (No cool ideas, maybe one day…) Hopefully people can improve on it

Back on topic… Is there no other CMS that has an interesting solution to this that might work for txp?

I agree that it’s up to the user to install an update or not.

Last edited by JanDW (2009-09-29 00:12:58)


TXPDream – A Textpattern Tag Library for Adobe Dreamweaver. (updated for 4.2.0) | jdw_if_ajax – Only serve certain parts of a page when requested with AJAX

Offline

Board footer

Powered by FluxBB