'Sera.
Rieccomi con uno dei miei complessi mentali!xD
Vorrei mettere, alla destra del mio menù (in fase di costruzione), i titoli di alcune news, che ruotino.
Insomma un marquee che scorra verso l'altro con dentro le varie news casuali, che cambiano ad ogni aggiornamento pagina.
Ho cercato su internet, ed ho trovato solo una guida per un Hack a Cutenews, il mio gestore di news.
La guida consisteva nel creare un file: show_random.php nella root principale di cutenews (create a file called show_random.php in the CuteNews root folder and put this in it)
con dentro questo code:
Poi la guida diceva di:Codice PHP:<?
// show_random.php
error_reporting (E_ALL ^ E_NOTICE);
$cutepath = __FILE__;
$cutepath = preg_replace( "'\\\show_random\.php'", "", $cutepath);
$cutepath = preg_replace( "'/show_random\.php'", "", $cutepath);
$news = file($cutepath."data/news.txt");
shuffle($news);
$i = 0;
$newsids = array();
foreach ($news as $news_line) {
$news_arr = explode("|", $news_line);
if (isset($category) && !stristr($category, $news_arr[6])) { continue; }
$newsids[$i] = $news_arr[0];
$i++;
}
$randid = mt_rand(0, count($newsids)-1);
$subaction = "showfull";
$id = $newsids[$randid];
include($cutepath."show_news.php");
?>
then include the file as if it were show_news.php like so
questo codice:
Ora non funziona!Codice PHP:<?
$category = "1,2"; // whatever categories you want (or dont set any)
$template = "Headlines"; // whatever template you want (or dont set one)
include ("/cutepath/show_random.php");
?>
MI spiegate l'errore che ho commesso?
IL secondo passaggio non l'ho fatto, perchè credo che bisogni metter quel codice nella pagina dove voglio farlo comaprire, giusto?
Mi aiutate un attimo che non c'ho capito granché?

LinkBack URL
About LinkBacks
