';print_r($_SERVER);echo ''; #==== +++++++++ $FULL_NUM_PAGES=true; # Responsible for the generation of full page numbers (a little weight as host) $menucattape=$menucatdir=$pattern_list=$pattern_lenta=$adminpanel=$rsspage=$rsstime = $temp_title=$last_news_list=$rezult_ping=$menucatselect=$menucommentselect=$menutagselect=$keywords=$telo_query=''; $sesia=false; if(@$_SESSION[md5(getcwd())][session_id()]==md5 ($adminpass)) { $sesia=true; $temp_narod=$temp_query=''; if(file_exists('narod.php')){$temp_narod=' [NAROD.RU] ';} $adminpanel.=' [Log out] '.$temp_narod.' '.$temp_query.' [Images] [Category] [Tags] [Add page] [Del cache]'; } $_SESSION['real']=session_id(); $time1 = microtime(); $time_en_to_ru=$lang; $translit_popular=true; $popular_in_total=false; # --- setting start page --- if (array_key_exists('event', $_GET)==false && array_key_exists('event', $_POST)==false) {$_GET['str']=0; $_POST['event']='zero'; if ($startpage=='none') {$_GET['event']='all'; $_GET['zapros']=0; } else {$_GET['event']='page'; $_GET['zapros']=$startpage;} } if (array_key_exists('str', $_GET)==false) {$_GET['str']=0;} # --- checking caching--- #print $_SERVER['HTTP_CACHE_CONTROL'];// => max-age=0 if(isset($_SERVER['HTTP_CACHE_CONTROL'])) {$cashe=0;} if ($cashe > 0 && $sesia != true && strpos($_SERVER['REQUEST_URI'],'index.php?event=logmenu')!=true) { $temp = del_simb ($_SERVER['REQUEST_URI']);//print $cashepatch.$temp; if (@filemtime ($cashepatch.$temp)+$cashe >= time()) { $fpp=fopen($cashepatch.$temp, 'r'); $fulldata=fread($fpp,filesize($cashepatch.$temp)); fclose($fpp); # -- result output print trim($fulldata); if($_GET['event'] !="rss") {print "
Rumba XML ".abs(microtime()-$time1)."
";} exit; } } # --- misc stuff --- include 'data/lang.php'; $simb_http = "http:".chr("47").chr("47"); $simb_left = "  < < < <  "; $simb_right = "  > > > >  "; #$server=$simb_http.str_replace("index.php", "", $_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']); $server=$simb_http.str_replace("index.php", "", $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']); $serverlocal=getcwd(); $zapros='0'; $telo=''; $fulldata=$title=$desc=''; # ---------- get last komment $tempik = file("comment/lastfodif.txt"); $lastcomm = ''; for ($i=count($tempik)-1,$ss=$q88q; $i>0, $ss>0; $i--,$ss--) {if ($i<0 || $ss<0) {break;} $lastcomm.=$tempik[$i];} # ---------- get pattern for page ----- $MyGMTtime=gmdate("D, d M Y H:i:s"); if (array_key_exists('event', $_GET)==false) {$_GET['event'] = 'zero';} $searchpattern=false; $namepattern='pattern.html'; if( $_GET['event'] !="rss") { if(!isset($_GET['zapros'])){$_GET['zapros']='';} # $temp=explode('/', $_SERVER['REQUEST_URI']); $tempik='pattern.html'; if (isset($_SERVER['REDIRECT_URL'])) { $temp=explode('/', $_SERVER['REDIRECT_URL']); if(strpos($temp[count($temp)-1], '.html')){$tempik=trim($temp[count($temp)-1]);} //else{$tempik='index.html';} } else if (($_GET['event'] =='all' || $_GET['event'] =='page') && $sesia==false) {$tempik='index.html';} // //print $_GET['event'].'==='.$_SERVER['REDIRECT_URL']; # individual pattern if (file_exists('data/template/'.$tempik) && trim($tempik)!='') { $namepattern='data/template/'.$tempik; $searchpattern=true; } /* # pattern event+kat if($searchpattern==false) { if(isset($_GET['zapros'])) { if (file_exists('data/template/'.$_GET['event'].'_'.$_GET['zapros'].'.html')) { $namepattern='data/template/'.$_GET['event'].'_'.$_GET['zapros'].'.html'; $searchpattern=true; } } } //if($searchpattern==true){print 'asdas';} */ # pattern event+kat+subkat if($searchpattern==false) { if(isset($_GET['zapros'])) { $temp = ''; $temp_pat_adr=array(); # get list name for pattern foreach (explode ('-', $_GET['zapros']) as $item) { $temp = ($temp=='')? $item:$temp.'-'.$item; $temp_pat_adr[]=$temp; } $temp_pat_adr[]=''; rsort ($temp_pat_adr); # search category pattern foreach ($temp_pat_adr as $item) { if (file_exists('data/template/'.$_GET['event'].'_'.$item.'.html')) {$namepattern='data/template/'.$_GET['event'].'_'.$item.'.html'; $searchpattern=true; break;} } } } # pattern event if($searchpattern==false) { if (file_exists('data/template/'.$_GET['event'].'.html')) $namepattern='data/template/'.$_GET['event'].'.html'; $searchpattern=true; } # load pattern $fpp=fopen($namepattern, "r"); $fulldata=fread($fpp,filesize($namepattern)); fclose($fpp); } if($_GET['event'] =="rss") { $fpp=fopen("data/pattern.xml", "r"); $fulldata=fread($fpp,filesize("data/pattern.xml")); fclose($fpp); } # ---------- get pattern for content --- $telo_template_current = (isset($telo_template[$_GET['event']]))? $telo_template[$_GET['event']]:$telo_template['index']; # ---------- get category #$menucatselect=''."\r\n"; # ---------- get datafile if (file_exists($basepatch.'data.xml')) { $xml = simplexml_load_file($basepatch.'data.xml'); } else {exit('Failed to open data.xml.');} # ------------ get cloud if (file_exists('data/cloud.txt')) { $fpp=fopen('data/cloud.txt', 'r'); $cloud=''.fread($fpp,filesize('data/cloud.txt')).''; fclose($fpp); } # ------------ get cloud links if (file_exists('data/cloud_link.txt')) { $fpp=fopen('data/cloud_link.txt', 'r'); $cloud_link = explode("\n",trim(fread($fpp,filesize('data/cloud_link.txt')))); foreach ($cloud_link as $item) { $temp = explode('|', trim($item)); $cloud_link_mass["$temp[0]"]=$temp[1]; } fclose($fpp); } # ------------ get randzapis if (file_exists('./data/randzapis.txt')) { $fpp=fopen('./data/randzapis.txt', 'r'); $randzapis=fread($fpp,filesize('./data/randzapis.txt')); fclose($fpp); } # ------------ get archive if (file_exists('data/archive.txt')) { $archive = ''; $tempik = file ('data/archive.txt'); foreach (file ('data/archive.txt') as $item) { $temp_pub = (time()>=strtotime(strip_tags ($item)))? true:false; if ($temp_pub==true || $sesia==true) {if ($time_en_to_ru) { $temp_ar = strip_tags (trim($item)); $item=str_replace($temp_ar, time_en_to_ru($temp_ar, $ling, 'en', $lang), $item); } $archive.=$item;} } } # ---------------- # ---------------- SITEMAP # ---------------- if (array_key_exists('event', $_GET)!=false) { if ($_GET['event']=='sitemap') { $temp = $xml->xpath(' /articles/page/@id| /articles/page/@key| /articles/page/titl| /articles/page/desc| /articles/page/data| /articles/page/metatitl'); $i=count($temp); $y=$_GET['str']*$mapsize; $telo.='

'.$ling[$lang][41].'

'; for ($x=0, $z=0; $x<$i; $x++, $z++) { $temp_pub = (time()>=strtotime($temp[$x+4]))? true:false; if($z>=$y && $z<$y+$mapsize && isset($temp[$x]) && ($temp_pub==true || $sesia==true)) { $temp_metatitl = ($temp[$x+5]=='')? ' ': ' title=\''.$temp[$x+5].'\' '; # generate metatitle if ($temp_pub==false) {$temp[$x+2].=' ('.$ling[$lang][59].') ';} else{$temp_map[]='
  • '.$temp[$x+2].'
  • '."\r\n";}# random $telo.='

    '.$temp[$x+2].'

    '.$temp[$x+3]."

    \r\n"; $desc.=$temp[$x+2].'. '; # -- keywords $temptags = explode (';',$temp[$x+1]); foreach ($temptags as $item2) { if ($item2 != '') { $tempkey = explode ('-',$item2); $temp_tags [$tempkey[0]] = $tempkey [1]; } } } $x=$x+5; if($temp_pub==false && $sesia!=true){$z--;} if ($z==$y+$mapsize && $FULL_NUM_PAGES==false){break;} } $title.=$pref_sitemap; # -- may prefer keys handle if ($keygen=='yes'){ foreach ($temp_tags as $item3) { $keywords.=$item3.', ';}} $telo.='
    '; if ($_GET['str']>=1){$telo.=''.$simb_left.' ';} # -- Do page numbers if ($gen_num_str >0) { $z = ceil($z/$mapsize)-1; for ($v=0; $v<=$z; $v++) { if ($_GET['str'] == $v) {$telo.=''.($v+1).' ';} if ($_GET['str'] != $v && $_GET['str']>=$v-$gen_num_str && $_GET['str']<=$v+$gen_num_str) {$telo.=''.($v+1).' ';} } } if ($z>$_GET['str']){$telo.=''.$simb_right.'';} $telo.='
    '; # -- likelink if ($likelink =='yes') {include 'data/likelink.php';} # -- querylink if ($querylink =='yes') {$telo.=get_query_link($ling[$lang], $sesia, $translit_popular, $keywords);} # -- random zapis -- $time_randzapis = (file_exists('./data/randzapis.txt'))? filemtime('./data/randzapis.txt'):0; # echo "
    "; print_r ($temp_map); echo "
    "; if ($time_randzapis+$limit_randzapis <= time()) { $temp_count = count($temp_map)-1; #$i/4; $fff = fopen ('./data/randzapis.txt', 'w'); $temp_nom=array(); $q99q = ($q99q<$temp_count)?$q99q:$temp_count+1; for ($i=$q99q; $i>0; $i--) { $temp_rand = rand(0, $temp_count); while (isset($temp_nom["$temp_rand"])) { $temp_rand = rand(0, $temp_count); } $temp_nom["$temp_rand"]=true; fwrite ($fff, $temp_map["$temp_rand"]); } fclose ($fff); } } } # ---------------- # ---------------- DIR # ---------------- if (array_key_exists('event', $_GET)!=false) { if ($_GET['event']=='dir' && $_GET['zapros']==true) { $temp_tags=array(); $temp_zapros=$_GET['zapros']; /* foreach(file('./data/category.txt') as $item) { if (strstr($item, $_GET['zapros'])!=false) {$tempik=explode('|', $item); $telo.='

    '.$tempik[1].'

    ';} } */ $telo.='

    '.$catmassiv["$temp_zapros"]."

    \r\n

    ".$catmassivdesc["$temp_zapros"]."

    \r\n"; $desc.=strip_tags($catmassivdesc["$temp_zapros"]); //$catmassivdesc $temp = $xml->xpath(' /articles/*[contains(@tags,\''.$_GET['zapros'].'\')]/@id| /articles/*[contains(@tags,\''.$_GET['zapros'].'\')]/@key| /articles/*[contains(@tags,\''.$_GET['zapros'].'\')]/titl| /articles/*[contains(@tags,\''.$_GET['zapros'].'\')]/data| /articles/*[contains(@tags,\''.$_GET['zapros'].'\')]/metatitl'); /* /articles/page[@tags=\''.$_GET['zapros'].'\']/@id| /articles/page[@tags=\''.$_GET['zapros'].'\']/@key| /articles/page[@tags=\''.$_GET['zapros'].'\']/titl| /articles/page[@tags=\''.$_GET['zapros'].'\']/data'); */ $i=count($temp); for ($x=0, $z=0; $x<$i; $x++, $z++) { $temp_pub = (time()>=strtotime($temp[$x+3]))? true:false; if(isset($temp[$x]) && ($temp_pub==true || $sesia==true)) { if($temp_pub==false) {$telo.=''.$ling[$lang][59].' ';} $temp_metatitl = ($temp[$x+4]=='')? ' ': ' title=\''.$temp[$x+4].'\' '; # generate metatitle $telo.=''.$temp[$x+2].'
    '."\r\n"; //$desc.=$temp[$x+2].' '; } $title.=$temp[$x+2].' '; # -- keywords $temptags = explode (';',$temp[$x+1]); foreach ($temptags as $item2) { if ($item2 != '') { $tempkey = explode ('-',$item2); $temp_tags [$tempkey[0]] = $tempkey [1]; } } $x=$x+4; } $title = $pref_list.$catmassiv[$_GET['zapros']]; $desc = $catmassiv[$_GET['zapros']].': '.$desc; //$desc = $pref_list.$catmassiv[$_GET['zapros']].': '.$desc; # -- may prefer keys handle if ($keygen=='yes'){ foreach ($temp_tags as $item3) { $keywords.=$item3.', ';}} # -- likelink if ($likelink =='yes') {include 'data/likelink.php';} # -- querylink if ($querylink =='yes') {$telo.=get_query_link($ling[$lang], $sesia, $translit_popular, $keywords);} } } # ---------------- # ---------------- TAPE # ---------------- if (array_key_exists('event', $_GET)!=false) { if ($_GET['event']=='tape' && $_GET['zapros']==true && $_GET['str']!==false) { $temp = $xml->xpath(' /articles/*[contains(@tags,\''.$_GET['zapros'].'\')]/@id| /articles/*[contains(@tags,\''.$_GET['zapros'].'\')]/@key| /articles/*[contains(@tags,\''.$_GET['zapros'].'\')]/titl| /articles/*[contains(@tags,\''.$_GET['zapros'].'\')]/desc| /articles/*[contains(@tags,\''.$_GET['zapros'].'\')]/author| /articles/*[contains(@tags,\''.$_GET['zapros'].'\')]/data| /articles/*[contains(@tags,\''.$_GET['zapros'].'\')]/anons| /articles/*[contains(@tags,\''.$_GET['zapros'].'\')]/metatitl'); /* /articles/page[@tags=\''.$_GET['zapros'].'\']/@id| /articles/page[@tags=\''.$_GET['zapros'].'\']/@key| /articles/page[@tags=\''.$_GET['zapros'].'\']/titl| /articles/page[@tags=\''.$_GET['zapros'].'\']/desc| /articles/page[@tags=\''.$_GET['zapros'].'\']/author| /articles/page[@tags=\''.$_GET['zapros'].'\']/data| /articles/page[@tags=\''.$_GET['zapros'].'\']/anons'); */ # echo "
    "; print_r ($temp); echo "
    "; $i=count($temp); $y=$_GET['str']*$tapesize; $temp_tags=array(); if(isset($temp[0])) { for ($x=0, $z=0; $x<$i; $x++, $z++) { $temp_pub = (time()>=strtotime($temp[$x+5]))? true:false; if($z>=$y && $z<$y+$tapesize && isset($temp[$x]) && ($temp_pub==true || $sesia==true)) { if($temp_pub==false){$telo.='

    '.$ling[$lang][59].'

    ';} if ($unik_tape!='no') {$temp[$x+6]= unikanons ($temp[$x+6], $unik_tape); } /* $telo.='

    '.$temp[$x+2].'

    '; if ($infopage=='yes') { $telo.=$ling[$lang][33].': '.$temp[$x+4].' '.$ling[$lang][57].': '.time_en_to_ru($temp[$x+5], $ling, 'en', $lang).''; } $telo.='

    '.linkator ( $server, $prefiks, $ling, $listsize, $cloud_link_mass, $temp[$x+6]).' '.$ling[$lang][48].'

    '; */ $temp[$x+7] = ($temp[$x+7]=='')? $temp[$x+2]:$temp[$x+7]; # generate metatitle $title.=$temp[$x+7].' '; $desc.=$temp[$x+3].' '; # -- keywords $temptags = explode (';',$temp[$x+1]); foreach ($temptags as $item2) { if ($item2 != '') { $tempkey = explode ('-',$item2); $temp_tags [$tempkey[0]] = $tempkey [1]; } } # -- content $temp_content=linkator ($server, $prefiks, $ling, $listsize, $cloud_link_mass, $temp[$x+6]); //$title.=$temp[$x+2].' '; $desc.=$temp[$x+3].' '; # -- add content to template $telo.=content_to_template ( $telo_template_current, $temp_content, $temp[$x], $temp[$x+2], $temp[$x+4], $temp[$x+5], $temp[$x+7], $ling, $lang ); # PATTERN, ID, NAME, AUTHOR, DATE, keywords, ling, lang } $x=$x+7; if($temp_pub==false && $sesia!=true){$z--;} if ($z==$y+$tapesize && $FULL_NUM_PAGES==false){break;} } $title = $pref_dirs.$catmassiv[$_GET['zapros']].': '.$title; $desc = $pref_dirs.$catmassiv[$_GET['zapros']].': '.$desc; # -- may prefer keys handle if ($keygen=='yes'){ foreach ($temp_tags as $item3) { $keywords.=$item3.', ';}} $telo.='
    '; if ($_GET['str']>=1){$telo.=''.$simb_left.' ';} # -- Do page numbers if ($gen_num_str >0) { $z = ceil($z/$tapesize)-1; for ($v=0; $v<=$z; $v++) { if ($_GET['str'] == $v) {$telo.=''.($v+1).' ';} if ($_GET['str'] != $v && $_GET['str']>=$v-$gen_num_str && $_GET['str']<=$v+$gen_num_str) {$telo.=''.($v+1).' ';} } } if ($z>$_GET['str']){$telo.=''.$simb_right.'';} $telo.='
    '; # -- crosslink //if ($crosslink=='yes') // {include 'data/getlist.php';} # -- likelink if ($likelink =='yes' && $startpage != $_GET['zapros']) {include 'data/likelink.php';} # -- querylink if ($querylink =='yes') {$telo.=get_query_link($ling[$lang], $sesia, $translit_popular, $keywords);} } } } # ---------------- # ---------------- TAGs # ---------------- if (array_key_exists('event', $_GET)!=false) { if ($_GET['event']=='key' && $_GET['zapros']==true && $_GET['str']!==false) { $temp = $xml->xpath(' /articles/*[contains(@key,\''.$_GET['zapros'].'\')]/@id| /articles/*[contains(@key,\''.$_GET['zapros'].'\')]/@key| /articles/*[contains(@key,\''.$_GET['zapros'].'\')]/titl| /articles/*[contains(@key,\''.$_GET['zapros'].'\')]/desc| /articles/*[contains(@key,\''.$_GET['zapros'].'\')]/author| /articles/*[contains(@key,\''.$_GET['zapros'].'\')]/data| /articles/*[contains(@key,\''.$_GET['zapros'].'\')]/anons| /articles/*[contains(@key,\''.$_GET['zapros'].'\')]/metatitl'); $i=count($temp); $y=$_GET['str']*$serhsize; if(isset($temp[0])) { for ($x=0, $z=0; $x<$i; $x++, $z++) { $temp_pub = (time()>=strtotime($temp[$x+5]))? true:false; if($z>=$y && $z<$y+$serhsize && isset($temp[$x]) && ($temp_pub==true || $sesia==true)) { if($temp_pub==false){$telo.='

    '.$ling[$lang][59].'

    ';} if ($unik_tags!='no') {$temp[$x+6]= unikanons ($temp[$x+6], $unik_tags); } /* $telo.='

    '.$temp[$x+2].'

    '; if ($infopage=='yes') { $telo.=$ling[$lang][33].': '.$temp[$x+4].' '.$ling[$lang][57].': '.time_en_to_ru($temp[$x+5], $ling, 'en', $lang).''; } $telo.='

    '.linkator ( $server, $prefiks, $ling, $listsize, $cloud_link_mass, $temp[$x+6]).' '.$ling[$lang][48].'

    '."\r\n"; */ $temp[$x+7] = ($temp[$x+7]=='')? $temp[$x+2]:$temp[$x+7]; # generate metatitle $title.=$temp[$x+7].' '; $desc.=$temp[$x+3].' '; # -- keywords $temptags = explode (';',$temp[$x+1]); foreach ($temptags as $item2) { if ($item2 != '') { $tempkey = explode ('-',$item2); $temp_tags [$tempkey[0]] = $tempkey [1]; } } # create title for tag $temp3 = explode (';', $temp[$x+1]); foreach ($temp3 as $item3) { if (strpos ($item3, $_GET['zapros']) !== false) { $temp_title=explode ('-', $item3); } } # -- # -- content $temp_content=linkator ($server, $prefiks, $ling, $listsize, $cloud_link_mass, $temp[$x+6]); //$title.=$temp[$x+2].' '; $desc.=$temp[$x+3].' '; # -- add content to template $telo.=content_to_template ( $telo_template_current, $temp_content, $temp[$x], $temp[$x+2], $temp[$x+4], $temp[$x+5], $temp[$x+7], $ling, $lang ); # PATTERN, ID, NAME, AUTHOR, DATE, keywords, ling, lang } $x=$x+7; if($temp_pub==false && $sesia!=true){$z--;} if ($z==$y+$serhsize && $FULL_NUM_PAGES==false){break;} } if (isset($temp_title[1])==true) { $title = $pref_tags.$temp_title[1].': '.$title; $desc = $pref_tags.$temp_title[1].': '.$desc; } # -- may prefer keys handle if ($keygen=='yes'){ foreach ($temp_tags as $item3) { $keywords.=$item3.', ';}} $telo.='
    '; if ($_GET['str']>0){$telo.=''.$simb_left.' ';} # -- Do page numbers if ($gen_num_str >0) { $z = ceil($z/$serhsize)-1; for ($v=0; $v<=$z; $v++) { if ($_GET['str'] == $v) {$telo.=''.($v+1).' ';} if ($_GET['str'] != $v && $_GET['str']>=$v-$gen_num_str && $_GET['str']<=$v+$gen_num_str) {$telo.=''.($v+1).' ';} } } if ($z>$_GET['str']){$telo.=''.$simb_right.'';} $telo.='
    '; } # -- crosslink //if ($crosslink=='yes') // {include 'data/getlist.php';} if ($likelink =='yes' && $startpage != $_GET['zapros']) {include 'data/likelink.php';} # -- querylink if ($querylink =='yes') {$telo.=get_query_link($ling[$lang], $sesia, $translit_popular, $keywords);} } } # ---------------- # ---------------- RSS # ---------------- if (array_key_exists('event', $_GET)!=false) { if ($_GET['event']=='rss') { $temp = $xml->xpath(' /articles/page/@id| /articles/page/titl| /articles/page/desc| /articles/page/author| /articles/page/data| /articles/page/anons'); $i=count($temp); $y=0; if(isset($temp[0])) { for ($x=0, $z=0; $x<$i; $x++, $z++) { $temp_pub = (time()>=strtotime($temp[$x+4]))? true:false; if($z>=$y && $z<$y+$all_size && isset($temp[$x]) && $temp_pub==true) { $telo.=" ".$temp[$x+1][0]." ".$server.$prefiks.''.$temp[$x].".html ".html_xml($temp[$x+5])." ".$temp[$x+3]." ".$temp[$x+4]." "; $title.=$temp[$x+1].' '; $desc.=$temp[$x+2].' '; } $x=$x+5; if($temp_pub==false){$z--;} if ($z==$y+$all_size){break;} } } } } # ---------------- # ---------------- POPULAR # ---------------- if (array_key_exists('event', $_GET)!=false) { if ($_GET['event']=='popular' && array_key_exists('str', $_GET)!==false) { $zapros= str_replace('-', ' ', $_GET['zapros']); if($translit_popular==true){$zapros= lat_ru($_GET['zapros'], 'lr', 'f');} else {$zapros=ucfirst($zapros);} //print $zapros; $title = $pref_pop.$zapros.': '.$title; $desc = $pref_pop.$zapros.': '.$desc; $zapros= del_predlog($zapros); $zapros= str_replace('-', ' ', $zapros); $zapros= str_replace('+', ' ', $zapros); $temp_zapros = explode(' ', trim($zapros)); //$temp_zapros = del_stop_slova($temp_zapros, $stopword); $page_mass = array(); # --- generate list pages --- foreach ($temp_zapros as $item) { $temp = $xml->xpath(' /articles/*[contains(text,\''.$item.'\')]/@id| /articles/*[contains(text,\''.$item.'\')]/data'); if($temp) { //$tempik = array_chunk($temp, 2); foreach (array_chunk($temp, 2) as $item2) { $temp_pub = (time()>=strtotime($item2[1]))? true:false; if ($temp_pub==true || $popular_in_total==true) { if(!isset($page_mass["$item2[0]"])){$page_mass["$item2[0]"]=0;} $page_mass["$item2[0]"]++; } } } } arsort($page_mass); $page_mass=array_keys ($page_mass); # --- load pages --- $page_mass2 = array_chunk($page_mass, $popsize); if(isset($page_mass2[$_GET['str']])) { foreach ($page_mass2[$_GET['str']] as $item) { $temp = $xml->xpath(' /articles/page[@id=\''.$item.'\']/titl| /articles/page[@id=\''.$item.'\']/desc| /articles/page[@id=\''.$item.'\']/author| /articles/page[@id=\''.$item.'\']/data| /articles/page[@id=\''.$item.'\']/text| /articles/page[@id=\''.$item.'\']/metatitl'); //echo '
    ';print_r($temp);echo '
    '; $temp[5] = ($temp[5]=='')? $temp[0]:$temp[5]; # generate metatitle $desc.=$temp[1].' '; $title.=$temp[5].' '; /* $telo.='

    '.$temp[0].'

    '; if ($infopage=='yes') { $telo.=$ling[$lang][33].': '.$temp[2].' '.$ling[$lang][57].': '.time_en_to_ru($temp[3], $ling, 'en', $lang).''; } $telo.='

    '.get_page_core($temp_zapros, $temp[4], $sentence_in_query).'


    '; */ # -- content $temp_content=get_page_core($temp_zapros, $temp[4], $sentence_in_query); # -- add content to template $telo.=content_to_template ( $telo_template_current, $temp_content, $item, $temp[0], $temp[2], $temp[3], $temp[5], $ling, $lang ); # PATTERN, CONTENT, ID, NAME, AUTHOR, DATE, keywords, ling, lang } } # navigation $telo.='
    '; if ($_GET['str']>0) {$telo.=''.$simb_left.' ';} if (isset($page_mass2[$_GET['str']+1])) {$telo.=''.$simb_right.' ';} $telo.='
    '; # search OK if(!isset($page_mass[0])) { $telo.='

    '.$ling[$lang][61].'

    '; $telo.=' '.$ling[$lang][19].' '; $title.=' '.$ling[$lang][19]; $desc.=' '.$ling[$lang][19]; } # -- likelink if ($likelink =='yes' && $startpage != $_GET['zapros']) {include 'data/likelink.php';} # -- querylink if ($querylink =='yes') {$telo.=get_query_link($ling[$lang], $sesia, $translit_popular, $keywords);} } } # ---------------- # ---------------- Archive # ---------------- if (array_key_exists('event', $_GET)!=false) { if ($_GET['event']=='archive' && $_GET['zapros']==true && $_GET['str']!==false) { $_GET['zapros']= str_replace('-', ' ', $_GET['zapros']); $temp = $xml->xpath(' /articles/*[contains(data,\''.$_GET['zapros'].'\')]/@id| /articles/*[contains(data,\''.$_GET['zapros'].'\')]/@key| /articles/*[contains(data,\''.$_GET['zapros'].'\')]/titl| /articles/*[contains(data,\''.$_GET['zapros'].'\')]/desc| /articles/*[contains(data,\''.$_GET['zapros'].'\')]/author| /articles/*[contains(data,\''.$_GET['zapros'].'\')]/data| /articles/*[contains(data,\''.$_GET['zapros'].'\')]/anons| /articles/*[contains(data,\''.$_GET['zapros'].'\')]/metatitl'); $_GET['zapros']= str_replace(' ', '-', $_GET['zapros']); $i=count($temp); $y=$_GET['str']*$archsize; if(isset($temp[0])) { for ($x=0, $z=0; $x<$i; $x++, $z++) { $temp_pub = (time()>=strtotime($temp[$x+5]))? true:false; if($z>=$y && $z<$y+$archsize && isset($temp[$x]) && ($temp_pub==true || $sesia==true)) { if($temp_pub==false){$telo.='

    '.$ling[$lang][59].'

    ';} if ($unik_archive!='no') {$temp[$x+5]= unikanons ($temp[$x+6], $unik_archive); } /* $telo.='

    '.$temp[$x+2].'

    '; if ($infopage=='yes') { $telo.=$ling[$lang][33].': '.$temp[$x+4].' '.$ling[$lang][57].': '.time_en_to_ru($temp[$x+5], $ling, 'en', $lang).''; } $telo.='

    '.linkator ( $server, $prefiks, $ling, $listsize, $cloud_link_mass, $temp[$x+6]).' '.$ling[$lang][48].'

    '."\r\n"; */ $temp[$x+7] = ($temp[$x+7]=='')? $temp[$x+2]:$temp[$x+7]; # generate metatitle $title.=$temp[$x+2].' '; $desc.=$temp[$x+3].' '; # -- keywords $temptags = explode (';',$temp[$x+1]); foreach ($temptags as $item2) { if ($item2 != '') { $tempkey = explode ('-',$item2); $temp_tags [$tempkey[0]] = $tempkey [1]; } } # -- content $temp_content=linkator ($server, $prefiks, $ling, $listsize, $cloud_link_mass, $temp[$x+6]); //$title.=$temp[$x+2].' '; $desc.=$temp[$x+3].' '; # -- add content to template $telo.=content_to_template ( $telo_template_current, $temp_content, $temp[$x], $temp[$x+2], $temp[$x+4], $temp[$x+5], $temp[$x+7], $ling, $lang ); # PATTERN, ID, NAME, AUTHOR, DATE, keywords, ling, lang } $x=$x+7; if($temp_pub==false && $sesia!=true){$z--;} if ($z==$y+$archsize && $FULL_NUM_PAGES==false){break;} } $title = $pref_archive.str_replace('-', ' ', $_GET['zapros']).': '.$title; $desc = $pref_archive.str_replace('_', ' ', $_GET['zapros']).': '.$desc; # -- may prefer keys handle if ($keygen=='yes'){ foreach ($temp_tags as $item3) { $keywords.=$item3.', ';}} $telo.='
    '; if ($_GET['str']>0){$telo.=''.$simb_left.' ';} # -- Do page numbers if ($gen_num_str >0) { $z = ceil($z/$archsize)-1; for ($v=0; $v<=$z; $v++) { if ($_GET['str'] == $v) {$telo.=''.($v+1).' ';} if ($_GET['str'] != $v && $_GET['str']>=$v-$gen_num_str && $_GET['str']<=$v+$gen_num_str) {$telo.=''.($v+1).' ';} } } if ($z>$_GET['str']){$telo.=''.$simb_right.'';} $telo.='
    '; } # -- likelink if ($likelink =='yes' && $startpage != $_GET['zapros']) {include 'data/likelink.php';} # -- querylink if ($querylink =='yes') {$telo.=get_query_link($ling[$lang], $sesia, $translit_popular, $keywords);} } } # ---------------- # ---------------- Author # ---------------- if (array_key_exists('event', $_GET)!=false) { if ($_GET['event']=='author' && $_GET['zapros']==true && $_GET['str']!==false) { $_GET['zapros']= str_replace('-', ' ', $_GET['zapros']); $_GET['zapros']= str_replace('_', ' ', $_GET['zapros']); $temp = $xml->xpath(' /articles/*[contains(author,\''.$_GET['zapros'].'\')]/@id| /articles/*[contains(author,\''.$_GET['zapros'].'\')]/@key| /articles/*[contains(author,\''.$_GET['zapros'].'\')]/titl| /articles/*[contains(author,\''.$_GET['zapros'].'\')]/desc| /articles/*[contains(author,\''.$_GET['zapros'].'\')]/author| /articles/*[contains(author,\''.$_GET['zapros'].'\')]/data| /articles/*[contains(author,\''.$_GET['zapros'].'\')]/anons| /articles/*[contains(author,\''.$_GET['zapros'].'\')]/metatitl'); $_GET['zapros']= str_replace(' ', '_', $_GET['zapros']); $i=count($temp); $y=$_GET['str']*$archsize; if(isset($temp[0])) { for ($x=0, $z=0; $x<$i; $x++, $z++) { $temp_pub = (time()>=strtotime($temp[$x+5]))? true:false; if($z>=$y && $z<$y+$archsize && isset($temp[$x]) && ($temp_pub==true || $sesia==true)) { if($temp_pub==false){$telo.='

    '.$ling[$lang][59].'

    ';} if ($unik_archive!='no') {$temp[$x+5]= unikanons ($temp[$x+6], $unik_archive); } /* $telo.='

    '.$temp[$x+2].'

    '; if ($infopage=='yes') { $telo.=$ling[$lang][33].': '.$temp[$x+4].' '.$ling[$lang][57].': '.time_en_to_ru($temp[$x+5], $ling, 'en', $lang).''; } $telo.='

    '.linkator ( $server, $prefiks, $ling, $listsize, $cloud_link_mass, $temp[$x+6]).' '.$ling[$lang][48].'

    '."\r\n"; */ $temp[$x+7] = ($temp[$x+7]=='')? $temp[$x+2]:$temp[$x+7]; # generate metatitle $title.=$temp[$x+7].' '; $desc.=$temp[$x+3].' '; # -- keywords $temptags = explode (';',$temp[$x+1]); foreach ($temptags as $item2) { if ($item2 != '') { $tempkey = explode ('-',$item2); $temp_tags [$tempkey[0]] = $tempkey [1]; } } # -- content $temp_content=linkator ($server, $prefiks, $ling, $listsize, $cloud_link_mass, $temp[$x+6]); //$title.=$temp[$x+2].' '; $desc.=$temp[$x+3].' '; # -- add content to template $telo.=content_to_template ( $telo_template_current, $temp_content, $temp[$x], $temp[$x+2], $temp[$x+4], $temp[$x+5], $temp[$x+7], $ling, $lang ); # PATTERN, ID, NAME, AUTHOR, DATE, keywords, ling, lang } $x=$x+7; if($temp_pub==false && $sesia!=true){$z--;} if ($z==$y+$archsize && $FULL_NUM_PAGES==false){break;} } $title = $pref_author.str_replace('_', ' ', $_GET['zapros']).': '.$title; $desc = $pref_author.str_replace('_', ' ', $_GET['zapros']).': '.$desc; # -- may prefer keys handle if ($keygen=='yes'){ foreach ($temp_tags as $item3) { $keywords.=$item3.', ';}} $telo.='
    '; if ($_GET['str']>0){$telo.=''.$simb_left.' ';} # -- Do page numbers if ($gen_num_str >0) { $z = ceil($z/$archsize)-1; for ($v=0; $v<=$z; $v++) { if ($_GET['str'] == $v) {$telo.=''.($v+1).' ';} if ($_GET['str'] != $v && $_GET['str']>=$v-$gen_num_str && $_GET['str']<=$v+$gen_num_str) {$telo.=''.($v+1).' ';} } } if ($z>$_GET['str']){$telo.=''.$simb_right.'';} $telo.='
    '; } # -- likelink if ($likelink =='yes' && $startpage != $_GET['zapros']) {include 'data/likelink.php';} # -- querylink if ($querylink =='yes') {$telo.=get_query_link($ling[$lang], $sesia, $translit_popular, $keywords);} } } # ---------------- # ---------------- ALL # ---------------- if (array_key_exists('event', $_GET)!=false) { if ($_GET['event']=='all' && $_GET['str']!==false) { $temp = $xml->xpath(' /articles/page/@id| /articles/page/@key| /articles/page/titl| /articles/page/desc| /articles/page/author| /articles/page/data| /articles/page/anons| /articles/page/metatitl'); $i=count($temp); $cc = $y=$_GET['str']*$all_size; if(isset($temp[0])) { for ($x=0, $z=0; $x<$i; $x++, $z++) { $temp_pub = (time()>=strtotime($temp[$x+5]))? true:false; if($z>=$y && $z<$y+$all_size && isset($temp[$x]) && ($temp_pub==true || $sesia==true)) { if($temp_pub==false){$telo.='

    '.$ling[$lang][59].'

    ';} /* $telo.='

    '.$temp[$x+2].'

    '; if ($infopage=='yes') { $telo.=$ling[$lang][33].': '.$temp[$x+4].' '.$ling[$lang][57].': '.time_en_to_ru($temp[$x+5], $ling, 'en', $lang).''; } $telo.='

    '.linkator ( $server, $prefiks, $ling, $listsize, $cloud_link_mass, $temp[$x+6]).' '.$ling[$lang][48].'

    '; */ # -- keywords $temptags = explode (';',$temp[$x+1]); foreach ($temptags as $item2) { if ($item2 != '') { $tempkey = explode ('-',$item2); $temp_tags [$tempkey[0]] = $tempkey [1]; } } # -- content $temp_content=linkator ($server, $prefiks, $ling, $listsize, $cloud_link_mass, $temp[$x+6]); $temp[$x+7] = ($temp[$x+7]=='')? $temp[$x+2]:$temp[$x+7]; # generate metatitle $title.=$temp[$x+7].' '; $desc.=$temp[$x+3].' '; # -- add content to template $telo.=content_to_template ( $telo_template_current, $temp_content, $temp[$x], $temp[$x+2], $temp[$x+4], $temp[$x+5], $temp[$x+7], $ling, $lang ); # PATTERN, ID, NAME, AUTHOR, DATE, keywords, ling, lang } $x=$x+7; if($temp_pub==false && $sesia!=true){$z--;} if ($z==$y+$all_size && $FULL_NUM_PAGES==false){break;} } # -- may prefer keys handle if ($keygen=='yes' && isset($temp_tags)==true){ foreach ($temp_tags as $item3) { $keywords.=$item3.', ';}} $telo.='
    '; if ($_GET['str']>1){$telo.=''.$simb_left.' ';$title = $title;} if ($_GET['str']==0){$title = $pref_home.$title;} if ($_GET['str']==1){$telo.="".$simb_left." "; } # -- Do page numbers if ($gen_num_str >0) { $z = ceil($z/$all_size)-1; for ($v=0; $v<=$z; $v++) { if ($_GET['str'] == $v) { if ($v==0) {$telo.=''.($v+1).' ';} else {$telo.=''.($v+1).' ';} } if ($_GET['str'] != $v && $_GET['str']>=$v-$gen_num_str && $_GET['str']<=$v+$gen_num_str) { if ($v==0) {$telo.=''.($v+1).' ';} else {$telo.=''.($v+1).' ';} } } } if ($z>$_GET['str']){$telo.=''.$simb_right.'';} $telo.='
    '; } # -- crosslink //if ($crosslink=='yes') // {include 'data/getlist.php';} # -- likelink if ($likelink =='yes') {include 'data/likelink.php';} # -- querylink if ($querylink =='yes') {$telo.=get_query_link($ling[$lang], $sesia, $translit_popular, $keywords);} } } # ---------------- # ---------------- GALLERY MAIN # ---------------- if (array_key_exists('event', $_GET)!=false) { if ($_GET['event']=='gallery' && $_GET['str']!==false) { $title = $pref_gallery.' '.($_GET['str']+1); $desc = $pref_gallery.' '.($_GET['str']+1); $temp = file ('data/listimages.txt'); $tempik = array_chunk($temp, $gallerysize); $telo.='

    '.$ling[$lang][56].'

    '; # get images if(count($temp)>0) { foreach ($tempik[$_GET['str']] as $item) { $temp_name = str_replace('.gif', '', trim($item)); $temp_name = str_replace('.jpg', '', $temp_name); $temp_name = str_replace('.jpeg', '', $temp_name); $temp_name = str_replace('.png', '', $temp_name); $telo.=' '; } $telo.='

    '; if ($_GET['str']>=1){$telo.=''.$simb_left.' ';} # -- Do page numbers if ($gen_num_str >0) { $z = ceil(count($temp)/$gallerysize)-1; for ($v=0; $v<=$z; $v++) { if ($_GET['str'] == $v) {$telo.=''.($v+1).' ';} if ($_GET['str'] != $v && $_GET['str']>=$v-$gen_num_str && $_GET['str']<=$v+$gen_num_str) {$telo.=''.($v+1).' ';} } } if ($z>$_GET['str']){$telo.=''.$simb_right.'';} $telo.='
    '; } # -- crosslink //if ($crosslink=='yes') // {include 'data/getlist.php';} # -- likelink if ($likelink =='yes' && $startpage != $_GET['zapros']) {include 'data/likelink.php';} # -- querylink if ($querylink =='yes') {$telo.=get_query_link($ling[$lang], $sesia, $translit_popular, $keywords);} } } # ---------------- # ---------------- PAGE # ---------------- if (array_key_exists('event', $_GET)!=false) { if ($_GET['event']=='page' && $_GET['zapros']==true) { $temp = $xml->xpath(' /articles/page[@id=\''.$_GET['zapros'].'\']/@tags| /articles/page[@id=\''.$_GET['zapros'].'\']/@key| /articles/page[@id=\''.$_GET['zapros'].'\']/@comm| /articles/page[@id=\''.$_GET['zapros'].'\']/titl| /articles/page[@id=\''.$_GET['zapros'].'\']/desc| /articles/page[@id=\''.$_GET['zapros'].'\']/author| /articles/page[@id=\''.$_GET['zapros'].'\']/data| /articles/page[@id=\''.$_GET['zapros'].'\']/anons| /articles/page[@id=\''.$_GET['zapros'].'\']/text| /articles/page[@id=\''.$_GET['zapros'].'\']/metatitl'); $x=0; // echo '
    ';print_r($temp);echo '
    '; if(isset($temp[$x])) { if(time()'.$ling[$lang][59].'';} //$telo.='

    '.$temp[$x+3].'

    '; if ($time_en_to_ru) {$temp[$x+6]=time_en_to_ru($temp[$x+6], $ling, 'en', $lang);} //if ($infopage=='yes' && ($temp[$x]!='slujebnaya' || $sesia==true)) //{ //if ($temp[$x]=='slujebnaya'){$temp[$x+6]=date("d M Y");} //$telo.=$ling[$lang][33].': '.$temp[$x+5].' '.$ling[$lang][57].': '.$temp[$x+6].''; //} if (file_exists('pic/'.$_GET['zapros'].'.jpg')==true) {$telo.='';} if (file_exists('pic/'.$_GET['zapros'].'.gif')==true) {$telo.='';} # Editing by size on one page if($sentence_in_page>0) { $temp_sent1= explode ('. ', trim($temp[$x+8])); $temp_sent2=''; $t_0=$_GET['str']*$sentence_in_page; # Offer Starter $t_1=$_GET['str']*$sentence_in_page+$sentence_in_page; $t_2=count($temp_sent1); for ($r=$t_0; $r<$t_1; $r++) { if ($r>=$t_2){break;} $temp_sent2.=$temp_sent1[$r].'. '; } $temp_content='

    '.linkator ( $server, $prefiks, $ling, $listsize, $cloud_link_mass, $temp_sent2).'


    '; # page numbers for PAGES if ($_GET['str']>0 && $_GET['str']<=1) {$temp_content.=''.$simb_left.' '; $title .= ' '.$_GET['str'].' ';} if ($_GET['str']>1) {$temp_content.=''.$simb_left.' '; $title .= ' '.$_GET['str'].' ';} if ($_GET['str']<$t_2/$sentence_in_page-1) {$temp_content.=''.$simb_right.' '; $title .= ' '.$_GET['str'].' ';} $temp_content.='
    '; } else {$temp_content='

    '.linkator ( $server, $prefiks, $ling, $listsize, $cloud_link_mass, $temp[$x+8]).'

    ';} # usual format pages (without pagination) if ($sesia==true) { $adminpanel.=' [Del page] '; $adminpanel.=' [Edit page] '; } $temp[$x+9] = ($temp[$x+9]=='')? $temp[$x+3]:$temp[$x+9]; # generate metatitle $title.=$temp[$x+9]; $desc.=$temp[$x+4]; } else { # Error 404 header("HTTP/1.1 404 Not Found"); exit; } $pagetempcomm=$temp[$x+2]; # -- add content to template $telo.=content_to_template ( $telo_template_current, $temp_content, $_GET['zapros'], $temp[$x+3], $temp[$x+5], $temp[$x+6], $temp[$x+9], $ling, $lang ); # PATTERN, CONTENT, ID, NAME, AUTHOR, DATE, ling, lang # -- add big text if(file_exists('data/bigtext/'.$_GET['zapros'].'.html')) {$telo.="

    \r\n".file_get_contents('data/bigtext/'.$_GET['zapros'].'.html').'

    ';} # -- key $temp_tags = array (); if ($temp[$x+1]!=false)# && $startpage != $_GET['zapros'] { $telo.='
    '.$ling[$lang][58].': '; $temptags = explode (';',$temp[$x+1]); foreach ($temptags as $item2) { if ($item2 != '') { $tempkey = explode ('-',$item2); $temp_tags [$tempkey[0]] = $tempkey [1]; $telo.=''.$tempkey[1].' '; if ($keygen=='yes'){ $keywords.=$tempkey[1].', ';} } } } # -- crosslink //if ($crosslink =='yes') // {include 'data/getlist.php';} # -- likelink if ($likelink =='yes') #&& $startpage != $_GET['zapros'] {include 'data/likelink.php';} # -- querylink if ($querylink =='yes') {$telo.=get_query_link($ling[$lang], $sesia, $translit_popular, $keywords);} # -- comment $fpp=@fopen('comment/'.$_GET['zapros'].'.txt', 'r'); if($fpp!=false) { $telo.='

    '.$ling[$lang][11].'

    '; $telo.=fread($fpp,filesize('comment/'.$_GET['zapros'].'.txt')); fclose($fpp); } if ($pagetempcomm=='yes' && $_GET['zapros']!=$contaktpage)# && $startpage != $_GET['zapros'] {include 'data/formmail.php'; $telo.=$komm;} else if ($pagetempcomm=='yes' && $_GET['zapros']=$contaktpage)# && $startpage != $_GET['zapros'] {include 'data/formcontact.php'; $telo.=$komm;} } } # ---------------- # ---------------- EDIT # ---------------- if (array_key_exists('event', $_GET)!=false) { if ($_GET['event']=='edit' && $_GET['zapros']==true && $sesia==true) { $temp = $xml->xpath(' /articles/page[@id=\''.$_GET['zapros'].'\']/@key| /articles/page[@id=\''.$_GET['zapros'].'\']/@tags| /articles/page[@id=\''.$_GET['zapros'].'\']/@comm| /articles/page[@id=\''.$_GET['zapros'].'\']/titl| /articles/page[@id=\''.$_GET['zapros'].'\']/desc| /articles/page[@id=\''.$_GET['zapros'].'\']/author| /articles/page[@id=\''.$_GET['zapros'].'\']/data| /articles/page[@id=\''.$_GET['zapros'].'\']/anons| /articles/page[@id=\''.$_GET['zapros'].'\']/text| /articles/page[@id=\''.$_GET['zapros'].'\']/metatitl'); $x=0; if(isset($temp[$x])) { $telo.='

    '.$temp[$x+3].'

    '; $adminpanel.=' [Del page] '; # -- restores the old section -- $temp_address=trim($temp[$x]); $menucatselect="'."\r\n".$menucatselect; # -- restore to comments -- if ($temp[$x+2]=='yes') {$menucommentselect="\r\n \r\n";} else {$menucommentselect="\r\n \r\n";} $temp_for_checked = $temp[$x+1]; # checkbox include "data/formaddpage.php"; $formadd=str_replace("rumba_id", $_GET['zapros'], $formadd); $formadd=str_replace("rumba_old_id", $_GET['zapros'], $formadd); $formadd=str_replace("rumba_key", $temp[$x+1], $formadd); $formadd=str_replace("rumba_titl", $temp[$x+3], $formadd); $formadd=str_replace("rumba_metatitl", $temp[$x+9], $formadd); $formadd=str_replace("rumba_author", $temp[$x+5], $formadd); $formadd=str_replace("rumba_data", $temp[$x+6], $formadd); $formadd=str_replace("rumba_desc", $temp[$x+4], $formadd); $formadd=str_replace("rumba_anons", $temp[$x+7], $formadd); $formadd=str_replace("rumba_text", $temp[$x+8], $formadd); $formadd=str_replace("add_page", 'edit_page', $formadd); $telo.=$formadd; $title.=$temp[$x+3]; $desc.=$temp[$x+4];} # for del comment $fpp=@fopen('comment/'.$_GET['zapros'].'.txt', 'r'); if($fpp!=false) {fclose($fpp); $telo.='

    '.$ling[$lang][10].'

    '; $telo.="\r\n
    "; $telo.="\r\n"; $telo.=" 
    "; } } } # ---------------- # ---------------- LOG MENU # ---------------- if (array_key_exists('event', $_GET)!=false) { if ($_GET['event']=='logmenu') { $telo='

    Log In

    '; include 'data/formlogin.php'; $telo.=''; $title='Login'; } } # ---------------- # ---------------- LOG IN # ---------------- if (array_key_exists('event', $_POST)!=false) { if ($_POST['event']=='login' && $_POST['ses_id']==$_SESSION['real'] && ($colsnums.$_POST['sendkod']<=$_SESSION['post']+10 && $colsnums.$_POST['sendkod']>=$_SESSION['post']-10) && $_POST['sendpass']==$adminpass && $_POST['sendname']==$adminlogin) { $_SESSION[md5(getcwd())][session_id()]=md5 ($adminpass); $title='Login'; $telo.='

    '.$ling[$lang][17].'

    '; $telo.=' '.$ling[$lang][61].' '; } if ($_POST['event']=='login' && ($_POST['ses_id']!=$_SESSION['real'] || ($colsnums.$_POST['sendkod']>$_SESSION['post']+10 && $colsnums.$_POST['sendkod']<$_SESSION['post']-10) || $_POST['sendpass']!=$adminpass || $_POST['sendname']!=$adminlogin)) { $title='Login'; $telo.='

    '.$ling[$lang][18].'

    '; $telo.=' '.$ling[$lang][18].' '; sleep(3); } } # ---------------- # ---------------- LOG OUT # ---------------- if (array_key_exists('event', $_GET)!=false) { if ($_GET['event']=='logout' && $sesia==true) { session_destroy(); $adminpanel=''; $title=$ling[$lang][23]; $telo.='

    '.$ling[$lang][17].'

    '; $telo.=' '.$ling[$lang][61].' '; } } # ---------------- # ---------------- ADD PAGE MENU # ---------------- if (array_key_exists('event', $_GET)!=false) { if ($_GET['event']=='addpagemenu' && $sesia==true) { $telo='

    '.$ling[$lang][36].'

    '; $title=$ling[$lang][36]; # -- comments -- $menucommentselect="\r\n \r\n"; $temp_for_checked = 'rumba-Rumba'; # checkbox include "data/formaddpage.php"; $formadd= str_replace ("rumba_key","rumba-Rumba;",$formadd); $formadd= str_replace ("rumba_data",$MyGMTtime, $formadd); $telo.=$formadd; } } # ---------------- # ---------------- TAG MENU # ---------------- if (array_key_exists('event', $_GET)!=false) { if ($_GET['event']=='tagmenu' && $sesia==true) { $telo='

    '.$ling[$lang][44].'

    '; $title=$ling[$lang][44]; $telo.="

    ".$ling[$lang][52]."

    \r\n"; $telo.='"; $telo.="
    \r\n
    \r\n

    ".$ling[$lang][66]."

    ".$ling[$lang][30]." (Only letters!)
    \r\n
    \r\n ".$ling[$lang][9]." (Only letters!)
    \r\n
    \r\n
    "; } } # ---------------- # ---------------- ADD TAG # ---------------- if (array_key_exists('event', $_POST)!==false) { if ($_POST['event']=='add_tag' && $sesia==true) { $_POST['sendid'] = strtolower ($_POST['sendid']); $_POST['sendid'] = str_replace (' ', '', $_POST['sendid']); $_POST['sendid'] = str_replace ('-', '', $_POST['sendid']); $_POST['sendid'] = str_replace ('_', '', $_POST['sendid']); $title=$ling[$lang][40]; $temp=''; $fpp = fopen('./data/checked.txt', 'a+'); fwrite($fpp, $_POST['sendid'].'|'.$_POST['sendname'].'|\r\n"); fclose ($fpp); $telo.='

    '.$ling[$lang][17].'

    '; $telo.=' '.$ling[$lang][61].' '; } } # ---------------- # ---------------- DEL TAG # ---------------- if (array_key_exists('event', $_POST)!==false) { if ($_POST['event']=='del_tag' && $sesia==true) { $temp=''; $fpp = fopen('./data/checked2.txt', 'w+'); foreach(file('./data/checked.txt') as $item) { if (stristr($item, '"sendtag_'.$_POST['sendtags'].'"')!=true) {fwrite($fpp, $item);} } fclose ($fpp); unlink ('./data/checked.txt'); @rename ('./data/checked2.txt', './data/checked.txt'); $telo.='

    '.$ling[$lang][17].'

    '; $telo.=' '.$ling[$lang][61].' '; } } # ---------------- # ---------------- CATEGORY MENU # ---------------- if (array_key_exists('event', $_GET)!=false) { if ($_GET['event']=='categorymenu' && $sesia==true) { $telo='

    '.$ling[$lang][29].'

    '; $title=$ling[$lang][29]; $telo.="

    ".$ling[$lang][52]."

    \r\n"; $telo.=""; $telo.="
    \r\n


    \r\n

    ".$ling[$lang][60]."

    \r\n ".$ling[$lang][70]."
    \r\n
    \r\n ".$ling[$lang][71]."?
    \r\n ".$ling[$lang][30]."
    \r\n
    \r\n ".$ling[$lang][9]."
    \r\n
    \r\n ".$ling[$lang][73]."
    \r\n
    \r\n ".$ling[$lang][34]."
    \r\n
    \r\n
    "; clearing_cache($cashepatch); } } # ---------------- # ---------------- ADD CATEGORY # ---------------- if (array_key_exists('event', $_POST)!==false) { if ($_POST['event']=='add_category' && $sesia==true) { $title=$ling[$lang][40]; $temp=''; $fpp = fopen('data/category2.txt', 'w'); $_POST['senddesc'] = str_replace ("\r", ' ', $_POST['senddesc']); $_POST['senddesc'] = str_replace ("\n", '
    ', $_POST['senddesc']); //fwrite($fpp, $_POST['sendid'].'|'.$_POST['sendname'].'|'.time()."\r\n"); foreach (file('data/category.txt') as $item) { fwrite($fpp, $item); if (strpos($item, $_POST['sendtags2'].'|')!==false) { if (isset($_POST['sendsub'])) { $tempik = explode ("|", $item); $_POST['sendid']=$tempik[0].'-'.$_POST['sendid']; } fwrite($fpp, $_POST['sendid'].'|'.$_POST['sendname'].'|'.time().'|'.$_POST['senddesc'].'|'.$_POST['sendmetatitl']."\r\n"); } } fclose ($fpp); unlink ('data/category.txt'); rename ('data/category2.txt', 'data/category.txt'); $telo.='

    '.$ling[$lang][17].'

    '; $telo.=' '.$ling[$lang][61].' '; clearing_cache($cashepatch); } } # ---------------- # ---------------- DEL CATEGORY # ---------------- if (array_key_exists('event', $_POST)!==false) { if ($_POST['event']=='del_category' && $sesia==true) {//print $_POST['sendtags']; $temp=''; $fpp = fopen('data/category2.txt', 'w+'); foreach(file('./data/category.txt') as $item) { if (strpos($item, $_POST['sendtags'].'|')===false) {fwrite($fpp, $item);} } fclose ($fpp); unlink ('./data/category.txt'); @rename ('./data/category2.txt', './data/category.txt'); $telo.='

    '.$ling[$lang][17].'

    '; $telo.=' '.$ling[$lang][61].' '; } } # ---------------- # ---------------- DEL PAGE # ---------------- if (array_key_exists('event', $_GET)!=false) { if ($_GET['event']=='delpage' && $sesia==true) { $f_new = fopen($basepatch.'data2.xml', 'w+'); $flag=true; foreach(file($basepatch.'data.xml') as $item2) { if (stristr($item2,' '; $telo.=' '.$ling[$lang][61].' '; clearing_cache($cashepatch); } } # ---------------- # ---------------- EDIT PAGE # ---------------- if (array_key_exists('event', $_POST)!==false) { if ($_POST['event']=='edit_page' && $sesia==true) { # -- send PING -- if(isset($_POST['sendping'])) { $rezult_ping=send_ping ($ping_urls, $server.$prefiks.trim($_POST['sendid']).'.html', $_POST['sendtitl']); } $f_new = fopen($basepatch.'data2.xml', 'w+'); $flag=true; $temp_post_checkbox_str=''; foreach(file($basepatch.'data.xml') as $item2) { if (stristr($item2,'$itt) { $itt = htmlspecialchars ($itt); $_POST[$key] = str_replace("\\\\", "\\", $itt); $_POST[$key] = str_replace("\\'", "'", $_POST[$key]); $_POST[$key] = str_replace('\\', '', $_POST[$key]); if(strpos($key, 'sendtag_')!==false) # checkbox { $temp_post_checkbox_str.=$_POST[$key].'-'.$checkbox_mass["$_POST[$key]"].';'; } } # after date $temp_senddata = date('D, d M Y H:i:s', strtotime($_POST['senddata'])+$_POST['sendlost']*24*3600); foreach(file('data/blank.txt') as $item) { $item= str_replace('rumbaid', $_POST['sendid'], $item); $item= str_replace('rumbatags', $_POST['sendtags'], $item); $item= str_replace('rumbakey', $temp_post_checkbox_str, $item);#$_POST['sendkey'] $item= str_replace('rumbacomm', $_POST['sendcomm'], $item); $item= str_replace('rumbatitl', $_POST['sendtitl'], $item); $item= str_replace('rumbametatitl', $_POST['sendmetatitl'], $item); $item= str_replace('rumbadesc', $_POST['senddesc'], $item); $item= str_replace('rumbaauthor', $_POST['sendauthor'], $item); $item= str_replace('rumbaanons', $_POST['sendanons'], $item); $item= str_replace('rumbatext', $_POST['sendtext'], $item); $item= str_replace('rumbadata', $temp_senddata, $item);#date("Y-M-d") $MyGMTtime if (stristr($item,' '; $telo.=' '.$ling[$lang][61].'

    '.$rezult_ping; clearing_cache($cashepatch); } } # ---------------- # ---------------- ADD PAGE !!! # ---------------- if (array_key_exists('event', $_POST)!==false) { if ($_POST['event']=='add_page' && $sesia==true) { $temp=''; # -- send PING -- if(isset($_POST['sendping'])) { $rezult_ping=send_ping ($ping_urls, $server.$prefiks.trim($_POST['sendid']).'.html', $_POST['sendtitl']); } $f_new = fopen($basepatch.'data2.xml', 'w+'); $temp_post_checkbox_str=''; // add page in START or END base if ($_POST['add-end']=='end'){$who_in_blank='/articles>'; $name_add_blank = 'data/blank2.txt';} else{$who_in_blank='$itt) { $itt = htmlspecialchars ($itt); $_POST[$key] = str_replace("\\\\", "\\", $itt); $_POST[$key] = str_replace("\\'", "'", $_POST[$key]); $_POST[$key] = str_replace('\\', '', $_POST[$key]); if(strpos($key, 'sendtag_')!==false) # checkbox { $temp_post_checkbox_str.=$_POST[$key].'-'.$checkbox_mass["$_POST[$key]"].';'; } } # after date $temp_senddata = date('D, d M Y H:i:s', strtotime($_POST['senddata'])+$_POST['sendlost']*24*3600); foreach(file($name_add_blank) as $item) { $item= str_replace('rumbaid', $_POST['sendid'], $item); $item= str_replace('rumbatags', $_POST['sendtags'], $item); $item= str_replace('rumbakey', $temp_post_checkbox_str, $item);#$_POST['sendkey'] $item= str_replace('rumbacomm', $_POST['sendcomm'], $item); $item= str_replace('rumbatitl', $_POST['sendtitl'], $item); $item= str_replace('rumbametatitl', $_POST['sendmetatitl'], $item); $item= str_replace('rumbadesc', $_POST['senddesc'], $item); $item= str_replace('rumbaauthor', $_POST['sendauthor'], $item); $item= str_replace('rumbaanons', $_POST['sendanons'], $item); $item= str_replace('rumbatext', $_POST['sendtext'], $item); $item= str_replace('rumbadata', $temp_senddata, $item);#date("Y-M-d")$MyGMTtime fwrite($f_new, $item); } } else{fwrite($f_new, $item2);} } fclose($f_new); rename($basepatch.'data.xml', $basepatch.'data3.xml'); rename($basepatch.'data2.xml', $basepatch.'data.xml'); unlink ($basepatch.'data3.xml'); # -- set list links if ($crosslink=='yes') {include 'data/setlist.php';} set_cloud ($xml, $cloud_size); set_archive ($xml); $telo.='

    '.$ling[$lang][17].'

    '; $telo.=' '.$ling[$lang][61].'

    '.$rezult_ping; clearing_cache($cashepatch); } } # ---------------- # ---------------- COMMENT # ---------------- if (array_key_exists('event', $_POST)!==false) { if ($_POST['event']=='comment' && (($colsnums.$_POST['kodreal']<=$_SESSION['post']+10 && $colsnums.$_POST['kodreal']>=$_SESSION['post']-10) || $_POST['kodreal']==$adminpass) && $_POST['ses_id']==$_SESSION['real']) { $telo='

    '.$ling[$lang][11].'

    '; $telo.='

    '.$ling[$lang][43].'

    '; if (trim($_POST['komtext'])=='' || trim($_POST['komname'])=='' || strlen($_POST['komtext'])<5) {exit($ling[$lang][37]);} include 'data/comment.php'; $telo.=''; $title=$ling[$lang][11]; } else if ($_POST['event']=='comment') { $title=$ling[$lang][11]; $telo.='

    '.$ling[$lang][11].'

    '; $telo.=' '.$ling[$lang][18].' '; } } # ---------------- # ---------------- DEL COMMENT # ---------------- if (array_key_exists('event', $_POST)!==false) { if ($_POST['event']=='del_comment' && $sesia==true) { $fpp=@fopen('comment/'.$_POST['send_id'].'.txt2', 'w'); $temp=file('comment/'.$_POST['send_id'].'.txt'); foreach ($temp as $item) { if (strstr ($item, $_POST['senddelcomm'])==false) {fwrite ($fpp, $item);} } fclose($fpp); copy ('comment/'.$_POST['send_id'].'.txt2', 'comment/'.$_POST['send_id'].'.txt'); unlink ('comment/'.$_POST['send_id'].'.txt2'); if (count ($temp)==1) {unlink ('comment/'.$_POST['send_id'].'.txt');} $telo.='

    '.$ling[$lang][11].'

    '; $telo.='

    '.$ling[$lang][49].'

    '; $title=$ling[$lang][49]; } } # ---------------- # ---------------- IMAGE LOAD # ---------------- if (array_key_exists('event', $_POST)!==false) { if ($_POST['event']=='load_img' && $sesia==true) { # название в транслит $_POST['namefile'] = trim(lat_ru($_POST['namefile'], 'rl', 'f')); $_POST['namefile'] = str_replace(' ', ' ', $_POST['namefile']); $_POST['namefile'] = str_replace(' ', '-', $_POST['namefile']); $_POST['namefile'] = strtolower($_POST['namefile']); //$temp=explode('.', $_FILES['addfile']['name']); $okonec= str_replace('image/', '', $_FILES['addfile']['type']); $_POST['namefile'].='.'.$okonec; while(file_exists('images/'.$_POST['namefile'])) { $_POST['namefile']=str_replace('.', '-.', $_POST['namefile']); }#print $_POST['namefile']; #echo '
    ';print_r($_FILES);echo '
    '; #--- load -------- $pic_ex = array('.jpg', '.jpeg', '.gif', '.png'); if ($_FILES['addfile']['tmp_name']==true && ( in_array(strrchr($_FILES['addfile']['tmp_name'], '.'), $pic_ex)==true || in_array(strrchr($_FILES['addfile']['name'], '.'), $pic_ex)==true ) ) { copy($_FILES['addfile']['tmp_name'], "images/".$_POST['namefile']) or die("Could not copy $addfile"); //define('$gallerywidth',200); // Thumbmail image $gallerywidth //define('$gallerywidth',200); // Thumbnail image $gallerywidth //define('EXT','.tmb'); // Thumbnail extension //define('IMAGES_PER_PAGE',16); // Image count per one page //define('IMAGES_PER_ROW',4); // Image count per one row //RGB for thumbinal background //define('R',255); //define('G',255); //define('B',255); $file="images/".$_POST['namefile']; $imageInfo = getimagesize( $file ); switch( $imageInfo[2] ) { case 1: $image = imagecreatefromgif( $file ); break; case 2: $image = imagecreatefromjpeg( $file ); break; case 3: $image = imagecreatefrompng( $file ); break; default: exit(); } // Create the thumnail image $result = imagecreatetruecolor($gallerywidth,$gallerywidth); $bg = imagecolorallocate( $result, 255, 255, 255 ); imagefilledrectangle( $result, 0, 0, $gallerywidth-1, $gallerywidth-1, $bg ); // Calculate the aspect ratio for the thumbnail: $border = $gallerywidth/20; $gallerywidth = $gallerywidth-$border*2; $ratio1 = $imageInfo[0]/$gallerywidth; $ratio2 = $imageInfo[1]/$gallerywidth; $ratio = $ratio1>=$ratio2?$ratio1:$ratio2; if ( $ratio<1 ) $ratio=1; $$gallerywidth = $imageInfo[0]/$ratio; $$galleryheight = $imageInfo[1]/$ratio; imagecopyresampled( $result, $image, ($gallerywidth-$$gallerywidth)/2+$border, ($gallerywidth-$$galleryheight)/2+$border, 0, 0, $$gallerywidth, $$galleryheight, $imageInfo[0], $imageInfo[1] ); switch( $imageInfo[2] ) { case 1: imagegif ($result, "images/mini/".$_POST['namefile']); break; case 2: imagejpeg ($result, "images/mini/".$_POST['namefile']); break; case 3: imagepng ($result, "images/mini/".$_POST['namefile']); break; default: exit(); } # create images list $fpp = fopen ('data/listimages.txt', 'w+'); $dir = opendir ("images/"); while ($file = readdir ($dir)) { if($file!='.' && $file!='..' && $file!='' && $file!='mini') {fwrite ($fpp, $file."\r\n"); } } closedir ($dir); fclose ($fpp); chdir($serverlocal); # -- $_GET['event']='imagemenu'; $telo.='

    '.$ling[$lang][17].'

    '; $telo.=' '.$ling[$lang][61].' '; } else{ $_GET['event']='imagemenu'; $telo.='

    '.$ling[$lang][18].'

    '; $telo.=' '.$ling[$lang][18].' '; } } } # ---------------- # ---------------- IMAGE DEL # ---------------- if (array_key_exists('event', $_POST)!==false) { if ($_POST['event']=='delete_img' && $sesia==true) { #--- del -------- unlink($_POST['imgs']); @unlink(str_replace('images/', 'images/mini/', $_POST['imgs'])); # create images list $fpp = fopen ('data/listimages.txt', 'w+'); $dir = opendir ("images/"); while ($file = readdir ($dir)) { if($file!='.' && $file!='..' && $file!='' && $file!='mini') {fwrite ($fpp, $file."\r\n"); } } closedir ($dir); fclose ($fpp); chdir($serverlocal); # -- $_GET['event']='imagemenu'; $telo.='

    '.$ling[$lang][17].'

    '; $telo.=' '.$ling[$lang][61].' '; } } # ---------------- # ---------------- IMAGE MENU # ---------------- if (array_key_exists('event', $_GET)!=false) { if ($_GET['event']=='imagemenu' && $sesia==true) { $telo='

    '.$ling[$lang][51].'

    '; $title=$ling[$lang][51]; $temp=''; include "data/images.php"; $telo.=$core; } } # ---------------- # ---------------- del cache # ---------------- if (array_key_exists('event', $_GET)!=false) { if ($_GET['event']=='del_cache' && $sesia==true) { clearing_cache($cashepatch); $telo='

    '.$ling[$lang][72].'

    '; $title=$ling[$lang][36]; $telo.=' '.$ling[$lang][61].' '; } } # ---------------- # ---------------- OK # ---------------- if (array_key_exists('event', $_POST)!==false) { if ($_POST['event']=='ok') { $telo.='

    '.$ling[$lang][17].'

    '; $telo.=' '.$ling[$lang][61].' '; } } # ---------------- # ---------------- # ---------------- # - Error 404 if ($telo=='') { header("HTTP/1.1 404 Not Found"); exit; } # -- launch party scripts expansion $dir = opendir ('./data/add/'); while ($file = readdir ($dir)) { if($file!="." && $file!=".." && $file!="") { if(strpos($file,".html")==true) { $fpp=fopen('./data/add/'.$file, 'r'); $temp=fread($fpp,filesize('./data/add/'.$file)); fclose($fpp); $file= str_replace('.html', '', $file); $fulldata= str_replace('['.$file.']', $temp, $fulldata); } if(strpos($file,".php")==true) { include_once './data/add/'.$file; } } } closedir ($dir); //$dir = opendir ('./'); closedir ($dir); # --- work with the template ---- $fulldata= str_replace("[adminmail]", $adminmail, $fulldata); $fulldata= str_replace("[serverphp]", $server, $fulldata); $fulldata= str_replace("[titlephp]", $title, $fulldata); $fulldata= str_replace("[lastcomm]", $lastcomm, $fulldata); $fulldata= str_replace("[list]", $pattern_list, $fulldata); $fulldata= str_replace("[lenta]", $pattern_lenta, $fulldata); $fulldata= str_replace("[cloud]", $cloud, $fulldata); $fulldata= str_replace("[randzapis]", $randzapis, $fulldata); $fulldata= str_replace("[archive]", $archive, $fulldata); $fulldata= str_replace("[last_news_list]", $last_news_list, $fulldata); if (array_key_exists('event', $_GET)==false) {$_GET['event'] = 'zero';} if ($_GET['event']!='rss') { $fulldata= str_replace("", "\r\n", $fulldata); $fulldata= str_replace("", "\r\n", $fulldata); if($desc!='') { if (trim($keywords)!='' && $keygen=='yes') {$fulldata= str_replace("", "\r\n\r\n", $fulldata);} else {$fulldata= str_replace("", "\r\n", $fulldata);} } $fulldata= str_replace("[telophp]", $adminpanel.xml_html("
    \r\n".$telo_query."
    \r\n".$telo), $fulldata); } else { $fulldata= str_replace("[descphp]", trim($desc), $fulldata); $fulldata= str_replace("[rsspage]", $rsspage, $fulldata); $fulldata= str_replace("[rsstime]", $rsstime, $fulldata); $telo= str_replace("", '', $telo); $fulldata= str_replace("[telophp]", $telo, $fulldata); } # --- checking caching --- if ($cashe > 0 && $sesia != true && $_GET['event']!='logmenu') { $temp = del_simb ($_SERVER['REQUEST_URI']); //if (@filemtime ($cashepatch.$temp)+$cashe) < time()) // { $fpp=fopen($cashepatch.$temp, 'w+'); fwrite($fpp, $fulldata); fclose($fpp); // } } # -- OUT print trim($fulldata); ?>