나는 MySQL과 완벽하게 작동하지 않는 꽤 복잡한 스크립트를 가지고 있는데, 부분적으로는 그렇게한다.내 상황에 대한 페이지 매김?
function get_all_images($dir)
{
$dir = opendir($dir);
$dirArray = array();
while($entryName = readdir($dir))
{
if(($entryName != ".") && ($entryName != "..") && ($entryName != ".svn") && ($entryName != ".htaccess"))
{
$dirArray[] = $entryName;
}
}
closedir($dir);
(sizeof($dirArray)) ? arsort($dirArray) : '';
return (is_array($dirArray)) ? $dirArray : '';
}
이것은 어떻게 내 페이지의 결과는 순전히 특정 폴더에서 이미지 이름입니다 ... 내가 설명하려고
하자, 내 결과를 얻기 위해이 기능을 사용하여 의미 기본적으로 내 페이지에 결과가 표시됩니다.
<?php
include('includes/header.php');
$images = get_all_images('i');
$url = str_replace('www.', '', generate_site_url());
$flag = false;
$count = 0;
if (empty($images))
{
echo '<h2>There are no uploaded images</h2><br>';
}
foreach ($images as $image)
{
$filename = $image_name = $image;
$image_link = $url . IMAGES_PATH . $filename;
$user_id = fetch_user_id($image_link);
$delete_link = (isset($_POST['delete_link'])) ? $_POST['delete_link'] : '';
$delete_image = (isset($_POST['delete_image'])) ? $_POST['delete_image'] : '';
if ($delete_admin_submit)
{
unlink('./t/' . $delete_image);
unlink('./t/big' . $delete_image);
adminDelete('./i/' . $delete_image, $delete_link);
header('Location: ' . $imgit_action);
exit();
}
echo '<div class="' . ($count++ % 2 ? "odd-color" : "even-color") . '">';
echo '<table>';
echo '<tr><td class="fullwidth"><a class="preview_img" href="' . $image_link . '"><img src="' . $image_link . '" title="Click to enlarge" width="300" class="thumb" /></a></td></tr>';
echo '<tr><td><span class="default">Direct link:</span> ';
echo '<input type="text" readonly="readonly" class="link-area" onmouseover="this.select();" value="' . $image_link . '" />';
echo '<form method="post" action="" onsubmit="return confirmSingleDeletion();" style="display: inline;"> ';
echo '<input type="submit" class="icon_delete" name="delete_link" value="' . $image_link . '" title="Delete this image" />';
echo '<input type="hidden" name="delete_image" value="' . $image_name . '" />';
echo '</form>';
echo '</td></tr>';
echo ($flag) ? '<hr /><br>' : '';
echo '</table>';
if (!empty($user_id))
{
echo '<br><strong class="normal">Uploader ID:</strong> ';
echo '<em class="normal">' . $user_id . '</em><br>';
}
echo '<br>';
$flag = true;
}
?>
<a href="<?php echo $home_action; ?>"><span class="button-sub">« Back to Index</span></a>
<?php echo '</div>'; ?>
<?php include('includes/footer_alt.php'); ?>
이제 결과를 페이지로 나누는 방법을 간단히 알지 못합니다. 여기 12000 가지 이상의 결과가 있습니다. 페이지를로드하는 데 많은 시간이 걸립니다.이 큰 결과를 페이지로 나누려면 도움이 필요합니다.
누구든지 나를 도울 수 있습니까? 적어도 시작하는 방법을 내게 줄래? 나는 정말로 감사 할 것이다.
감사합니다.
이 당신에게 어떤 유용 할 것을 ?? http://stackoverflow.com/questions/5105810/view-files-in-directory-with-pagination-php –
나는 그걸로 뭔가를 얻으려고 노력할 것이다. 다시보고 할 것입니다. 감사. – Aborted
링크와 함께이 일을 진행할 수 없습니다. : \ – Aborted