You have no permission to access this page!!!'; exit;} }else{ echo '
You have no permission to access this page!!!
'; exit; } function curPageURL() { $pageURL = 'http'; if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} $pageURL .= "://"; if ($_SERVER["SERVER_PORT"] != "80") { $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; } else { $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; } return $pageURL; } $url = curPageURL(); //if (strpos($url,'localhost') != true || strpos($url,$cdomains) != true) {echo '
You have no permission to access this page!!!
'; exit;} else {} */ $urls = explode("/cat.php",$url); $j = ""; $pg = ""; $pg = isset($_GET["pg"]) ? $_GET["pg"] : 1; $images = array(); chdir($dir); //fileatime - show last time file was accessed //filectime - show last time file was changed //filemtime - show last time file was modified //sort() //sort arrays in ascending order //rsort() //sort arrays in descending order array_multisort(array_map('fileatime', ($files = glob("*.*"))), SORT_ASC, $files); rsort($files); foreach ($files as $filename) { if (!preg_match('/\.(jpg|JPG)$/', $filename)) continue; //$size = filesize($dir . $filename); $lastmod = filemtime($filename); $images[] = array('modtime' => $lastmod, 'name' => $filename, 'url' => $dir . $filename); } rsort ($images); $flag = 1; $i = '1'; $current_page = $pg - 1; $per_page = 16; $per_row = 5; $start = $current_page * $per_page; $end = $start + $per_page; $total = count($images); $total_page = ceil($total / $per_page); for ($i = $start; $i < $end; $i++) { $pic = isset($images[$i]['name']) ? $images[$i]['name'] : 'none'; $pic_name = isset($images[$i]['name']) ? substr($images[$i]['name'], 0, -4) : ' '; if ($pic !='none') { $fData = ''; $theData = ''; $head = ''; @$fh = fopen($pic.".html", 'r'); @$theData = fread($fh, 1024); fclose($fh); $fData = strip_tags ($theData,''); $fEx = explode(" ", $fData); $fcount = count($fEx); if ($fcount >8) $max = 8; else $max = 4; $words = explode(" ", $fData); $count = count($words)+1; if ($count > $max) { $head = ""; for ($s = 0; $s < $max; $s++) {$head .= $words[$s] . " ";} $head .= '...';} echo "
".$fData."
".date ("d F Y", filemtime($pic)).""; $file1 = $urls[0].'/'.$dir."zoom/".$pic; ?>
".$head."
"; //$clear = '0'; //$clear = $i+1; if ($clear % 4) {} //else {echo '
';} } if ($flag == $per_row) { $flag = 0; } $flag++; } echo '
'; ?>