Nieuw lid |
|
Beste,
Kan iemand mij vertellen wat de uitkomst van deze code is ?
" . ( time() - ( DAYS * 24 * 60 * 60 ) ) . "
" . ( time() - ( DAYS * 24 * 60 * 60 ) ) . "
Want volgens mij werkt me conjob niet helemaal zoals hij moet.
<?php
#define
#minimaal aantal links na DAYS
define ( 'MINIMUM_LINKS', 25 );
#binnen welk aantal dagen moeten er 'MINIMUM_LINKS' aanwezig zijn?
define ( 'DAYS', 14 );
#header
require_once ( '../inc/php/header.inc.php' );
#select pages
$rRes = $oCon->dbQuery ( "SELECT iPageID FROM pages WHERE bChecked = '0' AND iCreated < '" . ( time() - ( DAYS * 24 * 60 * 60 ) ) . "'" );
#loop
while ( $oData = $oCon->dbFetchObject ( $rRes ) ) {
#check links
$iTotal = $oCon->dbFetchResult ( "SELECT COUNT(*) FROM links WHERE iCatID IN ( SELECT iCatID FROM page_categories WHERE iPageID = '" . $oData->iPageID . "' )" );
#more then required?
if ( $iTotal > MINIMUM_LINKS )
$oCon->dbQuery ( "UPDATE pages SET bChecked = '1' WHERE iPageID = '" . $oData->iPageID . "'" );
else
$oCon->dbQuery ( "DELETE FROM pages WHERE iPageID = '" . $oData->iPageID . "'" );
}
?>
<?php #define #minimaal aantal links na DAYS define ( 'MINIMUM_LINKS', 25 ); #binnen welk aantal dagen moeten er 'MINIMUM_LINKS' aanwezig zijn? #header require_once ( '../inc/php/header.inc.php' ); #select pages $rRes = $oCon->dbQuery ( "SELECT iPageID FROM pages WHERE bChecked = '0' AND iCreated < '" . ( time() - ( DAYS * 24 * 60 * 60 ) ) . "'" ); #loop while ( $oData = $oCon->dbFetchObject ( $rRes ) ) { #check links $iTotal = $oCon->dbFetchResult ( "SELECT COUNT(*) FROM links WHERE iCatID IN ( SELECT iCatID FROM page_categories WHERE iPageID = '" . $oData->iPageID . "' )" ); #more then required? if ( $iTotal > MINIMUM_LINKS ) $oCon->dbQuery ( "UPDATE pages SET bChecked = '1' WHERE iPageID = '" . $oData->iPageID . "'" ); else $oCon->dbQuery ( "DELETE FROM pages WHERE iPageID = '" . $oData->iPageID . "'" ); } ?>
|