changed sql query to only publish posts with publish times before the current time