Matt, great job on the tutorials. I must say I have learned an enormous amount of php over the last few months due to using your CMS as a foundation.
However, I am having a bit of an issue when I move everything from my localhost to my mediatemple server. I have fixed a ton of the errors that I had but these two persist.
1) The dates bump one day back every time I add a new post. Also, when I update the post it bumps one day further back. I have changed the timezone to America/Chicago from the php website and have looked at a few of the UNIX time fixes and havent really found anything that worked yet.
2) I am getting an invalid argument error and header error when I try to delete a post. Here is the error that I get from the browser (this is for a church so Article was replaced by Sermon):
[i][b]Warning: Invalid argument supplied for foreach() in tylercookmedia.com/html/clients/agape/admin/classes/Sermon.php on line 162
Warning: Invalid argument supplied for foreach() in tylercookmedia.com/html/clients/agape/admin/classes/Sermon.php on line 167
Warning: Cannot modify header information - headers already sent by (output started at tylercookmedia.com/html/clients/agape/admin/classes/Sermon.php:162) in tylercookmedia.com/html/clients/agape/admin/add-sermon.php on line 145[/b]
[/i]
Here is the code from all of those lines and I am pretty much stuck as to what the problem is sense it works locally but not on the live server.
line 162
// Delete all fullsize images for this Sermon
foreach (glob(SERMON_IMAGE_PATH . "/" . IMG_TYPE_FULLSIZE . "/" . $this->id . ".*") as $filename) {
if ( !unlink( $filename ) ) trigger_error( "Sermon::deleteImages(): Couldn't delete image file.", E_USER_ERROR );
}
Line 167
// Delete all thumbnail images for this Sermon
foreach (glob( SERMON_IMAGE_PATH . "/" . IMG_TYPE_THUMB . "/" . $this->id . ".*") as $filename) {
if ( !unlink( $filename ) ) trigger_error( "Sermon::deleteImages(): Couldn't delete thumbnail file.", E_USER_ERROR );
}
Header Error on line 145 (im assuming that once the for each error is resolved this one will work itself out)
function deleteSermon() {
if ( !$sermon = Sermon::getById( (int)$_GET['sermonId'] ) ) {
header( "Location: add-sermon.php?error=sermoneNotFound" );
return;
}
$sermon->deleteImages();
$sermon->delete();
header( "Location: add-sermon.php?status=sermonDeleted" );
}
Any ideas on what could be causing this would be much appreciated.