Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-03-08 00:50:44

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

request: modified file_download_list plugin

aim: put <code>< txp:mod_file_download_list /></code> in an article form and by default it lists only those files with the category <code>“article-[articleID]”</code> e.g. <code>category=“article-15”</code> if you happen to be on article #15

so: when you create a file in txp, you can give it a file category (e.g. article-15) to bind it to an article

I went and mucked about with taghandlers.php, inserting permutations of this line from jmr_gallery into various slots:

<code>$category = ‘article-’ . $thisarticle[‘thisid’]</code>

but never got a result… even with new-found knowledge of the ternary conditional operator (dangers of google)

but I figure a plugin with this basic modification of file_download_list would be a piece of pastis for someone who knew php

+++

edit: request retracted — see below

Last edited by nardo (2005-03-09 09:25:38)

Offline

#2 2005-03-09 07:27:54

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

Re: request: modified file_download_list plugin

okay, I hestitate to call this a plugin, as it’s about 30 chars tacked into Txp’s existing code… but here’s <a href=“http://www.firecorner.com/txp/dub_file_download_list.txt”>dub_file_download_list</a>

+ + +

Minor mod of the file_download_list tag which functions exactly the same… except:

  • if you don’t specify a category, the default category is “article-[articleID]”.

Workflow:

  • pop tag in article form, obviously
  • create an article, note its ID, upload file(s) and give ‘em the file category of “article-[articleID]” e.g. article-9
  • now your article will display only those file(s) tied to that post

+ + +

don’t know php so this was a result of some blind stumbling with occasional consultation of php.net, jmr_gallery and chicken entrails — but who knew getting Apache/MySQL/Txp going on Windows was as easy as getting a beer? … mein localhost, is good …

but anyway, a built-in version of ‘article image(s)’ for files would be better, acknowledging that screen space is at a premium and dean doesn’t want the write tab page looking like the somme, 1916

Last edited by nardo (2005-03-09 07:28:46)

Offline

Board footer

Powered by FluxBB