Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
danoise@renoise.com Posted March 24, 2016 Posted March 24, 2016 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?
danoise@renoise.com Posted April 7, 2016 Author Posted April 7, 2016 Seeing that I didn't receive a response, let me rephrase my question. In IPBoard 3, I would be able to access and query the database from within a template. For example:https://www.invisionpower.com/support/guides/_/advanced-and-developers/api-methods/kernel-databases-classdbphp-r166 But, how can I do the same thing in IPB4 ?
danoise@renoise.com Posted April 8, 2016 Author Posted April 8, 2016 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.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.