{MP3} Replacement Tag
- marcus@localhorst
- Posts: 815
- Joined: Fri 28. May 2004, 11:31
- Location: localhorst
- Contact:
{MP3} Replacement Tag
Well, with the very cool MP3 Player made by Nesium.com it's possible to stream external (or internal) mp3 files.
unfortunately, at the moment the player is not for free, but there will come a free player.
for the moment, take a look here:
http://www.fieldmuzick.net/fieldcontent/blogplog.phtml
the custom tag is very simple, every other player, should work with that...
greatings marcus
unfortunately, at the moment the player is not for free, but there will come a free player.
for the moment, take a look here:
http://www.fieldmuzick.net/fieldcontent/blogplog.phtml
the custom tag is very simple, every other player, should work with that...
greatings marcus
- marcus@localhorst
- Posts: 815
- Joined: Fri 28. May 2004, 11:31
- Location: localhorst
- Contact:
ehm, at the moment not really, because the player ist not free
but the PHP code is very simple... you could use every other swf player which stream mp3 from any url.
put the following in a file in the frontend_render folder:
in the moment there is a bug but i've got no idea what's happend. i think the regex to catch the url is not fine
if someone know a free flash mp3 player which loads the mp3 over the url, please tell.
i didn't programm the player, so i can't give it away...
but there will come a free version...
there are a lot free players which uses xml files to load the mp3...
but the PHP code is very simple... you could use every other swf player which stream mp3 from any url.
put the following in a file in the frontend_render folder:
write all the code which display the flashplayer in the $mp3_playa var.function play_mp3($source='') {
$mp3_playa = '';
$source = preg_replace('/\{MP3:(.*?)\}/e', '"$1"', $source);
$mp3_playa = '<embed write_here_the_code_to_embed_your_swf_mp3_player.swf?var=$source>';
return $mp3_playa;
}
if( ! ( strpos($content["all"],'{MP3:')===false ) ) {
$content["all"] = preg_replace('/\{MP3:(.*?)\}/e','play_mp3("$1");',$content["all"]);
}
in the moment there is a bug but i've got no idea what's happend. i think the regex to catch the url is not fine
if someone know a free flash mp3 player which loads the mp3 over the url, please tell.
i didn't programm the player, so i can't give it away...
but there will come a free version...
there are a lot free players which uses xml files to load the mp3...
I knew the player isn't free. But was hoping to get a hint about howto make my own tag including a .swf file.
I am a little worried about modifying too much of the phpwcms code. especially because a new verrsion is just around the corner.
Another thing is that I haven't studied the phpwcms code in detail so I have no idea about how easy it is to extend with my own code and how easy my modifications is transferred to the next version of the base code.
The test site I'm ttesting phpwcms at this moment has this http://www.1to12.dk/index.php?id=2,0,0,1,0,0 page with a .swf file but it's hardcoded in the page. A tag would be nice
/Niels
I am a little worried about modifying too much of the phpwcms code. especially because a new verrsion is just around the corner.
Another thing is that I haven't studied the phpwcms code in detail so I have no idea about how easy it is to extend with my own code and how easy my modifications is transferred to the next version of the base code.
The test site I'm ttesting phpwcms at this moment has this http://www.1to12.dk/index.php?id=2,0,0,1,0,0 page with a .swf file but it's hardcoded in the page. A tag would be nice
/Niels
The simple viewer I'm using at the moment is free and can be found at http://www.zoomify.com
If you wan't to modify the source is available for about usd 130
/Niels
If you wan't to modify the source is available for about usd 130
/Niels
Hi...
I would love this function on my site,
how is the development going??
is it possible to see the complete code that you use??
with embeded code and all??
just replace file path with sometinhg...
for me it only returns the "$source" in the var,
like this:
instead of:
any suggestions???
I would love this function on my site,
how is the development going??
is it possible to see the complete code that you use??
with embeded code and all??
just replace file path with sometinhg...
for me it only returns the "$source" in the var,
like this:
Code: Select all
streammp3.swf?url=$source
Code: Select all
streammp3.swf?url=http://domain.com/mp3file.mp3
- marcus@localhorst
- Posts: 815
- Joined: Fri 28. May 2004, 11:31
- Location: localhorst
- Contact:
write
than
- my mistake
Code: Select all
$mp3_playa = '<embed write_here_the_code_to_embed_your_swf_mp3_player.swf?var='.$source.'>';
Code: Select all
$mp3_playa = '<embed write_here_the_code_to_embed_your_swf_mp3_player.swf?var=$source>';
- my mistake
cool mp3-player
the coolest mp3-player is free (gpl), easy to implement, done by marc reichelt.
check a working implementation at http://www.autoteile-discount.de
the player and install instructions can be downloaded at
http://www.marcreichelt.de/spezial/musicplayer/
volkman
check a working implementation at http://www.autoteile-discount.de
the player and install instructions can be downloaded at
http://www.marcreichelt.de/spezial/musicplayer/
volkman
- Fulvio Romanin
- Posts: 394
- Joined: Thu 4. Dec 2003, 11:12
- Location: Udine, Italy
- Contact:
- marcus@localhorst
- Posts: 815
- Joined: Fri 28. May 2004, 11:31
- Location: localhorst
- Contact:
- Fulvio Romanin
- Posts: 394
- Joined: Thu 4. Dec 2003, 11:12
- Location: Udine, Italy
- Contact:
so here's the file you need - name it filelist_xml.php, then it'll be a breeze to use it and tweak it for your mp3 player - i can share mine if you want to, but that's not so important.
-------------------------
usage (the simplest usage you'd need)
-------------------------
define which wcms page will have the mp3 files attached inside of this file. Then, from the file manager, import the mp3 files and insert each one of them as a separate file list content part (might work with all in the same, didn't test them). That's REALLY all.
----------------------------
filelist_xml.php
by Luca Malisan and Fulvio Romanin
-----------------------------
<?php
if (stristr($_SERVER['HTTP_ACCEPT'], "application/xhtml+xml")) {
header("Content-Type: application/xhtml+xml; charset=utf-8");
} else {
header("Content-Type: text/html; charset=utf-8");
}
require_once ("config/phpwcms/conf.inc.php");
require_once ("include/inc_lib/default.inc.php");
$aid = intval($_GET['aid']);
$FILE = array();
$xml = '';
$sql_cnt = "SELECT * FROM ".DB_PREPEND."phpwcms_articlecontent WHERE acontent_aid=".$aid." ".
"AND acontent_visible=1 AND acontent_trash=0 AND acontent_type=7 LIMIT 1";
if($cresult = mysql_query($sql_cnt, $db) or die("error while listing contents for this article")) {
if($crow = mysql_fetch_array($cresult)) {
if($crow["acontent_files"]) {
$file_tmp = '';
$file_id = explode(":", $crow["acontent_files"]);
$file_text = explode("\n", $crow["acontent_text"]);
if(is_array($file_id) && count($file_id)) {
$fx=0; $fxa="";
if(isset($fxb)) {
unset($fxb);
}
foreach($file_id as $key => $value) {
if($fx) {
$fxa .= " OR ";
}
$fxa .= "f_id=".intval($value);
$fxb[$key]["fid"] = intval($value);
$fxc[$key] = '';
$fx++;
}
$file_sql = "SELECT * FROM ".DB_PREPEND."phpwcms_file WHERE f_public=1 AND f_aktiv=1 AND f_kid=1 AND f_trash=0 AND (".$fxa.");";
if($file_result = mysql_query($file_sql, $db) or die ("error while retrieving file list file's info")) {
while($file_row = mysql_fetch_assoc($file_result)) {
$dl_filename = $file_row["f_hash"];
if($file_row["f_ext"]) $dl_filename .= ".".$file_row["f_ext"];
$FILE[] = PHPWCMS_ROOT.$phpwcms["file_path"].$dl_filename;
$xml .= "\t".'<SONG ';
$xml .= "\n\t\t".'info="'.utf8_encode($file_row["f_shortinfo"]).'" ';
$xml .= "\n\t\t".'filename="'.utf8_encode($file_row["f_name"]).'" ';
$xml .= "\n\t\t".'file="'.PHPWCMS_URL.substr($phpwcms["file_path"],1).$dl_filename.'"';
$xml .= "\n\t></SONG>\n";
}
mysql_free_result($file_result);
}
}
}
}
}
echo '<'.'?xml version="1.0" encoding="utf-8"?'.">\n";
echo "<archive>\n";
echo $xml;
echo '</archive>';
?>
-------------------------
usage (the simplest usage you'd need)
-------------------------
define which wcms page will have the mp3 files attached inside of this file. Then, from the file manager, import the mp3 files and insert each one of them as a separate file list content part (might work with all in the same, didn't test them). That's REALLY all.
----------------------------
filelist_xml.php
by Luca Malisan and Fulvio Romanin
-----------------------------
<?php
if (stristr($_SERVER['HTTP_ACCEPT'], "application/xhtml+xml")) {
header("Content-Type: application/xhtml+xml; charset=utf-8");
} else {
header("Content-Type: text/html; charset=utf-8");
}
require_once ("config/phpwcms/conf.inc.php");
require_once ("include/inc_lib/default.inc.php");
$aid = intval($_GET['aid']);
$FILE = array();
$xml = '';
$sql_cnt = "SELECT * FROM ".DB_PREPEND."phpwcms_articlecontent WHERE acontent_aid=".$aid." ".
"AND acontent_visible=1 AND acontent_trash=0 AND acontent_type=7 LIMIT 1";
if($cresult = mysql_query($sql_cnt, $db) or die("error while listing contents for this article")) {
if($crow = mysql_fetch_array($cresult)) {
if($crow["acontent_files"]) {
$file_tmp = '';
$file_id = explode(":", $crow["acontent_files"]);
$file_text = explode("\n", $crow["acontent_text"]);
if(is_array($file_id) && count($file_id)) {
$fx=0; $fxa="";
if(isset($fxb)) {
unset($fxb);
}
foreach($file_id as $key => $value) {
if($fx) {
$fxa .= " OR ";
}
$fxa .= "f_id=".intval($value);
$fxb[$key]["fid"] = intval($value);
$fxc[$key] = '';
$fx++;
}
$file_sql = "SELECT * FROM ".DB_PREPEND."phpwcms_file WHERE f_public=1 AND f_aktiv=1 AND f_kid=1 AND f_trash=0 AND (".$fxa.");";
if($file_result = mysql_query($file_sql, $db) or die ("error while retrieving file list file's info")) {
while($file_row = mysql_fetch_assoc($file_result)) {
$dl_filename = $file_row["f_hash"];
if($file_row["f_ext"]) $dl_filename .= ".".$file_row["f_ext"];
$FILE[] = PHPWCMS_ROOT.$phpwcms["file_path"].$dl_filename;
$xml .= "\t".'<SONG ';
$xml .= "\n\t\t".'info="'.utf8_encode($file_row["f_shortinfo"]).'" ';
$xml .= "\n\t\t".'filename="'.utf8_encode($file_row["f_name"]).'" ';
$xml .= "\n\t\t".'file="'.PHPWCMS_URL.substr($phpwcms["file_path"],1).$dl_filename.'"';
$xml .= "\n\t></SONG>\n";
}
mysql_free_result($file_result);
}
}
}
}
}
echo '<'.'?xml version="1.0" encoding="utf-8"?'.">\n";
echo "<archive>\n";
echo $xml;
echo '</archive>';
?>
Completeness is reached through subtraction, not through addition
- marcus@localhorst
- Posts: 815
- Joined: Fri 28. May 2004, 11:31
- Location: localhorst
- Contact:
mp3 player RT
hi,
FYI, I've nearly finished my little mp3 stream RT:
http://www.phpwcms.de/forum/viewtopic.php?t=12125
anton
FYI, I've nearly finished my little mp3 stream RT:
http://www.phpwcms.de/forum/viewtopic.php?t=12125
anton