CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   PHP (http://www.codingforums.com/forumdisplay.php?f=6)
-   -   Need Help With Display (http://www.codingforums.com/showthread.php?t=283358)

Bonzai 12-01-2012 02:48 PM

Need Help With Display
 
hey guys i need help :(


in get this on php web site :

J?nnif?r Lop?z - Papi

but it need's to be:

Jénifèr lopéz - Papi


for test i put é è


here the code from php site:





<?php
// @----------------------------------------------------------------------@
// | PHP ONAIR 1.0 |
// @----------------------------------------------------------------------@
// | Copyright © 2012 Olivier Noël , South Music Luxembourg a.s.b.l. |
// @----------------------------------------------------------------------@
// | Author: Olivier Noël <stilnoct@me.com> |
// @----------------------------------------------------------------------@
//
// ONAIR.php Version 1.0 30/11/2012
// @----------------------------------------------------------------------@
// | READ INSTALLATION INSTRUCTIONS BEFORE |
// | ask it <stilnoct@me.com> |
// @----------------------------------------------------------------------@
function saveChildren($element)
{
global $elements;
foreach($element->children() as $child)
{
$elements[$child->getName()] = $child;
saveChildren($child);
}
}
function getAttribute($element, $attr)
{
foreach ($element->attributes() AS $key => $attribute)
{
if ($key == $attr) return $attribute;
}
}
global $elements;
// @----------------------------------------------------------------------@
// | NOW ON AIR XML phath |
// @----------------------------------------------------------------------@
if (file_exists("onair/NowOnAir.xml"))
{
$xmlstring = utf8_decode(file_get_contents("onair/NowOnAir.xml"));
$xmlstring = str_replace("&", "and", $xmlstring);
$xml = simplexml_load_string($xmlstring);

saveChildren($xml);

foreach ($elements AS $key => $elmnt)
{
switch ($key)
{
case "Song":
$actsongtitle = getAttribute($elmnt, "title");
break;

case "Artist":
$actartistname = getAttribute($elmnt, "name");
break;
}
}
$act_onair = true;
}
if ($act_onair === true)
{
$act_string = $actartistname." - ".$actsongtitle;
if ($songs[0] != $act_string)
{
$txt = $act_string."\n";
{
}
}
}
// @----------------------------------------------------------------------@
// | HERE YOU CAN CHANGE THE TEXT : NOW ON AIR |
// | COLOR STYLE ETC |
// @----------------------------------------------------------------------@
echo "
<html>
<head>
<meta http-equiv='refresh' content='30'>
</head>
<body style='background-color:transparent;';>
<div style='font-size:11; color:#AAAAAA; font-family:Verdana,Arial;'>";
echo "<span style='font-weight:slim; color:#EC7906;'>NOW ON AIR :</span><br>".htmlentities($act_string);
// @----------------------------------------------------------------------@
// | NEXT ON AIR XML phath |
// @----------------------------------------------------------------------@
if (file_exists("onair/AirPlayNext.xml"))
{
$xmlstring = utf8_decode(file_get_contents("onair/AirPlayNext.xml"));
$xmlstring = str_replace("&", "and", $xmlstring);
$xml = simplexml_load_string($xmlstring);

saveChildren($xml);

foreach ($elements AS $key => $elmnt)
{
switch ($key)
{
case "Song":
$actsongtitle = getAttribute($elmnt, "title");
break;

case "Artist":
$actartistname = getAttribute($elmnt, "name");
break;
}
}
$act_onair = true;
}

$t = file_get_contents("onair/last5.txt");
$songs = explode("\n", $t);

if ($act_onair === true)
{
$act_string = $actartistname." - ".$actsongtitle;
if ($songs[0] != $act_string)
{
$txt = $act_string."\n";
// @----------------------------------------------------------------------@
// | LAST PLAYED "for ($i=0; $i<1; $i++) = 1 SONG , 2 = 2 SONGS |
// @----------------------------------------------------------------------@
for ($i=-0; $i<7; $i++)
{
if ($songs[$i] != "") $txt .= $songs[$i]."\n";
}
file_put_contents("onair/last5.txt", $txt);
$t = file_get_contents("onair/last5.txt");
$songs = explode("\n", $t);
}
}

// @----------------------------------------------------------------------@
// | HERE YOU CAN CHANGE THE TEXT : NEXT ON AIR , LAST 6 PLAYED |
// | COLOR STYLE ETC |
// @----------------------------------------------------------------------@

echo "
<html>
<head>
<meta http-equiv='refresh' content='15'>
</head>
<body style='background-color:transparent;';>
<div style='font-size:11; color:#AAAAAA; font-family:Verdana,Arial;'>";
echo "<br><span style='font-weight:slim; color:#EC7906;'>COMING UP :</span><br>".htmlentities($act_string);
echo "<br><br><span style='font-weight:slim; color:#EC7906;'>LAST PLAYED :</span><br>";
$c = count($songs);
for ($i=2; $i<$c; $i++) echo htmlentities($songs[$i])."<br>";
// @----------------------------------------------------------------------@
// | YOU ARE NOT PERMITTED TO REMOVE, CHANGE OR DELETE THE NEXT FILES |
// @----------------------------------------------------------------------@
echo "</div>";
echo "
<div>";
echo "<span style='font-weight:smal; font-size:11; font-family:Verdana,Arial;'color:#EC7906;'></span><br>";
?>

vinyl-junkie 12-01-2012 04:35 PM

Moderator Note: This post was moved to its own thread. I have no idea what an appropriate title should be.

Fou-Lu 12-01-2012 04:37 PM

This appears a duplicate as found here


All times are GMT +1. The time now is 07:43 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.