for (; $top <= $num_page && $total >= 0; $top++) {
        $top_display[] = $top;
        $total--;
    }
    sort($top_display, SORT_NUMERIC);
    if ($top > $rows / $pagination + 1) {
        $arrow_last_display = 0;
    }
    $tpl->assign("bottom_display", $bottom_display);
    $tpl->assign("top_display", $top_display);
    $tpl->assign("arrow_first_display", $arrow_first_display);
    $tpl->assign("arrow_last_display", $arrow_last_display);
}
$resultat = array("code" => 0, "msg" => 'ok', "data" => null, "pagination" => null);
//$fp = fopen('/tmp/debug.txt', 'a+');
//fwrite($fp, print_r($get_information, true));
$_SESSION['OT_form_logs'] = $get_information['form'];
try {
    $tickets = $ticket_log->getLog($get_information['form'], $centreon_bg, $get_information['pagination'], $get_information['current_page']);
    //fwrite($fp, print_r($tickets, true));
    $tpl = new Smarty();
    $tpl = initSmartyTplForPopup($centreon_open_tickets_path, $tpl, 'views/logs/templates', $centreon_path);
    $tpl->assign("tickets", $tickets['tickets']);
    $resultat['data'] = $tpl->fetch('data.ihtml');
    // Get Pagination
    set_pagination($tpl, $get_information['pagination'], $get_information['current_page'], $tickets['rows']);
    $resultat['pagination'] = $tpl->fetch('pagination.ihtml');
} catch (Exception $e) {
    $resultat['code'] = 1;
    $resultat['msg'] = $e->getMessage();
}
<?php

if (count($getArticles) > 0) {
    foreach ($getArticles as $g) {
        $userdata = $userUtil->getUser($g['AUTEUR']);
        $date = $this->instance->date->time($g['DATE'], TRUE);
        $news_categories = array();
        $_keyWords = array();
        $categories = $news->getArticlesRelatedCategory($g['ID']);
        $gkeywords = $news->getNewsKeyWords($g['ID']);
        //looping keywords
        foreach ($gkeywords as $kw) {
            $_keyWords[] = array('TITLE' => $kw['TITLE'], 'LINK' => $this->instance->url->site_url(array($page[0]['PAGE_CNAME'], 'tags', $kw['URL_TITLE'])), 'DESCRIPTION' => $kw['DESCRIPTION']);
        }
        foreach ($categories as $category) {
            $news_categories[] = array('TITLE' => $category['CATEGORY_NAME'], 'LINK' => $this->instance->url->site_url(array($page[0]['PAGE_CNAME'], 'categorie', $category['CATEGORY_URL_TITLE'])), 'DESCRIPTION' => $category['CATEGORY_DESCRIPTION']);
        }
        $userdata = $this->instance->users_global->getUser($g['AUTEUR']);
        $date = $g['DATE'];
        // $Pcategory		=	$news->retreiveCat($g['CATEGORY_ID']);
        $ttComments = $news->countComments($g['ID']);
        set_blog_post(array('title' => $g['TITLE'], 'content' => $g['CONTENT'], 'thumb' => $g['THUMB'], 'full' => $g['IMAGE'], 'author' => $userdata, 'link' => $this->instance->url->site_url(array($page[0]['PAGE_CNAME'], 'lecture', $g['URL_TITLE'])), 'timestamp' => $date, 'categories' => $news_categories, 'keywords' => $_keyWords, 'comments' => $ttComments));
    }
    $superArray['currentPage'] = $paginate['current_page'];
    $superArray['totalPage'] = $paginate['available_pages'];
    $superArray['innerLink'] = $paginate['pagination'];
    set_pagination($superArray);
}
$theme->blog_posts();
示例#3
0
set_blog_single(array('title' => $GetNews[0]['TITLE'], 'content' => $GetNews[0]['CONTENT'], 'thumb' => $GetNews[0]['IMAGE'], 'full' => $GetNews[0]['IMAGE'], 'author' => $userdata, 'timestamp' => $GetNews[0]['DATE'], 'categories' => $categories, 'keywords' => $keywords, 'comments' => $news->countComments($GetNews[0]['ID'])));
// intégration des commentaires
if (count($Comments) > 0) {
    foreach ($Comments as $c) {
        $userdata = get_user($c['AUTEUR'], 'as_id');
        $final_user = $userdata;
        if (!$userdata) {
            $final_user = array('PSEUDO' => $c['OFFLINE_AUTEUR'], 'ID' => 0, 'EMAIL' => '');
            $author_link = '#';
        } else {
            $author_link = get_instance()->url->site_url(array('account', 'profile', $userdata['PSEUDO']));
        }
        set_blog_comment(array('author' => $final_user, 'authorlink' => $author_link, 'content' => $c['CONTENT'], 'timestamp' => $c['DATE']));
    }
}
set_pagination(array('innerLink' => $pagination[4], 'currentPage' => $currentPage));
// Intégration du formulaire de réponse.
if ($this->instance->users_global->isConnected()) {
    $pseudo = $this->instance->users_global->current('PSEUDO');
    $email = $this->instance->users_global->current('EMAIL');
} else {
    $pseudo = '';
    $email = '';
}
// REPLY FORM
if ($setting['EVERYONEPOST'] == 0) {
    if ($userUtil->isConnected()) {
        set_form('blog_single_reply_form', array('type' => 'text', 'name' => 'pseudo', 'value' => $pseudo, 'placeholder' => 'Entrez votre pseudo', 'text' => 'Entrez votre pseudo'));
        set_form('blog_single_reply_form', array('type' => 'text', 'name' => 'mail', 'value' => $email, 'placeholder' => 'Entrez votre email', 'text' => 'Entrez votre email'));
        set_form('blog_single_reply_form', array('type' => 'textarea', 'name' => 'content', 'placeholder' => 'Entrez votre commentaireE', 'text' => 'Entrez votre commentaire'));
        set_form('blog_single_reply_form', array('type' => 'submit', 'value' => 'Publier le commentaire'));