|sU",$curfile,$marr,PREG_SET_ORDER|PREG_OFFSET_CAPTURE); $i1=0; if(isset($marr[0][0][0])) { $tstr=substr($curfile,0,$marr[$i1][0][1]); echo $tstr; $count=count($marr); for(; $i1<$count-1; ++$i1) { $phpstr=$marr[$i1][1][0]; //var_dump($phpstr); eval($phpstr); $l=$marr[$i1][0][1]+strlen($marr[$i1][0][0]); echo substr($curfile,$l,$marr[$i1+1][0][1]-$l); } $ts=$marr[$i1][0][1]+strlen($marr[$i1][0][0]); eval($marr[$i1][1][0]); echo substr($curfile,$ts); } else echo $curfile; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// $str=$_SERVER['REQUEST_URI']; /////////////////////////////////////////////// for paging! if(strpos($str,'?')) {$str = substr($str,0,strpos($str,'?'));} /////////////////////////////////////////////// end for paging /////////////////////////////////////////////// for lang $tbl = '`defmenu`'; if(strpos($str,'/en') !== false) { $str = str_replace('/en','',$str); $tbl = '`en`'; } if(strpos($str,'/ua') !== false) { $str = str_replace('/ua','',$str); $tbl = '`ua`'; } /////////////////////////////////////////////// /* if(strstr($str,'events/p')) { $str='/events/'; } if($pos=strpos($str,'?')) { $str=substr($str,0,$pos); } */ //create_content('pages', 'longebay.html', 'main.html', $defNote,$def_navigation_separator); //if($str=='0'){ if($str=='/') { create_content($defTable, $defView, $defDesign, $defNote,$def_navigation_separator); } //elseif($str=='/en/') //{ // create_content('pages', 'en_first.html', 'en_main.html', $defNote,$def_navigation_separator); //} else { if(substr($str,-1)!='/') $str.='/'; $q='select * from ' .$tbl. ' where link like "'.$str.'"'; $r=mysqli_query($dbh,$q); $n=mysqli_num_rows($r); if($n>0) { $row=mysqli_fetch_assoc($r); create_content($row['ltable'], $row['lview'], $row['lmain'], $row['lrecord'],$def_navigation_separator); }else { $t1=substr($str,0,strrpos($str,'/',-2)+1); $t2=substr($str,strrpos($str,'/',-2)+1,-1); $q='select * from ' .$tbl. ' where link like "'.$t1.'"'; $r=mysqli_query($dbh,$q); $n=mysqli_num_rows($r); if($n>0) { $row=mysqli_fetch_assoc($r); if(!preg_match("/![0-9]*/",$t2)) { $q1='select linkid from `'.$row['ltable'].'` where linkid like "'.$t2.'"'; $r1=mysqli_query($dbh,$q1); $n=mysqli_num_rows($r1); if($n>0) { if(isset($_POST['design'])) $view=$_POST['design']; else { $view='long'; } create_content($row['ltable'], $view.'.html',$row['lmain'], $t2,$def_navigation_separator); }else { error404(); exit(); if(isset($_POST['design'])) $view=$_POST['design']; else { if($t1=='/catalog/') $view='dshort'; else $view='long'; } create_content($row['ltable'], $view.'.html',$row['lmain'], $t2,$def_navigation_separator); } }else { //echo $row['ltable'].'/'.$row['lview'].'/'.$row['lmain'].'/'.$row['lrecord']; create_content($row['ltable'], $row['lview'], $row['lmain'], $row['lrecord'],$def_navigation_separator); } }else { $npos=strpos($str,'/',1); $sname=substr($str,1,$npos-1); $q='select menuname from basemenu where menuname like "'.$sname.'"'; $r=mysqli_query($dbh,$q); $n=mysqli_num_rows($r); $surl=substr($str,$npos); if($n>0) { $q='select * from '.$sname.' where link like "'.$surl.'"'; $r=mysqli_query($dbh,$q); $n=mysqli_num_rows($r); if($n>0) { $row=mysqli_fetch_assoc($r); create_content($row['ltable'], $row['lview'], $row['lmain'], $row['lrecord'],$def_navigation_separator); }else { $t1=substr($surl,0,strrpos($surl,'/',-2)+1); $t2=substr($surl,strrpos($surl,'/',-2)+1,-1); $q='select * from '.$sname.' where link like "'.$t1.'"'; $r=mysqli_query($dbh,$q); $n=mysqli_num_rows($r); if($n>0) { $row=mysqli_fetch_assoc($r); if(preg_match('/^!.+/i',$t2)) { //echo ' =='.$row['lview'].'== '; create_content($row['ltable'], $row['lview'], $row['lmain'], $row['lrecord'],$def_navigation_separator); }else { $q1='select linkid from '.$row['ltable'].' where linkid like "'.$t2.'"'; $r1=mysqli_query($dbh,$q1); $n=mysqli_num_rows($r1); if($n>0) { if(isset($_POST['design'])){ $view=$_POST['design']; create_content($row['ltable'], $view.'.html', $row['lmain'], $t2,$def_navigation_separator); } else{ $view='mlong'; create_content($row['ltable'], $view.'.html', 'en_main.html', $t2,$def_navigation_separator); // inner_pages } } else { error404(); } } } else { error404(); } } }else { //echo $surl.' '.$sname; if($sname=='catalog') { $linkid=explode('/',$surl); var_dump($linkid); $sel='select * from '.$sname.' where linkid like "'.$linkid[2].'"'; $qur=mysqli_query($dbh,$sel); if($n=mysqli_num_rows($qur)>0) { create_content($sname, 'dlong.html', 'work.html', $linkid[2],$def_navigation_separator); } } //echo $sel='select * from '.$sname.' where linkid like"'.str_replace('/','',$surl).'"'; /*$qur=mysqli_query($dbh,$sel); if($n=mysqli_num_rows($qur)>0) { create_content($sname, 'long.html', 'main_catalog.html', str_replace('/','',$surl),$def_navigation_separator); }*/ } } } } //} ?>