Phoca Download Plugin - Bugfix multivids in multiarticles

Phoca plugins - support for all Phoca plugins except Phoca Gallery plugins
ndee
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 24 Apr 2008, 12:08

Phoca Download Plugin - Bugfix multivids in multiarticles

Post by ndee »

Hi,

the download plugin renders multiple video files correctly with flowplayer in one article. But if you have a category in blog style and you have multilple articles with videos published each div an js gets the same IDs and causes the plugin to not work anymore.

My bugfix proposal is to add the article id to the div and js code so that they are unique for each article.

Bugfix: go to line 70 of plg_phocadownload/phocadownload.php (version 1.3.3) : where it says:

Code: Select all

for($i = 0; $i < $count_matches; $i++) {
and add a new var below that line:

Code: Select all

//generate unique id by concatenating the run variable $i with the article id
$count = $article->id . "-" . $i;
and then replace the ocurrances of $i with count in js and div code about lines 289,296,319
find:

Code: Select all

pdplayer'.$i.'
and replace with:

Code: Select all

pdplayer'.$count.'
Greets,
ndee
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48706
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Phoca Download Plugin - Bugfix multivids in multiarticles

Post by Jan »

Hi, thank you for this information.

Jan
If you find Phoca extensions useful, please support the project
Post Reply