Hi
im wondering how i could implement Pagination to my media
here is my function…
[php]function get_media($media_cat, $display_recent, $purifier, $media_id) {
if (!empty($media_id)) {
if ($media_id == $media_cat) {
$display_recent = null;
}
}
$files = array();
$files = glob(MEDIA_BASEDIR.$media_cat.’/*.txt’);
usort($files, function($x, $y) {
return $x < $y;
});
$recent_content = array_slice($files, 0, $display_recent);
foreach ($recent_content as $media) {
$line = file($media);
$media_title = ($purifier->purify($line[0]));
$date_time = basename($media);
$date_time = basename($media, ‘.txt’);
$content = file_get_contents($media);
$content = str_replace($media_title,’’,$content);
thememediatop($media_title, $media_cat, $media_id);
print_r ($purifier->purify($content));
thememediabottom($date_time);
}
}[/php]
i will probably make a new function for the media page itself for the pagination, this function can be placed on any page by telling it what directory to use and how many to display useing…
[php]get_media(‘Announcements’, 1, $purifier, $media_id);[/php]
any help would be great, thanks.