kod sledeci:
Code:
<?php
include('konekcija/konekcija.php');
$tip = 'Vesti';
if(isset($_GET['m']) && !is_numeric($_GET['m'])&&isset($_GET['y']) && !is_numeric($_GET['y']))
die();
$my = "";
$nl = "\r\n";
if(isset($_GET['m'])&&isset($_GET['y'])){
$my=sprintf("AND v.godina='%s'AND v.mesec='%s'",$_GET['y'],$_GET['m']);
}
echo('<?xml version="1.0" encoding="utf-8"?>');
echo('<vesti>');
$upit = sprintf("SELECT v.naslov,v.sadrzaj,v.godina,v.mesec,v.vreme
FROM vesti AS v
WHERE v.tip='%s'%s
ORDER BY v.vreme DESC LIMIT 0,10",$tip,$my);
$query = mysql_query($upit,$konekcija) or die(mysql_error());
while($result = mysql_fetch_assoc($query)) {
echo('
<vest title="'.$result['naslov'].'" links="index.php">'.$result['sadrzaj'].'</vest>
') .$nl;
}
echo('</vesti>');
?>
<?php
include('konekcija/konekcija.php');
$tip = 'Vesti';
if(isset($_GET['m']) && !is_numeric($_GET['m'])&&isset($_GET['y']) && !is_numeric($_GET['y']))
die();
$my = "";
$nl = "\r\n";
if(isset($_GET['m'])&&isset($_GET['y'])){
$my=sprintf("AND v.godina='%s'AND v.mesec='%s'",$_GET['y'],$_GET['m']);
}
echo('<?xml version="1.0" encoding="utf-8"?>');
echo('<vesti>');
$upit = sprintf("SELECT v.naslov,v.sadrzaj,v.godina,v.mesec,v.vreme
FROM vesti AS v
WHERE v.tip='%s'%s
ORDER BY v.vreme DESC LIMIT 0,10",$tip,$my);
$query = mysql_query($upit,$konekcija) or die(mysql_error());
while($result = mysql_fetch_assoc($query)) {
echo('
<vest title="'.$result['naslov'].'" links="index.php">'.$result['sadrzaj'].'</vest>
') .$nl;
}
echo('</vesti>');
?>
i on fino radi... lepo mi IE ovaj fajl prikaze kao obican xml fajl... Ali Flash nece da ga ucita.
Actionscript:
Code:
vesti_xml = new XML();
vesti_xml.ignoreWhite = true;
vesti_xml.load("vesti.php");
vesti_xml.onLoad = function(status) {
if (status) {
obj_xml = this.firstChild.childNodes;
clipGen();
}
};
// funkcija za generisanje
function clipGen() {
for (var i = 0; i < obj_xml.length; i++) {
this.attachMovie("clip", "clip" + i, i);
this["clip" + i]._y = this["clip" + i]._height * i;
this["clip" + i]._x = 0;
this["clip" + i].naslov.text = obj_xml[i].attributes.title;
// za generisanje linka
this["clip" + i].url_button.url = obj_xml[i].attributes.links;
this["clip" + i].url_button.onRelease = function() {
getURL(this.url,"_self");
}
}
}
vesti_xml = new XML();
vesti_xml.ignoreWhite = true;
vesti_xml.load("vesti.php");
vesti_xml.onLoad = function(status) {
if (status) {
obj_xml = this.firstChild.childNodes;
clipGen();
}
};
// funkcija za generisanje
function clipGen() {
for (var i = 0; i < obj_xml.length; i++) {
this.attachMovie("clip", "clip" + i, i);
this["clip" + i]._y = this["clip" + i]._height * i;
this["clip" + i]._x = 0;
this["clip" + i].naslov.text = obj_xml[i].attributes.title;
// za generisanje linka
this["clip" + i].url_button.url = obj_xml[i].attributes.links;
this["clip" + i].url_button.onRelease = function() {
getURL(this.url,"_self");
}
}
}
Gde gresim? Mora da je neka glupost!!!