本文整理汇总了PHP中htmlentities_utf8函数的典型用法代码示例。如果您正苦于以下问题:PHP htmlentities_utf8函数的具体用法?PHP htmlentities_utf8怎么用?PHP htmlentities_utf8使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了htmlentities_utf8函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addJob
/**
* Add a job posting to the database.
* @param string job title
* @param string description
* @param Array categories id
* @param int 1 if public; 0 otherwise.
* @param string Closing date for this job post, mysql TIMESTAMP format
* @precondition ATutor Mailer class imported.
*/
function addJob($title, $description, $categories, $is_public, $closing_date)
{
require AT_INCLUDE_PATH . 'classes/phpmailer/atutormailer.class.php';
global $addslashes, $db, $msg, $_config, $_base_href;
if ($_SESSION['jb_employer_id'] < 1) {
$msg->addError();
//authentication error
exit;
} else {
include AT_JB_INCLUDE . 'Employer.class.php';
$employer = new Employer($_SESSION['jb_employer_id']);
$employer_id = $employer->getId();
}
$title = $addslashes($title);
$description = $addslashes($description);
$is_public = isset($is_public) ? 1 : 0;
$closing_date = $addslashes($closing_date);
$approval_state = $_config['jb_posting_approval'] == 1 ? AT_JB_POSTING_STATUS_UNCONFIRMED : AT_JB_POSTING_STATUS_CONFIRMED;
$sql = 'INSERT INTO ' . TABLE_PREFIX . "jb_postings (employer_id, title, description, is_public, closing_date, created_date, revised_date, approval_state) VALUES ({$employer_id}, '{$title}', '{$description}', {$is_public}, '{$closing_date}', NOW(), NOW(), {$approval_state})";
$result = mysql_query($sql, $db);
$posting_id = mysql_insert_id();
//add to posting category table
if (!empty($categories)) {
foreach ($categories as $id => $category) {
$category = intval($category);
$sql = 'INSERT INTO ' . TABLE_PREFIX . "jb_posting_categories (posting_id, category_id) VALUES ({$posting_id}, {$category})";
mysql_query($sql, $db);
//send out notification if the person is subscribed to the category.
$sql = 'SELECT m.member_id, m.email FROM ' . TABLE_PREFIX . 'jb_category_subscribes cs LEFT JOIN ' . TABLE_PREFIX . "members m ON cs.member_id=m.member_id WHERE category_id={$category}";
$result = mysql_query($sql, $db);
$post_link = $_base_href . AT_JB_BASENAME . 'view_post.php?jid=' . $posting_id;
if ($result) {
while ($row = mysql_fetch_assoc($result)) {
$mail = new ATutorMailer();
$mail->AddAddress($row['email'], get_display_name($row['member_id']));
$body = _AT('jb_subscription_msg', $title, $this->getCategoryNameById($category), $post_link);
$body .= "\n\n";
$body .= _AT('jb_posted_by') . ": " . htmlentities_utf8($employer->getCompany()) . "\n";
$mail->FromName = $_config['site_name'];
$mail->From = $_config['contact_email'];
$mail->Subject = _AT('jb_subscription_mail_subject');
$mail->Body = $body;
if (!$mail->Send()) {
$msg->addError('SENDING_ERROR');
}
unset($mail);
}
}
}
}
if (!$result) {
//TODO: db error message
$msg->addError();
}
}
示例2: job_board_news
function job_board_news()
{
global $db;
$news = array();
$job = new Job();
$result = $job->getAllJobs('created_date', 'desc');
if (is_array($result)) {
foreach ($result as $row) {
$title = htmlentities_utf8($row['title']);
$news[] = array('time' => $row['revised_date'], 'object' => $row, 'thumb' => AT_JB_BASENAME . 'images/jb_icon_tiny.png', 'link' => '<span title="' . strip_tags($title) . '"><a href="' . AT_JB_BASENAME . 'view_post.php?jid=' . $row['id'] . '">' . $title . "</a></span>");
}
}
return $news;
}
示例3: export
/**
* Export
*/
function export()
{
global $savant;
//localize
$wl = $this->wl;
//assign all the neccessarily values to the template.
$savant->assign('title', htmlentities_utf8($wl->getTitle(), ENT_QUOTES, 'UTF-8'));
$url = $wl->getUrl();
$savant->assign('url_href', urlencode($url['href']));
$savant->assign('url_target', $url['target']);
//TODO: not supported yet
//$savant->assign('url_window_features', $url['window_features']);
//generates xml
$xml = $savant->fetch(TR_INCLUDE_PATH . 'classes/Weblinks/Weblinks.tmpl.php');
return $xml;
}
示例4: printSocialNameForConnection
function printSocialNameForConnection($id, $trigger)
{
global $_config, $display_name_formats, $db;
$display_name_format = $_config['display_name_format'];
//if trigger = true, it's for the drop down ajax
if ($trigger == true) {
if ($display_name_format > 1) {
$display_name_format = 1;
}
} else {
if ($display_name_format == 1) {
$display_name_format = 2;
}
}
$sql = 'SELECT login, first_name, second_name, last_name FROM %smembers WHERE member_id=%d';
$row = queryDB($sql, array(TABLE_PREFIX, $id), TRUE);
return htmlentities_utf8(_AT($display_name_formats[$display_name_format], $row['login'], $row['first_name'], $row['second_name'], $row['last_name']));
}
示例5: printSocialNameForConnection
function printSocialNameForConnection($id, $trigger)
{
global $_config, $display_name_formats, $db;
$display_name_format = $_config['display_name_format'];
//if trigger = true, it's for the drop down ajax
if ($trigger == true) {
if ($display_name_format > 1) {
$display_name_format = 1;
}
} else {
if ($display_name_format == 1) {
$display_name_format = 2;
}
}
$sql = 'SELECT login, first_name, second_name, last_name FROM ' . TABLE_PREFIX . 'members WHERE member_id=' . $id;
$result = mysql_query($sql, $db);
$row = mysql_fetch_assoc($result);
return htmlentities_utf8(_AT($display_name_formats[$display_name_format], $row['login'], $row['first_name'], $row['second_name'], $row['last_name']));
}
示例6: bigbluebutton_news
function bigbluebutton_news() {
global $db, $enrolled_courses, $system_courses;
$news = array();
if ($enrolled_courses == ''){
return $news;
}
$sql = 'SELECT * FROM '.TABLE_PREFIX.'bigbluebutton WHERE course_id IN '.$enrolled_courses;
$result = mysql_query($sql, $db);
if($result){
while($row = mysql_fetch_assoc($result)){
$news[] = array('time'=>htmlentities_utf8($row['course_timing']),
'object'=>$row,
'alt'=>_AT('bigbluebutton'),
'course'=>$system_courses[$row['course_id']]['title'],
'thumb'=>'mods/bigbluebutton/bigbluebutton_sm.png',
'link'=>htmlentities_utf8($row['message']));
}
}
return $news;
}
示例7: foreach
require AT_INCLUDE_PATH . 'header.inc.php';
?>
<div id="my_courses_container">
<ul class="my-courses-list-ul" >
<?php
foreach ($this->courses as $row) {
static $counter;
$counter++;
?>
<li class="my-courses-list">
<?php
echo '<a href="' . url_rewrite('bounce.php?course=' . $row['course_id']) . '"> ' . htmlentities_utf8($row['title']) . '</a>';
?>
<?php
if ($row['last_cid']) {
?>
<a class="my-courses-resume" href="bounce.php?course=<?php
echo $row['course_id'] . SEP . 'p=' . urlencode('content.php?cid=' . $row['last_cid']);
?>
"><img src="<?php
echo $_base_href;
?>
themes/default/images/resume.png" border="" alt="<?php
echo _AT('resume');
?>
" title="<?php
echo _AT('resume');
示例8: mysql_query
$query = "\tSELECT user_camp.id\n\t\t\t\t\t\tFROM user_camp\n\t\t\t\t\t\tWHERE user_id = {$user_id} AND camp_id = " . $_camp->id;
$result = mysql_query($query);
$user_camp_id = mysql_result($result, 0, 'id');
$mat_list_id = "NULL";
$query = "\tSELECT user.scoutname \n\t\t\t\t\t\tFROM user, user_camp\n\t\t\t\t\t\tWHERE user.id = user_camp.user_id\n\t\t\t\t\t\tAND user_camp.id = {$user_camp_id}";
$result = mysql_query($query);
$resp_str = mysql_result($result, 0, 'scoutname');
}
if (substr($resp, 0, 8) == "mat_list") {
$user_camp_id = "NULL";
$mat_list_id = substr($resp, 9);
$query = "\tSELECT mat_list.name \n\t\t\t\t\t\tFROM mat_list\n\t\t\t\t\t\tWHERE mat_list.id = {$mat_list_id}";
$result = mysql_query($query);
$resp_str = mysql_result($result, 0, 'name');
}
$resp_str_js = htmlentities_utf8($resp_str);
$query = "\tSELECT\n\t\t\t\t\t\tid\n\t\t\t\t\tFROM\n\t\t\t\t\t(\n\t\t\t\t\t\tSELECT\t\n\t\t\t\t\t\t\tid as id,\n\t\t\t\t\t\t\tname as name\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\tmat_article\n\t\t\t\t\t\t\n\t\t\t\t\t\tUNION\n\t\t\t\t\t\t\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tmat_article.id as id,\n\t\t\t\t\t\t\tconcat( mat_article_alias.name, ' (', mat_article.name, ')' ) as name\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\tmat_article,\n\t\t\t\t\t\t\tmat_article_alias\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tmat_article_alias.mat_article_id = mat_article.id\n\t\t\t\t\t\t\n\t\t\t\t\t\tORDER BY name\n\t\t\t\t\t) as mat\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tmat.name = '{$article}'";
$result = mysql_query($query);
if (mysql_num_rows($result)) {
$id = mysql_result($result, 'id');
} else {
$id = "NULL";
}
$query = "\tUPDATE mat_event\n\t\t\t\t\tSET \n\t\t\t\t\t\t`user_camp_id` = {$user_camp_id},\n\t\t\t\t\t\t`mat_list_id` = {$mat_list_id},\n\t\t\t\t\t\t`mat_article_id` = {$id},\n\t\t\t\t\t\t`article_name` = '{$article}',\n\t\t\t\t\t\t`quantity` = '{$quantity}'\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tid = {$entry_id}";
$result = mysql_query($query);
if (!mysql_error()) {
$ans = array("values" => array("1" => $quantity_js, "2" => $article_js, "3" => $resp_str_js));
echo json_encode($ans);
die;
} else {
$ans = array("error" => true, "error_msg" => "Fehler aufgetreten");
示例9: htmlentities_utf8
* This file is part of eCamp.
*
* eCamp is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* eCamp is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with eCamp. If not, see <http://www.gnu.org/licenses/>.
*/
$job_name = htmlentities_utf8(trim($_REQUEST['job_name']));
$job_name_save = mysql_real_escape_string($_REQUEST['job_name']);
$cmd = mysql_real_escape_string($_REQUEST['cmd']);
// Authentifizierung überprüfen
// write --> Ab Lagerleiter (level: 50)
if ($_user_camp->auth_level < 50 || $job_name == "") {
// Keine Berechtigung
if ($_user_camp->auth_level < 50) {
//$xml_replace[error] = 1;
//$xml_replace['error-msg'] = "Keine Berechtigung";
$ans = array("error" => true, "msg" => "Keine berechtigung!");
echo json_encode($ans);
die;
} else {
//$xml_replace[error] = 2;
//$xml_replace['error-msg'] = "Bitte gib zuerst einen Job-Namen ein!";
示例10: mysql_query
if($response['messageKey'] == 'checksumError'){
$msg->addError("CHECKSUM_ERROR_BBB");
}
else{
$msg = $response['message'];
}
}
else{//"The meeting was created, and the user will now be joined "
$bbb_joinURL = BigBlueButton::joinURL($meetingID,$username,"ap", $salt, $url);
}
$sql = "SELECT * from ".TABLE_PREFIX."bigbluebutton WHERE course_id = '$meetingID'";
$result = mysql_query($sql, $db);
if (mysql_num_rows($result) > 0) {
while ($row = mysql_fetch_assoc($result)) {
/****
* SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY are defined in include/lib/constance.lib.inc
* SUBLINK_TEXT_LEN determins the maxium length of the string to be displayed on "detail view" box.
*****/
$list[] = '<a href="'.$bbb_joinURL.'"'.
(strlen(htmlentities_utf8($row['message'])) > SUBLINK_TEXT_LEN ? ' title="'.htmlentities_utf8($row['course_timing']).'"' : '') .' title="'.htmlentities_utf8($row['course_timing']).'">'.
validate_length(htmlentities_utf8($row['message']), SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) .'</a>';
}
return $list;
} else {
return 0;
}
?>
示例11: current
echo $current_file['folder_id'];
?>
" />
</form>
<?php
} else {
?>
<?php
$current_file = current($files);
}
?>
<div class="input-form">
<div class="row">
<h3><?php
echo htmlentities_utf8($current_file['file_name']);
?>
<small> - <?php
echo _AT('revision');
?>
<?php
echo $current_file['num_revisions'];
?>
</small></h3>
<span style="font-size: small"><?php
echo get_display_name($current_file['member_id']);
?>
- <?php
echo AT_date(_AT('filemanager_date_format'), $current_file['date'], AT_DATE_MYSQL_DATETIME);
?>
</span>
示例12: intval
$id = intval($_REQUEST['id']);
$sql = "SELECT * FROM ".TABLE_PREFIX."groups_types WHERE type_id=$id AND course_id=$_SESSION[course_id]";
$result = mysql_query($sql,$db);
if (!($type_row = mysql_fetch_assoc($result))) {
require (AT_INCLUDE_PATH.'header.inc.php');
$msg->printErrors('GROUP_TYPE_NOT_FOUND');
require (AT_INCLUDE_PATH.'footer.inc.php');
exit;
}
$tmp_groups = array();
$sql = "SELECT group_id, title FROM ".TABLE_PREFIX."groups WHERE type_id=$id ORDER BY title";
$result = mysql_query($sql, $db);
while ($row = mysql_fetch_assoc($result)) {
$tmp_groups[$row['group_id']] = htmlentities_utf8($row['title']);
}
$groups_keys = array_keys($tmp_groups);
$groups_keys = implode($groups_keys, ',');
if (isset($_POST['cancel'])) {
$msg->addFeedback('CANCELLED');
header('Location: index.php');
exit;
} else if (isset($_POST['submit'])) {
$sql = "DELETE FROM ".TABLE_PREFIX."groups_members WHERE group_id IN ($groups_keys)";
mysql_query($sql, $db);
$sql = '';
foreach ($_POST['groups'] as $mid => $gid) {
$mid = abs($mid);
示例13: htmlentities_utf8
/* http://atutor.ca */
/* */
/* This program is free software. You can redistribute it and/or */
/* modify it under the terms of the GNU General Public License */
/* as published by the Free Software Foundation. */
/************************************************************************/
if (!defined('AT_INCLUDE_PATH')) { exit; }
// print the AccessForAll alternatives tool bar
// see /content.php for details of the alt_infos() array
// images for the toolbar can be customized by adding images of the same name to a theme's images directory
?>
<div id="alternatives_shortcuts">
<?php
foreach ($this->alt_infos as $alt_info){
echo '<a href="'.$_SERVER['PHP_SELF'].'?cid='.$this->cid.(($_GET['alternative'] == $alt_info['0']) ? '' : htmlentities_utf8(SEP).'alternative='.$alt_info[0]).'">
<img src="'.AT_BASE_HREF.(($_GET['alternative'] == $alt_info[0]) ? $alt_info[3] : $alt_info[4]).'" alt="'.(($_GET['alternative'] == $alt_info[0]) ? $alt_info[2] : $alt_info[1]).'" title="'.(($_GET['alternative'] == $alt_info[0]) ? $alt_info[2] : $alt_info[1]).'" border="0" class="img1616"/></a>';
}
?>
</div>
<?php if ($this->shortcuts): ?>
<fieldset id="shortcuts"><legend><?php echo _AT('shortcuts'); ?></legend>
<ul>
<?php foreach ($this->shortcuts as $link): ?>
<li><a href="<?php echo $link['url']; ?>"><?php echo $link['title']; ?></a></li>
<?php endforeach; ?>
</ul>
</fieldset>
<?php endif; ?>
示例14: generateApplicationTitle
/**
* Generate the title string for application.
*
* @param int application id
* @return the title string that has a hyperlink to the application itself.
*/
function generateApplicationTitle($app_id)
{
$app_id = intval($app_id);
//This here, it is actually better to use $url instead of app_id.
//$url is the primary key. $id is also a key, but it is not guranteed that it will be unique
$sql = "SELECT title FROM %ssocial_applications WHERE id=%d";
$row = queryDB($sql, array(TABLE_PREFIX, $app_id), TRUE);
$msg = _AT("has_added_app", url_rewrite(AT_SOCIAL_BASENAME . 'applications.php?app_id=' . $app_id, AT_PRETTY_URL_IS_HEADER), htmlentities_utf8($row['title']));
return $msg;
}
示例15: array_unique
for ($i = 0; $i < count($words); $i++) {
$words[$i] = $strtolower($words[$i]);
}
$words = array_unique($words);
if (count($words) > 0) {
$count = 0;
$glossary_key_lower = array_change_key_case($glossary);
foreach ($words as $k => $v) {
$original_v = $v;
$v = $strtolower($v);
//array_change_key_case change everything to lowercase, including encoding.
if (isset($glossary_key_lower[$v]) && $glossary_key_lower[$v] != '') {
$v_formatted = urldecode(array_search($glossary_key_lower[$v], $glossary));
$def = AT_print($glossary_key_lower[$v], 'glossary.definition');
$count++;
echo '<a class="tooltip" href="' . $_base_path . 'mods/_core/glossary/index.php?g_cid=' . $_SESSION['s_cid'] . htmlentities(SEP) . 'w=' . urlencode($original_v) . '#term" title="' . htmlentities_utf8($v_formatted) . ': ' . $def . '">';
if ($strlen($original_v) > 26) {
$v_formatted = $substr($v_formatted, 0, 26 - 4) . '...';
}
echo AT_print($v_formatted, 'glossary.word') . '</a>';
echo '<br />';
}
}
if ($count == 0) {
/* there are defn's, but they're not defined in the glossary */
echo '<strong>' . _AT('no_terms_found') . '</strong>';
}
} else {
/* there are no glossary terms on this page */
echo '<strong>' . _AT('no_terms_found') . '</strong>';
}