Community Forums

ATutor Bug Reports

Patcher problem ++


You must be signed-in to post.

AuthorSubject
 
Page: 1
vegard

Avatar for vegard
vaj_mp3_2.zip

Attachment: vaj_mp3_2.zip
Subject: Patcher problem ++Quote this post in your reply
hia, I've tried several times to run this patch to update 1.6.2 to use the Flash mp3 player, but it won't alter the file, and gives me the following error:

The patch has been installed successfully!

* Below is the list of the backup files created by the Patcher. After ensuring ATutor works properly with the patch, you may want to delete these files. If ATutor does not work properly with the patch, you can always revert back to the old files by renaming the backup files to the original file names, removing the [patch_id].old portion of the file name.
/www/vaj/atutor.no/www/atutor/include/lib/output.inc.php.vaj_mp3_2.old (Warning: One or more code chunks to be deleted or replaced are not found.)


what the patch tries to do is take this code:

highlight_code(' // .mp3
preg_match_all("#\[media[0-9a-z\|]*\](.+[^\s\"]+).mp3\[/media\]#i",$text,$media_matches[7],PREG_SET_ORDER);
$media_replace[7] = "<object type=\"audio/mpeg\" data=\"##MEDIA1##.mp3\" width=\"##WIDTH##\" height=\"##HEIGHT##\"><param name=\"src\" value=\"##MEDIA1##.mp3\"><param name=\"autoplay\" value=\"false\"><param name=\"autoStart\" value=\"0\"><a href=\"##MEDIA1##.mp3\">##MEDIA1##.mp3</a></object>";')

and replace it with this code

highlight_code(' /* old .mp3 remved by patch
preg_match_all("#\[media[0-9a-z\|]*\](.+[^\s\"]+).mp3\[/media\]#i",$text,$media_matches[7],PREG_SET_ORDER);
$media_replace[7] = "<object type=\"audio/mpeg\" data=\"##MEDIA1##.mp3\" width=\"##WIDTH##\" height=\"##HEIGHT##\"><param name=\"src\" value=\"##MEDIA1##.mp3\"><param name=\"autoplay\" value=\"false\"><param name=\"autoStart\" value=\"0\"><a href=\"##MEDIA1##.mp3\">##MEDIA1##.mp3</a></object>"; */

// .mp3 flash player added by patch
preg_match_all("#\[media[0-9a-z\|]*\](.+[^\s\"]+).mp3\[/media\]#i",$text,$media_matches[7],PREG_SET_ORDER);
$media_replace[7] = "<object type=\"application/x-shockwave-flash\" data=\"".AT_BASE_HREF.AT_INCLUDE_PATH."player.swf\" id=\"audioplayer1\" height=\"24\" width=\"200\"><param name=\"movie\" value=\"".AT_BASE_HREF.AT_INCLUDE_PATH."player.swf\"><param name=\"FlashVars\" value=\"playerID=1&soundFile=##MEDIA1##.mp3\"><param name=\"quality\" value=\"high\"><param name=\"menu\" value=\"false\"><param name=\"wmode\" value=\"transparent\"></object>";')

I have tried to create a different patch that only adds a comment to the same file, and then it worked just fine..

also note, this was supposed to be in core in 1.6.2 but isn't. the Flash player itself is added to the trunk (include/player.swf), but the output.lib.php is not updated. see:

atutor.no/contribs/mp3-flash-player
Posted: 2008-12-16 07:25:25
cindy

Avatar for cindy
0003.zip

Attachment: 0003.zip
Subject: Re: Patcher problem ++Quote this post in your reply
Thanks, Vegard. You found a bug in patcher.

The bug is, when multiple different new-line characters are presented in search/replace strings or in the file to alter, the patch may fail when the new-line characters happen not to match.

I attach a patch here which should fix the problem. Please try your own patch after installing my one. Kindly let me know whether the patch works for you. I will publish it to public if it goes well.

Thanks again.
Posted: 2008-12-16 10:33:45
vegard

Avatar for vegard
vaj_mp3_3.zip

Attachment: vaj_mp3_3.zip
Subject: Re: Patcher problem ++Quote this post in your reply
thanks Cindy, I applied your patch, made a new one of mine and it worked just fine! smile

I'll attach the new patch here if you like to test for yourself.
Posted: 2008-12-17 04:02:03
jessica4u
Subject: helloQuote this post in your reply
spammer
mimanwfor2@yahoo.com
Posted: 2012-07-28 05:10:37
 
Page: 1

You must be signed-in to post.

Related Articles