Author Topic: [Mod]Flash Mp3 Player  (Read 68716 times)

0 Members and 1 Guest are viewing this topic.

Rembrandt

  • Guest
[Mod]Flash Mp3 Player
« on: August 04, 2009, 03:50:26 PM »
Hi!

einige werde diesen Flash MP3 Player schon kennen, hier ist meine Version.

die Playliste wird automatisch erstellt,
das heißt alle mp3 in der jeweiligen Kategorie werden automatisch in die Playliste übernommen.
befinden sich mp3 in der Lightbox werden die in die Playliste übernommen.

für die Hintergrundfarbe des Players sind für den IE Explorer keine weiteren Einstellungen erforderlich.
bei verwendung im Firefox muß in der mp3.html der wert für die Hintergrundfarbe (bgcolor) angepasst werden.

wollt ihr den Artist Namen angezeigt haben, müßt ihr den Namen in das Keyword Feld der mp3 Datei schreiben.

Demo: demo.vienna-pictures.com

Neue Files:
audiolist.xml
fsmp3playerv15.swf

Beide Dateien befinden sich im Anhang, ladet sie euch herunter und kopiert sie in den Root Ordner eurer Galerie.

Geänderte Files:
detail.php
mp3.html

1.)sucht in der detail.php

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------

und fügt davor ein:

//######################################### Start Flash-Mp3-Player ##################################################
$file_ext get_file_extension($image_row['image_media_file']);
if (
$file_ext == mp3){ 
  
$img_total " AND image_id IN ('".str_replace(",","','",$image_id_sql)."')";
    if (!empty(
$image_id_sql)){
     
$sql "SELECT image_id, cat_id, image_name, image_keywords, image_media_file, image_thumb_file
                FROM "
.IMAGES_TABLE."
                WHERE image_active = 1 
$img_total AND cat_id NOT IN (".get_auth_cat_sql("auth_viewcat""NOTIN").") AND image_media_file LIKE '%.mp3' 
                ORDER BY "
.$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort']."
         "
;
  }
  else{ 
     
$sql "SELECT image_id, cat_id, image_name, image_keywords, image_media_file, image_thumb_file
                FROM "
.IMAGES_TABLE."
                WHERE  image_active = 1 
$sql_where_query AND cat_id = '$cat_id' AND cat_id NOT IN (".get_auth_cat_sql("auth_viewcat""NOTIN").") AND image_media_file LIKE '%.mp3'
                ORDER BY "
.$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort']."
                "
;
   }
	
$result $site_db->query($sql);
 
  
$fp fopen("audiolist.xml""w+");
	
$text "";
	
$text "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
	
$text .= "<songs>\n";
	
while (
$image_row $site_db->fetch_array($result,MYSQL_ASSOC)){
	
$zeichen = array('"',"'",'#''?''§''$''%''&''/''('')''=''^''°''*''@');
	
$img_name str_replace($zeichen,"",$image_row['image_name']);
	
$text .= "<song path=\"./data/media/".$image_row['cat_id']."/".$image_row['image_media_file']."\" bild=\"./data/thumbnails/".$image_row['cat_id']."/".$image_row['image_thumb_file']."\" artist=\"".$image_row['image_keywords']."\" title=\"".$img_name."\" />\n";
}
	
$text .= "</songs>\n";
	
fwrite($fp$text);
	
fclose($fp);
}
//######################################### End Flash Mp3 Player #####################################################


2.) sucht in templates/YourTemplates/media/mp3.html

<!-- Template file for MP3 Audio Files -->
<!--<
embed src="{media_src}" type="audio/x-mpeg" hidden="true" autostart="true" loop="true" height="1" width="1"></embed> -->
{
media_icon}<br />

und ersetzt es mit:

<!-- Template file for MP3 Audio Files -->
<!--<
embed src="{media_src}" type="audio/x-mpeg" hidden="true" autostart="true" loop="true" height="1" width="1"></embed> -->
<!-- {
media_icon}<br /> -->
<!-- 
######################################### Start Flash-Mp3-Player ################################################## -->
<div>
<
object type="application/x-shockwave-flash" id="fsmp3playerv15" data="fsmp3playerv15.swf" width="450" height="300" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"  >
	
<
param name="allowScriptAccess" value="sameDomain"/>
	
<
param name="movie" value="fsmp3playerv15.swf" />
	
<
param name="wmode" value="transparent" />
	
<
param name="loop" value="false"/>
	
<
param name="menu" value="false"/>
	
<
param name="quality" value="high"/>
  <
object  type="application/x-shockwave-flash"  data="fsmp3playerv15.swf"   width="450" height="300"  />
	
<
param name="bgcolor" value="#ffffff"/> <!-- backgroundcolor for FF value="#yourColorInHex" // -->
	
<
param name="movie" value="fsmp3playerv15.swf" />
  </
object>
</
object>
  <
noscript>
      
Your browser does not support Flash!
     <
span style="text-align:center;"><a href="http://www.macromedia.com/go/getflash/">Install Flash Now!</a></span>
  </
noscript>
</
div>
<!-- 
######################################### End Flash Mp3 Player ##################################################### -->


viel Spass :)

mfg Andi
« Last Edit: August 20, 2009, 06:23:53 PM by Rembrandt »

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [Mod]Flash Mp3 Player
« Reply #1 on: August 04, 2009, 04:17:30 PM »
... danke Andi ...  :D
... verschoben nach "Mods & Plugins (Releases & Support)" ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod]Flash Mp3 Player
« Reply #2 on: August 04, 2009, 04:42:01 PM »
Thanks Andi for sharing.
There are a few things I must point out at:

1) the mod saves .xml file into root of 4images, which means it will be shared with other visitors and also might conflict if two visitors opened two different .mp3 files.
2) the mod doesn't support search results
3) it might produce invalid .xml if image name contains quotes
4) the playlist will always be sorted by...image_id I guess.
5) if(empty($image_id_sql)) is unnecessary
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Rembrandt

  • Guest
Re: [Mod]Flash Mp3 Player
« Reply #3 on: August 04, 2009, 07:16:27 PM »
Hi!
...
1) the mod saves .xml file into root of 4images, which means it will be shared with other visitors and also might conflict if two visitors opened two different .mp3 files.
2) the mod doesn't support search results
3) it might produce invalid .xml if image name contains quotes
4) the playlist will always be sorted by...image_id I guess.
5) if(empty($image_id_sql)) is unnecessary

Thank you for your feedback
i think I have done all the points listed. *puhhh*

I always thought is simple php   :)

point 1 is not clear to me, I've tested with different user, it works for me.  ...hm?
or maybe you have a better solution? ....I have no idea.

mfg Andi

Offline GaYan

  • Sr. Member
  • ****
  • Posts: 301
  • ♫ | G2 | ♫
    • View Profile
    • Ziramagic
Re: [Mod]Flash Mp3 Player
« Reply #4 on: August 05, 2009, 08:19:42 PM »
yeeeh...i was looking for this  :lol: i think some 1 also did this b4..but he has removed it..thanks man,,,, this is 1 of the best mods we ever expected !  :)
I'm Back :)

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [Mod]Flash Mp3 Player
« Reply #5 on: August 20, 2009, 11:42:08 AM »
... nur als Hinweis ...
... im Media-Template sollten die Hinweiszeilen "## Start / End Flash-Mp3-Player ##" entsprechend für eine html-Datei und nicht wie für eine php-Datei auskommentiert sein, so sind diese Zeilen jeweils über und unter dem Flash-Player zu sehen ... ;)
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline kai

  • Administrator
  • Addicted member
  • *****
  • Posts: 1.421
    • View Profile
    • 4images - Image Gallery Management System
Re: [Mod]Flash Mp3 Player
« Reply #6 on: August 20, 2009, 11:58:32 AM »
Well done! Thank you!
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.805
  • I ♥ 4I
    • View Profile
Re: [Mod]Flash Mp3 Player
« Reply #7 on: August 20, 2009, 02:22:30 PM »
WOW!
Tolle Sache!

Aber den HTML Code würde ich nicht im [php*][*/php] setzen sondern in [code*][*/code]

Wirklich nice!

Habs in meiner Liste aufgenommen!

Rembrandt

  • Guest
Re: [Mod]Flash Mp3 Player
« Reply #8 on: August 20, 2009, 06:23:00 PM »
Hi!
... nur als Hinweis ...
stimmt, auf meiner demoseite sind sie deshalb nicht zu sehn da ich dort den fehler ursprünglich korrigiert habe.

nur aufs forum habe ich vergessen. :)

mfg Andi

ps.: aber anscheinend interressiert das eh niemanden.  :cry:

Offline Kurman

  • Newbie
  • *
  • Posts: 42
    • View Profile
    • www.kurman.ru
Re: [Mod]Flash Mp3 Player
« Reply #9 on: August 21, 2009, 12:07:54 AM »
Viele danke!

Very simple solution!

Has the same problem, as previous Flash Mp3 Player from KW (lightbox edition, via playlist): both stops reading the song in xml playlist if it has any cyrillic charachter in keywords  8O - not in file name or something, but key words. It seems as data to xml being imported from keywords too. It is useless feature, but not knowing how to prevent it, I do not fill in Keywords nothing in cyrillic.  :(

And if I see any cyrillyc in xml content, I remoove it manually, and then player works vell.

For example: some times, when generating xml content, there may randomly appear something in cyrillyc, has been taked from keywords.:
Code: [Select]
<song path="./data/media/11/cevsen015.mp3" bild="./data/thumbnails/11/cevsen015.jpg" artist="IN THIS PLACE SOMETIMES BEYING
 INSERTED KEYWORDS, IF THEY ARE IN CYRILLIC, AND AS A RESULT, PLAYER STOPS READING XML RIGHT HERE" title="cevsen015" />

So, this player should be used outside of lightbox (for them, who use cyrillic at least, by manullly tracking xml contents), but not in lightbox where xml file regenerated every time.  :|

But very good player for them, who do not use non-latin charachters.  :wink:
« Last Edit: August 21, 2009, 12:30:27 AM by Kurman »
4images running as a music portal http://music.kurman.ru/

Rembrandt

  • Guest
Re: [Mod]Flash Mp3 Player
« Reply #10 on: August 21, 2009, 05:33:35 AM »
Hi!
... both stops reading the song in xml playlist if it has any cyrillic charachter in keywords  8O - not in file name or something, but key words. ...

i have cyrillic charachter in keywords it work, or I understand something wrong?

look at my demo site...

mfg Andi

Offline Kurman

  • Newbie
  • *
  • Posts: 42
    • View Profile
    • www.kurman.ru
Re: [Mod]Flash Mp3 Player
« Reply #11 on: August 21, 2009, 02:20:51 PM »
Yes, it works, but randomly, (I did not find reason) while generating xml it inserts in artist name cyrillyc keywords (not from description, but exactly keywords, of the track). (as described in previouse message).

But maybe you are right, and there possibly are some other reasons.. I'll test it a while and return if see any changes. At first time, when I detected it, I manually deleted all cyrillic charachters from xml file and till now have no problem. Maybe generating xml file was interrupted by something else(if it possible).. I do not know.. As I've said, if problem returns, it will be more clear..

In the next days I intend to test it for using as a playlist player in lightbox.
Have you tested  it in that way?

Nevertheless, it is a good job and useful MOD.  :thumbup:
« Last Edit: August 21, 2009, 02:41:36 PM by Kurman »
4images running as a music portal http://music.kurman.ru/

Offline Tino23

  • Full Member
  • ***
  • Posts: 191
    • View Profile
    • LMJ - Motorsport
Re: [Mod]Flash Mp3 Player
« Reply #12 on: September 13, 2009, 02:50:22 PM »
Kann es sein, dass der Player als Postkarte nicht Funktioniert? Bei mir wird dann bloß der Player angezeigt, aber weiter passiert nichts. Sonst läuft aber alles wunderbar!

Rembrandt

  • Guest
Re: [Mod]Flash Mp3 Player
« Reply #13 on: September 13, 2009, 04:05:07 PM »
Hi!
Kann es sein, dass der Player als Postkarte nicht Funktioniert? Bei mir wird dann bloß der Player angezeigt, aber weiter passiert nichts. Sonst läuft aber alles wunderbar!
habe es gerade auf der demoseite probiert, als vorschau funktioniert es einwandfrei.
aber ganz ehrlich, den player als postkarte,... daran habe ich nicht wirklich gedacht.  :P

mfg Andi


Offline Tino23

  • Full Member
  • ***
  • Posts: 191
    • View Profile
    • LMJ - Motorsport
Re: [Mod]Flash Mp3 Player
« Reply #14 on: September 13, 2009, 05:42:13 PM »
 8) nicht so wild. Ich hab den Mod ja schon seit einem Jahr bei mir drin und hab es auch erst heute gemerkt ;-) wollte nur sicher gehen, dass ich nicht damals einen fehler beim einbauen gemacht habe (hatte den Mod noch von KurtW)