mp3 erweiterung

Gesperrt
hypekermit
Beiträge: 213
Registriert: Mi 9. Okt 2002, 21:24
Kontaktdaten:

mp3 erweiterung

Beitrag von hypekermit » Di 1. Apr 2003, 17:38

habe eine mp3 erweiterung gebastelt.

nur beim edit modus kommt die fehlermeldung...

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/www/web15/html/conchilli/contenido/inc/con_editcontent.inc.php(123) : eval()'d code on line 21

ich nehme an da stimmt was mit dem modul nicht...

hier das modul:


$MP3 = "CMS_MP3[1]";
$MP3Size = getimagesize($MP3);

echo "<object classid="CLSID:05589FA1-C356-11CE-BF01-00AA0055595A" width="100" height="100">";
echo "<param name="FileName" value="Blub.mp3">";
echo "<param name="type" value="application/x-mplayer2">";
echo "<param name="PlayCount" value="3">";
echo "<param name="Volume" value="1000">";
echo "<param name="ShowControls" value="true">";
echo "<param name="ShowDisplay" value="true">";
echo "<embed src="Blub.mp3" type="application/x-mplayer2"playcount= "3" width="100" height="100">";
echo "</embed>";
echo "</object>";


könnt ihr mal drüberschauen


vielen dank für eure hilfe....

hypekermit
Beiträge: 213
Registriert: Mi 9. Okt 2002, 21:24
Kontaktdaten:

fehler

Beitrag von hypekermit » Di 1. Apr 2003, 17:39

so sieht das modul aus :::

$MP3 = "CMS_MP3[1]";
$MP3Size = getimagesize($MP3);

echo "<object classid="CLSID:05589FA1-C356-11CE-BF01-00AA0055595A" width="100" height="100">";
echo "<param name="FileName" value="CMS_MP3[1]">";
echo "<param name="type" value="application/x-mplayer2">";
echo "<param name="PlayCount" value="3">";
echo "<param name="Volume" value="1000">";
echo "<param name="ShowControls" value="true">";
echo "<param name="ShowDisplay" value="true">";
echo "<embed src="CMS_MP3[1]" type="application/x-mplayer2"playcount= "3" width="100" height="100">";
echo "</embed>";
echo "</object>";

Sven777b
Beiträge: 503
Registriert: Mi 18. Sep 2002, 00:00
Wohnort: Sachsen
Kontaktdaten:

Beitrag von Sven777b » Mi 2. Apr 2003, 13:50

also wenn jetzt dein Code nicht durchs Forum zerhauen wurde (PS: wozu gibt es eigentlich hier oben die Schaltfläche "Code" ?!?) , dann hast du einfach mal eben extrem schusselig programmiert:

echo "<param name="FileName" value="CMS_MP3[1]">";

zähl mal die anführungszeichen :lol:
du beendest das echo bereits nach name= - wenn du Codes mit Anführungszeichen per echo ausgeben willst, musst du entweder
- die weiteren Anführungszeichen escapen

Code: Alles auswählen

echo "<param name=\"FileName\" value=\"CMS_MP3[1]\">"; 
- den Code in einfache Anführungszeichen setzen:

Code: Alles auswählen

echo '<param name="FileName" value="CMS_MP3[1]">'; 
Module zum anschauen:
bei Sven: http://contenido-module.de
bei Pulk : http://spielwiese.pulk.net

Der-Dirigent: http://der-dirigent.de

hypekermit
Beiträge: 213
Registriert: Mi 9. Okt 2002, 21:24
Kontaktdaten:

hallo sven

Beitrag von hypekermit » Sa 5. Apr 2003, 12:15

den fehler habe ich bereits behoben... jetzt kommt diese fehlermeldung:

'http://meine adresse.../contenido/front_single/CMS_MP3[1]' konnte nicht gefunden werden. Überprüfen Sie den Pfad und den Dateinamen. (Fehler=80070002)

Datei kann nicht geöffnet werden. Überprüfen Sie den Pfad und den Dateinamen und wiederholen Sie den Vorgang. (Fehler=80070002)

er zeigt den player spielt aber nix weil er nix findet....


-------------------------------------

mein modul sieht wie folgt aus...

Code: Alles auswählen

$MP3 = "CMS_MP3[1]";
$MP3Size = getimagesize($MP3);

      echo "<object classid=\"CLSID:05589FA1-C356-11CE-BF01-00AA0055595A\" width=\"200\" height=\"200\">";
      echo "<param name=\"FileName\" value=\"CMS_MP3[1]\">";
      echo "<param name=\"type\" value=\"application/x-mplayer2\">";
      echo "<param name=\"PlayCount\" value=\"1\">";
      echo "<param name=\"Volume\" value=\"1000\">";
      echo "<param name=\"ShowControls\" value=\"true\">";
      echo "<param name=\"ShowDisplay\" value=\"true\">";
      echo "<embed src=\"CMS_MP3[1]\" type=\"application/x-mplayer2\"playcount= \"1\" width=\"100\" height=\"100\">";
      echo "</embed>"; 
      echo "</object>";
-------------------------------------


habe auch bei der config das mp3 beim client eingefügt

-------------------------------------

habe den sql dump eingespielt (habe den swf umgeschrieben)

sieht so aus:

Code: Alles auswählen

INSERT INTO con_type VALUES (15, 'CMS_MP3', '$tmp = $a_content["CMS_MP3"][$val];\r\n$sql = "SELECT * FROM $cfgTab_upl WHERE idclient=\'$client\' AND idupl=\'$tmp\'";\r\n$db2 = new DB_Contenido;\r\n$db2->query($sql);\r\nif ($db2->next_record()) {$tmp = $cfgClient[$client]["frontendpath"][$db2->f("dirname")].$db2->f("filename");}\r\n$tmp = htmlspecialchars($tmp);\r\n$tmp = str_replace("\'", "\\\'", $tmp);', 'MP3', 0, '', '2002-05-13 19:04:21', '2002-05-13 19:04:21');
INSERT INTO con_type VALUES (16, 'CMS_MP3DESCR', '$tmp = $a_content["CMS_MP3DESCR"][$val];\r\n$tmp = htmlspecialchars($tmp);\r\n$tmp = str_replace("\'", "\\\'", $tmp);\r\nif ($edit) {$editbutton = "<A HREF=\\"".$sess->url("front_content_edit.inc.php?action=10&idcat=$idcat&idside=$idside&idsidelang=$idsidelang&type=CMS_MP3&typenr=$val&lang=$lang")."\\"><IMG SRC=\\"".$cfgPathFrontendImg."but_editmp3.gif\\" border=0></A>";\r\n$editbutton = AddSlashes(AddSlashes($editbutton));\r\n$tmp = $tmp.$editbutton;}', 'Beschreibung', 0, '', '2002-05-13 19:04:28', '2002-05-13 19:04:28');

-------------------------------------

habe das template: tplInputField_CMS_MP3.inc in den ordner tpl eingespielt:

Code: Alles auswählen


<?
if ($submit == "editcontent") {
	consaveContentEntry($idsidelang, "CMS_MP3", $typenr, $CMS_MP3);
	consaveContentEntry($idsidelang, "CMS_MP3DESCR", $typenr, $CMS_MP3DESCR);
	conGenerateCodeForSideInAllCategories($idside);
	Header("Location:".$sess->url("front_content_edit.inc.php?area=$tmp_area&idside=$idside&idcat=$idcat&lang=$lang")."");
}
?>
<html>
<head>
<title>contenido</title>
<link rel="stylesheet" type="text/css" href="<? print $ContenidoPath ?>contenido.css">
</HEAD>
<BODY MARGINHEIGHT=0 MARGINWIDTH=0 LEFTMARGIN=0 TOPMARGIN=0>
<table width="100%"  border=0 cellspacing="0" cellpadding="0" bgcolor=<? echo "$bg"; ?> >
  <tr>
    <td width="10" rowspan="4"><img src="<? print $ContenidoPath.$cfgPathImg ?>space.gif" width="10" height="10"></td>
    <td width="100%"><img src="<? print $ContenidoPath.$cfgPathImg ?>space.gif" width="10" height="10"></td>
    <td width="10" rowspan="4"><img src="<? print $ContenidoPath.$cfgPathImg ?>space.gif" width="10" height="10"></td>
  </tr>
  <tr>
    <td>

<?

	$sql = "SELECT * FROM $cfgTab_content AS A, $cfgTab_side_lang AS B, $cfgTab_type AS C WHERE A.idtype=C.idtype AND A.idsidelang=B.idsidelang AND B.idsidelang='$idsidelang'";
	$db->query($sql);
	while ($db->next_record()) {
		$a_content[$db->f("type")][$db->f("typeid")] = $db->f("value");
                 $a_description[$db->f("type")][$db->f("typeid")] = $db->f("description");
	}
	echo "  <FORM name=\"editcontent\" method=\"post\" action=\"".$sess->url("front_content_edit.inc.php")."\">";
	$sess->hidden_session();
	echo "  <INPUT type=hidden name=lang value=\"$lang\">";
	echo "  <INPUT type=hidden name=submit value=\"editcontent\">";
	echo "  <INPUT type=hidden name=typenr value=\"$typenr\">";
	echo "  <INPUT type=hidden name=idside value=\"$idside\">";
	echo "  <INPUT type=hidden name=idcat value=\"$idcat\">";
	echo "  <INPUT type=hidden name=idsidelang value=\"$idsidelang\">";
	echo "  <INPUT type=hidden name=action value=\"10\">";
	echo "  <INPUT type=hidden name=type value=\"$type\">";

	echo "  <TABLE cellpadding=$cellpadding cellspacing=$cellpadding border=0>";
	echo "  <TR><TD valign=\"top\" class=head nowrap>&nbsp;".$typenr.".&nbsp;".$a_description["CMS_MP3"][$typenr].":&nbsp;</TD><TD class=content>";
		echo "<SELECT name=CMS_MP3 SIZE=1>";
		if ($a_content["CMS_MP3"][$typenr] != "0") {
	        	echo "<option value=0>".$lngForm["nothing"]."</option>";
	        } else {
        		echo "<option value=0 selected>".$lngForm["nothing"]."</option>";
		}
		$sql = "SELECT * FROM $cfgTab_upl WHERE idclient='$client' AND filetype='mp3' ORDER BY filename";
        	$db->query($sql);
        	while ($db->next_record()) {
	               	if ($db->f("idupl") != $a_content["CMS_MP3"][$typenr]) {
	                	echo "<option value=\"".$db->f("idupl")."\">".$db->f("dirname")."/".$db->f("filename")." [".$db->f("description")."]</option>";
                	} else {
	                        echo "<option value=\"".$db->f("idupl")."\" selected>".$db->f("dirname")."/".$db->f("filename")." [".$db->f("description")."]</option>";
                	}
	        }
		echo "</SELECT>";
	echo "  </TD></TR>";
	echo "  <TR><TD valign=top class=head nowrap>&nbsp;".$a_description["CMS_MP3DESCR"][$typenr].":&nbsp;</TD><TD class=content>";
	echo "  <TEXTAREA name=CMS_MP3DESCR ROWS=3 COLS=30>".$a_content["CMS_MP3DESCR"][$typenr]."</TEXTAREA>";
	echo "  </TD></TR>";
	$tmp_area = "con_editcontent";
	echo "  <TR valign=top><TD colspan=2><br>
      		<a href=".$sess->url("front_content_edit.inc.php?area=$tmp_area&idside=$idside&idcat=$idcat&lang=$lang")."><img src=\"".$ContenidoPath.$cfgPathImg."but_cancel.gif\" border=0></a>
      		<INPUT type=image name=submit value=submit src=\"".$ContenidoPath.$cfgPathImg."but_ok.gif\" border=0>
      		</TD></TR>";

	echo "  </TABLE>
      		</FORM>";

?>
</td></tr></table>
</body>
</HTML>
-------------------------------------

hast du eine idee warum er das mp3 nicht findet???

Sven777b
Beiträge: 503
Registriert: Mi 18. Sep 2002, 00:00
Wohnort: Sachsen
Kontaktdaten:

Beitrag von Sven777b » Sa 5. Apr 2003, 12:51

habe das template: tplInputField_CMS_MP3.inc in den ordner tpl eingespielt:
hast du es wirklich nur tplInputField_CMS_MP3.inc genannt ?
es muss nämlich tplInputField_CMS_MP3.inc.php heissen
Module zum anschauen:
bei Sven: http://contenido-module.de
bei Pulk : http://spielwiese.pulk.net

Der-Dirigent: http://der-dirigent.de

hypekermit
Beiträge: 213
Registriert: Mi 9. Okt 2002, 21:24
Kontaktdaten:

Beitrag von hypekermit » Mo 7. Apr 2003, 10:54

habs schon richtig war ein fehler von mir

es sieht wirklich so aus:

tplInputField_CMS_MP3.inc.php

was könnte der fehler sein ?

andreasL
Beiträge: 5
Registriert: Mo 23. Jun 2003, 15:35
Kontaktdaten:

Beitrag von andreasL » Do 26. Jun 2003, 19:50

Hallo Hyperkermit,

auf die Gefahr hin, dass die Antwort für Dich zu spät kommt und Du mittlerweile verzweifelt bist :wink: - ich arbeite erst seit kurzem mit contenido und auch nur ein bisschen, bin daher erst seit paar Tagen hier im Forum...

...hier die Lösung Deines Problems:

Ich hab so ziemlich dasselbe versucht und hab mir deshalb mal die Sourcen von Contenido durchgeschaut.

In der Datei contenido/inc/con_editcontent.inc.php befindet sich folgendes Statement:

Code: Alles auswählen

$success = array_walk($a_[strtolower($db->f("type"))],'extractNumber');
Die Funktion extrahiert alle Ziffern aus dem "Type[Nummer]", bei Dir also aus "CMS_MP3[1]". Da wird natürlich bei auch das '3' gefunden.
Das ist nun aber für die Ausführung des Codes dieses Types sehr von Bedeutung.

Also, benenn Deine beiden Types in der DB-Tabelle "con_type" einfach um in z.B. "CMS_AUDIO" und "CMS_AUDIODESCR" und referenziere sie im Output Deines Moduls entsprechend.

Viele Grüße,
Andreas

hypekermit
Beiträge: 213
Registriert: Mi 9. Okt 2002, 21:24
Kontaktdaten:

hallo andreas

Beitrag von hypekermit » Do 3. Jul 2003, 09:16

zunächst danke für deine antwort...

habe alles geändert bekomme jetzt folgende fehlermeldung...

Code: Alles auswählen

Warning: getimagesize: Unable to open '' for reading. in /home/www/web15/html/contenido/inc/con_editcontent.inc.php(123) : eval()'d code on line 52
mein Modul sieht wie folgt aus:

input: output:

Code: Alles auswählen

$AUDIO = "CMS_AUDIO[1]";
$AUDIOSize = getimagesize($AUDIO);

      echo "<object classid=\"CLSID:05589FA1-C356-11CE-BF01-00AA0055595A\" width=\"200\" height=\"200\">";
      echo "<param name=\"FileName\" value=\"CMS_AUDIO[1]\">";
      echo "<param name=\"type\" value=\"application/x-mplayer2\">";
      echo "<param name=\"PlayCount\" value=\"1\">";
      echo "<param name=\"Volume\" value=\"1000\">";
      echo "<param name=\"ShowControls\" value=\"true\">";
      echo "<param name=\"ShowDisplay\" value=\"true\">";
      echo "<embed src=\"CMS_AUDIO[1]\" type=\"application/x-mplayer2\"playcount= \"1\" width=\"100\" height=\"100\">";
      echo "</embed>"; 
      echo "</object>";
mein geänderte Datei tplInputField_CMS_AUDIO.inc.php
hat folgenden code

Code: Alles auswählen

<?
if ($submit == "editcontent") {
	consaveContentEntry($idsidelang, "CMS_AUDIO", $typenr, $CMS_MP3);
	consaveContentEntry($idsidelang, "CMS_AUDIODESCR", $typenr, $CMS_MP3DESCR);
	conGenerateCodeForSideInAllCategories($idside);
	Header("Location:".$sess->url("front_content_edit.inc.php?area=$tmp_area&idside=$idside&idcat=$idcat&lang=$lang")."");
}
?>
<html>
<head>
<title>contenido</title>
<link rel="stylesheet" type="text/css" href="<? print $ContenidoPath ?>contenido.css">
</HEAD>
<BODY MARGINHEIGHT=0 MARGINWIDTH=0 LEFTMARGIN=0 TOPMARGIN=0>
<table width="100%"  border=0 cellspacing="0" cellpadding="0" bgcolor=<? echo "$bg"; ?> >
  <tr>
    <td width="10" rowspan="4"><img src="<? print $ContenidoPath.$cfgPathImg ?>space.gif" width="10" height="10"></td>
    <td width="100%"><img src="<? print $ContenidoPath.$cfgPathImg ?>space.gif" width="10" height="10"></td>
    <td width="10" rowspan="4"><img src="<? print $ContenidoPath.$cfgPathImg ?>space.gif" width="10" height="10"></td>
  </tr>
  <tr>
    <td>

<?

	$sql = "SELECT * FROM $cfgTab_content AS A, $cfgTab_side_lang AS B, $cfgTab_type AS C WHERE A.idtype=C.idtype AND A.idsidelang=B.idsidelang AND B.idsidelang='$idsidelang'";
	$db->query($sql);
	while ($db->next_record()) {
		$a_content[$db->f("type")][$db->f("typeid")] = $db->f("value");
                 $a_description[$db->f("type")][$db->f("typeid")] = $db->f("description");
	}
	echo "  <FORM name=\"editcontent\" method=\"post\" action=\"".$sess->url("front_content_edit.inc.php")."\">";
	$sess->hidden_session();
	echo "  <INPUT type=hidden name=lang value=\"$lang\">";
	echo "  <INPUT type=hidden name=submit value=\"editcontent\">";
	echo "  <INPUT type=hidden name=typenr value=\"$typenr\">";
	echo "  <INPUT type=hidden name=idside value=\"$idside\">";
	echo "  <INPUT type=hidden name=idcat value=\"$idcat\">";
	echo "  <INPUT type=hidden name=idsidelang value=\"$idsidelang\">";
	echo "  <INPUT type=hidden name=action value=\"10\">";
	echo "  <INPUT type=hidden name=type value=\"$type\">";

	echo "  <TABLE cellpadding=$cellpadding cellspacing=$cellpadding border=0>";
	echo "  <TR><TD valign=\"top\" class=head nowrap>&nbsp;".$typenr.".&nbsp;".$a_description["CMS_AUDIO"][$typenr].":&nbsp;</TD><TD class=content>";
		echo "<SELECT name=CMS_AUDIO SIZE=1>";
		if ($a_content["CMS_AUDIO"][$typenr] != "0") {
	        	echo "<option value=0>".$lngForm["nothing"]."</option>";
	        } else {
        		echo "<option value=0 selected>".$lngForm["nothing"]."</option>";
		}
		$sql = "SELECT * FROM $cfgTab_upl WHERE idclient='$client' AND filetype='mp3' ORDER BY filename";
        	$db->query($sql);
        	while ($db->next_record()) {
	               	if ($db->f("idupl") != $a_content["CMS_AUDIO"][$typenr]) {
	                	echo "<option value=\"".$db->f("idupl")."\">".$db->f("dirname")."/".$db->f("filename")." [".$db->f("description")."]</option>";
                	} else {
	                        echo "<option value=\"".$db->f("idupl")."\" selected>".$db->f("dirname")."/".$db->f("filename")." [".$db->f("description")."]</option>";
                	}
	        }
		echo "</SELECT>";
	echo "  </TD></TR>";
	echo "  <TR><TD valign=top class=head nowrap>&nbsp;".$a_description["CMS_AUDIODESCR"][$typenr].":&nbsp;</TD><TD class=content>";
	echo "  <TEXTAREA name=CMS_AUDIODESCR ROWS=3 COLS=30>".$a_content["CMS_AUDIODESCR"][$typenr]."</TEXTAREA>";
	echo "  </TD></TR>";
	$tmp_area = "con_editcontent";
	echo "  <TR valign=top><TD colspan=2><br>
      		<a href=".$sess->url("front_content_edit.inc.php?area=$tmp_area&idside=$idside&idcat=$idcat&lang=$lang")."><img src=\"".$ContenidoPath.$cfgPathImg."but_cancel.gif\" border=0></a>
      		<INPUT type=image name=submit value=submit src=\"".$ContenidoPath.$cfgPathImg."but_ok.gif\" border=0>
      		</TD></TR>";

	echo "  </TABLE>
      		</FORM>";

?>
</td></tr></table>
</body>
</HTML>
zu guter letzt habe ich die config angepasst:

Code: Alles auswählen

//**************** CLIENT 1 *****************************

$cfgClient[1]["path"]["frontend"]           = "/home/www/web15/html/front_frame/";          // for Contenido PHP
$cfgClient[1]["path"]["htmlpath"]           = "front_frame/";     // for Contenido-HTML
$cfgClient[1]["htmlpath"]["frontend"]       = "../".$cfgClient[1]["path"]["htmlpath"];// for linking to files in frontend from contenido (main -> dis_editcontent)

//**** just comment out one of those blocks to not display this folder for upload ************
$cfgClient[1]["path"]["img"]                = $cfgClient[1]["path"]["frontend"]."img/";
$cfgClient[1]["htmlpath"]["img"]            = $cfgClient[1]["htmlpath"]["frontend"]."img/";
$cfgClient[1]["frontendpath"]["img"]        = "img/";
$cfgClient[1]["actionname"]["img"]          = "Bilder";
$cfgClient[1]["text"]["img"]                = "Laden Sie ein Bild auf den Webserver";
$cfgClient[1]["filetype"]["img"]            = "img";

$cfgClient[1]["path"]["pdf"]                = $cfgClient[1]["path"]["frontend"]."pdf/";
$cfgClient[1]["htmlpath"]["pdf" ]           = $cfgClient[1]["htmlpath"]["frontend"]."pdf/";
$cfgClient[1]["frontendpath"]["pdf"]        = "pdf/";
$cfgClient[1]["actionname"]["pdf"]          = "PDF";
$cfgClient[1]["text"]["pdf"]                = "Laden Sie ein PDF-Dokument auf den Webserver";
$cfgClient[1]["filetype"]["pdf"]            = "pdf";

$cfgClient[1]["path"]["mp3"]                = $cfgClient[1]["path"]["frontend"]."mp3/";
$cfgClient[1]["htmlpath"]["mp3" ]           = $cfgClient[1]["htmlpath"]["frontend"]."mp3/";
$cfgClient[1]["frontendpath"]["mp3"]        = "mp3/";
$cfgClient[1]["actionname"]["mp3"]          = "AUDIO";
$cfgClient[1]["text"]["mp3"]                = "Laden Sie ein AUDIO-Sound auf den Webserver";
$cfgClient[1]["filetype"]["mp3"]            = "mp3";

hast du eine idee ????

danke für deine hilfe

Gesperrt