Include mp3 player u wordpress

Želio bi u wordpress temu implementirati jedan mp3 player.
Player se sastoji od par datoteka:
[list]
[:28e7oq1j]xml (postavke za vizualno oblikovanje playera)[/:m:28e7oq1j]
[:28e7oq1j]flash player [/:m:28e7oq1j]
[:28e7oq1j]js (javascript)[/:m:28e7oq1j]
[:28e7oq1j]php[/:m:28e7oq1j]
[:28e7oq1j]mp3.html[/:m:28e7oq1j][/list:u:28e7oq1j]

pomoću xamppa pozovem mp3.html…i sve radi…

sad sam promijenio taj mp3.html u mp3.php i includao na željeno mjesto u index.php od wordpressa…
stranica je učitana na željeno mjesto…no…ispisana je poruka…koja je u mp3.php upisana kada posjetitelj nema na računalo instaliran flash player…“It looks like you don’t have flash player installed. Click here to go to Macromedia download page.”…na računalu je instaliran novi flash player…no nakon ponovnog pokretanja firefoxa pojavljuje se ista poruka…što još treba učiniti da mp3 player proradi?..jeli to izvedivo?..

Zasto ne vratis u .html?

Mislim da u index.php svakako moraš pozvati flash ako nešzo želiš pokrenuti. O kojem se playeru radi? Prvo to trebaš reći. Mislim ipak da si u startu fulao.

mrga_cro…isto je kad je i html…

renato100
ovo bi htio ugraditi
http://www.flashmp3player.org/

Macromedia flash player 8
Ako se skine s neta…

http://www.flashmp3player.org/
…majstor brzo može znati da li je to izvedivo…
Može mala pomoć?

U koji index.php si ti to pkušao ugurati? Od wp ili teme?

index teme…

index je rasjeckan…kontam da sve mora biti učitano…
samo…kamo…java script sam zaljepio u header…pod head…
kamo da ovo zaljepim?

<!-- Div that contains player. -->
<div id="player">
<h1>No flash player!</h1>
<p>It looks like you don't have flash player installed. <a href="http://www.macromedia.com/go/getflashplayer" >Click here</a> to go to Macromedia download page.</p>
</div>

<!-- Script that embeds player. -->
<script language="javascript" type="text/javascript">
var so = new SWFObject("flashmp3player.swf", "player", "319", "87", "9"); // Location of swf file. You can change player width and height here (using pixels or percents).
so.addParam("quality", "high");
so.addVariable("content_path","mp3"); // Location of a folder with mp3 files (relative to php script).
so.addVariable("color_path","default.xml"); // Location of xml file with color settings.
so.addVariable("script_path","flashmp3player.php"); // Location of php script.
so.write("player");
</script>

taj dio je bio u html…u body djelu…ako ga zaljepi u sidebar…javlja mi da nije player instaliran…kao što sam rekao na početku…

To ti je zato sto u indexu ti ajmo reci radis kostur stranice, ti si stavio u sidebar dio, no jesi li u sidebar.php isto stavio player.

Html koji radi je strukturiran ovako:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
Developed by Reality Software | www.realitysoftware.ca
Released by Flash MP3 Player | www.flashmp3player.org
Note: This is a free application distributed under the Creative Commons Attribution 3.0 license,
which means you can use it in any way you want provided you keep our links intact.
Don't want our links in the script? You can support this project by purchasing a paid
version: www.flashmp3player.org/buy.html
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Flash MP3 Player</title>

<!-- Location of javascript. -->
<script language="javascript" type="text/javascript" src="swfobject.js" ></script>

</head>

<body>

<!-- Div that contains player. -->
<div id="player">
<h1>No flash player!</h1>
<p>It looks like you don't have flash player installed. <a href="http://www.macromedia.com/go/getflashplayer" >Click here</a> to go to Macromedia download page.</p>
</div>

<!-- Script that embeds player. -->
<script language="javascript" type="text/javascript">
var so = new SWFObject("flashmp3player.swf", "player", "319", "87", "9"); // Location of swf file. You can change player width and height here (using pixels or percents).
so.addParam("quality", "high");
so.addVariable("content_path","mp3"); // Location of a folder with mp3 files (relative to php script).
so.addVariable("color_path","default.xml"); // Location of xml file with color settings.
so.addVariable("script_path","flashmp3player.php"); // Location of php script.
so.write("player");
</script>




</body>
</html>

dakle, u sebe poziva sve kaj je potrebno…

u teminu datoteku…header.php…unutar tagova head…
sam zaljepio ovaj kod:

<!-- Location of javascript. -->
<script language="javascript" type="text/javascript" src="swfobject.js" ></script>

kod je iz flashmp3player.html…

u teminu datoteku…sidebar.php…na željeno mjesto…sam zaljepio ovaj kod:

<?php include('flashmp3player.html'); ?>

dakle, kad se otvara index…
header poziva javascript…swfobject.js…
a sidebar ostatak koda…tj…čitavu html stranicu…
no…tada javlja da nema flash playera…zašto?..
u čemu sam fulao?

[quote=“blum”]Html koji radi je strukturiran ovako:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
Developed by Reality Software | www.realitysoftware.ca
Released by Flash MP3 Player | www.flashmp3player.org
Note: This is a free application distributed under the Creative Commons Attribution 3.0 license,
which means you can use it in any way you want provided you keep our links intact.
Don't want our links in the script? You can support this project by purchasing a paid
version: www.flashmp3player.org/buy.html
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Flash MP3 Player</title>

<!-- Location of javascript. -->
<script language="javascript" type="text/javascript" src="swfobject.js" ></script>

</head>

<body>

<!-- Div that contains player. -->
<div id="player">
<h1>No flash player!</h1>
<p>It looks like you don't have flash player installed. <a href="http://www.macromedia.com/go/getflashplayer" >Click here</a> to go to Macromedia download page.</p>
</div>

<!-- Script that embeds player. -->
<script language="javascript" type="text/javascript">
var so = new SWFObject("flashmp3player.swf", "player", "319", "87", "9"); // Location of swf file. You can change player width and height here (using pixels or percents).
so.addParam("quality", "high");
so.addVariable("content_path","mp3"); // Location of a folder with mp3 files (relative to php script).
so.addVariable("color_path","default.xml"); // Location of xml file with color settings.
so.addVariable("script_path","flashmp3player.php"); // Location of php script.
so.write("player");
</script>




</body>
</html>

dakle, u sebe poziva sve kaj je potrebno…

u teminu datoteku…header.php…unutar tagova head…
sam zaljepio ovaj kod:

<!-- Location of javascript. -->
<script language="javascript" type="text/javascript" src="swfobject.js" ></script>

kod je iz flashmp3player.html…

u teminu datoteku…sidebar.php…na željeno mjesto…sam zaljepio ovaj kod:

<?php include('flashmp3player.html'); ?>

dakle, kad se otvara index…
header poziva javascript…swfobject.js…
a sidebar ostatak koda…tj…čitavu html stranicu…
no…tada javlja da nema flash playera…zašto?..
u čemu sam fulao?[/quote]

Prvo mislim da imaš problema s putanjama do datoteka, drugo ne znam zašto includaš cijelu datoteku kad jedino što ti treba je ovaj dio
[HTML]

No flash player!

It looks like you don't have flash player installed. Click here to go to Macromedia download page.

[/HTML]

ali prije svega provjeri putanje.

Najbolje instaliraj si firebug dodatak za Firefox i kad to instaliraš pokreni firefox, prikaži si firebug od na karticu Net i tamo pogledaj što se učitava, ono što ti bude crveno znači da nije učitano i da ti je putanja kriva.

Napravi to pa javi što se događa.

CreatifCode
hvala za karticu Net…korisna informacija…

da…dobro kažeš…znam da čitavu html nebi trebao učitavati…
tek nekih 3 tjedna u slobodno vrijeme istražujem wordpress…tak da mi je to bilo najjednostavnije…
u fazi sam dizajna…a dopao mi se player…pa sam na brzaka htio viditi dal ga mogu implementirati i koristiti u fazi dizajna…

kontao sam da bi moglo biti problema sa putanjama…inače…sve datoteke o kojima je riječ…od playera…nalaze se u istom folder gdje index.php i “druge.php” od teme
pogledao sam pomoću firebuga…
javascript…swfobject.php…se ne učitava…a njega sam stavio u header.php…unutar head…

koja bi onda bila ispravna putanja?..kak dalje?

[quote=“blum”]CreatifCode
hvala za karticu Net…korisna informacija…

da…dobro kažeš…znam da čitavu html nebi trebao učitavati…
tek nekih 3 tjedna u slobodno vrijeme istražujem wordpress…tak da mi je to bilo najjednostavnije…
u fazi sam dizajna…a dopao mi se player…pa sam na brzaka htio viditi dal ga mogu implementirati i koristiti u fazi dizajna…

kontao sam da bi moglo biti problema sa putanjama…inače…sve datoteke o kojima je riječ…od playera…nalaze se u istom folder gdje index.php i “druge.php” od teme
pogledao sam pomoću firebuga…
javascript…swfobject.php…se ne učitava…a njega sam stavio u header.php…unutar head…

koja bi onda bila ispravna putanja?..kak dalje?[/quote]

mislim da bi ti ispravna putanja do swfobject.php trebala biti

http://www.domena.com/wp-content/themes/tvoja-tem/swfobject.php

s tim da za ovaj prvi dio imaš funkciju mislim da je bloginfo(‘template_url’);

http://codex.wordpress.org/Function_Reference/

probaj pa javi.

Inače, uvijek ti je najbolje raditi include sa cijelom putanjom do datoteke. Inače se zna dogoditi da kad s jednog servera npr. win seliš na drugi npr. linux imaš velikih problema, ja sam čak jednom imao takav problem kad sam seli s lokalnog Ubuntu na live CentOS server. A zna isto tako doći od drugih problema kao što je iščitavanje relativne, absolutne putanje, iščitavanja direktorija itd.

ova opcija…Net…u firebugu je super…
CreatifCode…hvala još jednom…

Uspio sam učitati player…na način…
u header.phphead dio…sam zaljepio…

<!-- Location of javascript. -->
<script language="javascript" type="text/javascript" src="http://www.mojadomena.com/wp-content/themes/mojatema/swfobject.js" ></script>

također…u sidebar.php…na željeno mjesto sam zaljepio…

<?php include('flashmp3player.html'); ?>

stime da sam u flashmp3player.html
ovom djelu…

<!-- Div that contains player. -->
<div id="player">
<h1>No flash player!</h1>
<p>It looks like you don't have flash player installed. <a href="http://www.macromedia.com/go/getflashplayer" >Click here</a> to go to Macromedia download page.</p>
</div>

<!-- Script that embeds player. -->
<script language="javascript" type="text/javascript">
var so = new SWFObject("http://www.mojadomena.com/wp-content/themes/mojatema/flashmp3player.swf", "player", "319", "87", "9"); // Location of swf file. You can change player width and height here (using pixels or percents).
so.addParam("quality", "high");
so.addVariable("content_path","mp3"); // Location of a folder with mp3 files (relative to php script).
so.addVariable("color_path","http://www.mojadomena.com/wp-content/themes/mojatema/default.xml"); // Location of xml file with color settings.
so.addVariable("script_path","http://www.mojadomena.com/wp-content/themes/mojatema/flashmp3player.php"); // Location of php script.
so.write("player");
</script>

promijenio putanje…vidi se…
putanja za mp3 folder mora ostati relativna…i stvar radi…:slight_smile:

također…malo sam eksperementirao…
ako se u header.phphead djelu…make

<!-- Location of javascript. -->
<script language="javascript" type="text/javascript" src="http://www.ljubavnapoezija.com/wp-content/themes/twentyten/swfobject.js" ></script>

stvari isto radi…jer je učitana čitava stranica…samo pjesma ima kaženje od 2-3 sec…nije baš zgodno…

ista stvar je i kad se isti dio koda makne iz flashmp3player.html…koja se čitava učitava…
na ovaj način se datoteka swfobject.js…dva put učitava…ali…lijepo radi…

ovo još nisam pogledao…

budući sam novi u wordpressu…i malo znam o kodu…
sad me još interesira…da očistim kod…
učitavam čitavu stranicu…a treba mi samo gore ispisani dio…
kako to izvesti?..koji kod ispisati u sidebar.php da stvari lijepo radi?

sad sam u sidebar zaljepio…

<?php include('flashmp3player.html'); ?>

a…pilim…kontam kak pojednostaviti kod…

CreatifCode…hvala na pomoći!..:slight_smile:

[quote=“blum”]a…pilim…kontam kak pojednostaviti kod…

CreatifCode…hvala na pomoći!..:)[/quote]

No problemo.


Copyright © 2020 WM Forum - AboutContact - Sponsored by: Mydataknox & Webmaster.Ninja