Jump to content

IPDownloads/view template: accessing files


Recommended Posts

Posted

Hi all,

I am looking for a cleaner, better way to do something seemingly simple: access the files associated with a download on the IPDownloads "view" page. 

The idea is to iterate through, and if file is deemed to be audio, automatically embed it in a media player.
With 3.x I made this work by querying the database directly (hackish solution, but it works).

My problem is that the $file variable does not seem to expose the files - it appears even the number of files is not specified anywhere? 

And if this is not possible... well, I am still quite new to 4.x - perhaps there is some other way to achieve the same result? 

 

 

 

  • 2 weeks later...
Posted

And, to be even more concrete: this is the SQL statement I'm using in IPBoard3

$this->DB->build( array( 'select' => '*', 'from' => 'downloads_files_records', 'where' => "record_backup=0 AND record_file_id=" . $file["file_id"] . " AND record_type IN('upload','link')", 'order' => 'record_realname' ) );

The statement hands over a list of files that are associated with the download - which is all I need. 

Going through the code of IPBoard4, I have seen a similar-looking "select" method, the syntax of which I am not sure about. 
So, really I am looking to figure out the corresponding method in IPB4, or better still, documentation. 

 

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...