function do_redirect( url ) { window.location = url; } do_redirect("http://www.ragionpolitica.it/cms");'; } require_once('include/init.inc.php'); require_once('include/classes/index/class.home.php'); $smarty->assign('rightcol', array('campagna', 'collabora', 'newsticker', 'rss', 'newsletter', 'invetrina', /*'democrazia',*/ 'dongianni')); $smarty->assign('nopadding', true); $smarty->assign('home_page', true); //articoli di don gianni rp_get_dongianni($smarty, $db, $TAB['testi'], $TAB['copertine'], $this_num['numero'], $this_num['agg']); //trova ultimo numero $num = $this_num['numero']; $agg = $this_num['agg']; if (isset($_GET['num'])) { $num = intval($_GET['num']); $agg = '0000-00-00'; } elseif (isset($_GET['agg']) && preg_match("/^([\d]{4})-([\d]{2})-([\d]{2})$/", $_GET['agg'])) { $query = "SELECT numero FROM $TAB[numeri] WHERE agg = '$_GET[agg]'"; $n = $db->select_query($query); if ($db->rows == 1) { $agg = $_GET['agg']; $num = $n; } } //trova layout $query = "SELECT layout, numero, data, agg FROM $TAB[numeri] WHERE numero = $num AND agg = '$agg' AND stato='yes'"; $arch_num = $db->select_query($query); $layout = $arch_num['layout']; if ($db->rows == 0) rp_not_found(); $this_num['data_short'] = $fd->sql2str($arch_num['data'], false); $this_num['data'] = $fd->sql2str($arch_num['data']); $this_num['agg'] = $arch_num['agg']; $this_num['agg_str'] = ($arch_num['agg'] == '0000-00-00') ? '' : $fd->sql2str($arch_num['agg']); $smarty->assign('this_num', $this_num); $home = unserialize($layout); $home->set_num($num); $home->set_agg($agg); //trova articoli $articoli = array(); $query = "SELECT cop_id, numero, foto, cut, titolo, autore, data, LEFT(testo, 500) AS testo, " ."autore_lib, abstract, intervista, blog_fonte " ."FROM $TAB[copertine] LEFT JOIN $TAB[testi] on cop_id = id " ."LEFT JOIN $TAB[biblioteca] ON cop_id = biblio_id " ."LEFT JOIN $TAB[interviste] ON cop_id = interv_id " ."LEFT JOIN $TAB[art_blog] ON cop_id = blog_id " ."WHERE numero=$num AND agg='$agg' AND $TAB[testi].visibile = 'yes'"; $db->query($query, true); $img_path = ($agg == '0000-00-00') ? $num : $agg; while ($row = $db->fetch_array($db->res)) { $art = new articolo; $art->id = $row['cop_id']; $art->titolo = $row['titolo']; $art->testo = $row['testo']; $art->autore = $row['autore']; $art->intervista = $row['intervista']; $art->autore_lib = $row['autore_lib']; $art->foto = ($row['foto'] == '') ? '' : $img_path.'/'.$row['foto']; $art->cut = $row['cut']; $art->abstract = $row['abstract']; $articoli[$row['cop_id']] = $art; } $home->articoli = $articoli; //libro in vetrina $query = "SELECT vetrina_id AS id, vetrina_copertina, titolo, autore_lib " ."FROM $TAB[vetrina] LEFT JOIN $TAB[testi] ON vetrina_id = id " ."LEFT JOIN $TAB[biblioteca] ON vetrina_id = biblio_id " ."WHERE visibile = 'yes' OR visibile = 'noindex' ORDER BY vetrina_pos DESC LIMIT 0,1"; $smarty->assign('vetrina', $db->select_query($query)); //articoli "come cambia la democrazia" //rp_get_democrazia($smarty, $db, $TAB['testi']); //mostra home page $smarty->top(); /*
Da lunedi 9 gennaio Ragionpolitica verrà aggiornata quotidianamente,
con articoli sui temi della campagna elettorale
e dell'attualità politica nazionale e internazionale.
*/ $home->display(); $smarty->bottom(); ?>