$confirmation = 2;
    }
}
global $smarty;
$id_shop = $context->shop->id;
$id_lang = $context->language->id;
$id_tdpost = Tools::getValue('tdpost');
if (Tools::getValue('replytocom')) {
    $replytocom = Tools::getValue('replytocom');
} else {
    $replytocom = 0;
}
$numofrepost = Configuration::get('td_numofrepost') ? Configuration::get('td_numofrepost') : 5;
$numofcomments = Configuration::get('td_numofcomments') ? Configuration::get('td_numofcomments') : 5;
$postcomments = tdpsblogModel::getComments($id_tdpost);
$posttotalcomments = count(tdpsblogModel::getTotalCommentsByPost($id_tdpost));
$postcateogyr = tdpsblogModel::getPostCategory();
//print_r($postcateogyr);
// print_r($postcomments);
$tdblogpspost = $psblogobject->gettdBlogPostByID($id_tdpost, $id_lang, $id_shop);
$data = array();
foreach ($tdblogpspost as $tdblogps) {
    $data[] = $tdblogps;
}
if (file_exists(_PS_THEME_DIR_ . 'modules/tdpsblog/form.tpl')) {
    $smarty->assign('comments_form', _PS_THEME_DIR_ . 'modules/tdpsblog/form.tpl');
} else {
    $smarty->assign('comments_form', _PS_MODULE_DIR_ . 'tdpsblog/views/templates/front/form.tpl');
}
if (file_exists(_PS_THEME_DIR_ . 'modules/tdpsblog/comments.tpl')) {
    $smarty->assign('comments_tmp', _PS_THEME_DIR_ . 'modules/tdpsblog/comments.tpl');