Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2012-07-01 15:00:26

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Automate latest file download link by category.

If this is in the tag trace:

<txp:file_download_list limit="1" wraptag="p" category="Newsletters" sort="created desc">
                [SQL (0.000647): select * from txp_file where 1=1 and category = 'Newsletters' and status = '4' order by created desc limit 0, 1]
                [SQL (0.000388): select Form from txp_form where name='files']
                [Form: files]
                <txp:text item="file" />
                <txp:file_download_link>
                        <txp:file_download_name/>
                        <txp:file_download_size format="auto" decimals="2" />
                </txp:file_download_link>
                <txp:text item="category" />
                <txp:file_download_category/>
                <txp:text item="download" />
                <txp:file_download_downloads/>
        </txp:file_download_list>

it doesn’t look like it’s using the code either colak or I provided. Are you sure you made your changes to page template ‘default’? Edit: Ah, it’s using form ‘files’. It looks like it’s ignoring the file_download_link container tag’s content. So either follow etc’s advice, or put my or colak’s code in form ‘files’.

Edit 2: In 4.0.6 I find this addition to function file_download_link:

			// cleanup: this wasn't called from a form,
			// so we don't want this value remaining
			if (!$from_form)
			{
				$thisfile = '';
			}

Looks to me like it was a bug corrected in 4.0.6.

Last edited by els (2012-07-01 15:11:43)

Offline

#17 2012-07-01 15:15:52

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Automate latest file download link by category.

Regarding the upgrade: it shouldn’t be a problem at all, there are a couple of plugins that might need a fix. If you post your active plugins, we can have a look if any of them needs attention when upgrading.

Offline

#18 2012-07-01 23:34:20

thehairyhand
Member
From: Australia
Registered: 2012-05-08
Posts: 11

Re: Automate latest file download link by category.

Wow… Look at all this help I am getting from all over the world. You guys are beautiful!
Yes – its all working now.
I will definitely upgrade txp – I have been meaning to do it – but time and being a teacher – dad… – lots of excuses I know. And if there are any snags I know where to come for help.
Thank you so much Els, etc and Colak.

Offline

Board footer

Powered by FluxBB