PHP Classes

File: get_thumbs.php

Recommend this page to a friend!
  Classes of Olaf Lederer   Import templates   get_thumbs.php   Download  
File: get_thumbs.php
Role: Application script
Content type: text/plain
Description: A tool to copy (batch) thumbnails from TM
Class: Import templates
Import data about templates
Author: By
Last change:
Date: 18 years ago
Size: 1,762 bytes


Class file image Download
(1200); // you need to change this if this value (seconds) is to low/high

microtime_float() {
$usec, $sec) = explode(" ", microtime());
   return ((float)
$usec + (float)$sec);
if (isset(
$_POST['Submit'])) {
$time_start = microtime_float();
$test_import = new Import_templates;
$counter = 0;
$total = $_POST['end'] - $_POST['start'];
    for (
$i = $_POST['start']; $i < $_POST['end']; $i++) {
        if (
$test_import->copy_thumbs($i)) $counter++;
$time_end = microtime_float();
$msg = "... executed in ".$time = $time_end - $time_start." seconds<br>";
$msg .= "Copied ".$counter." of ".$total." thumbnails!";
} else {
$msg = "&nbsp;";
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>TM thumbnail copy tool</title>

<h2>TM thumbnail copy tool</h2>
<p>Use this file to copy thumbnails (files like 8938-m.jpg) on you own server with the same directory structure like on templatemonster.
With the current time limit its possible to copy ca. 700 thumbnails a time. </p>
<form method="post">
  <label for="start">Start number</label>
<input name="start" type="text" value="<?php echo (isset($_POST['start'])) ? $_POST['start'] : ""; ?>" size="6">
  <label for="end">end number</label>
<input name="end" type="text" value="<?php echo (isset($_POST['end'])) ? $_POST['end'] : ""; ?>" size="6">
  <input type="submit" name="Submit" value="Copy now!">
<p><?php echo $msg; ?></p>