Hi all,
First a small question:
Will the new admin interface contain an admin interface for event handling?
Now, on to the big one.
I've got problems with the mgd_update_article_created function. Basicly I
supply it with an unix timestamp and everything, but the fields does not get
updated. Here's the code, what is the problem?

<?

$topic = 14;

$article= mgd_list_topic_articles_all($topic);

if ($article) while ($article->fetch()) {

$date = "$article->extra1";  // Delimiters may be slash, dot, or hyphen
$created = $article->created;
$lng = strlen($date);

if ($lng == 10 && ereg( "([0-9]{1,2}).([0-9]{1,2}).([0-9]{4})", $date,
$regs ) ) {

list( $month, $day, $year ) = split( '[/.-]', $date );
// sjekker for 01 02 osv...
if (strpos($day,0)==0) {
$day= substr($day,1);
}
if (strpos($month,0)==0) {
$month= substr($month,1);
}
// ferdig med det.
$timestamp = mktime(0,0,1,$month,$day,$year);
$date2 = date ("d.m.Y",$timestamp);
$datecreated = date("d.m.Y",$created);
$id = $article->id;

if (date("d.m.Y",$created) != $date) {
echo "starter opp konvertering<br>";
if (mgd_update_article_created($id,$timestamp)) {
echo "article has new created date $date, timestamp: $timestamp";
} else { echo "ingen konvertering!"; }
}

// de to over er mgd biten
} // avslutter if ereg
} // avslutter while
?>

Tarjei


--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org

To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]

Reply via email to