Location: PHPKode > scripts > ImageVine Image Hosting Script > ImageVine/Script/admin/files.php
<?php

/*

    File Name: files.php
	Project: ImageVine
	Author: ScriptVine.com
	Revision: 1a

*/


// include header
include("header.php");

// set page name
$page = "files";

// set page title
$page_title = "Manage Files";

// check admin login
$admin->check_admin_login();

// get current page number
$page_number = isset($_GET['p']) ? $_GET['p'] : 1;

// start query for all uploaded files
$q = "SELECT image_name, original_name, views, image_size, id FROM uploads ORDER BY id DESC ";
$num = mysql_num_rows(mysql_query($q));

// setup pagination
$pagination = new Pagination();
$pagination->setLink($config['base_url'] . '/admin/files.php?p=%s');
$pagination->setPage($page_number);
$pagination->setSize(20);
$pagination->setTotalRecords($num);

// continue query for all uploaded files
$q .= $pagination->getLimitSql();
$r = mysql_query($q) or die(mysql_error());

// loop over results and build array
while($i = mysql_fetch_array($r))
{
    $filesArray[] = array("image_name" => $i['image_name'], 
	                      "original_name" => $i['original_name'], 
						  "views" => $i['views'],
						  "id" => $i['id'],
						  "size" => $i['image_size']);
}

// set template vars
$smarty->assign("files", $filesArray);
$smarty->assign("pagination", $pagination->create_links());

// include footer
include("footer.php");

?>
Return current item: ImageVine Image Hosting Script