• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP htmlent函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中htmlent函数的典型用法代码示例。如果您正苦于以下问题:PHP htmlent函数的具体用法?PHP htmlent怎么用?PHP htmlent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: get_debug

/**
* Print debuginformation from the framework.
*/
function get_debug()
{
    // Only if debug is wanted.
    $Origo = Origin::Instance();
    if (empty($Origo->config['debug'])) {
        return;
    }
    // Get the debug output
    $html = null;
    if (isset($Origo->config['debug']['db-num-queries']) && $Origo->config['debug']['db-num-queries'] && isset($Origo->db)) {
        $flash = $Origo->session->GetFlash('database_numQueries');
        $flash = $flash ? "{$flash} + " : null;
        $html .= "<p>Database made {$flash}" . $Origo->db->GetNumQueries() . " queries.</p>";
    }
    if (isset($Origo->config['debug']['db-queries']) && $Origo->config['debug']['db-queries'] && isset($Origo->db)) {
        $flash = $Origo->session->GetFlash('database_queries');
        $queries = $Origo->db->GetQueries();
        if ($flash) {
            $queries = array_merge($flash, $queries);
        }
        $html .= "<p>Database made the following queries.</p><p>" . implode('<br/><br/>', $queries) . "</p>";
    }
    if (isset($Origo->config['debug']['timer']) && $Origo->config['debug']['timer']) {
        $html .= "<p>Page was loaded in " . round(microtime(true) - $Origo->timer['first'], 5) * 1000 . " msecs.</p>";
    }
    if (isset($Origo->config['debug']['trial']) && $Origo->config['debug']['trial']) {
        $html .= "<hr><h3>Debuginformation</h3><p>The content of trial:</p><pre>" . htmlent(print_r($Origo, true)) . "</pre>";
    }
    if (isset($Origo->config['debug']['session']) && $Origo->config['debug']['session']) {
        $html .= "<hr><h3>SESSION</h3><p>The content of Origin->session:</p><pre>" . htmlent(print_r($Origo->session, true)) . "</pre>";
        $html .= "<p>The content of \$_SESSION:</p><pre>" . htmlent(print_r($_SESSION, true)) . "</pre>";
    }
    return $html;
}
开发者ID:xd3x4L-1,项目名称:page,代码行数:37,代码来源:functions.php


示例2: showForm

 protected function showForm()
 {
     global $site;
     global $tmpl;
     // protected against cross site injection attempts
     $randomKeyName = 'teamReactivate_' . microtime();
     // convert some special chars to underscores
     $randomKeyName = strtr($randomKeyName, array(' ' => '_', '.' => '_'));
     $randomkeyValue = $site->setKey($randomKeyName);
     $tmpl->assign('keyName', $randomKeyName);
     $tmpl->assign('keyValue', htmlent($randomkeyValue));
     // display teams that can be reactivated
     $teamids = \team::getDeletedTeamIds();
     $teamData = array();
     foreach ($teamids as $teamid) {
         $teamData[] = array('id' => $teamid, 'name' => (new team($teamid))->getName());
     }
     $tmpl->assign('teams', $teamData);
     // a team must always have a leader
     // display user choice to admin
     // get all teamless users
     $users = \user::getTeamlessUsers();
     $userData = array();
     foreach ($users as $user) {
         // a team should only be reactivated so it can play...no point of inactive, disabled or banned user
         if ($user->getStatus() === 'active') {
             $userData[] = array('id' => $user->getID(), 'name' => $user->getName());
         }
     }
     $tmpl->assign('users', $userData);
 }
开发者ID:laiello,项目名称:bz-owl,代码行数:31,代码来源:teamReactivate.php


示例3: DisplayObject

    /**
     * Display all items of the CObject.
     */
    public function DisplayObject()
    {
        $this->Menu();
        $this->data['main'] .= <<<EOD
\t<h2>Dumping content of CDeveloper</h2>
\t<p>Here is the content of the controller, including properties from CObject which holds access to common resources in Origin.</p>
EOD;
        $this->data['main'] .= '<pre>' . htmlent(print_r($this, true)) . '</pre>';
    }
开发者ID:xd3x4L-1,项目名称:page,代码行数:12,代码来源:CCDeveloper.php


示例4: addToVisitsLog

 public function addToVisitsLog($id)
 {
     // insert login of user to visits log
     $ip_address = getenv('REMOTE_ADDR');
     $host = gethostbyaddr($ip_address);
     $query = 'INSERT INTO `visits` (`userid`,`ip-address`,`host`,`forwarded_for`,`timestamp`) VALUES' . ' (?, ?, ?, ?, ?)';
     $query = $this->prepare($query);
     $args = array($id, htmlent($ip_address), htmlent($host), htmlent(getenv('HTTP_X_FORWARDED_FOR')), date('Y-m-d H:i:s'));
     $this->execute($query, $args);
 }
开发者ID:laiello,项目名称:bz-owl,代码行数:10,代码来源:userOperations.php


示例5: get_debug

/**
 * Print debuginformation from the framework.
 */
function get_debug()
{
    $bbb = CBehovsboboxen::Instance();
    // Only if debug is wanted.
    if (empty($bbb->config['debug'])) {
        return;
    }
    // Get the debug output
    $html = null;
    if (isset($bbb->config['debug']['db-num-queries']) && $bbb->config['debug']['db-num-queries'] && isset($bbb->db)) {
        $flash = $bbb->session->GetFlash('database_numQueries');
        $flash = $flash ? "{$flash} + " : null;
        $html .= "<p>Database made {$flash}" . $bbb->db->GetNumQueries() . " queries.</p>";
    }
    if (isset($bbb->config['debug']['db-queries']) && $bbb->config['debug']['db-queries'] && isset($bbb->db)) {
        $flash = $bbb->session->GetFlash('database_queries');
        $queries = $bbb->db->GetQueries();
        if ($flash) {
            $queries = array_merge($flash, $queries);
        }
        $html .= "<p>Database made the following queries.</p><pre>" . implode('<br/><br/>', $queries) . "</pre>";
    }
    if (isset($bbb->config['debug']['timer']) && $bbb->config['debug']['timer']) {
        $now = microtime(true);
        //echo 'now: ' . $now . '<br />';
        $flash = $bbb->session->GetFlash('timer');
        //echo 'flash: ' . $flash . '<br />';
        if ($flash) {
            $redirect = $flash ? round($flash['redirect'] - $flash['first'], 3) . ' secs + x + ' : null;
            echo 'redirect: ' . $redirect . '<br />';
            $total = $flash ? round($now - $flash['first'], 3) . ' secs. Per page: ' : null;
            echo 'total: ' . $total . '<br />';
            $html .= "<p>Page was loaded in {$total}{$redirect}" . round($now - $bbb->timer['first'], 3) . " secs.</p>";
        }
    }
    if (isset($bbb->config['debug']['memory']) && $bbb->config['debug']['memory']) {
        $flash = $bbb->session->GetFlash('memory');
        $flash = $flash ? round($flash / 1024 / 1024, 2) . ' Mbytes + ' : null;
        $html .= "<p>Peek memory consumption was {$flash}" . round(memory_get_peak_usage(true) / 1024 / 1024, 2) . " Mbytes.</p>";
    }
    if (isset($bbb->config['debug']['behovsboboxen']) && $bbb->config['debug']['behovsboboxen']) {
        $html .= "<hr><h3>Debuginformation</h3><p>The content of CBehovsboboxen:</p><pre>" . htmlent(print_r($bbb, true)) . "</pre>";
    }
    if (isset($bbb->config['debug']['session']) && $bbb->config['debug']['session']) {
        $html .= "<hr><h3>SESSION</h3><p>The content of CBehovsboboxen->session:</p><pre>" . htmlent(print_r($bbb->session, true)) . "</pre>";
        $html .= "<p>The content of \$_SESSION:</p><pre>" . htmlent(print_r($_SESSION, true)) . "</pre>";
    }
    if (isset($bbb->config['debug']['timestamp']) && $bbb->config['debug']['timestamp']) {
        $html .= $bbb->log->TimestampAsTable();
        $html .= $bbb->log->PageLoadTime();
        $html .= $bbb->log->MemoryPeak();
    }
    return "<div class='debug'>{$html}</div>";
}
开发者ID:Electrotest,项目名称:BehovsBoBoxen,代码行数:57,代码来源:functions.php


示例6: showForm

 protected function showForm()
 {
     global $site;
     global $tmpl;
     // protected against cross site injection attempts
     $randomKeyName = 'teamJoin_' . $this->team->getID() . '_' . microtime();
     // convert some special chars to underscores
     $randomKeyName = strtr($randomKeyName, array(' ' => '_', '.' => '_'));
     $randomkeyValue = $site->setKey($randomKeyName);
     $tmpl->assign('keyName', $randomKeyName);
     $tmpl->assign('keyValue', htmlent($randomkeyValue));
 }
开发者ID:laiello,项目名称:bz-owl,代码行数:12,代码来源:teamJoin.php


示例7: preview

 function preview($folder, $id)
 {
     global $site;
     global $tmpl;
     parent::showMail($folder, $id);
     $tmpl->setTemplate('PMDelete');
     $tmpl->assign('showPreview', true);
     $tmpl->assign('title', 'Delete ' . $tmpl->getTemplateVars('title'));
     // protected against cross site injection attempts
     $randomKeyName = 'pmDelete_' . microtime();
     // convert some special chars to underscores
     $randomKeyName = strtr($randomKeyName, array(' ' => '_', '.' => '_'));
     $randomkeyValue = $site->setKey($randomKeyName);
     $tmpl->assign('keyName', $randomKeyName);
     $tmpl->assign('keyValue', htmlent($randomkeyValue));
 }
开发者ID:laiello,项目名称:bz-owl,代码行数:16,代码来源:pmDelete.php


示例8: Parse

 function Parse($string)
 {
     global $config;
     require_once dirname(__FILE__) . '/nbbc/nbbc.php';
     $setup = new BBCode();
     if (!isset($config)) {
         // old compatibility mode
         $setup->SetSmileyURL(baseaddress() . 'smileys');
     } else {
         $setup->SetSmileyURL($config->getValue('baseaddress') . 'smileys');
     }
     // $setup->SetEnableSmileys(false);
     $setup->SetAllowAmpersand(true);
     // escape (x)html entities
     return $setup->Parse(htmlent($string));
 }
开发者ID:laiello,项目名称:bz-owl,代码行数:16,代码来源:nbbc-wrapper_example.php


示例9: insertEditText

 function insertEditText($readonly = false)
 {
     global $tmpl;
     global $config;
     global $db;
     if ($readonly || isset($_POST['confirmationStep'])) {
         // data passed to form -> use it
         $query = $db->prepare('SELECT `name` FROM `users` WHERE `id`=? LIMIT 1');
         $db->execute($query, user::getCurrentUserId());
         $author = $db->fetchRow($query);
         if ($author === false) {
             $author = 'error: no author could be determined';
         }
         $db->free($query);
     }
     // do not drop original message id that a reply would be refering to
     // but drop reply mode (users and teams are already added to recipients at this point)
     $formArgs = '';
     if (isset($_GET['id'])) {
         $formArgs .= '&amp;id=' . $_GET['id'];
     }
     $tmpl->assign('formArgs', $formArgs);
     $tmpl->assign('subject', $this->pm->getSubject());
     $tmpl->assign('time', $this->pm->getTimestamp());
     $tmpl->assign('playerRecipients', $this->pm->getUserNames());
     $tmpl->assign('teamRecipients', $this->pm->getTeamNames());
     $tmpl->assign('rawContent', htmlent($this->pm->getContent()));
     switch ($readonly) {
         case true:
             $tmpl->assign('authorName', htmlent($author['name']));
             if ($config->getValue('bbcodeLibAvailable')) {
                 $tmpl->assign('content', $tmpl->encodeBBCode($this->pm->getContent()));
             } else {
                 $tmpl->assign('content', htmlent($this->pm->getContent()));
             }
             $tmpl->assign('showPreview', true);
             // overwrite editor's default text ('Write changes')
             $tmpl->assign('submitText', 'Send PM');
             break;
         default:
             $tmpl->assign('showSendForm', true);
             // display the formatting buttons addded by addFormatButtons
             $this->editor->showFormatButtons();
             break;
     }
 }
开发者ID:laiello,项目名称:bz-owl,代码行数:46,代码来源:pmAdd.php


示例10: insertEditText

 function insertEditText($readonly = false)
 {
     global $tmpl;
     global $author;
     global $last_modified;
     global $config;
     if ($readonly || isset($_POST['confirmationStep'])) {
         $content = $_POST['staticContent'];
     } elseif (isset($_GET['edit'])) {
         $content = $this->readContent($this->path, $author, $last_modified, true);
     } else {
         $content = 'Replace this text with the page content.';
     }
     switch ($readonly) {
         case true:
             $tmpl->assign('rawContent', htmlent($content));
             if ($config->getValue('bbcodeLibAvailable')) {
                 $tmpl->assign('contentPreview', $tmpl->encodeBBCode($content));
             } else {
                 // TODO: only fall back to using raw data if config says so
                 $tmpl->assign('contentPreview', $content);
             }
             break;
         default:
             $tmpl->assign('rawContent', htmlent($content));
             // display the formatting buttons addded by addFormatButtons
             $this->editor->showFormatButtons();
             break;
     }
 }
开发者ID:laiello,项目名称:bz-owl,代码行数:30,代码来源:staticPageEditor.php


示例11: showForm

 protected function showForm()
 {
     global $site;
     global $tmpl;
     // protected against cross site injection attempts
     $randomKeyName = 'teamCreate_' . \user::getCurrentUser()->getID() . '_' . microtime();
     // convert some special chars to underscores
     $randomKeyName = strtr($randomKeyName, array(' ' => '_', '.' => '_'));
     $randomkeyValue = $site->setKey($randomKeyName);
     $tmpl->assign('keyName', $randomKeyName);
     $tmpl->assign('keyValue', htmlent($randomkeyValue));
     // bbcode editor
     include_once dirname(dirname(dirname(__FILE__))) . '/bbcode_buttons.php';
     $bbcode = new bbcode_buttons();
     // set up name of field to edit so javascript knows which element to manipulate
     $tmpl->assign('buttonsToFormat', $bbcode->showBBCodeButtons('team_description'));
     unset($bbcode);
 }
开发者ID:laiello,项目名称:bz-owl,代码行数:18,代码来源:teamAdd.php


示例12: htmlent

<?php

if (!isset($account_needs_to_be_converted) || !$account_needs_to_be_converted) {
    if (isset($_SESSION['user_logged_in']) && $_SESSION['user_logged_in']) {
        $this->helper->done('already logged in');
    }
}
$account_old_website = htmlent($config->getValue('oldWebsiteName'));
if (!isset($msg)) {
    $msg = '';
}
if (!(isset($_POST['local_login_wanted']) && $_POST['local_login_wanted'])) {
    $msg .= '<form action="' . $config->getValue('baseaddress') . 'Login/' . '" method="post">' . "\n";
    $msg .= '<p class="first_p">' . "\n";
    if ($config->getValue('login.modules.forceExternalLoginOnly')) {
        $msg .= $this->helper->return_self_closing_tag('input type="submit" name="local_login_wanted" value="Update old account from ' . $account_old_website . '"');
    } else {
        $msg .= $this->helper->return_self_closing_tag('input type="submit" name="local_login_wanted" value="Local login"');
    }
    $msg .= '</p>' . "\n";
    $msg .= '</form>' . "\n";
}
if (isset($_POST['local_login_wanted']) && $_POST['local_login_wanted']) {
    /* 		$msg .= '<div class="static_page_box">' . "\n"; */
    $msg .= '<p class="first_p">';
    if ($config->getValue('login.modules.local.convertUsersToExternalLogin')) {
        require_once dirname(dirname(__FILE__)) . '/login_module_list.php';
        if (isset($module['bzbb']) && $module['bzbb']) {
            $msg .= '<strong><span class="unread_messages">Before you continue make absolutely sure your account here and the my.bzflag.org/bb/ (forum) account have exactly the same username or you will give someone else access to your account and that access can never be revoked.</span></strong></p>';
        }
    }
开发者ID:laiello,项目名称:bz-owl,代码行数:31,代码来源:login_text.php


示例13: bbcode

 function bbcode($string)
 {
     if (strcmp(bbcode_lib_path(), '') === 0) {
         // no bbcode library specified
         return $this->linebreaks(htmlent($string));
     }
     // load the library
     require_once bbcode_lib_path();
     if (strcmp(bbcode_command(), '') === 0) {
         // no command that starts the parser
         return $this->linebreaks(htmlent($string));
     } else {
         $parse_command = bbcode_command();
     }
     if (!(strcmp(bbcode_class(), '') === 0)) {
         // no class specified
         // this is no error, it only means the library stuff isn't started by a command in a class
         $bbcode_class = bbcode_class();
         $bbcode_instance = new $bbcode_class();
     }
     // execute the bbcode algorithm
     if (isset($bbcode_class)) {
         if (bbcode_sets_linebreaks()) {
             return $bbcode_instance->{$parse_command}($string);
         } else {
             return $this->linebreaks($bbcode_instance->{$parse_command}($string));
         }
     } else {
         if (bbcode_sets_linebreaks()) {
             return $parse_command($string);
         } else {
             return $this->linebreaks($parse_command($string));
         }
     }
 }
开发者ID:laiello,项目名称:bz-owl,代码行数:35,代码来源:siteinfo.php


示例14: jquerycommentary_run

function jquerycommentary_run()
{
    global $_SERVER, $output, $session;
    require_once 'lib/commentary.php';
    $section = httpget('section');
    $commentary = db_prefix('commentary');
    $accounts = db_prefix('accounts');
    if (($commid = httpget('rmvcmmnt')) != "") {
        $prefix = db_prefix('commentary');
        check_su_access(SU_EDIT_COMMENTS);
        if ($session['user']['superuser'] & SU_EDIT_COMMENTS) {
            db_query("DELETE FROM {$prefix} WHERE commentid = '{$commid}'");
        }
        db_query("INSERT INTO {$commentary} (section, author, comment, postdate) VALUES ('blackhole', '{$session['user']['acctid']}', 'I fucked up', '" . date('Y-m-d H:i:s') . "')");
        invalidatedatacache("comments-{$section}");
        invalidatedatacache("comments-blackhole");
    }
    if (httpget('section') == get_module_pref('current_section') && httpget('section') != '') {
        //echo 'x';
        //var_dump(get_all_module_settings());
        $output = "";
        $_SERVER['REQUEST_URI'] = httpget('r');
        $session['counter'] = httpget('c');
        viewcommentary(get_module_pref('current_section'), get_module_setting('message'), get_module_setting('limit'), get_module_setting('talkline'));
        $output = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $output);
        $output = substr($output, 0, strpos($output, "<jquerycommentaryend>"));
        db_query("UPDATE accounts SET laston = '" . date('Y-m-d H:i:s') . "' WHERE acctid = '{$session['user']['acctid']}'");
        echo trim("{$output}");
        invalidatedatacache("comments-{$section}");
        /*$sql = db_query(
              "SELECT a.name, a.acctid
              FROM accounts AS a
              LEFT JOIN module_userprefs AS m
              ON m.userid = a.acctid
              LEFT JOIN module_userprefs AS u
              ON u.userid = m.userid
              WHERE m.modulename = 'jquerycommentary'
              AND m.setting = 'is_typing'
              AND m.value = '1'
              AND u.modulename = 'jquerycommentary'
              AND u.setting = 'current_section'
              and u.value = '" . get_module_pref('current_section') ."'"
          );
          $typing = [];
          while ($row = db_fetch_assoc($sql)) {
              array_push($typing, [$row['acctid'], $row['name']]);
          }
          $isTyping = appoencode('`@');
          $i = 0;
          echo appoencode('`@Who\'s typing: `n');
          if (count($typing) != 0) {
              foreach ($typing as $key => $val) {
                  $i++;
                  if ($i == 1) {
                      $isTyping .= appoencode($val[1]);
                  }
                  else if ($i > 1 && count($typing) > $i) {
                      $isTyping .= appoencode("`@, {$val[1]}");
                  }
                  else if ($i == count($typing)) {
                      $isTyping .= appoencode("`@ and {$val[1]}");
                  }
              }
              echo $isTyping;
          }
          else {
              echo appoencode('`@No one');
          }*/
    }
    switch (httpget('op')) {
        case 'get_json':
            $sql = db_query("SELECT commentid, author, comment FROM commentary WHERE section = '{$session['current_commentary_area']}' AND deleted = '0' ORDER BY commentid+0 DESC LIMIT 0, 25");
            $json = [];
            while ($row = db_fetch_assoc($sql)) {
                array_push($json, $row);
            }
            echo "<pre>";
            echo json_encode($json, JSON_PRETTY_PRINT);
            echo "</pre>";
            break;
        case 'post':
            $post = httpallpost();
            $post = modulehook('jquery-post-commentary', $post);
            $commentary = db_prefix('commentary');
            if ($post['method'] == 'insertcommentary') {
                require_once 'lib/commentary.php';
                injectcommentary(get_module_pref('current_section'), get_module_setting('talkline'), $post['comment']);
            } else {
                $commentid = explode('_', $post['method']);
                require_once 'lib/systemmail.php';
                require_once 'lib/sanitize.php';
                $post['comment'] = htmlent($post['comment']);
                db_query("UPDATE {$commentary} SET comment = '{$post['comment']}' WHERE commentid = '{$commentid[1]}'");
                db_query("INSERT INTO {$commentary} (section, author, comment, postdate) VALUES ('blackhole', '{$session['user']['acctid']}', 'I fucked up', '" . date('Y-m-d H:i:s') . "')");
                invalidatedatacache("comments-{$session['current_commentary_section']}");
                invalidatedatacache("comments-blackhole");
            }
            break;
        case 'last_comment':
            require_once 'lib/sanitize.php';
//.........这里部分代码省略.........
开发者ID:stephenKise,项目名称:Legend-of-the-Green-Dragon,代码行数:101,代码来源:jquerycommentary.php


示例15: foreach



<?php 
echo $form->GetHTML();
?>

<div class="page-header">
  <h2>Current messages</h2>
</div>

<?php 
foreach ($entries as $val) {
    ?>
<div class = well>
  <p>
  <strong><?php 
    echo htmlent($val['name']);
    ?>
</strong>
  <br /><small><?php 
    echo $val['created'];
    ?>
</small>
  </p>
  <p><?php 
    echo htmlent($val['entry']);
    ?>
</p>
</div>
<?php 
}
开发者ID:rud0lph,项目名称:HAL,代码行数:29,代码来源:guestbook.tpl.php


示例16: showTeam

 public function showTeam($teamid)
 {
     global $tmpl;
     global $db;
     $team = new team($teamid);
     if (!$team->exists()) {
         $tmpl->setTemplate('NoPerm');
         return;
     }
     if (!$tmpl->setTemplate('teamSystemProfile')) {
         $tmpl->noTemplateFound();
         die;
     }
     // FIXME: implement something to avoid hardcoded paths
     $tmpl->assign('pmLink', '../PM/?add&teamid=' . $teamid);
     $tmpl->assign('status', $team->getStatus());
     $tmpl->assign('title', 'Team ' . htmlent($team->getName()));
     // the team's leader
     $teamLeader = $team->getLeaderId();
     $teamData = array();
     $teamData['profileLink'] = './?profile=' . $team->getID();
     $teamData['name'] = $team->getName();
     $teamData['score'] = $team->getScore();
     $teamData['scoreClass'] = $this->rankScore($teamData['score']);
     $teamData['matchSearchLink'] = '../Matches/?search_string=' . $teamData['name'] . '&amp;search_type=team+name' . '&amp;search_result_amount=200' . '&amp;search=Search';
     $teamData['matchCount'] = $team->getMatchCount();
     $teamData['memberCount'] = $team->getMemberCount();
     $teamData['leaderLink'] = '../Players/?profile=' . $team->getLeaderId();
     $teamData['leaderName'] = (new \user($team->getLeaderId()))->getName();
     $teamData['activityNew'] = $team->getActivityNew();
     $teamData['activityOld'] = $team->getActivityOld();
     $teamData['created'] = $team->getCreationTimestampStr();
     $teamData['wins'] = $team->getMatchCount('won');
     $teamData['draws'] = $team->getMatchCount('draw');
     $teamData['losses'] = $team->getMatchCount('lost');
     $teamData['logo'] = $team->getAvatarURI();
     $tmpl->assign('teamDescription', $team->getDescription());
     $tmpl->assign('team', $teamData);
     $tmpl->assign('teamid', $teamid);
     $tmpl->assign('canPMTeam', \user::getCurrentUserLoggedIn() && \user::getCurrentUserId() > 0 ? true : false);
     // tell template if user can edit this team
     $tmpl->assign('canEditTeam', \user::getCurrentUserLoggedIn() && \user::getCurrentUserId() === $teamLeader || \user::getCurrentUser()->getPermission('allow_edit_any_team_profile'));
     // tell template if user can delete this team
     // either user has deletion permission for team
     // or user is leader of team and there are one or less members in team
     $tmpl->assign('canDeleteTeam', $team->getStatus() !== 'deleted' && (\user::getCurrentUser()->getPermission('team.allowDelete ' . $team->getID()) || \user::getCurrentUser()->getPermission('allow_delete_any_team') || \user::getCurrentUserId() === $team->getLeaderId()));
     $showMemberActionOptions = false;
     if (\user::getCurrentUserId() === $teamLeader || \user::getCurrentUser()->getPermission('allow_kick_any_team_members')) {
         $showMemberActionOptions = true;
     }
     $members = array();
     $memberids = $team->getUserIds();
     foreach ($memberids as $memberid) {
         $user = new \user($memberid);
         $member = array();
         // rename db result fields and assemble some additional informations
         // use a temporary array for better readable (but slower) code
         if (!$showMemberActionOptions && \user::getCurrentUserId() === $memberid) {
             $showMemberActionOptions = true;
         }
         $member['profileLink'] = '../Players/?profile=' . $user->getID();
         $member['userName'] = $user->getName();
         $member['permissions'] = $teamLeader === $memberid ? 'Leader' : 'Standard';
         if ($country = $user->getCountry()) {
             $member['countryName'] = $country->getName();
             if (strlen($country->getFlag()) > 0) {
                 $member['countryFlag'] = $country->getFlag();
             }
         }
         $member['joined'] = $user->getJoinTimestampStr();
         $member['last_login'] = $user->getLastLoginTimestampStr();
         // show leave/kick links if permission is given
         // a team leader can neither leave or be kicked
         // a leader must first give someone else leadership to leave
         if ((\user::getCurrentUserId() === $teamLeader || \user::getCurrentUser()->getPermission('allow_kick_any_team_members') || \user::getCurrentUserId() === $user->getID()) && $user->getID() !== $teamLeader) {
             $member['removeLink'] = './?remove=' . $user->getID() . '&amp;team=' . $teamid;
             if (\user::getCurrentUserId() === $user->getID()) {
                 $member['removeDescription'] = 'Leave team';
             } else {
                 $member['removeDescription'] = 'Kick member from team';
             }
         }
         // append current member data
         $members[] = $member;
         unset($user);
     }
     $tmpl->assign('members', $members);
     $tmpl->assign('showMemberActionOptions', $showMemberActionOptions);
     // show last entered matches
     $matches = array();
     // show available options if any available
     $allowEdit = \user::getCurrentUser()->getPermission('allow_edit_match');
     $allowDelete = \user::getCurrentUser()->getPermission('allow_delete_match');
     $tmpl->assign('showMatchActionOptions', $allowEdit || $allowDelete);
     $tmpl->assign('allowEdit', $allowEdit);
     $tmpl->assign('allowDelete', $allowDelete);
     // get match data
     // sort the data by id to find out if abusers entered a match at a long time in the past
     $query = $db->prepare('SELECT `timestamp`,`team1_id`,`team2_id`,' . '(SELECT `name` FROM `teams` WHERE `id`=`team1_id`) AS `team1_name`' . ',(SELECT `name` FROM `teams` WHERE `id`=`team2_id`) AS `team2_name`' . ',`team1_points`,`team2_points`,`userid`' . ',(SELECT `users`.`name` FROM `users`' . ' WHERE `users`.`id`=`matches`.`userid`)' . ' AS `username`' . ',`matches`.`id`' . ' FROM `matches` WHERE `matches`.`team1_id`=?' . ' OR `matches`.`team2_id`=?' . ' ORDER BY `id` DESC LIMIT 0,10');
     $db->execute($query, array($teamid, $teamid));
//.........这里部分代码省略.........
开发者ID:laiello,项目名称:bz-owl,代码行数:101,代码来源:teamList.php


示例17: htmlspecialchars

 // timezone
 echo '<p><label class="player_edit" for="edit_player_location">Change timezone:</label> ';
 echo '<select id="edit_player_timezone" name="timezone">';
 for ($i = -12; $i <= 12; $i++) {
     echo '<option value="';
     echo htmlspecialchars($i);
     if ($timezone === $i) {
         echo '" selected="selected';
     }
     echo '">';
     if ($i >= 0) {
         $time_format = '+' . strval($i);
     } else {
         $time_format = strval($i);
     }
     echo htmlent('UTC ' . $time_format);
     echo '</option>' . "\n";
 }
 unset($time_format);
 echo '</select>';
 echo '</p>' . "\n\n";
 // user comment
 if ($site->bbcode_lib_available()) {
     echo "\n" . '<div class="player_edit">';
     echo '<div class="invisi" style="display: inline;">';
     echo '	<label class="player_edit">bbcode:</label><span>';
     echo '</div>';
     include dirname(dirname(__FILE__)) . '/CMS/bbcode_buttons.php';
     $bbcode = new bbcode_buttons();
     $bbcode->showBBCodeButtons('user_comment');
     unset($bbcode);
开发者ID:laiello,项目名称:bz-owl,代码行数:31,代码来源:edit.php


示例18: generateKey

 private function generateKey()
 {
     global $site;
     global $tmpl;
     $randomKeyName = 'addon.pageSystem.' . microtime();
     // convert some special chars to underscores
     $randomKeyName = strtr($randomKeyName, array(' ' => '_', '.' => '_'));
     $randomkeyValue = $site->setKey($randomKeyName);
     $tmpl->assign('keyName', $randomKeyName);
     $tmpl->assign('keyValue', htmlent($randomkeyValue));
 }
开发者ID:laiello,项目名称:bz-owl,代码行数:11,代码来源:pageSystem.php


示例19: elseif

        } elseif (isset($_GET['profile'])) {
            echo '&amp;profile=' . htmlent($_GET['profile']);
        }
        echo '">Previous visits</a>' . "\n";
    }
    if ($show_next_visits_button) {
        echo '	<a href="./?i=';
        echo (int) $view_range + $num_results;
        if (isset($_GET['search'])) {
            echo '&amp;search';
            if (isset($_GET['search_string'])) {
                echo '&amp;search_string=' . htmlspecialchars($_GET['search_string']);
            }
            if (isset($_GET['search_type'])) {
                echo '&amp;search_type=' . htmlspecialchars($_GET['search_type']);
            }
            if (isset($num_results)) {
                echo '&amp;search_result_amount=' . strval($num_results);
            }
        } elseif (isset($_GET['profile'])) {
            echo '&amp;profile=' . htmlent($_GET['profile']);
        }
        echo '">Next visits</a>' . "\n";
    }
    echo '</p>' . "\n";
}
?>
</div>
</body>
</html>
开发者ID:laiello,项目名称:bz-owl,代码行数:30,代码来源:index.php


示例20: getName

 public function getName()
 {
     return htmlent($this->info['username']);
 }
开发者ID:laiello,项目名称:bz-owl,代码行数:4,代码来源:local.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP htmlent_utf8函数代码示例发布时间:2022-05-15
下一篇:
PHP htmlencode函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap