Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2013-02-22 11:25:26
- gour
- Member
- From: Hlapičina, Croatia
- Registered: 2013-01-17
- Posts: 124
(re)set download counter
In order to migrate web site for one non-profit organization, I need to have public area with audio mp3 files (lectures) available for download.
Is there some plugin which can handle download counters for such files allowing one to set/reset it without jumping into db tables?
Offline
Re: (re)set download counter
Textpattern natively keeps a record of the download count of a file.
You can also reset the download count on a file-by-file basis from the main Content > Files tab. Select the files you want to reset the download count for in the table, then in the “with selected files…” menu, choose “Reset download count”.
Offline
#3 2013-02-22 13:22:43
- gour
- Member
- From: Hlapičina, Croatia
- Registered: 2013-01-17
- Posts: 124
Re: (re)set download counter
springworks wrote:
Textpattern natively keeps a record of the download count of a file.
That’s clear.
You can also reset the download count on a file-by-file basis from the main Content > Files tab.
I’m aware of that as well, but as wrote in the subject, I’ve a need to set counter to certain value as well?
Offline
Re: (re)set download counter
gour wrote:
I’ve a need to set counter to certain value as well?
As far as I’m aware there is no current plugin that can do this, but in 4.5.x there is a callback available for the multi-edit dropdown:
register_callback('gou_set_download_count_ui', 'file_ui', 'multi_edit_options');
function gou_set_download_count_ui($evt, $stp, $options) {
// Add item(s) to the $options array here
}
// Register this function first to be called when file/file_multi_edit fires
function gou_set_download_count() {
$selected = ps('selected'); // The items in the list that have been selected
$method = ps('edit_method');
// if the $method matches the one you set up above, do some DB wrangling
}
Not sure if that’s the UI workflow you’re after but it might help.
Last edited by Bloke (2013-02-22 14:41:43)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#5 2013-02-22 17:34:43
- gour
- Member
- From: Hlapičina, Croatia
- Registered: 2013-01-17
- Posts: 124
Re: (re)set download counter
Bloke wrote:
As far as I’m aware there is no current plugin that can do this, but in 4.5.x there is a callback available for the multi-edit dropdown:
Hmm, but, being still quite new with txp, I’ve no idea how to use it. :-(
They’re explained in the book, but I’ve not reach that far (yet).
Not sure if that’s the UI workflow you’re after but it might help.
Nothing particular, I just have to set counters to a certain value when migrating from old Concrete5 sites to the txp, iow. no need to have it as some permanent UI for constant tweaking.
Last edited by gour (2013-02-22 18:05:21)
Offline
Re: (re)set download counter
If you’re only doing it once then doing it directly in the data base is probably the easiest option. rss_admin_db_manager could help you do it if you don’t have other DB access.
Something like:
update txp_file set downloads = 100 where id = 1
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
#7 2013-02-22 21:02:40
- gour
- Member
- From: Hlapičina, Croatia
- Registered: 2013-01-17
- Posts: 124
Re: (re)set download counter
MattD wrote:
If you’re only doing it once then doing it directly in the data base is probably the easiest option. rss_admin_db_manager could help you do it if you don’t have other DB access.
Thank you. That looks promising and simple-enough, although we have phpmyadmin access as well.
Offline
#8 2013-02-22 21:49:11
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: (re)set download counter
Hi Gour,
I’m working on a File Edit tab plugin at the moment, which happens to have a “Reset counter to zero” option. I can adapt it to do “Reset counter to x” if you’d like?
Adi
Offline
#9 2013-02-24 09:48:37
- gour
- Member
- From: Hlapičina, Croatia
- Registered: 2013-01-17
- Posts: 124
Re: (re)set download counter
gomedia wrote:
I’m working on a File Edit tab plugin at the moment, which happens to have a “Reset counter to zero” option. I can adapt it to do “Reset counter to x” if you’d like?
That would be great ‘cause rss_admin_db_manager does not work here, iow. I do not get any tabs.
Moreover, I believe that such functionality should be present in txp.
So, please, add it! ;)
Sincerely,
Gour
p.s. Otherwise, I managed to set the counter via phpmyadmin.
Offline
Re: (re)set download counter
gour wrote:
That would be great ‘cause rss_admin_db_manager does not work here, iow. I do not get any tabs.
OT: you are using the modded version for Txp 4.0.6+ right?
Note to self: change download link on textpattern.org
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#11 2013-02-24 15:14:56
- gour
- Member
- From: Hlapičina, Croatia
- Registered: 2013-01-17
- Posts: 124
Re: (re)set download counter
Bloke wrote:
gour wrote:
OT: you are using the modded version for Txp 4.0.6+ right?
Nope, I just dl-ed from the link @textpattern.org.
Offline
Re: (re)set download counter
You should try the modded one. It works in most (alas not all) setups.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline