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


PHP Template::unset_var方法代码示例

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


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

示例1: WIDGET_springMenu

function WIDGET_springMenu($dataArray)
{
    global $_CONF;
    $rand = rand(1, 1000);
    $slideCounter = 1;
    $retval = '';
    $templateFile = 'spring-menu.thtml';
    // define the JS we need for this theme..
    $outputHandle = outputHandler::getInstance();
    // core js
    $outputHandle->addLinkScript($_CONF['site_url'] . '/javascript/addons/accordion-image-menu/jquery.accordionImageMenu.min.js');
    $outputHandle->addLinkStyle($_CONF['site_url'] . '/javascript/addons/accordion-image-menu/accordionImageMenu.css');
    $T = new Template($_CONF['path_layout'] . '/widgets');
    if (isset($dataArray['template'])) {
        $templateFile = $dataArray['template'];
    }
    $T->set_file('widget', $templateFile);
    $T->set_var('rand', $rand);
    $T->set_block('widget', 'images', 'i');
    foreach ($dataArray['images'] as $images) {
        $T->unset_var('link');
        $T->unset_var('image');
        $T->unset_var('slidecounter');
        if (isset($images['link']) && $images['link'] != '') {
            $T->set_var('link', $images['link']);
        }
        $imageURL = str_replace("%site_url%", $_CONF['site_url'], $images['image']);
        $T->set_var('image', $imageURL);
        $T->set_var('slidecounter', $slideCounter);
        $T->parse('i', 'images', true);
        $slideCounter++;
    }
    $last = 0;
    $T->set_block('widget', 'options', 'o');
    foreach ($dataArray['options'] as $option => $value) {
        $optionLine = '';
        if ($last > 0) {
            $optionLine .= ',';
        }
        $optionLine .= "'" . $option . "'" . ": " . "'" . $value . "'";
        $T->set_var('optionvalue', $optionLine);
        $T->parse('o', 'options', true);
        $last++;
    }
    $T->parse('output', 'widget');
    $retval = $T->finish($T->get_var('output'));
    return $retval;
}
开发者ID:spacequad,项目名称:glfusion,代码行数:48,代码来源:lib-widgets.php

示例2: MAIL_displayForm

/**
* Shows the form the admin uses to send glFusion members a message. Now you
* can email a user or an entire group depending upon whether uid or grp_id is
* set.  if both arguments are >0, the group send function takes precedence
*
* @return   string      HTML for the email form
*
*/
function MAIL_displayForm($uid = 0, $grp_id = 0, $from = '', $replyto = '', $subject = '', $message = '')
{
    global $_CONF, $_TABLES, $_USER, $LANG31, $LANG03, $LANG_ADMIN;
    USES_lib_admin();
    $retval = '';
    if (isset($_POST['postmode'])) {
        $postmode = COM_applyFilter($_POST['postmode']);
        if ($postmode != 'html' || $postmode != 'plaintext') {
            $postmode = $_CONF['postmode'];
        }
    } else {
        $postmode = $_CONF['postmode'];
    }
    $mail_templates = new Template($_CONF['path_layout'] . 'admin/mail');
    $mail_templates->set_file('form', 'mailform.thtml');
    if ($postmode == 'html') {
        $mail_templates->set_var('show_htmleditor', true);
    } else {
        $mail_templates->unset_var('show_htmleditor');
    }
    $mail_templates->set_var('postmode', $postmode);
    $mail_templates->set_var('lang_postmode', $LANG03[2]);
    $mail_templates->set_var('postmode_options', COM_optionList($_TABLES['postmodes'], 'code,name', $postmode));
    $mail_templates->set_var('startblock_email', COM_startBlock($LANG31[1], '', COM_getBlockTemplate('_admin_block', 'header')));
    $mail_templates->set_var('php_self', $_CONF['site_admin_url'] . '/mail.php');
    $usermode = $uid > 0 && $grp_id == 0 ? true : false;
    $send_to_group = $usermode ? '' : '1';
    $mail_templates->set_var('send_to_group', $send_to_group);
    $menu_arr = array(array('url' => $_CONF['site_admin_url'] . '/user.php', 'text' => $LANG_ADMIN['admin_users']), array('url' => $_CONF['site_admin_url'] . '/group.php', 'text' => $LANG_ADMIN['admin_groups']), array('url' => $_CONF['site_admin_url'], 'text' => $LANG_ADMIN['admin_home']));
    $instructions = $usermode ? $LANG31[28] : $LANG31[19];
    $icon = $_CONF['layout_url'] . '/images/icons/mail.png';
    $admin_menu = ADMIN_createMenu($menu_arr, $instructions, $icon);
    $mail_templates->set_var('admin_menu', $admin_menu);
    if ($usermode) {
        // we're sending e-Mail to a specific user
        $mail_templates->set_var('lang_instructions', $LANG31[28]);
        $mail_templates->set_var('lang_to', $LANG31[18]);
        $to_user = '';
        $lang_warning = $LANG31[29];
        $warning = '';
        // get the user data, and check the privacy settings
        $result = DB_query("SELECT username,fullname,email FROM {$_TABLES['users']} WHERE uid = " . (int) $uid);
        $nrows = DB_numRows($result);
        if ($nrows > 0) {
            $A = DB_fetchArray($result);
            $username = $_CONF['show_fullname'] ? $A['fullname'] : $A['username'];
            $to_user = $username . ' (' . $A['email'] . ')';
            $emailfromadmin = DB_getItem($_TABLES['userprefs'], 'emailfromadmin', "uid = " . (int) $uid);
            $warning = $emailfromadmin == 1 ? '' : $LANG31[30];
        }
        $mail_templates->set_var('to_user', $to_user);
        $mail_templates->set_var('to_uid', $uid);
        $mail_templates->set_var('lang_warning', $lang_warning);
        $mail_templates->set_var('warning', $warning);
    } else {
        // we're sending e-Mail to a group of users
        $mail_templates->set_var('lang_instructions', $LANG31[19]);
        $mail_templates->set_var('lang_to', $LANG31[27]);
        $mail_templates->set_var('lang_selectgroup', $LANG31[25]);
        // build group options select, allow for possibility grp_id has been supplied
        $group_options = '';
        $result = DB_query("SELECT grp_id, grp_name FROM {$_TABLES['groups']} WHERE grp_name <> 'All Users'");
        $nrows = DB_numRows($result);
        $groups = array();
        for ($i = 0; $i < $nrows; $i++) {
            $A = DB_fetchArray($result);
            $groups[$A['grp_id']] = ucwords($A['grp_name']);
        }
        asort($groups);
        foreach ($groups as $groupID => $groupName) {
            if (SEC_inGroup('Root') || SEC_inGroup($groupName) && $groupName != 'Logged-in Users' && $groupName != 'Mail Admin') {
                $group_options .= '<option value="' . $groupID . '"';
                $group_options .= $groupID == $grp_id ? ' selected="selected"' : '';
                $group_options .= '>' . $groupName . '</option>';
            }
        }
        $mail_templates->set_var('group_options', $group_options);
    }
    $mail_templates->set_var('lang_from', $LANG31[2]);
    $frm = empty($from) ? $_CONF['site_name'] : $from;
    $mail_templates->set_var('site_name', $frm);
    $mail_templates->set_var('lang_replyto', $LANG31[3]);
    $rto = empty($replyto) ? $_CONF['site_mail'] : $replyto;
    $mail_templates->set_var('site_mail', $rto);
    $mail_templates->set_var('lang_subject', $LANG31[4]);
    $mail_templates->set_var('subject', $subject);
    $mail_templates->set_var('lang_body', $LANG31[5]);
    $mail_templates->set_var('message_text', $message);
    $mail_templates->set_var('message_html', $message);
    $mail_templates->set_var('lang_sendto', $LANG31[6]);
    $mail_templates->set_var('lang_allusers', $LANG31[7]);
    $mail_templates->set_var('lang_admin', $LANG31[8]);
//.........这里部分代码省略.........
开发者ID:spacequad,项目名称:glfusion,代码行数:101,代码来源:mail.php

示例3: mailstoryform

/**
* Display form to email a story to someone.
*
* @param    string  $sid    ID of article to email
* @return   string          HTML for email story form
*
*/
function mailstoryform($sid, $to = '', $toemail = '', $from = '', $fromemail = '', $shortmsg = '', $msg = 0)
{
    global $_CONF, $_TABLES, $_USER, $LANG03, $LANG08, $LANG_LOGIN;
    $retval = '';
    if (COM_isAnonUser() && ($_CONF['loginrequired'] == 1 || $_CONF['emailstoryloginrequired'] == 1)) {
        $display = COM_siteHeader('menu', $LANG_LOGIN[1]);
        $display .= SEC_loginRequiredForm();
        $display .= COM_siteFooter();
        echo $display;
        exit;
    }
    $result = DB_query("SELECT COUNT(*) AS count FROM {$_TABLES['stories']} WHERE sid = '" . DB_escapeString($sid) . "'" . COM_getTopicSql('AND') . COM_getPermSql('AND'));
    $A = DB_fetchArray($result);
    if ($A['count'] == 0) {
        return COM_refresh($_CONF['site_url'] . '/index.php');
    }
    if ($msg > 0) {
        $retval .= COM_showMessage($msg, '', '', 0, 'info');
    }
    if (empty($from) && empty($fromemail)) {
        if (!COM_isAnonUser()) {
            $from = COM_getDisplayName($_USER['uid'], $_USER['username'], $_USER['fullname']);
            $fromemail = DB_getItem($_TABLES['users'], 'email', "uid = {$_USER['uid']}");
        }
    }
    $postmode = $_CONF['mailuser_postmode'];
    $mail_template = new Template($_CONF['path_layout'] . 'profiles');
    $mail_template->set_file('form', 'contactauthorform.thtml');
    if ($postmode == 'html') {
        $mail_template->set_var('show_htmleditor', true);
    } else {
        $mail_template->unset_var('show_htmleditor');
    }
    $mail_template->set_var('lang_postmode', $LANG03[2]);
    $mail_template->set_var('postmode', $postmode);
    $mail_template->set_var('start_block_mailstory2friend', COM_startBlock($LANG08[17]));
    $mail_template->set_var('lang_fromname', $LANG08[20]);
    $mail_template->set_var('name', $from);
    $mail_template->set_var('lang_fromemailaddress', $LANG08[21]);
    $mail_template->set_var('email', $fromemail);
    $mail_template->set_var('lang_toname', $LANG08[18]);
    $mail_template->set_var('toname', $to);
    $mail_template->set_var('lang_toemailaddress', $LANG08[19]);
    $mail_template->set_var('toemail', $toemail);
    $mail_template->set_var('lang_shortmessage', $LANG08[27]);
    $mail_template->set_var('shortmsg', @htmlspecialchars($shortmsg, ENT_COMPAT, COM_getEncodingt()));
    $mail_template->set_var('lang_warning', $LANG08[22]);
    $mail_template->set_var('lang_sendmessage', $LANG08[16]);
    $mail_template->set_var('story_id', $sid);
    PLG_templateSetVars('emailstory', $mail_template);
    $mail_template->set_var('end_block', COM_endBlock());
    $mail_template->parse('output', 'form');
    $retval .= $mail_template->finish($mail_template->get_var('output'));
    return $retval;
}
开发者ID:spacequad,项目名称:glfusion,代码行数:62,代码来源:profiles.php

示例4: isset

            $output .= " - <b>" . $i . "</b> -&nbsp;&nbsp;";
        } else {
            $output .= " - " . $i . " -&nbsp;&nbsp;";
        }
    }
    $tpl->set_var("PROGRESS", $output);
    $tpl->parse("PROGRESS_ROW", "progress_row");
}
//build current questionary page
$double = false;
$page_content = $geo->get_page($page_number);
$numbering = $question_number ? $geo->get_page_questionnumber($page_number) : 0;
foreach ($page_content as $segment) {
    $entity = $segment;
    //clear cell for line
    $tpl->unset_var("QUEST_CELL");
    //get question number if needed
    $numbering_string = $numbering != 0 && isset($entity["input_id"]) ? $numbering++ . ". " : "";
    // build HTML for each element
    switch ($entity["type"]) {
        case QUESTIONARY_DESCRIPTION:
            $tpl->set_var("DESCRIPTION", $UBB->encode($entity["text"]));
            $tpl->parse("QUEST_CELL", "description", true);
            break;
        case QUESTIONARY_CAPTION:
            $tpl->set_var("CAPTION", nl2br(norm_post($entity["text"])));
            $tpl->parse("QUEST_CELL", "caption", true);
            break;
        case QUESTIONARY_EMPTY_LINE:
            $tpl->parse("QUEST_CELL", "empty_line", true);
            break;
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:answer.php

示例5: requestpassword

/**
* User request for a new password - send email with a link and request id
*
* @param username string   name of user who requested the new password
* @param msg      int      index of message to display (if any)
* @return         string   form or meta redirect
*
*/
function requestpassword($username, $msg = 0)
{
    global $_CONF, $_TABLES, $LANG04;
    $retval = '';
    // no remote users!
    $username = DB_escapeString($username);
    $result = DB_query("SELECT uid,email,passwd,status FROM {$_TABLES['users']} WHERE username = '" . $username . "' AND (account_type & " . LOCAL_USER . ")");
    $nrows = DB_numRows($result);
    if ($nrows == 1) {
        $A = DB_fetchArray($result);
        if ($_CONF['usersubmission'] == 1 && $A['status'] == USER_ACCOUNT_AWAITING_APPROVAL) {
            echo COM_refresh($_CONF['site_url'] . '/index.php?msg=48');
        }
        $reqid = substr(md5(uniqid(rand(), 1)), 1, 16);
        DB_change($_TABLES['users'], 'pwrequestid', "{$reqid}", 'uid', (int) $A['uid']);
        $T = new Template($_CONF['path_layout'] . 'email/');
        $T->set_file(array('html_msg' => 'mailtemplate_html.thtml', 'text_msg' => 'mailtemplate_text.thtml'));
        $T->set_block('html_msg', 'content', 'contentblock');
        $T->set_block('text_msg', 'contenttext', 'contenttextblock');
        $T->set_var('content_text', sprintf($LANG04[88], $username));
        $T->parse('contentblock', 'content', true);
        $T->parse('contenttextblock', 'contenttext', true);
        $T->set_var('url', $_CONF['site_url'] . '/users.php?mode=newpwd&uid=' . $A['uid'] . '&rid=' . $reqid);
        $T->set_var('button_text', $LANG04[91]);
        $T->parse('contentblock', 'content', true);
        $T->parse('contenttextblock', 'contenttext', true);
        $T->unset_var('button_text');
        $T->set_var('content_text', $LANG04[89]);
        $T->parse('contentblock', 'content', true);
        $T->parse('contenttextblock', 'contenttext', true);
        $T->set_var('site_url', $_CONF['site_url']);
        $T->set_var('site_name', $_CONF['site_name']);
        $T->set_var('title', $_CONF['site_name'] . ': ' . $LANG04[16]);
        $T->parse('output', 'html_msg');
        $mailhtml = $T->finish($T->get_var('output'));
        $T->parse('textoutput', 'text_msg');
        $mailtext = $T->finish($T->get_var('textoutput'));
        $msgData['htmlmessage'] = $mailhtml;
        $msgData['textmessage'] = $mailtext;
        $msgData['subject'] = $_CONF['site_name'] . ': ' . $LANG04[16];
        $msgData['from']['name'] = $_CONF['site_name'];
        $msgData['from']['email'] = $_CONF['noreply_mail'];
        $msgData['to']['email'] = $A['email'];
        $msgData['to']['name'] = $username;
        COM_emailNotification($msgData);
        COM_updateSpeedlimit('password');
        if ($msg) {
            echo COM_refresh($_CONF['site_url'] . "/index.php?msg={$msg}");
        } else {
            echo COM_refresh($_CONF['site_url'] . '/index.php');
        }
    } else {
        COM_updateSpeedlimit('password');
        echo COM_refresh($_CONF['site_url'] . '/users.php?mode=getpassword');
        exit;
    }
    return $retval;
}
开发者ID:spacequad,项目名称:glfusion,代码行数:66,代码来源:users.php

示例6: fopen

 $tpl->set_block("language", "category_edit_title");
 $tpl->set_block("language", "category_edit_description");
 $tpl->set_block("language", "category_edit_ubb");
 $tpl->set_block("language", "category_edit_button_ok");
 $tpl->set_block("language", "category_edit_button_cancel");
 $tpl->set_var(array("DOC_ROOT" => $config_webserver_ip));
 $tpl->parse("TITLE", "category_edit_title");
 $tpl->parse("LANGUAGE_FEEDBACK_HEADLINE_NULL", "category_edit_feedback_headline_null");
 $tpl->parse("LANGUAGE_DESCRIPTION", "category_edit_description");
 $tpl->parse("LANGUAGE_UBB", "category_edit_ubb");
 $tpl->parse("BUTTON_LABEL", "category_edit_button_ok");
 $tpl->parse("LANGUAGE_BUTTON_CANCEL", "category_edit_button_cancel");
 $tpl->parse("CONTENT", $current_file);
 $tpl->parse("OUT", "blueprint");
 $out = $tpl->get_var("OUT");
 $tpl->unset_var("BUTTON_LABEL");
 $fp = fopen("{$topic_doc_root}/templates/{$language}/{$current_file}.ihtml", "w");
 fwrite($fp, $out);
 fclose($fp);
 echo "&nbsp;&nbsp;&nbsp; {$current_file}.ihtml abgeschlossen. (... {$topic_doc_root}/templates/{$language}/{$current_file}.ihtml)<br>";
 //*******************************************************************
 //* category_sort.ihtml
 //*******************************************************************
 $current_file = "category_sort";
 $tpl->set_file($current_file, "{$current_file}.ihtml");
 $tpl->set_block("language", "category_sort_title");
 $tpl->set_block("language", "category_sort_button_ok");
 $tpl->set_block("language", "category_sort_button_cancel");
 $tpl->set_var(array("DOC_ROOT" => $config_webserver_ip));
 $tpl->parse("TITLE", "category_sort_title");
 $tpl->parse("BUTTON_LABEL", "category_sort_button_ok");
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:admin_language.php

示例7: parse


//.........这里部分代码省略.........
     }
     $archivetid = DB_getItem($_TABLES['topics'], 'tid', "archive_flag=1");
     $sql = " (date <= NOW()) AND (draft_flag = 0)";
     if (empty($topic)) {
         $sql .= COM_getLangSQL('tid', 'AND', 's');
     }
     // if a topic was provided only select those stories.
     if (!empty($topic)) {
         $sql .= " AND s.tid = '" . DB_escapeString($topic) . "' ";
     }
     if ($featured == 1) {
         $sql .= " AND s.featured = 1 ";
     } else {
         if ($featured == 2) {
             $sql .= " AND s.featured = 0 ";
         }
     }
     if ($frontpage == 1) {
         $sql .= " AND frontpage = 1 ";
     }
     if ($topic != $archivetid) {
         $sql .= " AND s.tid != '{$archivetid}' ";
     }
     $sql .= COM_getPermSQL('AND', 0, 2, 's');
     $sql .= COM_getTopicSQL('AND', 0, 's') . ' ';
     $userfields = 'u.uid, u.username, u.fullname';
     if ($_CONF['allow_user_photo'] == 1) {
         $userfields .= ', u.photo';
         if ($_CONF['use_gravatar']) {
             $userfields .= ', u.email';
         }
     }
     $orderBy = ' date DESC ';
     $headlinesSQL = "SELECT STRAIGHT_JOIN s.*, UNIX_TIMESTAMP(s.date) AS unixdate, " . 'UNIX_TIMESTAMP(s.expire) as expireunix, ' . $userfields . ", t.topic, t.imageurl " . "FROM {$_TABLES['stories']} AS s, {$_TABLES['users']} AS u, " . "{$_TABLES['topics']} AS t WHERE (s.uid = u.uid) AND (s.tid = t.tid) AND" . $sql . "ORDER BY featured DESC," . $orderBy;
     if ($display > 0) {
         $headlinesSQL .= " LIMIT " . $display;
     }
     $result = DB_query($headlinesSQL);
     $numRows = DB_numRows($result);
     if ($numRows < $cols) {
         $cols = $numRows;
     }
     if ($cols > 6) {
         $cols = 6;
     }
     if ($numRows > 0) {
         $T = new Template($_CONF['path'] . 'system/autotags/');
         $T->set_file('page', $template);
         $T->set_var('columns', $cols);
         $T->set_block('page', 'headlines', 'hl');
         $newstories = array();
         while ($A = DB_fetchArray($result)) {
             $T->unset_var('readmore_url');
             $T->unset_var('lang_readmore');
             if ($A['attribution_author'] != '') {
                 $author = $A['attribution_author'];
             } else {
                 $author = $A['username'];
             }
             $title = COM_undoSpecialChars($A['title']);
             $title = str_replace('&nbsp;', ' ', $title);
             $subtitle = COM_undoSpecialChars($A['subtitle']);
             if ($A['story_image'] != '') {
                 $story_image = $_CONF['site_url'] . $A['story_image'];
             } else {
                 $story_image = '';
             }
             $A['introtext'] = STORY_renderImages($A['sid'], $A['introtext']);
             if (!empty($A['bodytext'])) {
                 $closingP = strrpos($A['introtext'], "</p>");
                 if ($closingP !== FALSE) {
                     $text = substr($A['introtext'], 0, $closingP);
                     $A['introtext'] = $text;
                 }
                 // adds the read more link
                 $T->set_var('readmore_url', COM_buildUrl($_CONF['site_url'] . '/article.php?story=' . $A['sid']));
                 $T->set_var('lang_readmore', $LANG01['continue_reading']);
             }
             if ($truncate > 0) {
                 $A['introtext'] = $this->truncateHTML($A['introtext'], $truncate, '...');
             }
             $topicurl = $_CONF['site_url'] . '/index.php?topic=' . $A['tid'];
             $dt->setTimestamp($A['unixdate']);
             if ($A['commentcode'] >= 0) {
                 $cmtLinkArray = CMT_getCommentLinkWithCount('article', $A['sid'], $_CONF['site_url'] . '/article.php?story=' . $A['sid'], $A['comments'], 1);
                 $T->set_var(array('lang_comments' => '', 'comments_count' => $cmtLinkArray['comment_count'], 'comments_url' => $cmtLinkArray['url'], 'comments_url_extra' => $cmtLinkArray['url_extra']));
             } else {
                 $T->unset_var('lang_comments');
                 $T->unset_var('comments_count');
                 $T->unset_var('comments_url');
                 $T->unset_var('comments_url_extra');
             }
             $T->set_var(array('titlelink' => $titleLink ? TRUE : '', 'meta' => $meta ? TRUE : '', 'lang_by' => $LANG01[95], 'lang_posted_in' => $LANG01['posted_in'], 'story_topic_url' => $topicurl, 'title' => $title, 'subtitle' => $subtitle, 'story_image' => $story_image, 'text' => PLG_replaceTags($A['introtext']), 'date' => $A['date'], 'time' => $dt->format('Y-m-d', true) . 'T' . $dt->format('H:i:s', true), 'topic' => $A['topic'], 'tid' => $A['tid'], 'author' => $author, 'author_id' => $A['uid'], 'sid' => $A['sid'], 'short_date' => $dt->format($_CONF['shortdate'], true), 'date_only' => $dt->format($_CONF['dateonly'], true), 'date' => $dt->format($dt->getUserFormat(), true), 'url' => COM_buildUrl($_CONF['site_url'] . '/article.php?story=' . $A['sid']), 'attribution_url' => $A['attribution_url'], 'attribution_name' => $A['attribution_name']));
             $T->parse('hl', 'headlines', true);
         }
         $retval = $T->finish($T->parse('output', 'page'));
         CACHE_create_instance($instance_id, $retval, 0);
     }
     return $retval;
 }
开发者ID:spacequad,项目名称:glfusion,代码行数:101,代码来源:headlines.class.php

示例8: FF_postEditor

function FF_postEditor($postData, $forumData, $action, $viewMode)
{
    global $_CONF, $_TABLES, $_FF_CONF, $FF_userprefs, $_USER, $LANG_GF01, $LANG_GF02, $LANG_GF10, $REMOTE_ADDR;
    $retval = '';
    $editmoderator = false;
    $numAttachments = 0;
    $edit_val = '';
    $sticky_val = '';
    $locked_val = '';
    if (COM_isAnonUser()) {
        $uid = 1;
    } else {
        $uid = $_USER['uid'];
    }
    // initialize defaults
    if ($_FF_CONF['bbcode_disabled']) {
        $disable_bbcode_val = ' checked="checked"';
    } else {
        $disable_bbcode_val = '';
    }
    if ($_FF_CONF['smilies_disabled']) {
        $disable_smilies_val = ' checked="checked"';
    } else {
        $disable_smilies_val = '';
    }
    if ($_FF_CONF['urlparse_disabled']) {
        $disable_urlparse_val = ' checked="checked"';
    } else {
        $disable_urlparse_val = '';
    }
    // check postmode
    if (isset($postData['postmode'])) {
        // this means we are editing or previewing (or both)
        if (isset($postData['postmode_switch'])) {
            // means they selected a switch
            $chkpostmode = _ff_chkpostmode($postData['postmode'], $postData['postmode_switch']);
            if ($chkpostmode != $postData['postmode']) {
                $postData['postmode'] = $chkpostmode;
                $postData['postmode_switch'] = 0;
            }
        }
    } else {
        if ($_FF_CONF['post_htmlmode'] && $_FF_CONF['allow_html']) {
            $postData['postmode'] = 'html';
        } else {
            $postData['postmode'] = 'text';
        }
    }
    // verify postmode is allowed
    if ($postData['postmode'] == 'html' || $postData['postmode'] == 'HTML') {
        if ($_FF_CONF['allow_html'] || SEC_inGroup('Root') || SEC_hasRights('forum.html')) {
            $postData['postmode'] = 'html';
        } else {
            $postData['postmode'] = 'text';
        }
    }
    $postData['postmode_switch'] = 0;
    // action specific setup
    if ($action == 'edittopic' || $viewMode) {
        // need to see what options were checked...
        $status = 0;
        // get our options...
        if (isset($postData['disable_bbcode']) && $postData['disable_bbcode'] == 1) {
            $disable_bbcode_val = ' checked="checked"';
            $status += DISABLE_BBCODE;
        } else {
            $disable_bbcode_val = '';
        }
        if (isset($postData['disable_smilies']) && $postData['disable_smilies'] == 1) {
            $disable_smilies_val = ' checked="checked"';
            $status += DISABLE_SMILIES;
        } else {
            $disable_smilies_val = '';
        }
        if (isset($postData['disable_urlparse']) && $postData['disable_urlparse'] == 1) {
            $disable_urlparse_val = ' checked="checked"';
            $status += DISABLE_URLPARSE;
        } else {
            $disable_urlparse_val = '';
        }
    }
    // create our template
    $peTemplate = new Template($_CONF['path'] . 'plugins/forum/templates/');
    $peTemplate->set_file('posteditor', 'posteditor.thtml');
    if ($postData['postmode'] == 'html') {
        $peTemplate->set_var('html_mode', true);
    } else {
        $peTemplate->unset_var('html_mode');
    }
    if ($viewMode == PREVIEW_VIEW) {
        $peTemplate->set_var('preview_post', FF_previewPost($postData, $action));
    }
    $uniqueid = isset($postData['uniqueid']) ? COM_applyFilter($postData['uniqueid'], true) : mt_rand();
    $peTemplate->set_var('uniqueid', $uniqueid);
    if (SEC_inGroup($postData['use_attachment_grpid']) && $_FF_CONF['maxattachments'] > 0) {
        $peTemplate->set_var('use_attachments', true);
    }
    if ($action == 'newtopic') {
        $peTemplate->set_var('save_button', 'savetopic');
        $postmessage = $LANG_GF02['PostTopic'];
//.........这里部分代码省略.........
开发者ID:NewRoute,项目名称:glfusion,代码行数:101,代码来源:createtopic.php

示例9: displayMenuChildren

function displayMenuChildren($type, $elements, $template_file)
{
    global $_CONF;
    $retval = '';
    $C = new Template($_CONF['path_layout'] . '/menu/');
    $C->set_file(array('page' => $template_file));
    $C->set_block('page', 'Elements', 'element');
    $lastElement = end($elements);
    foreach ($elements as $child) {
        $C->unset_var('haschildren');
        $C->set_var(array('label' => $child['label'], 'url' => $child['url']));
        if (isset($child['target'])) {
            $C->set_var(array('target' => $child['target'] == '' ? '' : ' target="' . $child['target'] . '" '));
        } else {
            $C->set_var('target', '');
        }
        if (isset($child['children']) && $child['children'] != NULL && is_array($child['children'])) {
            $C->set_var('hasparent', true);
            $childHTML = displayMenuChildren($type, $child['children'], $template_file);
            $C->set_var('haschildren', true);
            $C->set_var('children', $childHTML);
        }
        if ($child == $lastElement) {
            $C->set_var('last', true);
        } else {
            $C->unset_var('last');
        }
        $C->parse('element', 'Elements', true);
        $C->unset_var('haschildren');
        $C->unset_var('children');
        $C->unset_var('hasparent');
    }
    $C->parse('output', 'page');
    $retval = $C->finish($C->get_var('output'));
    return $retval;
}
开发者ID:spacequad,项目名称:glfusion,代码行数:36,代码来源:lib-menu.php

示例10: STORY_edit


//.........这里部分代码省略.........
    $story_templates->set_var('cmt_close_year_options', $year_options);
    $cmt_close_ampm = '';
    $cmt_close_hour = $story->EditElements('cmt_close_hour');
    //correct hour
    if ($cmt_close_hour >= 12) {
        if ($cmt_close_hour > 12) {
            $cmt_close_hour = $cmt_close_hour - 12;
        }
        $ampm = 'pm';
    } else {
        $ampm = 'am';
    }
    $ampm_select = COM_getAmPmFormSelection('cmt_close_ampm', $ampm);
    if (empty($ampm_select)) {
        // have a hidden field to 24 hour mode to prevent JavaScript errors
        $ampm_select = '<input type="hidden" name="cmt_close_ampm" value="" />';
    }
    $story_templates->set_var('cmt_close_ampm_selection', $ampm_select);
    if ($_CONF['hour_mode'] == 24) {
        $hour_options = COM_getHourFormOptions($story->EditElements('cmt_close_hour'), 24);
    } else {
        $hour_options = COM_getHourFormOptions($cmt_close_hour);
    }
    $story_templates->set_var('cmt_close_hour_options', $hour_options);
    $minute_options = COM_getMinuteFormOptions($story->EditElements('cmt_close_minute'));
    $story_templates->set_var('cmt_close_minute_options', $minute_options);
    $story_templates->set_var('cmt_close_second', $story->EditElements('cmt_close_second'));
    if ($_CONF['onlyrootfeatures'] == 1 && SEC_inGroup('Root') or $_CONF['onlyrootfeatures'] !== 1) {
        $featured_options = "<select name=\"featured\">" . LB . COM_optionList($_TABLES['featurecodes'], 'code,name', $story->EditElements('featured')) . "</select>" . LB;
        $featured_options_data = COM_optionList($_TABLES['featurecodes'], 'code,name', $story->EditElements('featured'));
        $story_templates->set_var('featured_options_data', $featured_options_data);
    } else {
        $featured_options = "<input type=\"hidden\" name=\"featured\" value=\"0\"/>";
        $story_templates->unset_var('featured_options_data');
    }
    $story_templates->set_var('featured_options', $featured_options);
    $story_templates->set_var('frontpage_options', COM_optionList($_TABLES['frontpagecodes'], 'code,name', $story->EditElements('frontpage')));
    $story_templates->set_var('story_introtext', $story->EditElements('introtext'));
    $story_templates->set_var('story_bodytext', $story->EditElements('bodytext'));
    $story_templates->set_var('lang_introtext', $LANG24[16]);
    $story_templates->set_var('lang_bodytext', $LANG24[17]);
    $story_templates->set_var('lang_postmode', $LANG24[4]);
    $story_templates->set_var('lang_publishoptions', $LANG24[76]);
    $story_templates->set_var('lang_publishdate', $LANG24[69]);
    $story_templates->set_var('lang_nojavascript', $LANG24[77]);
    $story_templates->set_var('postmode', $story->EditElements('postmode'));
    if ($story->EditElements('postmode') == 'plaintext' || $story->EditElements('postmode') == 'text') {
        $allowedHTML = '';
    } else {
        $allowedHTML = COM_allowedHTML(SEC_getUserPermissions(), false, 'glfusion', 'story') . '<br/>';
    }
    $allowedHTML .= COM_allowedAutotags(SEC_getUserPermissions(), false, 'glfusion', 'story');
    $story_templates->set_var('lang_allowed_html', $allowedHTML);
    $fileinputs = '';
    $saved_images = '';
    if ($_CONF['maximagesperarticle'] > 0) {
        $story_templates->set_var('lang_images', $LANG24[47]);
        $icount = DB_count($_TABLES['article_images'], 'ai_sid', DB_escapeString($story->getSid()));
        if ($icount > 0) {
            $result_articles = DB_query("SELECT * FROM {$_TABLES['article_images']} WHERE ai_sid = '" . DB_escapeString($story->getSid()) . "'");
            for ($z = 1; $z <= $icount; $z++) {
                $I = DB_fetchArray($result_articles);
                $saved_images .= $z . ') ' . COM_createLink($I['ai_filename'], $_CONF['site_url'] . '/images/articles/' . $I['ai_filename']) . '&nbsp;&nbsp;&nbsp;' . $LANG_ADMIN['delete'] . ': <input type="checkbox" name="delete[' . $I['ai_img_num'] . ']" /><br />';
            }
        }
        $newallowed = $_CONF['maximagesperarticle'] - $icount;
开发者ID:spacequad,项目名称:glfusion,代码行数:67,代码来源:story.php

示例11: CMT_commentForm


//.........这里部分代码省略.........
            }
            $comment_template->set_var('sid', $sid);
            $comment_template->set_var('pid', $pid);
            $comment_template->set_var('type', $type);
            if ($mode == 'edit' || $mode == 'preview_edit') {
                //edit modes
                $comment_template->set_var('start_block_postacomment', COM_startBlock($LANG03[41]));
                $comment_template->set_var('cid', '<input type="hidden" name="cid" value="' . @htmlspecialchars(COM_applyFilter($_REQUEST['cid']), ENT_COMPAT, COM_getEncodingt()) . '"/>');
            } else {
                $comment_template->set_var('start_block_postacomment', COM_startBlock($LANG03[1]));
                $comment_template->set_var('cid', '');
            }
            $comment_template->set_var('CSRF_TOKEN', SEC_createToken());
            $comment_template->set_var('token_name', CSRF_TOKEN);
            if (!COM_isAnonUser()) {
                $comment_template->set_var('uid', $_USER['uid']);
                $name = COM_getDisplayName($_USER['uid'], $_USER['username'], $_USER['fullname']);
                $comment_template->set_var('username', $name);
                $comment_template->set_var('action_url', $_CONF['site_url'] . '/users.php?mode=logout');
                $comment_template->set_var('lang_logoutorcreateaccount', $LANG03[03]);
                $comment_template->set_var('username_disabled', 'disabled="disabled"');
                $comment_template->set_var('suballowed', true);
                $isSub = 0;
                if ($mode == 'preview_edit' || $mode == 'preview_new') {
                    $isSub = isset($_POST['subscribe']) ? 1 : 0;
                } else {
                    if (PLG_isSubscribed('comment', $type, $sid)) {
                        $isSub = 1;
                    }
                }
                if ($isSub == 0) {
                    $subchecked = '';
                } else {
                    $subchecked = 'checked="checked"';
                }
                $comment_template->set_var('subchecked', $subchecked);
            } else {
                //Anonymous user
                $comment_template->set_var('uid', 1);
                if (isset($_POST['username'])) {
                    $name = $filter->sanitizeUsername(COM_applyFilter($_POST['username']));
                    //for preview
                } else {
                    $name = $LANG03[24];
                    //anonymous user
                }
                $usernameblock = '<input type="text" name="username" size="16" value="' . $name . '" maxlength="32"/>';
                $comment_template->set_var('username', $name);
                // $usernameblock);
                $comment_template->set_var('action_url', $_CONF['site_url'] . '/users.php?mode=new');
                $comment_template->set_var('lang_logoutorcreateaccount', $LANG03[04]);
                $comment_template->set_var('username_disabled', '');
            }
            if ($postmode == 'html') {
                $comment_template->set_var('htmlmode', true);
            }
            $comment_template->set_var('lang_title', $LANG03[16]);
            $comment_template->set_var('title', @htmlspecialchars($title, ENT_COMPAT, COM_getEncodingt()));
            $comment_template->set_var('lang_comment', $LANG03[9]);
            $comment_template->set_var('comment', $edit_comment);
            $comment_template->set_var('lang_postmode', $LANG03[2]);
            $comment_template->set_var('postmode', $postmode);
            $comment_template->set_var('postmode_options', COM_optionList($_TABLES['postmodes'], 'code,name', $postmode));
            $comment_template->set_var('allowed_html', $filter->getAllowedHTML() . '<br/>' . COM_AllowedAutotags('', false, 'glfusion', 'comment'));
            $comment_template->set_var('lang_importantstuff', $LANG03[18]);
            $comment_template->set_var('lang_instr_line1', $LANG03[19]);
            $comment_template->set_var('lang_instr_line2', $LANG03[20]);
            $comment_template->set_var('lang_instr_line3', $LANG03[21]);
            $comment_template->set_var('lang_instr_line4', $LANG03[22]);
            $comment_template->set_var('lang_instr_line5', $LANG03[23]);
            if ($mode == 'edit' || $mode == 'preview_edit') {
                //editing comment or preview changes
                $comment_template->set_var('lang_preview', $LANG03[28]);
            } else {
                //new comment
                $comment_template->set_var('lang_preview', $LANG03[14]);
            }
            if (function_exists('msg_replaceEmoticons')) {
                $comment_template->set_var('smilies', msg_showsmilies());
            }
            $comment_template->unset_var('save_type');
            PLG_templateSetVars('comment', $comment_template);
            if ($mode == 'preview_edit' || $mode == 'edit' && $_CONF['skip_preview'] == 1) {
                //for editing
                $comment_template->set_var('save_type', 'saveedit');
                $comment_template->set_var('lang_save', $LANG03[29]);
                $comment_template->set_var('save_option', '<input type="submit" name="saveedit" value="' . $LANG03[29] . '"/>');
            } elseif ($_CONF['skip_preview'] == 1 || $mode == 'preview_new') {
                //new comment
                $comment_template->set_var('save_type', 'savecomment');
                $comment_template->set_var('lang_save', $LANG03[11]);
                $comment_template->set_var('save_option', '<input type="submit" name="savecomment" value="' . $LANG03[11] . '"/>');
            }
            $comment_template->set_var('end_block', COM_endBlock());
            $comment_template->parse('output', 'form');
            $retval .= $comment_template->finish($comment_template->get_var('output'));
        }
    }
    return $retval;
}
开发者ID:spacequad,项目名称:glfusion,代码行数:101,代码来源:lib-comment.php

示例12: array

 $story_template->set_var('story_title', $pagetitle);
 $story_template->set_var('story_subtitle', $story->DisplayElements('subtitle'));
 if ($_CONF['hidestorydate'] != 1) {
     $story_template->set_var('story_date', $story->displayElements('date'));
 }
 if ($_CONF['contributedbyline'] == 1) {
     $story_template->set_var('lang_contributedby', $LANG01[1]);
     $authorname = COM_getDisplayName($story->displayElements('uid'));
     $story_template->set_var('author', $authorname);
     $story_template->set_var('story_author', $authorname);
     $story_template->set_var('story_author_username', $story->DisplayElements('username'));
 }
 if ($story_image != '') {
     $story_template->set_var('story_image', $story_image);
 } else {
     $story_template->unset_var('story_image');
 }
 $story_options = array();
 if ($_CONF['hideemailicon'] == 0 && (!COM_isAnonUser() || $_CONF['loginrequired'] == 0 && $_CONF['emailstoryloginrequired'] == 0)) {
     $emailUrl = $_CONF['site_url'] . '/profiles.php?sid=' . $story->getSid() . '&amp;what=emailstory';
     $story_options[] = COM_createLink($LANG11[2], $emailUrl, array('rel' => 'nofollow'));
     $story_template->set_var('email_story_url', $emailUrl);
     $story_template->set_var('lang_email_story', $LANG11[2]);
     $story_template->set_var('lang_email_story_alt', $LANG01[64]);
 }
 $printUrl = COM_buildUrl($_CONF['site_url'] . '/article.php?story=' . $story->getSid() . '&amp;mode=print');
 if ($_CONF['hideprintericon'] == 0) {
     $story_options[] = COM_createLink($LANG11[3], $printUrl, array('rel' => 'nofollow'));
     $story_template->set_var('print_story_url', $printUrl);
     $story_template->set_var('lang_print_story', $LANG11[3]);
     $story_template->set_var('lang_print_story_alt', $LANG01[65]);
开发者ID:spacequad,项目名称:glfusion,代码行数:31,代码来源:article.php

示例13: foreach

 * as well. The absolute width of the portal is used to calculate the 
 * absolute width of portal columns with relative width specifications.
 */
// $portal_width = 800;
$portal_width = 0;
foreach ($columns as $column) {
    /*
      $column_width = calculate_absolute_length(
        $column->get_attribute("bid:portal:column:width"),
        $portal_width);
    */
    $column_width = $column->get_attribute("bid:portal:column:width");
    $portal_width += $column_width;
    $tpl->set_var(array("PORTAL_COLUMN_ID" => $column->get_id(), "PORTAL_COLUMN_WIDTH" => $column->get_attribute("bid:portal:column:width")));
    //clear variable for next column
    $tpl->unset_var("PORTLET_CELL");
    //editing area for column
    if ($writeable && $steam->get_login_user()->get_name() != "guest") {
        $tpl->parse("EDIT_AREA", "edit_area");
    }
    if (sizeof($columnPortlets[$column->get_id()]) > 0) {
        // column does contain portlets
        foreach ($columnPortlets[$column->get_id()] as $portlet) {
            if ($portlet->get_attribute("bid:portlet")) {
                //get the linked portlet if neccessary
                if ($portlet instanceof steam_link) {
                    $portlet = $portlet->get_link_object();
                }
                //get content of portlet
                $content = $portlet->get_attribute("bid:portlet:content");
                if (is_array($content) && count($content) > 0) {
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:index.php

示例14: displayThumb


//.........这里部分代码省略.........
     } else {
         $rating_box = '';
     }
     $T->set_var('rating_box', '<center>' . $rating_box . '</center>');
     $fs_bytes = @filesize($_MG_CONF['path_mediaobjects'] . 'orig/' . $this->filename[0] . '/' . $this->filename . '.' . $this->mime_ext);
     $fileSize = MG_get_size($fs_bytes);
     $direct_url = 'disp/' . $this->filename[0] . '/' . $this->filename . '.' . $this->mime_ext;
     if (!file_exists($_MG_CONF['path_mediaobjects'] . $direct_url)) {
         $direct_url = 'disp/' . $this->filename[0] . '/' . $this->filename . '.jpg';
     }
     if ($MG_albums[$this->album_id]->access == 3) {
         $edit_item = '<a href="' . $_MG_CONF['site_url'] . '/admin.php?mode=mediaedit&amp;s=1&amp;album_id=' . $this->album_id . '&amp;mid=' . $this->id . '">' . $LANG_MG01['edit'] . '</a>';
     } else {
         $edit_item = '';
     }
     $L = new Template(MG_getTemplatePath($this->album_id));
     $L->set_file('media_link', 'medialink.thtml');
     $L->set_var('href', $url_media_item);
     if ($this->type == 0) {
         if ($this->remote == 1) {
             $L->set_var('hrefdirect', $this->remote_url);
         } else {
             $L->set_var('hrefdirect', $_MG_CONF['mediaobjects_url'] . '/' . $direct_url);
         }
     }
     $caption = PLG_replaceTags(str_replace('$', '&#36;', $this->title), 'mediagallery', 'media_description');
     if ($this->owner_id == $_USER['uid'] || SEC_hasRights('mediagallery.admin')) {
         $caption .= '<br />(' . $this->id . ')';
     }
     $L->set_var('caption', $caption);
     $L->set_var('id', 'id' . rand());
     $L->parse('media_link_start', 'media_link');
     $media_start_link = $L->finish($L->get_var('media_link_start'));
     $T->set_var(array('play_now' => '', 'download_now' => $_MG_CONF['site_url'] . '/download.php?mid=' . $this->id, 'play_in_popup' => "javascript:showVideo('" . $_MG_CONF['site_url'] . '/video.php?n=' . $this->id . "'," . $resolution_y . ',' . $resolution_x . ')', 'row_height' => $tn_height + 40, 'media_title' => PLG_replaceTags($this->title, 'mediagallery', 'media_title'), 'media_description' => PLG_replaceTags(nl2br($this->description), 'mediagallery', 'media_description'), 'media_tag' => strip_tags($this->title), 'media_time' => $media_time[0], 'upload_time' => $upload_time[0], 'media_owner' => $username, 'site_url' => $_MG_CONF['site_url'], 'lang_published' => $LANG_MG03['published'], 'lang_on' => $LANG_MG03['on'], 'lang_hyphen' => $this->album == '' ? '' : '-', 'media_link_start' => $media_start_link, 'media_link_end' => '</a>', 'artist' => $this->artist, 'musicalbum' => $this->album != '' ? $this->album : '', 'genre' => $this->genre != '' ? $this->genre : '', 'alt_edit_link' => $edit_item, 'filesize' => $fileSize, 'media_id' => $this->id, 'raw_media_thumbnail' => $media_thumbnail, 'display_url' => $url_media_item, 'orig_url' => $url_orig));
     if ($data_type != '') {
         $T->set_var('data_type', $data_type);
     } else {
         $T->unset_var('data_type');
     }
     if ($videoid != '') {
         $T->set_var('videoid', $videoid);
     } else {
         $T->unset_var('videoid');
     }
     // frame template variables
     $F->set_var(array('media_id' => $this->id, 'media_link_start' => $media_start_link, 'media_link_end' => '</a>', 'url_media_item' => $url_media_item, 'url_display_item' => $url_display_item, 'media_thumbnail' => $media_thumbnail, 'media_size' => 'width="' . $newwidth . '" height="' . $newheight . '"', 'media_height' => $newheight, 'media_width' => $newwidth, 'border_width' => $newwidth + 15, 'border_height' => $newheight + 15, 'row_height' => $tn_height + 40, 'frWidth' => $newwidth - $MG_albums[$this->album_id]->frWidth, 'frHeight' => $newheight - $MG_albums[$this->album_id]->frHeight, 'media_tag' => strip_tags($this->description), 'filesize' => $fileSize));
     $F->parse('media', 'media_frame');
     $media_item_thumbnail = $F->finish($F->get_var('media'));
     $T->set_var(array('media_item_thumbnail' => $media_item_thumbnail, 'url_media_item' => $url_media_item, 'url_display_item' => $url_display_item, 'media_thumbnail' => $media_thumbnail, 'media_size' => 'width="' . $newwidth . '" height="' . $newheight . '"'));
     if ($MG_albums[$this->album_id]->enable_keywords) {
         if (!empty($this->keywords)) {
             $kwText = '';
             $keyWords = array();
             $keyWords = explode(' ', $this->keywords);
             $numKeyWords = count($keyWords);
             for ($i = 0; $i < $numKeyWords; $i++) {
                 $keyWords[$i] = str_replace('"', ' ', $keyWords[$i]);
                 $searchKeyword = $keyWords[$i];
                 $keyWords[$i] = str_replace('_', ' ', $keyWords[$i]);
                 $kwText .= '<a href="' . $_MG_CONF['site_url'] . '/search.php?mode=search&amp;swhere=1&amp;keywords=' . $searchKeyword . '&amp;keyType=any">' . $keyWords[$i] . '</a> ';
             }
             $T->set_var(array('media_keywords' => $kwText, 'lang_keywords' => $LANG_MG01['keywords']));
             $T->parse('media_cell_keywords', 'media_cell_keywords');
         } else {
             $T->set_var('lang_keywords', '');
         }
     } else {
         $T->set_var(array('media_cell_keywords' => '', 'lang_keywords' => ''));
     }
     if ($MG_albums[$this->album_id]->enable_rating) {
         $rating = $LANG_MG03['rating'] . ': <strong> ' . $this->rating / 2 . '</strong>/5 (' . $this->votes . ' ' . $LANG_MG03['votes'] . ')';
         $T->set_var('media_rating', $rating);
         $T->parse('media_rate_results', 'media_rate_results');
     }
     if ($MG_albums[$this->album_id]->enable_comments) {
         USES_lib_comment();
         $cmtLinkArray = CMT_getCommentLinkWithCount('mediagallery', $this->id, $_MG_CONF['site_url'] . '/media.php?f=0' . '&amp;sort=' . $sortOrder . '&amp;s=' . $this->id, $this->comments, 0);
         if ($this->type == 4 || $this->type == 1 && $MG_albums[$this->album_id]->playback_type != 2 || $this->type == 2 && $MG_albums[$this->album_id]->playback_type != 2 || $this->type == 5 && $MG_albums[$this->album_id]->playback_type != 2) {
             $cmtLink_alt = $cmtLinkArray['link_with_count'];
             // '<a href="' . $_MG_CONF['site_url'] . '/media.php?f=0' . '&amp;sort=' . $sortOrder . '&amp;s=' . $this->id . '">' . $LANG_MG03['comments'] . '</a>';
             $cmtLink = '';
         } else {
             $cmtLink = '';
             //$LANG_MG03['comments'];
             $cmtLink_alt = $cmtLinkArray['link_with_count'];
             //'<a href="' . $_MG_CONF['site_url'] . '/media.php?f=0' . '&amp;sort=' . $sortOrder . '&amp;s=' . $this->id . '">' . $LANG_MG03['comments'] . '</a>';
         }
         $T->set_var(array('comments_with_count' => $cmtLinkArray['link_with_count'], 'media_comments_count' => $cmtLinkArray['comment_count'], 'lang_comments' => $cmtLink, 'lang_comments_hot' => $cmtLink_alt));
         $T->parse('media_comments', 'media_comments');
     }
     if ($MG_albums[$this->album_id]->enable_views) {
         $T->set_var(array('media_views_count' => $this->views, 'lang_views' => $LANG_MG03['views']));
         $T->parse('media_views', 'media_views');
     }
     $T->set_var(array('max-width' => $tn_width));
     PLG_templateSetVars('mediagallery', $T);
     $T->parse('media_cell', 'media_cell_image');
     $retval = $T->finish($T->get_var('media_cell'));
     return $retval;
 }
开发者ID:spacequad,项目名称:glfusion,代码行数:101,代码来源:classMedia.php

示例15: elseif

         $topicTemplate->set_var(array('replytopiclink' => $replytopiclink, 'replytopiclinkimg' => $replytopiclinkimg, 'LANG_reply' => $LANG_GF01['POSTREPLY']));
     }
 } else {
     $newtopiclink = '';
     $newtopiclinkimg = '';
 }
 // Enable subscriptions if member
 if (!COM_isAnonUser()) {
     $forumid = $viewtopic['forum'];
     /* Check for a un-subscribe record */
     $ntopicid = -$showtopic;
     if (DB_count($_TABLES['subscriptions'], array('type', 'category', 'id', 'uid'), array('forum', (int) $forumid, $ntopicid, (int) $_USER['uid'])) > 0) {
         $notifylinkimg = '<img src="' . _ff_getImage('notify_on') . '" style="border:none;vertical-align:middle;" alt="' . $LANG_GF02['msg62'] . '" title="' . $LANG_GF02['msg62'] . '"/>';
         $notifylink = $_CONF['site_url'] . '/forum/notify.php?forum=' . $forumid . '&amp;submit=save&amp;topic=' . $showtopic;
         $topicTemplate->set_var('LANG_notify', $LANG_GF01['SubscribeLink']);
         $topicTemplate->unset_var('topic_subscribed');
         $topicTemplate->set_var('suboption', 'subscribe_topic');
         /* Check if user has subscribed to complete forum */
     } elseif (DB_count($_TABLES['subscriptions'], array('type', 'category', 'id', 'uid'), array('forum', (int) $forumid, '0', (int) $_USER['uid'])) > 0) {
         $notifyID = DB_getItem($_TABLES['subscriptions'], 'sub_id', "type='forum' AND category=" . (int) $forumid . " AND id=0 AND uid=" . (int) $_USER['uid']);
         $notifylinkimg = '<img src="' . _ff_getImage('notify_off') . '" style="border:none;vertical-align:middle;" alt="' . $LANG_GF02['msg137'] . '" title="' . $LANG_GF02['msg137'] . '"/>';
         $notifylink = $_CONF['site_url'] . '/forum/notify.php?submit=delete2&amp;id=' . $notifyID . '&amp;forum=' . $forumid . '&amp;topic=' . $showtopic;
         $topicTemplate->set_var('LANG_notify', $LANG_GF01['unSubscribeLink']);
         $topicTemplate->set_var('topic_subscribed', true);
         $topicTemplate->set_var('suboption', 'unsubscribe_topic');
         $topicTemplate->set_var('notify_id', $notifyID);
         /* Check if user is subscribed to this specific topic */
     } elseif (DB_count($_TABLES['subscriptions'], array('type', 'category', 'id', 'uid'), array('forum', (int) $forumid, (int) $showtopic, (int) $_USER['uid'])) > 0) {
         $notifyID = DB_getItem($_TABLES['subscriptions'], 'sub_id', "type='forum' AND category=" . (int) $forumid . " AND id=" . (int) $showtopic . " AND uid=" . (int) $_USER['uid']);
         $notifylinkimg = '<img src="' . _ff_getImage('notify_off') . '" style="border:none;vertical-align:middle;" alt="' . $LANG_GF02['msg137'] . '" title="' . $LANG_GF02['msg137'] . '"/>';
         $notifylink = $_CONF['site_url'] . '/forum/notify.php?submit=delete2&amp;id=' . $notifyID . '&amp;forum=' . $forumid . '&amp;topic=' . $showtopic;
开发者ID:spacequad,项目名称:glfusion,代码行数:31,代码来源:viewtopic.php


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