当前位置: 首页>>代码示例>>PHP>>正文


PHP e107::getTemplate方法代码示例

本文整理汇总了PHP中e107::getTemplate方法的典型用法代码示例。如果您正苦于以下问题:PHP e107::getTemplate方法的具体用法?PHP e107::getTemplate怎么用?PHP e107::getTemplate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在e107的用法示例。


在下文中一共展示了e107::getTemplate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: nodejs_forum_event_user_forum_post_created_callback

/**
 * Event callback after triggering "user_forum_post_created".
 *
 * @param array $info
 *  Details about forum post.
 */
function nodejs_forum_event_user_forum_post_created_callback($info)
{
    $postID = intval(vartrue($info['data']['post_id'], 0));
    $postUserID = intval(vartrue($info['data']['post_user'], 0));
    $postThreadID = intval(vartrue($info['data']['post_thread'], 0));
    if ($postID === 0 || $postThreadID === 0) {
        return;
    }
    // Get forum plugin preferences.
    $plugForumPrefs = e107::getPlugConfig('forum')->getPref();
    $db = e107::getDb();
    // Load thread.
    $thread = $db->retrieve('forum_thread', '*', 'thread_id = ' . $postThreadID);
    $threadUser = intval(vartrue($thread['thread_user'], 0));
    // Load forum to check (read) permission.
    $forum = $db->retrieve('forum', '*', 'forum_id = ' . intval(vartrue($thread['thread_forum_id'], 0)));
    // Author of the forum post.
    $authorPost = e107::user($postUserID);
    // Author of the forum topic.
    $authorThread = e107::user($threadUser);
    e107_require_once(e_PLUGIN . 'nodejs/nodejs.main.php');
    $template = e107::getTemplate('nodejs_forum');
    $sc = e107::getScBatch('nodejs_forum', true);
    $tp = e107::getParser();
    // Get topic page number.
    $postNum = $db->count('forum_post', '(*)', "WHERE post_id <= " . $postID . " AND post_thread = " . $postThreadID . " ORDER BY post_id ASC");
    $postPage = ceil($postNum / vartrue($plugForumPrefs['postspage'], 10));
    // Push rendered row item into Latest Forum Posts menu.
    $sc_vars = array('author' => $authorPost, 'post' => $info['data'], 'thread' => $thread, 'topicPage' => $postPage);
    $sc->setVars($sc_vars);
    $markup = $tp->parseTemplate($template['MENU']['RECENT']['ITEM'], true, $sc);
    $message = (object) array('broadcast' => true, 'channel' => 'nodejs_notify', 'callback' => 'nodejsForumMenu', 'type' => 'latestForumPosts', 'markup' => $markup);
    nodejs_enqueue_message($message);
    // Broadcast logged in users to inform about new forum post created.
    if ($authorPost) {
        $sc->setVars($sc_vars);
        $markup = $tp->parseTemplate($template['NOTIFICATION']['POST_ALL'], true, $sc);
        // It's a public forum, so broadcast every online user.
        if (intval(vartrue($forum['forum_class'], 0)) === 0) {
            $message = (object) array('broadcast' => true, 'channel' => 'nodejs_notify', 'callback' => 'nodejsForum', 'type' => 'newForumPostAny', 'markup' => $markup, 'exclude' => $postUserID);
            nodejs_enqueue_message($message);
        } else {
            $forumClass = vartrue($forum['forum_class'], 0);
            $db->select('nodejs_presence');
            while ($row = $db->fetch()) {
                if (isset($row['uid']) && check_class($forumClass, null, $row['uid'])) {
                    $message = (object) array('channel' => 'nodejs_user_' . $row['uid'], 'callback' => 'nodejsForum', 'type' => 'newForumPostAny', 'markup' => $markup, 'exclude' => $postUserID);
                    nodejs_enqueue_message($message);
                }
            }
        }
    }
    // Broadcast logged in (thread-author) user to inform about new forum post created in his/her topic.
    if (isset($authorThread['user_id'])) {
        $sc->setVars($sc_vars);
        $markup = $tp->parseTemplate($template['NOTIFICATION']['POST_OWN'], true, $sc);
        $message = (object) array('channel' => 'nodejs_user_' . $authorThread['user_id'], 'callback' => 'nodejsForum', 'type' => 'newForumPostOwn', 'markup' => $markup, 'exclude' => $postUserID);
        nodejs_enqueue_message($message);
    }
}
开发者ID:lonalore,项目名称:nodejs_forum,代码行数:66,代码来源:e_module.php

示例2: showImages

 function showImages($cat)
 {
     $mes = e107::getMessage();
     $tp = e107::getParser();
     $template = e107::getTemplate('gallery');
     $template = array_change_key_case($template);
     $sc = e107::getScBatch('gallery', TRUE);
     if (defset('BOOTSTRAP') === true || defset('BOOTSTRAP') === 2) {
         $template['list_start'] = str_replace('row', 'row-fluid', $template['list_start']);
     }
     $sc->total = e107::getMedia()->countImages($cat);
     $sc->amount = 12;
     // TODO Add Pref. amount per page.
     $sc->curCat = $cat;
     $sc->from = $_GET['frm'] ? intval($_GET['frm']) : 0;
     $list = e107::getMedia()->getImages($cat, $sc->from, $sc->amount);
     $catname = $tp->toHtml($this->catList[$cat]['media_cat_title'], false, 'defs');
     $inner = "";
     foreach ($list as $row) {
         $sc->setVars($row);
         $inner .= $tp->parseTemplate($template['list_item'], TRUE, $sc);
     }
     $text = $tp->parseTemplate($template['list_start'], TRUE, $sc);
     $text .= $inner;
     $text .= $tp->parseTemplate($template['list_end'], TRUE, $sc);
     e107::getRender()->tablerender(LAN_PLUGIN_GALLERY_TITLE, $mes->render() . $text);
 }
开发者ID:armpit,项目名称:e107,代码行数:27,代码来源:gallery.php

示例3: renderMenu

 /**
  * Render menu.
  */
 function renderMenu()
 {
     $tpl = e107::getTemplate('nodejs_comment');
     $sc = e107::getScBatch('nodejs_comment', true);
     $tp = e107::getParser();
     $cm = e107::getComment();
     $amount = (int) vartrue($this->plugPrefs['comment_display'], 10);
     /**
      * getCommentData() returns with array, which contains:
      * - comment_datestamp
      * - comment_author_id
      * - comment_author
      * - comment_comment
      * - comment_subject
      * - comment_type
      * - comment_title
      * - comment_url
      */
     $items = $cm->getCommentData($amount);
     $text = $tp->parseTemplate($tpl['MENU']['LATEST']['HEADER'], true, $sc);
     foreach ($items as $item) {
         $sc->setVars($item);
         $text .= $tp->parseTemplate($tpl['MENU']['LATEST']['ITEM'], true, $sc);
     }
     if (empty($items)) {
         $text .= '<a href="#" class="list-group-item no-posts text-center">' . LAN_PLUGIN_NODEJS_COMMENT_FRONT_05 . '</a>';
     }
     $text .= $tp->parseTemplate($tpl['MENU']['LATEST']['FOOTER'], true, $sc);
     e107::getRender()->tablerender(LAN_PLUGIN_NODEJS_COMMENT_FRONT_04, $text);
     unset($text);
 }
开发者ID:lonalore,项目名称:nodejs_comment,代码行数:34,代码来源:nodejs_comment_latest_menu.php

示例4: renderMenu

 /**
  * Render menu contents.
  */
 function renderMenu()
 {
     $template = e107::getTemplate('nodejs_online');
     $sc = e107::getScBatch('nodejs_online', true);
     $tp = e107::getParser();
     e107_require_once(e_PLUGIN . 'nodejs_online/includes/nodejs_online.php');
     $users = nodejs_online_get_online_users();
     $sc->setVars(array('count' => count($users)));
     $text = $tp->parseTemplate($template['MENU']['HEADER'], true, $sc);
     foreach ($users as $uid => $user) {
         $sc->setVars(array('user' => $user));
         $text .= $tp->parseTemplate($template['MENU']['ITEM'], true, $sc);
     }
     $text .= $tp->parseTemplate($template['MENU']['FOOTER'], true);
     e107::getRender()->tablerender(LAN_NODEJS_ONLINE_MENU_01, $text);
     unset($text);
 }
开发者ID:lonalore,项目名称:nodejs_online,代码行数:20,代码来源:nodejs_online_menu.php

示例5: renderMenu

 /**
  * Render menu contents.
  */
 function renderMenu()
 {
     $template = e107::getTemplate('paypal_donation');
     $sc = e107::getScBatch('paypal_donation', true);
     $tp = e107::getParser();
     $db = e107::getDb();
     $db->select('paypal_donation', '*', 'pd_status = 1 ORDER BY pd_weight ASC');
     $text = '';
     while ($row = $db->fetch()) {
         if (check_class($row['pd_visibility']) === true) {
             $item = array('menu_item' => $row, 'amounts' => $this->getAmounts($row['pd_id']), 'raised' => $this->getRaised($row['pd_id']));
             $sc->setVars($item);
             $text .= $tp->parseTemplate($template['MENU'], true, $sc);
         }
     }
     e107::getRender()->tablerender(LAN_PAYPAL_DONATION_FRONT_01, $text);
     unset($text);
 }
开发者ID:lonalore,项目名称:paypal_donation,代码行数:21,代码来源:paypal_donation_menu.php

示例6: nodejs_update_online_menu

 /**
  * Send messages to clients for updating online menu.
  */
 public function nodejs_update_online_menu()
 {
     e107_require_once(e_PLUGIN . 'nodejs/nodejs.main.php');
     e107_require_once(e_PLUGIN . 'nodejs_online/includes/nodejs_online.php');
     $template = e107::getTemplate('nodejs_online');
     $sc = e107::getScBatch('nodejs_online', true);
     $tp = e107::getParser();
     $users = nodejs_online_get_online_users();
     $message = (object) array('broadcast' => true, 'callback' => 'nodejsOnlineMenu', 'type' => 'nodejsOnlineMenuBadge', 'markup' => count($users));
     nodejs_enqueue_message($message);
     $list = '<li role="presentation" class="nav-header dropdown-header">' . LAN_NODEJS_ONLINE_MENU_01 . '</li>';
     foreach ($users as $uinfo => $row) {
         $sc->setVars(array('user' => $row));
         $list .= $tp->parseTemplate($template['MENU']['ITEM'], true, $sc);
     }
     $message = (object) array('broadcast' => true, 'callback' => 'nodejsOnlineMenu', 'type' => 'nodejsOnlineMenuList', 'markup' => $list);
     nodejs_enqueue_message($message);
 }
开发者ID:lonalore,项目名称:nodejs_online,代码行数:21,代码来源:e_cron.php

示例7: renderMenu

 /**
  * Render menu.
  */
 function renderMenu()
 {
     $tpl = e107::getTemplate('nodejs_forum');
     $sc = e107::getScBatch('nodejs_forum', true);
     $tp = e107::getParser();
     $items = $this->getLatestForumPosts();
     $text = $tp->parseTemplate($tpl['MENU']['RECENT']['HEADER'], true, $sc);
     foreach ($items as $item) {
         // Get topic page number.
         $postNum = $this->getPostNum($item['thread']['thread_id'], $item['post']['post_id']);
         $postPage = ceil($postNum / vartrue($this->plugForumPrefs['postspage'], 10));
         $item['topicPage'] = $postPage;
         $sc->setVars($item);
         $text .= $tp->parseTemplate($tpl['MENU']['RECENT']['ITEM'], true, $sc);
     }
     if (empty($items)) {
         $text .= '<div class="no-posts text-center">' . LAN_PLUGIN_NODEJS_FORUM_FRONT_05 . '</div>';
     }
     $text .= $tp->parseTemplate($tpl['MENU']['RECENT']['FOOTER'], true, $sc);
     e107::getRender()->tablerender(LAN_PLUGIN_NODEJS_FORUM_FRONT_04, $text);
     unset($text);
 }
开发者ID:lonalore,项目名称:nodejs_forum,代码行数:25,代码来源:nodejs_forum_recent_menu.php

示例8: showImages

 function showImages($cat)
 {
     $mes = e107::getMessage();
     $tp = e107::getParser();
     $template = e107::getTemplate('gallery');
     $sc = e107::getScBatch('gallery', TRUE);
     $sc->total = e107::getMedia()->countImages($cat);
     $sc->amount = 12;
     // TODO Add Pref. amount per page.
     $sc->curCat = $cat;
     $sc->from = $_GET['frm'] ? intval($_GET['frm']) : 0;
     $list = e107::getMedia()->getImages($cat, $sc->from, $sc->amount);
     $catname = $tp->toHtml($this->catList[$cat]['media_cat_title'], false, 'defs');
     $inner = "";
     foreach ($list as $row) {
         $sc->setVars($row);
         $inner .= $tp->parseTemplate($template['LIST_ITEM'], TRUE);
     }
     $text = $tp->parseTemplate($template['LIST_START'], TRUE);
     $text .= $inner;
     $text .= $tp->parseTemplate($template['LIST_END'], TRUE);
     e107::getRender()->tablerender("Gallery :: " . $catname, $mes->render() . $text);
 }
开发者ID:notzen,项目名称:e107,代码行数:23,代码来源:gallery.php

示例9: pluginsPage

 /**
  * Scan plugin directories and get information from e_libraries.php files.
  */
 function pluginsPage()
 {
     e107_require_once(e_PLUGIN . 'libraries/libraries.php');
     $mes = e107::getMessage();
     $tpl = e107::getTemplate('libraries');
     $sc = e107::getScBatch('libraries', true);
     $tp = e107::getParser();
     $addonsList = libraries_update_addon_list();
     $summ = count($addonsList);
     $message = str_replace('[summ]', $summ, LAN_PLUGIN_LIBRARIES_ADMIN_03);
     $mes->addInfo($message);
     $this->addTitle(LAN_PLUGIN_LIBRARIES_ADMIN_02);
     $output = $mes->render();
     $libraries = libraries_info();
     $output .= $tp->parseTemplate($tpl['TABLE']['HEADER']);
     foreach ($libraries as $machine_name => $info) {
         $details = libraries_detect($machine_name);
         $sc->setVars(array('name' => $details['name'], 'plugin' => varset($details['plugin'], false), 'theme' => varset($details['theme'], false), 'vendor' => $details['vendor url'], 'download' => $details['download url'], 'installed' => array('status' => $details['installed'], 'error' => varset($details['error'], ''), 'message' => varset($details['error message'], ''))));
         $output .= $tp->parseTemplate($tpl['TABLE']['ROW'], true, $sc);
     }
     $output .= $tp->parseTemplate($tpl['TABLE']['FOOTER']);
     return $output;
 }
开发者ID:lonalore,项目名称:libraries,代码行数:26,代码来源:admin_config.php

示例10: nodejs_comment_event_postcomment_callback

/**
 * Event callback after triggering "postcomment".
 *
 * @param array $comment
 *  Comment item.
 *
 * $comment contains:
 * - comment_pid
 * - comment_item_id
 * - comment_subject
 * - comment_author_id
 * - comment_author_name
 * - comment_author_email
 * - comment_datestamp
 * - comment_comment
 * - comment_blocked
 * - comment_ip
 * - comment_type
 * - comment_lock
 * - comment_share
 * - comment_nick
 * - comment_time
 * - comment_id
 *
 * getCommentData() returns with array, which contains:
 * - comment_datestamp
 * - comment_author_id
 * - comment_author
 * - comment_comment
 * - comment_subject
 * - comment_type
 * - comment_title
 * - comment_url
 */
function nodejs_comment_event_postcomment_callback($comment)
{
    e107_require_once(e_PLUGIN . 'nodejs/nodejs.main.php');
    $tpl = e107::getTemplate('nodejs_comment');
    $sc = e107::getScBatch('nodejs_comment', true);
    $tp = e107::getParser();
    $cm = e107::getComment();
    $cid = (int) vartrue($comment['comment_id'], 0);
    $pid = (int) vartrue($comment['comment_pid'], 0);
    $uid = (int) vartrue($comment['comment_author_id'], 0);
    $commentData = $cm->getCommentData(1, 0, 'comment_id=' . $cid);
    if (!isset($commentData[0])) {
        return;
    }
    $authorData = e107::user($uid);
    // Send notification to everyone for updating latest comments menu.
    $sc->setVars($commentData[0]);
    $markup = $tp->parseTemplate($tpl['MENU']['LATEST']['ITEM'], true, $sc);
    $message = (object) array('broadcast' => true, 'channel' => 'nodejs_notify', 'callback' => 'nodejsCommentMenu', 'type' => 'latestComments', 'markup' => $markup);
    nodejs_enqueue_message($message);
    // Send notification to everyone for notifying about new comment.
    $sc->setVars(array('account' => $authorData, 'comment' => $commentData[0]));
    $markup = $tp->parseTemplate($tpl['NOTIFICATION']['POST_ALL'], true, $sc);
    $message = (object) array('broadcast' => true, 'channel' => 'nodejs_notify', 'callback' => 'nodejsComments', 'type' => 'newCommentAny', 'markup' => $markup, 'exclude' => $authorData['user_id']);
    nodejs_enqueue_message($message);
    // Reply on comment.
    if ($pid > 0) {
        $commentParentData = $cm->getCommentData(1, 0, 'comment_id=' . $pid);
        array_pop($commentParentData);
        $authorParentData = e107::user();
        // Send notification to author of parent comment for notifying about new reply.
        $sc->setVars(array('account' => $authorData, 'comment' => $commentData[0]));
        $markup = $tp->parseTemplate($tpl['NOTIFICATION']['POST_OWN'], true, $sc);
        $message = (object) array('channel' => 'nodejs_user_' . $authorParentData['user_id'], 'callback' => 'nodejsComments', 'type' => 'newCommentOwn', 'markup' => $markup, 'exclude' => $authorData['user_id']);
        nodejs_enqueue_message($message);
    }
}
开发者ID:lonalore,项目名称:nodejs_comment,代码行数:71,代码来源:e_module.php

示例11: actionList

 public function actionList()
 {
     $request = $this->getRequest();
     // use only filtered variables
     $cid = $request->getRequestParam('cat');
     if ($cid && !isset($this->catList[$cid])) {
         // get ID by SEF
         $_cid = null;
         foreach ($this->catList as $id => $row) {
             if ($cid === $row['media_cat_sef']) {
                 $_cid = $id;
                 break;
             }
         }
         $cid = $_cid;
     }
     if (empty($cid) || !isset($this->catList[$cid])) {
         $this->_forward('category');
         return;
     }
     $tp = e107::getParser();
     $template = e107::getTemplate('gallery');
     $template = array_change_key_case($template);
     $sc = e107::getScBatch('gallery', TRUE);
     if (defset('BOOTSTRAP') === true || defset('BOOTSTRAP') === 2) {
         $template['list_start'] = str_replace('row', 'row-fluid', $template['list_start']);
     }
     $sc->total = e107::getMedia()->countImages($cid);
     $sc->amount = e107::getPlugPref('gallery', 'perpage', 12);
     // TODO Add Pref. amount per page.
     $sc->curCat = $cid;
     $sc->from = $request->getRequestParam('frm', 0);
     $list = e107::getMedia()->getImages($cid, $sc->from, $sc->amount);
     $catname = $tp->toHtml($this->catList[$cid]['media_cat_title'], false, 'defs');
     $cat = $this->catList[$cid];
     $inner = "";
     foreach ($list as $row) {
         $sc->setVars($row)->addVars($cat);
         $inner .= $tp->parseTemplate($template['list_item'], TRUE, $sc);
     }
     $text = $tp->parseTemplate($template['list_start'], TRUE, $sc);
     $text .= $inner;
     $text .= $tp->parseTemplate($template['list_end'], TRUE, $sc);
     if (isset($template['list_caption'])) {
         $title = $tp->parseTemplate($template['list_caption'], TRUE, $sc);
         $this->addTitle($title)->addBody($text);
     } else {
         $this->addTitle($catname)->addTitle(LAN_PLUGIN_GALLERY_TITLE)->addBody($text);
     }
 }
开发者ID:armpit,项目名称:e107,代码行数:50,代码来源:index.php

示例12: view_all_query

 function view_all_query($srch = '')
 {
     $sql = e107::getDb();
     $tp = e107::getParser();
     $text = "";
     $insert = "";
     $item = false;
     $removeUrl = e107::url('faqs', 'index');
     if (!empty($srch)) {
         $srch = $tp->toDB($srch);
         $insert = " AND (f.faq_question LIKE '%" . $srch . "%' OR f.faq_answer LIKE '%" . $srch . "%' OR FIND_IN_SET ('" . $srch . "', f.faq_tags) ) ";
         $message = "<span class='label label-lg label-info'>" . $srch . " <a class='e-tip' title='Remove' href='" . $removeUrl . "'>×</a></span>";
         e107::getMessage()->setClose(false, E_MESSAGE_INFO)->setTitle(LAN_FAQS_FILTER_ACTIVE, E_MESSAGE_INFO)->addInfo($message);
         $text = e107::getMessage()->render();
     }
     if (!empty($_GET['id'])) {
         $srch = intval($_GET['id']);
         //	$insert = " AND (f.faq_id = ".$srch.") ";
         $item = $srch;
     }
     if (!empty($_GET['cat'])) {
         $srch = $tp->toDB($_GET['cat']);
         $insert = " AND (cat.faq_info_sef = '" . $srch . "') ";
     }
     if (!empty($_GET['tag'])) {
         $srch = $tp->toDB($_GET['tag']);
         $insert = " AND FIND_IN_SET ('" . $srch . "', f.faq_tags)  ";
         $message = "<span class='label label-lg label-info'>" . $srch . " <a class='e-tip' title='Remove' href='" . $removeUrl . "'>×</a></span>";
         e107::getMessage()->setClose(false, E_MESSAGE_INFO)->setTitle(LAN_FAQS_FILTER_ACTIVE, E_MESSAGE_INFO)->addInfo($message);
         $text = e107::getMessage()->render();
     }
     list($orderBy, $ascdesc) = explode('-', vartrue($this->pref['orderby'], 'faq_order-ASC'));
     $query = "SELECT f.*,cat.* FROM #faqs AS f LEFT JOIN #faqs_info AS cat ON f.faq_parent = cat.faq_info_id WHERE cat.faq_info_class IN (" . USERCLASS_LIST . ") " . $insert . " ORDER BY cat.faq_info_order, f." . $orderBy . " " . $ascdesc . " ";
     if (!$sql->gen($query)) {
         $message = !empty($srch) ? "<b>" . $srch . "</b> was not found in search results. <a class='e-tip' title='Reset' href='" . $removeUrl . "'>Reset</a>" : LAN_FAQS_NONE_AVAILABLE;
         return "<div class='alert alert-warning alert-block'>" . $message . "</div>";
         //TODO LAN
     }
     // -----------------
     $FAQ_LISTALL = e107::getTemplate('faqs', true, 'all');
     $prevcat = "";
     $sc = e107::getScBatch('faqs', true);
     $sc->counter = 1;
     $sc->tag = htmlspecialchars($tag, ENT_QUOTES, 'utf-8');
     $sc->category = $category;
     if (!empty($_GET['id'])) {
         $sc->item = intval($_GET['id']);
         $js = "\n\t\t\t\t\$( document ).ready(function() {\n                    \$('html, body').animate({ scrollTop:  \$('div#faq_" . $sc->item . "').offset().top - 300 }, 4000);\n\t\t\t\t});\n\n\t\t\t\t";
         e107::js('footer-inline', $js);
     }
     //	$text = $tp->parseTemplate($FAQ_START, true, $sc);
     //	$text = "";
     if ($this->pref['list_type'] == 'ol') {
         $reversed = $ascdesc == 'DESC' ? 'reversed ' : '';
         $tsrch = array('<ul ', '/ul>');
         $trepl = array('<ol ' . $reversed, '/ol>');
         $FAQ_LISTALL['start'] = str_replace($tsrch, $trepl, $FAQ_LISTALL['start']);
         $FAQ_LISTALL['end'] = str_replace($tsrch, $trepl, $FAQ_LISTALL['end']);
     }
     while ($rw = $sql->fetch()) {
         $rw['faq_sef'] = eHelper::title2sef($tp->toText($rw['faq_question']), 'dashl');
         $sc->setVars($rw);
         if ($sc->item == $rw['faq_id']) {
             $this->pageTitle = $rw['faq_question'];
             $this->pageDescription = $rw['faq_answer'];
         }
         if ($rw['faq_info_order'] != $prevcat) {
             if ($prevcat != '') {
                 $text .= $tp->parseTemplate($FAQ_LISTALL['end'], true, $sc);
             }
             $text .= "\n\n<!-- FAQ Start " . $rw['faq_info_order'] . "-->\n\n";
             $text .= $tp->parseTemplate($FAQ_LISTALL['start'], true, $sc);
             $start = TRUE;
         }
         $text .= $tp->parseTemplate($FAQ_LISTALL['item'], true, $sc);
         $prevcat = $rw['faq_info_order'];
         $sc->counter++;
     }
     $text .= $start ? $tp->parseTemplate($FAQ_LISTALL['end'], true, $sc) : "";
     //		$text .= $tp->parseTemplate($FAQ_END, true, $sc);
     return $text;
 }
开发者ID:armpit,项目名称:e107,代码行数:82,代码来源:faqs.php

示例13: Forecasty

<?php

/*
 * Forecasty - A weather plugin for e107
 *
 * Copyright (C) 2015 Patrick Weaver (http://trickmod.com/)
 * For additional information refer to the README.md file.
 *
 */
if (!defined('e107_INIT')) {
    exit;
}
require_once e_PLUGIN . 'forecasty/_class.php';
$pref = e107::pref('forecasty');
$tp = e107::getParser();
$sc = e107::getScBatch('forecasty', true);
$template = e107::getTemplate('forecasty');
// TODO: Gather the visitors location if they are a memeber, if not, utilize the fallbackLocation.
$location = $pref['fallbackLocation'];
$wf = new Forecasty($pref['apiKey'], $location);
$current = $wf->getData('current');
$hour = $wf->getData('nexthour');
$day = $wf->getData('nextday');
$week = $wf->getData('nextweek');
$sc->setVars(array('current' => array('temperature' => $current['temperature'], 'feelsLike' => $current['feelsLike'], 'icon' => $current['icon'], 'condition' => $current['condition'], 'humidity' => $current['humidity'], 'windSpeed' => $current['windSpeed'], 'visibility' => $current['visibility'], 'pressure' => $current['pressure'], 'dewPoint' => $current['dewPoint']), 'nexthour' => array('temperature' => $hour['temperature'], 'feelsLike' => $hour['feelsLike'], 'icon' => $hour['icon'], 'condition' => $hour['condition'], 'humidity' => $hour['humidity'], 'windSpeed' => $hour['windSpeed'], 'visibility' => $hour['visibility'], 'pressure' => $hour['pressure'], 'dewPoint' => $hour['dewPoint']), 'nextday' => array('temperature' => $day['temperature'], 'feelsLike' => $day['feelsLike'], 'icon' => $day['icon'], 'condition' => $day['condition'], 'humidity' => $day['humidity'], 'windSpeed' => $day['windSpeed'], 'visibility' => $day['visibility'], 'pressure' => $day['pressure'], 'dewPoint' => $day['dewPoint']), 'nextweek' => array('temperature' => $week['temperature'], 'feelsLike' => $week['feelsLike'], 'icon' => $week['icon'], 'condition' => $week['condition'], 'humidity' => $week['humidity'], 'windSpeed' => $week['windSpeed'], 'visibility' => $week['visibility'], 'pressure' => $week['pressure'], 'dewPoint' => $week['dewPoint'])));
$text = $tp->parseTemplate($template['menu'], false, $sc);
e107::getRender()->tablerender('Weather', $text);
开发者ID:gitter-badger,项目名称:forecasty,代码行数:27,代码来源:forecasty_menu.php

示例14: renderPreview

 /**
  *
  */
 function renderPreview()
 {
     global $FORUM_PREVIEW;
     // BC v1.x
     $tp = e107::getParser();
     $ns = e107::getRender();
     $this->processAttachments();
     require_once HEADERF;
     if (USER) {
         $poster = USERNAME;
     } else {
         $poster = $_POST['anonname'] ? $_POST['anonname'] : LAN_ANONYMOUS;
     }
     $postdate = e107::getDate()->convert_date(time(), "forum");
     $tsubject = $tp->post_toHTML($_POST['subject'], true);
     $tpost = $tp->post_toHTML($_POST['post'], true);
     if ($_POST['poll_title'] != '' && check_class($this->forumObj->prefs->get('poll'))) {
         require_once e_PLUGIN . "poll/poll_class.php";
         $poll = new poll();
         $poll_text = $poll->render_poll($_POST, 'forum', 'notvoted', true);
     } else {
         $poll_text = false;
     }
     if (empty($FORUM_PREVIEW)) {
         if (deftrue('BOOTSTRAP')) {
             $FORUM_PREVIEW = e107::getTemplate('forum', 'forum_preview', 'item');
         } else {
             if (file_exists(THEME . "forum_preview_template.php")) {
                 require_once THEME . "forum_preview_template.php";
             } else {
                 require_once e_PLUGIN . "forum/templates/forum_preview_template.php";
             }
         }
     }
     $shortcodes = array('PREVIEW_DATE' => $postdate, 'PREVIEW_SUBJECT' => $tsubject, 'PREVIEW_POST' => $tpost);
     $text = $tp->simpleParse($FORUM_PREVIEW, $shortcodes);
     if ($poll_text) {
         $ns->tablerender($_POST['poll_title'], $poll_text);
     }
     $ns->tablerender(LAN_FORUM_3005, $text);
     /*
     		if ($this->action == 'edit')
     		{
     			if ($_POST['subject'])
     			{
     				$action = 'edit';
     			}
     			else
     			{
     				$action = 'rp';
     			}
     			$eaction = true;
     		}
     		else if($this->action == 'quote')
     		{
     			$action = 'rp';
     			$eaction = false;
     		}*/
 }
开发者ID:JBeezygit,项目名称:e107,代码行数:62,代码来源:forum_post.php

示例15: unset

require_once e_HANDLER . "news_class.php";
unset($text);
global $OTHERNEWS_STYLE;
$ix = new news();
$caption = TD_MENU_L1;
if (!empty($parm)) {
    if (is_string($parm)) {
        parse_str($parm, $parms);
    } else {
        $parms = $parm;
    }
}
if (!$OTHERNEWS_STYLE) {
    if (deftrue('BOOTSTRAP')) {
        define("OTHERNEWS_COLS", false);
        $template = e107::getTemplate('news', 'news_menu', 'other');
        $item_selector = '<div class="btn-group pull-right"><a class="btn btn-mini btn-xs btn-default" href="#otherNews" data-slide="prev">‹</a>  
 		<a class="btn btn-mini btn-xs btn-default" href="#otherNews" data-slide="next">›</a></div>';
        if (!empty($parms['caption'])) {
            $template['caption'] = e107::getParser()->toHtml($parms['caption'], true, 'TITLE');
        }
        $caption = "<div class='inline-text'>" . $template['caption'] . " " . $item_selector . "</div>";
        $OTHERNEWS_STYLE = $template['item'];
    } else {
        if (!empty($parms['caption'])) {
            $caption = e107::getParser()->toHtml($parms['caption'], true, 'TITLE');
        }
        $template['start'] = '';
        $template['end'] = '';
        $OTHERNEWS_STYLE = "\n\t\t<div style='padding:3px;width:100%'>\n\t\t<table style='border-bottom:1px solid black;width:100%' cellpadding='0' cellspacing='0'>\n\t\t<tr>\n\t\t<td style='vertical-align:top;padding:3px;width:20px'>\n\t\t{NEWSCATICON}\n\t\t</td><td style='text-align:left;padding:3px;vertical-align:top'>\n\t\t{NEWSTITLELINK}\n\t\t</td></tr></table>\n\t\t</div>\n";
    }
开发者ID:KonzolozZ,项目名称:e107,代码行数:31,代码来源:other_news_menu.php


注:本文中的e107::getTemplate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。