2 yabba Jan 05, 2007 09:30

 
 

Thank you for your post but its not completely clear what to do. Do i have to replace my routine with yours and delete the other function?
Could you paste it as a complete document?

It was a replacement for your current function, the full code should look something like this :
 <?php
/*
 * Plugin Name: mp3player, Version: 0.0.1
 *
 * Author: Njit
 *
 * INSTALLATION: Unzip or Unrar mp3player.zip on plugins folder
 *               login to admin page
 *               Activate the plugin mp3player
 * add this code
 * [mp3player=URL to MP3 File]
 * 
 */
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
class mp3player_plugin extends Plugin{
   var $code = 'mp3player';
   var $name = 'mp3player';
   var $priority = 100;
   var $apply_rendering = 'always';
   var $apply_to_html = true;
   var $apply_to_xml = true;
   var $short_desc = 'add mp3 audio on your page';
   var $long_desc = 'Its simple and fast. You can add mp3 audio on you posts.';
    
    
   function mp3player_plugin()
   {
      $this->short_desc = T_('add mp3 audio on your page');
      $this->long_desc = T_('Its simple and fast. You can add mp3 audio on you posts.');
   }
   function RenderItemAsHtml( & $params )
   {
      $params[ 'data' ] = preg_replace( '#\[mp3player=(.+?)]#i', '<embed src= "http://www.odeo.com/flash/audio_player_standard_gray.swf" quality="high" width="300" height="52" allowScriptAccess="always" wmode="transparent" type="application/x-shockwave-flash" flashvars= "valid_sample_rate=true&external_url=$1" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </embed>', $params[ 'data' ] );
     return true;
   }
   function RenderItemAsXml( & $params ){
      return $this->RenderItemAsHtml( $params );
   }
?>
I'm getting:
Parse error: parse error, unexpected ';', expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in
/data/members/paid/h/u/domainl/htdocs/www/b2/plugins/_mp3player.plugin.php on line 40line 40 is this the end of the php file..

Opps, I forgot a } on the line before ?>
¥

Thanks! It works fine now. 
For those who want a different style, you can also use "audio_player_black.swf"
¥