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


PHP e107::getScBatch方法代码示例

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


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

示例1: sc_threadtopic

 function sc_threadtopic()
 {
     global $THREADTOPIC_REPLY;
     $tmp = $this->forum->postGet($this->threadInfo['thread_id'], 0, 1);
     e107::getScBatch('view', 'forum')->setScVar('postInfo', $tmp[0]);
     return $this->e107->tp->parseTemplate($THREADTOPIC_REPLY, true);
 }
开发者ID:notzen,项目名称:e107,代码行数:7,代码来源:post_shortcodes.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: 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

示例5: display_help

function display_help($tagid = "helpb", $mode = 1, $addtextfunc = "addtext", $helpfunc = "help", $helpsize = '')
{
    return e107::getBB()->renderButtons($mode, 'data');
    // guessing the name of the textarea as 'data' no indicator unfortunately.
    // may cause pre-image and pre-file selector issues.
    //  if(defsettrue('e_WYSIWYG')) { return; }
    global $tp, $pref, $eplug_bb, $bbcode_func, $register_bb, $bbcode_help, $bbcode_helpactive, $bbcode_helptag, $bbcode_helpsize;
    $bbcode_helpsize = $helpsize;
    $bbcode_func = $addtextfunc;
    $bbcode_help = $helpfunc;
    $bbcode_helptag = $tagid;
    // $arr = get_defined_vars();
    // print_a($arr);
    // load the template
    if (is_readable(THEME . "bbcode_template.php")) {
        include THEME . "bbcode_template.php";
    } else {
        include e_THEME . "templates/bbcode_template.php";
    }
    if ($mode != 2 && $mode != "forum") {
        $bbcode_helpactive = TRUE;
    }
    // Load the Plugin bbcode AFTER the templates, so they can modify or replace.
    if (!empty($pref['e_bb_list'])) {
        foreach ($pref['e_bb_list'] as $val) {
            if (is_readable(e_PLUGIN . $val . "/e_bb.php")) {
                require e_PLUGIN . $val . "/e_bb.php";
            }
        }
    }
    $temp = array();
    $temp['news'] = $BBCODE_TEMPLATE_NEWSPOST;
    $temp['submitnews'] = $BBCODE_TEMPLATE_SUBMITNEWS;
    $temp['extended'] = $BBCODE_TEMPLATE_NEWSPOST;
    $temp['admin'] = $BBCODE_TEMPLATE_ADMIN;
    $temp['mailout'] = $BBCODE_TEMPLATE_MAILOUT;
    $temp['page'] = $BBCODE_TEMPLATE_CPAGE;
    $temp['maintenance'] = $BBCODE_TEMPLATE_ADMIN;
    $temp['comment'] = $BBCODE_TEMPLATE;
    $temp['signature'] = $BBCODE_TEMPLATE_SIGNATURE;
    if (isset($temp[$mode])) {
        $BBCODE_TEMPLATE = $temp[$mode];
    }
    $visible = deftrue('e_WYSIWYG') ? "style='display:none'" : "";
    if (is_readable(e_CORE . "shortcodes/batch/bbcode_shortcodes.php")) {
        $sc = e107::getScBatch('bbcode');
        if ($tagid == 'data') {
            $tagid = 'data_';
        }
        $data = array('tagid' => $tagid, 'template' => $mode, 'trigger' => $addtextfunc, 'hint_func' => $helpfunc, 'hint_active' => $bbcode_helpactive, 'size' => $helpsize);
        $sc->setVars($data);
        return "<div id='bbcode-panel-" . $tagid . "' class='mceToolbar bbcode-panel' {$visible}>" . $tp->parseTemplate($BBCODE_TEMPLATE) . "</div>";
    } else {
        return "ERROR: " . e_CORE . "shortcodes/batch/bbcode_shortcodes.php IS NOT READABLE.";
    }
}
开发者ID:notzen,项目名称:e107,代码行数:56,代码来源:ren_help.php

示例6: sc_social_login

 function sc_social_login($parm = null)
 {
     $pref = e107::pref('core', 'social_login_active');
     if (empty($pref)) {
         return;
     }
     $sc = e107::getScBatch('signup');
     $text = "<p>Sign in with:</p>";
     $text .= $sc->sc_signup_xup_login($parm);
     $text .= "\n\t\t<div class='clearfix'></div><hr class='clearfix' />";
     return $text;
 }
开发者ID:OSUser,项目名称:e107,代码行数:12,代码来源:e_shortcode.php

示例7: parseheader

 function parseheader($LAYOUT)
 {
     $tp = e107::getParser();
     $tmp = explode("\n", $LAYOUT);
     $sc = e107::getScBatch('_theme_');
     foreach ($tmp as $line) {
         if (preg_match("/{.+?}/", $line)) {
             echo $tp->parseTemplate($line, true, $sc) . "\n";
             // retain line-breaks.
         } else {
             echo $line . "\n";
             // retain line-breaks.
         }
     }
 }
开发者ID:armpit,项目名称:e107,代码行数:15,代码来源:header_default.php

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: 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

示例13: 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

示例14: 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

示例15: __construct

 function __construct()
 {
     global $pref, $TEMPLATE_TAGWORDS, $tagwords_shortcodes;
     $this->e107 = e107::getInstance();
     //language
     e107::includeLan(e_PLUGIN . "tagwords/languages/" . e_LANGUAGE . ".php");
     //shortcodes
     //require_once(e_PLUGIN.'tagwords/tagwords_shortcodes.php');
     $this->shortcodes = e107::getScBatch('tagwords', TRUE);
     //$this->shortcodes = $tagwords_shortcodes;
     //template
     if (is_readable(THEME . "tagwords_template.php")) {
         require_once THEME . "tagwords_template.php";
     } else {
         require_once e_PLUGIN . "tagwords/tagwords_template.php";
     }
     $this->template = $TEMPLATE_TAGWORDS;
     $this->pref = $this->get_prefs();
     //load plugin and core tagword areas
     $this->loadPlugin();
     $this->loadCore();
     //prepare and assign key'ed tagwords data
     $this->mapper();
 }
开发者ID:armpit,项目名称:e107,代码行数:24,代码来源:tagwords_class.php


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