session_start();
include_once("include/config.inc.php");
include_once("include/db.inc.php");
$db->connetti();
$result = $db->esegui("SELECT titolo, id, date_format(data, '%d') as giorno,
date_format(data, '%m') as mese, date_format(data, '%y') as anno,
date_format(data, '%H') as ora, date_format(data, '%i') as minuti,
date_format(data, '%s') as secondi, contenuto, autore, vista FROM ".$_CONFIG['db_news']." WHERE id='".$_GET['id']."'");
$notizia = $db->FetchArray($result);
?>
";
echo "";
echo "";
echo "";
echo " ";
echo "";
echo " | ";
echo " ";
$res = $db->esegui("SELECT * FROM ".$_CONFIG['table_banner']." WHERE id='2'");
$sponsor = $db->FetchArray($res);
echo $sponsor['codice'];
echo " | ";
echo " ";
echo " ";
echo " |
";
if ($_POST['commenta'])
{
if($_POST['validator'] != $_SESSION['rand_code'])
{
echo "";
echo " Commento non inviato, inserire correttamente il codice visualizzato
| ";
echo "
";
}
else
{
$db->esegui("INSERT INTO commenti SET autore='".$_POST['autore']."', testo='".$_POST['testo']."', mail='".$_POST['mail']."', news_id='".$_GET['id']."', app='0', ip='".$_SERVER['REMOTE_ADDR']."'" );
echo "";
echo " Commento salvato! Deve essere approvato dagli amministratori!
| ";
echo "
";
$msg = "Postato un commento alla notizia https://www.doremifasol.org/notizia.php?id=".$_GET['id']."";
mail("clabber4864@yahoo.it", "Commento a una notizia", $msg);
mail("sabrina.panfili@yahoo.it", "Commento a una notizia", $msg);
session_destroy();
}
//mail("spyre@spyre.it", "commento a una notizia", $msg);
}
$res = $db->esegui("SELECT * FROM ".$_CONFIG['table_utenti']." WHERE id='".$notizia['autore']."'");
$autore = $db->FetchArray($res);
echo "";
echo " ".$notizia['titolo']."";
?>
echo "
Notizia inserita da: ".$autore['nome']." ".$autore['cognome']."";
echo " in data {$notizia['giorno']}/{$notizia['mese']}/{$notizia['anno']} alle ore {$notizia['ora']}:{$notizia['minuti']}";
?>
Condividi
echo " vista ".$notizia['vista']." volte ";
echo "
".$notizia['contenuto']." ";
echo " | ";
echo " ";
?>
/*
Please keep the following lines if you will use this script. Thanks!
---------------------------------------------------------------------------
CALENDAR SCRIPT
Developed by : Steven Rebello (stevenrebello@indiatimes.com)
Developed on : 15 September 2001
Description : Prints a calendar for specified month and year in HTML
---------------------------------------------------------------------------
To use this calendar script, just add the following function
print_calendar($mon,$year);
into your code and
place the function call print_calendar($month,$year) where you want the calendar to be printed.
The function get_month_as_array
$month and $year are integers.
For eg. the following will print calendar for December 2001.
print_calendar(12,2001);
You can tweak the table properties as you like.
I did not want to complicate the function call with table property parameters like bordercolor etc..
*/
//----------------- This function is to do the HTML header chore---------------------
function print_HTML_header()
{
echo "\n\n".
"Calendar\n\n\n\n\n";
}
//----------------- This function is to do the HTML footer chore---------------------
function print_HTML_footer()
{
echo "";
}
//----------------- This function prints calendar---------------------
function print_calendar($mon,$year)
{
global $dates, $first_day, $start_day;
$first_day = mktime(0,0,0,$mon,1,$year);
$start_day = date("w",$first_day);
if (date("w",$first_day) == 0)
$start_day = 7;
else
$start_day = date("w",$first_day);
$res = getdate($first_day);
$month_name = $res["month"];
$no_days_in_month = date("t",$first_day);
//If month's first day does not start with first Sunday, fill table cell with a space
for ($i = 1; $i <= $start_day;$i++)
$dates[1][$i] = " ";
$row = 1;
$col = $start_day;
$num = 1;
while($num<=31)
{
if ($num > $no_days_in_month)
break;
else
{
$dates[$row][$col] = $num;
if (($col + 1) > 7)
{
$row++;
$col = 1;
}
else
$col++;
$num++;
}//if-else
}//while
//echo "";
//print_r($dates);
//echo " ";
$mon_num = date("n",$first_day);
$temp_yr = $next_yr = $prev_yr = $year;
$prev = $mon_num - 1;
$next = $mon_num + 1;
//If January is currently displayed, month previous is December of previous year
if ($mon_num == 1)
{
$prev_yr = $year - 1;
$prev = 12;
}
//If December is currently displayed, month next is January of next year
if ($mon_num == 12)
{
$next_yr = $year + 1;
$next = 1;
}
$mes['1'] ='Gennaio';
$mes['2'] ='Febbraio';
$mes['3'] ='Marzo';
$mes['4'] ='Aprile';
$mes['5'] ='Maggio';
$mes['6'] ='Giugno';
$mes['7'] ='Luglio';
$mes['8'] ='Agosto';
$mes['9'] ='Settembre';
$mes['10'] ='Ottobre';
$mes['11'] ='Novembre';
$mes['12'] ='Dicembre';
echo "
";
echo " ".
"<< | ".
"".$mes[date("n",$first_day)]." ".$temp_yr." | ".
" ".
">> | ";
echo "\n
L |
M | ";
echo " M |
G |
V |
S |
D |
";
echo " | ";
$end = ($start_day > 4)? 6:5;
for ($row=1;$row<=$end;$row++)
{
for ($col=0;$col<=7;$col++)
{
if ($dates[$row][$col] == "")
$dates[$row][$col] = " ";
if (!strcmp($dates[$row][$col]," "))
$count++;
$t = $dates[$row][$col];
//If date is today, highlight it
if ($col > 0)
{
//if (($t == date("j")) && ($mon == date("n")) && ($year == date("Y")))
//echo "\n".$t." | ";
//else
//If the date is absent ie after 31, print space
echo "\n".(($t == " " )? " " : "".$t."")." | ";
}
}// for -col
if (($row + 1) != ($end+1))
echo " ";
else
echo " ";
}// for - row
echo " ";
}
//----------Main Loop-----------
print_HTML_header();
$month = $_GET['month'];
//If $month is not present, set it to current month.
$month = (empty($month)) ? date("n") : $month;
$year = $_GET['year'];
//If $year is not present, set it to current year.
$year = (empty($year)) ? date("Y") : $year;
print_calendar($month,$year);
print_HTML_footer();
?>
| Cerca nelle notizie |
|
echo "";
echo "";
echo " ";
echo "
";
echo "";
echo "";
echo "
";
echo "";
echo "
";
echo "";
echo "
";
echo "";
echo "";
echo " | ";
echo "
";
?>
|
echo " ";
echo " Le ultime news | ";
echo "
";
echo " ";
echo " ";
$sql = "SELECT titolo, id, date_format(data, '%d') as giorno,
date_format(data, '%m') as mese, date_format(data, '%y') as anno,
date_format(data, '%H') as ora, date_format(data, '%i') as minuti,
date_format(data, '%s') as secondi, contenuto, autore FROM news ORDER BY id DESC LIMIT 6";
$result = $db->esegui($sql);
while ($notizia2 = $db->FetchArray($result))
{
echo "";
echo " ";
echo "{$notizia2['giorno']}/{$notizia2['mese']}/{$notizia2['anno']} - {$notizia2['ora']}:{$notizia2['minuti']} ".$notizia2['titolo'];
echo " ".' ';
echo "";
}
echo "
| ";
echo "
";
echo " ";
echo " I più cliccati | ";
echo "
";
echo " ";
echo " ";
$sql = "SELECT titolo, id, date_format(data, '%d') as giorno,
date_format(data, '%m') as mese, date_format(data, '%y') as anno,
date_format(data, '%H') as ora, date_format(data, '%i') as minuti,
date_format(data, '%s') as secondi, contenuto, autore FROM news ORDER BY vista DESC LIMIT 6";
$result = $db->esegui($sql);
while ($notizia2 = $db->FetchArray($result))
{
echo "";
echo " ";
echo "{$notizia2['giorno']}/{$notizia2['mese']}/{$notizia2['anno']} - {$notizia2['ora']}:{$notizia2['minuti']} ".$notizia2['titolo'];
echo " ".' ';
echo "";
}
echo "
| ";
echo "
";
/*echo "";
echo "
Segnala ad un amico | ";
echo "
";
if ($_POST['segnala'])
{
$msg = "Ciao!!!\n";
$msg .= "Il tuo amico ".$_POST['nome']." ti ha inviato una news dal sito https://www.doremifasol.org\n\n";
$msg .= "https://www.doremifasol.org/notizia.php?id=".$_GET['id']." Clicca qui per leggere la news\n\n";
$msg .= "Buona navigazione\n";
$msg .= "Lo staff di doremifasol.org\n";
echo "";
if (mail($_POST['mail'], "News da doremifasol.org", $msg, "FROM <".$_POST['nome'].">"))
echo "Notizia inviata!";
else
echo "Problemi nell'invio della segnalazione!";
echo " |
";
}
echo "";
echo " ";
echo " ";
echo "
";
echo " ";
echo " |
";*/
echo " ";
echo " Ricevi le news via email | ";
echo "
";
echo "";
echo " ";
?>
echo " | ";
echo "
";
echo " ";
echo " Commenti degli utenti | ";
echo "
";
echo "";
echo " ";
echo " ";
$res = $db->esegui("SELECT * FROM commenti WHERE news_id='".$notizia['id']."' AND app='1' ORDER BY id DESC");
while ($c = $db->FetchArray($res))
{
echo " ";
echo " ";
echo " ".$c['autore']." ";
echo " ".$c['testo']." ";
echo " | ";
echo " ";
echo "";
echo " | ";
echo " ";
}
echo " ";
echo " | ";
echo "
";
$res = $db->esegui("SELECT * FROM ".$_CONFIG['table_banner']." WHERE id='1'");
$sponsor = $db->FetchArray($res);
if ($sponsor['codice'] != "")
{
echo "";
echo " ";
echo $sponsor['codice'];
echo " | ";
echo "
";
}
else
{
echo "";
echo " | ";
echo "
";
}
echo "";
echo " | ";
echo "
";
echo "";
echo " doremifasol.org | ";
echo "
";
echo "
";
//echo "