Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-11-16 08:35:47

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

[plugin] [ORPHAN] upm_file: Associate single or multiple files with an article.

upm_file

Associate single or multiple files with an article.

Last edited by uli (2013-01-24 17:13:47)

Offline

#2 2006-11-17 10:41:29

douglgm
Member
From: Bristol
Registered: 2006-08-23
Posts: 182
Website

Re: [plugin] [ORPHAN] upm_file: Associate single or multiple files with an article.

Really like this one! It plugs a big whole in my current project! Many many thanks!

One little request-ette though… would there be anyway to associate a file category too? ;-)

Offline

#3 2006-11-17 11:56:59

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

Re: [plugin] [ORPHAN] upm_file: Associate single or multiple files with an article.

You’re welcome.

Er, wouldn’t that be what the built-in tag already does? :)

Offline

#4 2006-11-17 13:19:48

douglgm
Member
From: Bristol
Registered: 2006-08-23
Posts: 182
Website

Re: [plugin] [ORPHAN] upm_file: Associate single or multiple files with an article.

I’m aware of that tag. ;-)

I was thinking of the situation where I have a number of file’s I’d like to associate with an article, where some but not all are the entire contents of a particular category so in my custom field filelist I’d like to put something like:

1,32,12,15,“brand-x”,68

Of course I could use two tags to produce this list…

Offline

#5 2006-11-29 15:24:55

treofive
New Member
Registered: 2006-11-29
Posts: 4

Re: [plugin] [ORPHAN] upm_file: Associate single or multiple files with an article.

I think this is exactly what i need, just cant figure out how to work it.
I have an area that i have an article and i nned a download link associated with it.

could you please help in helping me set up my form for something like that. i cant get it to work.

Thank you in advance.

Offline

#6 2006-11-29 18:58:43

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

Re: [plugin] [ORPHAN] upm_file: Associate single or multiple files with an article.

The help that accompanies the plugin provides all the info you need. It uses the built-in files form tags.

Offline

#7 2006-11-30 03:06:41

minimal design
Member
Registered: 2006-10-15
Posts: 38

Re: [plugin] [ORPHAN] upm_file: Associate single or multiple files with an article.

I think you should mention in your help file that your plug-in creates a new tab under “extensions” tab. I laready had that “extensions” tab, and I don’t use many plugins so I thought it was specific to the plugin I had… didn’t think about looking in there… It must seem obvious to you and People used to Txp plugins, but I scratched my head for a while trying to figure out how to assign the right custom field to your plugin. I figured it out while looking at your php code thinking that maybe that’s where you had to change the prefs :P…

Last edited by minimal design (2006-11-30 03:53:12)

Offline

#8 2006-11-30 03:52:27

minimal design
Member
Registered: 2006-10-15
Posts: 38

Re: [plugin] [ORPHAN] upm_file: Associate single or multiple files with an article.

ok… I must be really retarded… I can’t get it to work…

I replaced my <txp:article /> in my default page like that:

<txp:if_section name="downloads"> <txp:upm_file_article /> </txp:if_section>

the “downloads” articles are linked to a custom article form in which I included <txp:file_download />. When I replace w/ <txp:upm_file_article /> I get a MySQL syntax error message on the “section index” page, not inside of if_individual_article (but I don’t get any result either).

What am I doing wrong?

Thanks!!

Last edited by minimal design (2006-11-30 04:08:57)

Offline

#9 2006-12-01 07:16:01

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

Re: [plugin] [ORPHAN] upm_file: Associate single or multiple files with an article.

I think you should mention…

I don’t like duplicating documentation. :)

What is the error you receive?

And, you said:

When I replace w/ <txp:upm_file_article />

Replace what, exactly? I think it would help if you could post exactly what is in your page, and, what is in the form you’re using.

Offline

#10 2006-12-03 15:13:29

minimal design
Member
Registered: 2006-10-15
Posts: 38

Re: [plugin] [ORPHAN] upm_file: Associate single or multiple files with an article.

As I understand it, you’re supposed to replace the regular <txp:article /> w/ your customized <txp:upm_file_article /> in your page/form template right? I hope so ‘cause hat’s what I’m doing…

The MySQL error I get is:

@tag_error <txp:upm_file_article/> -> Textpattern Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘from textpattern left outer join txp_file on(textpattern.custom_2 = txp_file.id)’ at line 3
select textpattern.*, unix_timestamp(textpattern.Posted) as uPosted,

from textpattern left outer join txp_file on(textpattern.custom_2 = txp_file.id) where 1 and Status = 4 and textpattern.Posted <= now() and textpattern.Section = ‘textpatterndownloads’ order by downloads desc, Posted desc limit 0, 10 on line 84@

I have this directly in my page:

<txp:if_section name="downloads"> <!-- DOWNLOADS --> <txp:if_category> <h2 class="with_sifr">Downloads » <txp:category title="1" /></h2> </txp:if_category> <txp:upm_file_article /> </txp:if_section>

and my download article use the form:

<txp:if_individual_article> <h2 class="with_sifr"><txp:title no_widow="0" /></h2> <txp:body /> <txp:output_form form="comments_display" /> <txp:else /> <h3><txp:permlink><txp:title /></txp:permlink></h3> <p class="date">Posted on <txp:posted format="%A, %B %e, %Y" /> in <txp:category1 link="1" section="downloads" title="1" /></p> <txp:excerpt /> <p class="post_comments"><a href="<txp:permlink />#comment"> <txp:comments_invite textonly="1" showcount="0" /></a> (<txp:if_comments><txp:comments_count /><txp:else />0</txp:if_comments>)</p> </txp:if_individual_article>

Hope that helps you help me… ;)

And although you might not feel like helping me after I say that (although it’s only a friendly advice, I know stuff can be interpreted all sorts of different ways when it’s said via text online…), but I think there’s nothing wrong with being extra precise in your documentation, even if it seems like redundancy… Documentation is almost the opposite of code, redundancy is good (as long as it doesn’t effect the organization of the info…). It’s similar to teaching, where you repeat the same thing over and over in different ways until the idea you’re trying to communicate gets through. I know from experience that even though you state something in the install instruction, some people will miss it. If you add the same info in the FAQ, less people will miss it (saves you time), but some will still ask you the question… It’s not necessarily because they’re not paying attention or don’t care, everyone’s different…

Thanks for the plugins and being so active on the forum – I’m not trying to be a pain… just sharing my personal opinion, it’s all open to discussion :)

Offline

#11 2006-12-05 08:34:37

timjcoulter
New Member
From: Oregon, USA
Registered: 2005-03-19
Posts: 5
Website

Re: [plugin] [ORPHAN] upm_file: Associate single or multiple files with an article.

I’m somewhat confused how to use this plugin. Part of the problem is that I haven’t used TxP’s built-in file handling much, so I’m having trouble conceptualizing how to use it. If anyone has any examples of how they’re using this plugin, it would be much appreciated!

Offline

#12 2006-12-05 22:36:53

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

Re: [plugin] [ORPHAN] upm_file: Associate single or multiple files with an article.

As I understand it, you’re supposed to replace the regular <txp:article /> w/ your customized <txp:upm_file_article /> in your page/form template right?

Correct.

You found a bug – a naughty comma where there should not be one.

v.0.2.

Offline

Board footer

Powered by FluxBB