<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<title>{$CONFIG.site_title} | Maintenance Operations</title>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<link rel="stylesheet" type="text/css" href="/templates/css/all.css" />
		<!--[if lte IE 6]><link rel="stylesheet" type="text/css" media="screen" href="/templates/css/ie.css" /><![endif]-->
		<link rel="icon" href="/templates/img/favicon.ico" type="image/x-icon" />
	</head>
	<body id="activity" class="admin">
		<div id="pagebody">
			<div id="content_container">
				{include file="$TEMPLATES/includes/header.tpl"}
				<div id="content">
					{include file="$TEMPLATES/includes/admin_side_menu.tpl"}
					<div class="main">
					<p class="intro">There are several maintenence operations you can perform:</p>
					<ul>
						<li class="intro"><span>Delete orphaned photos</span>: goes through each photo or video in the database and makes sure the physical file still exists.  If it no longer exists, this is removed from the database.</li>
						<li class="intro"><span>Check roll association</span>: Makes sure each photo or video belongs to the roll in which the file is located.  If it doesn't, it is added to this roll.</li>
						<li class="intro"><span>Check media urls</span>: makes sure each media url is unique, so that if two files with different extensions are in the same folder, unique names will be created for each.</li>
						<li class="intro"><span>Regenerate tag cache</span>: regenerates the tag cache from all tags.  This is useful for search, and in the rare case that a tag is not coming up as a result when it exists.</li>
						<li class="intro"><span>Update album count cache</span>: for each album, count the number of photos and videos, and update this number.</li>
						<li class="intro"><span>Delete albums with no photos</span>: if an album has no photos, purge it from the database</li>
						<li class="intro"><span>Update security cache</span>: make sure the security level for each album is in sync with the security of the photos contained within that album.</li>
						<li class="intro"><span>Update comment cache</span>: count the number of comments for each photo and update this number</li>
						<li class="intro"><span>Reset album modified times</span>: sets album modified times to the newest modified time of all the photos in that album.  Good way to automatically sort albums</li>
						<li class="intro"><span>Reset album created times</span>: sets album created times to the oldest timestamp of all the photos in that album.</li>
						<li class="intro"><span>Update comment search index</span>: rebuilds the search index so searching for text within comments will return the photo or video for which the comment was left</li>
						<li class="intro"><span>Flush tag email queue</span>: sends out all emails pending in the tag email queue</li>
						<li class="intro"><span>Reset thumbnail cache markers</span>: erase all database markers for thumbnail caches so that they can be incrementally regenerated with a partial thumbnail generation</li>
						<li class="intro"><span>Generate new thumbnails</span>: if the thumbnail cache has been properly reset (above), only generate new thumbnails</li>
						<li class="intro"><span>Regenerate all thumbnails</span>: pregenerates all thumbnails (newest photos first) which will dramatically increase loading times of albums.</li>
						<li class="intro"><span>Generate all flash videos</span>: converts all videos to a streaming format so this does not have to be done on the fly</li>
					</ul>

					<form action="/admin/maintenance" method="post" target="status" name="scan">
					<div class="control_select">
                                        <select name="operation">
                                                <option>--Select a maintenence operation--</option>
						<option value="1">Delete orphaned photos</option>
						<option value="2">Check roll association</option>
						<option value="3">Check media urls</option>
						<option value="4">Regenerate tag cache</option>
						<option value="5">Update album count cache</option>
						<option value="6">Delete albums with no photos</option>
						<option value="7">Update security cache</option>
						<option value="8">Update comment cache</option>
						<option value="9">Reset album modified times</option>
						<option value="10">Reset album created times</option>
						<option value="11">Update comment search index</option>
						<option value="12">Flush tag email queue</option>
						<option value="13">Reset thumbnail cache markers</option>
						<option value="14">Generate new thumbnails</option>
						<option value="15">Regenerate all thumbnails</option>
						<option value="16">Generate all flash videos</option>
                                        </select>
                                        <input type="submit" value="Perform Operation" onclick="this.disabled=true;this.value='Working on it ...';this.form.submit();"/>
					<div class="control_select">
                                        </form>

                                        <iframe id="status" name="status" src="/admin/status" frameborder="0" border="0" cellspacing="0"></iframe>

                                        </div>
				</div>
			{include file="$TEMPLATES/includes/footer.tpl"}
			</div>
		</div>
	</body>
</html>
