Login   Register  
PHP Classes
elePHPant
Icontem

File: remote_update.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Olaf Lederer  >  Import templates  >  remote_update.php  >  Download  
File: remote_update.php
Role: Example script
Content type: text/plain
Description: execute this file to with a CRON job
Class: Import templates
Import data about TemplateMonster.com templates
Author: By
Last change:
Date: 2005-05-21 01:24
Size: 1,403 bytes
 

Contents

Class file image Download
<?php 
set_time_limit
(240);
require(
$_SERVER['DOCUMENT_ROOT']."/classes/import_templates/import_templates.php"); 

function 
microtime_float() { 
   list(
$usec$sec) = explode(" "microtime()); 
   return ((float)
$usec + (float)$sec); 

$time_start microtime_float();
$body "The following updates are done:\r\n\r\n";

$test_import = new Import_templates;

$test_import->handle_keywords(1"yes");
$body .= $test_import->show_messages();

$test_import->handle_categories(1"yes");
$body .= $test_import->show_messages();

$test_import->handle_screenshots(1"yes");
$body .= $test_import->show_messages();

$test_import->handle_categorie_list("en""yes");
$body .= $test_import->show_messages();

$test_import->handle_authors("yes");
$body .= $test_import->show_messages();

$test_import->get_zero_thumbs();
$body .= $test_import->show_messages();
$test_import->write_log(1);

$time_end microtime_float();
$time $time_end $time_start;

$body .= "The script's execution time was ".number_format($time4".""")." seconds...";

$header "From: \"Webmaster\" <mail@provider.com>\r\n";
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-Type: text/plain; charset=\"utf-8\"\r\n";
$header .= "Content-Transfer-Encoding: 7bit\r\n";
$subject "Template import from ".date("d-m-Y"); 
mail("google@gmail.com"$subject$body$header);
exit;
?>