merge of post parsing code into autopromo.php