示例#1
0
<?php

require_once dirname(__FILE__) . '/../../config/config.inc.php';
require_once dirname(__FILE__) . '/../../init.php';
$psblogobject = new tdpsblogClass();
$context = Context::getContext();
global $smarty;
$context = Context::getContext();
$id_shop = $context->shop->id;
$id_lang = $context->language->id;
if (Tools::getValue('tdcatid')) {
    $totaltdpost = count($psblogobject->getNumberOfPostByCat($id_shop, $id_lang, Tools::getValue('tdcatid')));
} else {
    $totaltdpost = count($psblogobject->getNumberOfPost($id_shop, $id_lang));
}
$psblogobject->items_total = $totaltdpost;
$psblogobject->mid_range = 3;
if (Tools::getValue('page')) {
    $currentpage = Tools::getValue('page');
} else {
    $currentpage = 1;
}
if (Tools::getValue('tdcatid')) {
    //$categorybyid=tdpsblogModel::getCategoryByID(Tools::getValue('tdcatid'));
    //echo Tools::getValue('tdcatid');
    //echo Tools::getValue('rewrite');
    $psblogobject->paginate($currentpage, Tools::getValue('tdcatid'), Tools::getValue('rewrite'));
} else {
    $psblogobject->paginate($currentpage);
}
$limit = $psblogobject->limit;
示例#2
0
<?php

require_once dirname(__FILE__) . '/../../config/config.inc.php';
require_once dirname(__FILE__) . '/../../init.php';
$psblogobject = new tdpsblogClass();
$confirmation = '';
$context = Context::getContext();
if (Tools::isSubmit('submit')) {
    $author = $psblogobject->inputData(Tools::getValue('author'));
    $email = $psblogobject->inputData(Tools::getValue('email'));
    $comment = $psblogobject->inputData(Tools::getValue('comment'));
    if (filter_var(Tools::getValue('email'), FILTER_VALIDATE_EMAIL) && (isset($comment) && !empty($comment)) && (isset($author) && !empty($author))) {
        $psblogobject->insertComments($author, $email, $comment);
        $confirmation = 1;
    } else {
        $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));
示例#3
0
 function hookLeftColumn($params)
 {
     global $smarty;
     $this->context = Context::getContext();
     $psblog = new tdpsblogClass();
     $id_shop = $this->context->shop->id;
     $id_lang = $this->context->language->id;
     $numofrepost = Configuration::get('td_numofrepost') ? Configuration::get('td_numofrepost') : 5;
     $numofcomments = Configuration::get('td_numofcomments') ? Configuration::get('td_numofcomments') : 5;
     $blogtdrecentpost = $psblog->getRecentpost($id_shop, $id_lang, $numofrepost);
     $allblogtdcat = $psblog->getAllCategory($id_shop, $id_lang);
     $blogtdrecentcomments = $psblog->getRecentComments($id_shop, $id_lang, $numofcomments);
     //print_r($blogtdrecentpost);
     $smarty->assign(array('default_lang' => (int) $params['cookie']->id_lang, 'id_lang' => (int) $params['cookie']->id_lang, 'tdblogdetailslinks' => $this->context->link->getModuleLink('tdpsblog', 'details'), 'tdblogcatpostlinks' => $this->context->link->getModuleLink('tdpsblog', 'default'), 'base_url' => __PS_BASE_URI__, 'blogtdrecentpost' => $blogtdrecentpost, 'tdblogallcat' => $allblogtdcat, 'blogtdrecentcomments' => $blogtdrecentcomments));
     return $this->display(__FILE__, 'tdpsblog.tpl');
 }