database_query("SET NAMES utf8"); switch ($author) { case 'freid': $s='freid'; break; case 'esoteric': $s='eso'; break; case 'simon': $s='sim'; break; default: $s='miller'; } $sonquery= "Select * from son_".$s." where ".$s."_word='".$w."'"; $sonlist = $database->database_query($sonquery); $son_array = Array(); $son_count=0; while($sondata = $database->database_fetch_assoc($sonlist)) { //if ($s=='miller') {$tags=explode(";",$sondata[miller_tags]);} $son_array[$son_count] = Array('word' => $sondata[$s.'_word'], 'son' => str_replace(";", ";
", $sondata[$s.'_son']), // 'lookat' => $sondata[miller_lookat], // 'tags' => $tags ); $son_count++; } $otherlist = $database->database_query("Select * from son_sim where sim_word='".$w."'"); $arr=$database->database_fetch_assoc($otherlist); $sim=$arr[sim_son]; $otherlist = $database->database_query("Select * from son_eso where eso_word='".$w."'"); $arr=$database->database_fetch_assoc($otherlist); $eso=$arr[eso_son]; $otherlist = $database->database_query("Select * from son_freid where freid_word='".$w."'"); $arr=$database->database_fetch_assoc($otherlist); $freid=$arr[freid_son]; $otherlist = $database->database_query("Select * from son_miller where miller_word='".$w."'"); $arr=$database->database_fetch_assoc($otherlist); $miller=$arr[miller_son]; $database->database_query("SET NAMES latin1"); $smarty->assign('sondata', $son_array); $smarty->assign('bread', $bread); $smarty->assign('sim', $sim); $smarty->assign('eso', $eso); $smarty->assign('freid', $freid); $smarty->assign('miller', $miller); switch ($s) { case 'freid': $sonnik='сонник Фрейда'; $surl='/Sonnik_Freid'; break; case 'eso': $sonnik='Эзотерический сонник'; $surl='/Sonnik_Esoteric'; break; case 'sim': $sonnik='Сонник Симона Кананита'; $surl='/Sonnik_Simon_Kananit'; break; case 'miller': $sonnik='Сонник Миллера'; $surl='/Sonnik'; break; } //$pagename='К чему снится '.$son_array[0][word].", толкование сна ".$son_array[0][word].", приснилось ".$son_array[0][word].", ".$sonnik; $pagename='К чему снится '.$son_array[0][word].", ".$sonnik; $keywords="сонник,толкование снов,сны,".$son_array[0][word].", сонник миллера, сонник Фрейда, эзотеричесикй сонник, сонник симона кананита"; $description="Толкование сна ".$son_array[0][word].", к чему снится ".$son_array[0][word]." по ".$sonnik; $smarty->assign('pagename', $pagename); $smarty->assign('keywords', $keywords); $smarty->assign('description', $description); $smarty->assign('bread', 'Клеопа.ru » Сонники » '.$sonnik.' »

'.$w.'

'); // ПОПУЛЯРНЫЕ СТАТЬИ $query= "Select * from se_art ORDER BY view DESC LIMIT 15"; $qresult = $database->database_query($query); $pop_array = Array(); $pop_count=0; while($popdata = $database->database_fetch_assoc($qresult)) { if ($popdata[id]<846) {$arturl='article.php?id='.$popdata[id];} else {$arturl=$popdata[id].'-'.$popdata[url];} $pop_array[$pop_count] = Array('ddate' => $popdata[ddate], 'id' => $popdata[id], 'img' => $popdata[img], 'arturl' => $arturl, 'artname' => $popdata[artname]); $pop_count++; } shuffle($pop_array); array_splice($pop_array, 3); $smarty->assign('popdata', $pop_array); include "footer.php"; ?>