Menu

#17 Downloadcounter

open
Feature (4)
5
2014-04-17
2012-04-09
Anonymous
No

Add a integer column, counter, in the file table.
In template fileList add a th on line 25:
<?php $this->_tag_stack[] = array('tr', array()); $_block_repeat=true;smarty_block_tr($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Downloads<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_tr($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); } array_pop($this->_tag_stack); ?>

In template fileList add a td on line 83:
['f']['counter']; ?>

In template fileList add a td on line 99:

Add the following logic in lib/modules/default/files.inc.php on line 402:
$filec=$finfo[$num];
$filec['counter']=$finfo[$num]['counter']+1;
app()->db->update('files',$filec,array('id' => $finfo[$num]['id']),array('counter'));

Discussion

  • Anonymous

    Anonymous - 2014-04-07

    its possible put last date too???

     
  • Alessandro Briosi

    just to be clear, this modification has a big BUG which is that it modified the complied template (in templates_c directory) and not the original template file.

     
  • Anonymous

    Anonymous - 2014-04-08

    if the counter, make a download date together is possible?

     
  • Alessandro Briosi

    If all you want is the last download date then add the field and add the code to handle it.

    If what you want is the story of the file then you could use the logs.

     
  • Anonymous

    Anonymous - 2014-04-14

    Yes I want to last download date, did have the code?

     
  • Alessandro Briosi

    No, sorry I do not have the code.

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.