本文整理汇总了PHP中get_display_name函数的典型用法代码示例。如果您正苦于以下问题:PHP get_display_name函数的具体用法?PHP get_display_name怎么用?PHP get_display_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_display_name函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add_test
function add_test($test_id, $title)
{
global $db, $msg;
$no_error = true;
$studs_take_num = get_studs_take_more_than_once($_SESSION["course_id"], $test_id);
foreach ($studs_take_num as $member_id => $num)
{
if ($no_error) $no_error = false;
$error_msg .= get_display_name($member_id) . ": " . $num . " times<br>";
}
if (!$no_error)
{
$f = array('ADD_TEST_INTO_GRADEBOOK',
$title,
$error_msg);
$msg->addFeedback($f);
}
if ($no_error) // add into gradebook
{
$_POST["selected_grade_scale_id"] = intval($_POST["selected_grade_scale_id"]);
$sql_insert = "INSERT INTO ".TABLE_PREFIX."gradebook_tests (id, type, grade_scale_id)
VALUES (". $test_id. ", 'ATutor Test', ".$_POST["selected_grade_scale_id"].")";
$result_insert = mysql_query($sql_insert, $db) or die(mysql_error());
}
}
示例2: print_entry2
function print_entry2($row)
{
global $page, $system_courses, $forum_info;
static $counter;
$counter++;
$reply_link = '<a href="forum/view.php?fid=' . $row['forum_id'] . SEP . 'pid=';
if ($row['parent_id'] == 0) {
$reply_link .= $row['post_id'];
} else {
$reply_link .= $row['parent_id'];
}
$reply_link .= SEP . 'reply=' . $row['post_id'] . SEP . 'page=' . $page . '#post" >' . _AT('reply') . '</a>';
?>
<li class="<?php
if ($counter % 2) {
echo 'odd';
} else {
echo 'even';
}
?>
">
<a name="<?php
echo $row['post_id'];
?>
"></a>
<div class="forum-post-author">
<label class="title"><?php
echo htmlspecialchars(get_display_name($row['member_id']));
?>
</label><br />
</div>
<div class="forum-post-content">
<div class="date">
<p><?php
echo AT_date(_AT('forum_date_format'), $row['date'], AT_DATE_MYSQL_DATETIME);
?>
</p>
</div>
<div class="postheader"><h3><?php
echo AT_Print($row['subject'], 'forums_threads.subject');
?>
</h3></div>
<div class="body">
<p><?php
echo AT_print($row['body'], 'forums_threads.body');
?>
</p>
</div>
</div>
</li>
<?php
}
示例3: 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();
}
}
示例4: add_test
function add_test($test_id, $title)
{
global $msg;
$no_error = true;
$studs_take_num = get_studs_take_more_than_once($_SESSION["course_id"], $test_id);
foreach ($studs_take_num as $member_id => $num) {
if ($no_error) {
$no_error = false;
}
$error_msg .= get_display_name($member_id) . ": " . $num . " times<br>";
}
if (!$no_error) {
$f = array('ADD_TEST_INTO_GRADEBOOK', $title, $error_msg);
$msg->addFeedback($f);
}
if ($no_error) {
$sql_insert = "INSERT INTO %sgradebook_tests (id, type, grade_scale_id) VALUES (%d, 'ATutor Test', %d)";
$result_insert = queryDB($sql_insert, array(TABLE_PREFIX, $test_id, $_POST["selected_grade_scale_id"]));
}
}
示例5: is_test_updatable
function is_test_updatable($gradebook_test_id)
{
global $msg;
$sql = "SELECT g.id, t.title FROM %sgradebook_tests g, %stests t WHERE g.id=t.test_id AND g.type='ATutor Test' AND g.gradebook_test_id = %d";
$row = queryDB($sql, array(TABLE_PREFIX, TABLE_PREFIX, $gradebook_test_id), TRUE);
$no_error = true;
$studs_take_num = get_studs_take_more_than_once($_SESSION["course_id"], $row["id"]);
foreach ($studs_take_num as $member_id => $num) {
if ($no_error) {
$no_error = false;
}
$error_msg .= get_display_name($member_id) . ": " . $num . " times<br>";
}
if (!$no_error) {
$f = array('UPDATE_GRADEBOOK', $row['title'], $error_msg);
$msg->addFeedback($f);
}
if ($no_error) {
return true;
} else {
return false;
}
}
示例6: is_test_updatable
function is_test_updatable($gradebook_test_id)
{
global $db, $msg;
$sql = "SELECT g.id, t.title FROM " . TABLE_PREFIX . "gradebook_tests g, " . TABLE_PREFIX . "tests t WHERE g.id=t.test_id AND g.type='ATutor Test' AND g.gradebook_test_id = " . $gradebook_test_id;
$result = mysql_query($sql, $db) or die(mysql_error());
$row = mysql_fetch_assoc($result);
$no_error = true;
$studs_take_num = get_studs_take_more_than_once($_SESSION["course_id"], $row["id"]);
foreach ($studs_take_num as $member_id => $num) {
if ($no_error) {
$no_error = false;
}
$error_msg .= get_display_name($member_id) . ": " . $num . " times<br>";
}
if (!$no_error) {
$f = array('UPDATE_GRADEBOOK', $row['title'], $error_msg);
$msg->addFeedback($f);
}
if ($no_error) {
return true;
} else {
return false;
}
}
示例7: foreach
<div class="table-panel">
<table class="table table-bordered">
<thead>
<tr>
<?php
foreach ($headers as $header) {
?>
<th class="<?php
echo get_sorting_class($header);
?>
" data-column="<?php
echo $header['column_name'];
?>
">
<?php
echo get_display_name($header);
?>
</th>
<?php
}
?>
</tr>
</thead>
<tbody>
<?php
foreach ($body as $data) {
?>
<tr>
<?php
foreach ($headers as $header) {
?>
示例8: _AT
echo $_base_href;
?>
themes/<?php
echo $_SESSION['prefs']['PREF_THEME'];
?>
/images/profile.gif" alt="" border="0" class="pa_tool_image"/><?php
echo _AT('pa_set_profile_pic');
?>
</a>
</div>
<?php
} else {
?>
<div class="photo_actions">
<p><?php
echo _AT('pa_uploaded_by') . ': ' . AT_print(get_display_name($this->photo_info['member_id']), 'members.full_name');
?>
</p>
</div>
<?php
}
?>
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function () {
//the ATutor undo function
var undo = function (that, targetContainer) {
var markup = "<span class='flc-undo' aria-live='polite' aria-relevant='all'>" +
"<span class='flc-undo-undoContainer'><a href='#' class='flc-undo-undoControl'>[<?php
示例9: _AT
<input type="submit" name="move" value="<?php echo _AT('move_to_inbox'); ?>"/>
</td>
</tr>
</tfoot>
<tbody>
<?php if ($row = mysql_fetch_assoc($this->result)): ?>
<?php do { ?>
<?php if ($row['message_id'] == $_GET['view']): ?>
<tr class="selected">
<?php else: ?>
<tr onmousedown="document.form['m<?php echo $row['message_id']; ?>'].checked = !document.form['m<?php echo $row['message_id']; ?>'].checked; rowselectbox(this, document.form['m<?php echo $row['message_id']; ?>'].checked, '');" id="r_<?php echo $row['message_id']; ?>_1">
<?php endif; ?>
<td><input type="checkbox" name="id[]" value="<?php echo $row['message_id']; ?>" id="m<?php echo $row['message_id']; ?>" <?php if (isset($_POST['id']) && in_array($row['message_id'], $_POST['id'])) { echo 'checked="checked"'; } ?> title="<?php echo _AT('delete').': '.AT_print($row['subject'], 'messages.subject');?>" onmouseup="this.checked=!this.checked" /></td>
<?php
$name = get_display_name($row['to_member_id']);
echo '<td align="left" valign="middle">';
if ($_GET['view'] != $row['message_id']) {
echo $name;
} else {
echo '<strong>'.$name.'</strong>';
}
echo '</td>';
echo '<td><label for="m'.$row['message_id'].'">';
if ($_GET['view'] != $row['message_id']) {
echo '<a href="'.$_SERVER['PHP_SELF'].'?view='.$row['message_id'].'">'.AT_print($row['subject'], 'messages.subject').'</a>';
} else {
echo '<strong>'.AT_print($row['subject'], 'messages.subject').'</strong>';
示例10: header
$to = $_base_href . 'browse.php';
}
if (isset($_POST['cancel'])) {
$msg->addFeedback('CANCELLED');
header('Location: ' . $to);
exit;
}
$row = array();
$id = intval($_REQUEST['id']);
if (isset($system_courses[$id], $system_courses[$id]['member_id'])) {
$sql = "SELECT M.member_id, M.first_name, M.last_name, M.email FROM " . TABLE_PREFIX . "members M WHERE M.member_id={$system_courses[$id][member_id]}";
$result = mysql_query($sql, $db);
$row = mysql_fetch_assoc($result);
}
if ($row) {
$instructor_name = get_display_name($row['member_id']);
$instructor_email = AT_print($row['email'], 'members.email');
} else {
$msg->addError('INST_INFO_NOT_FOUND');
header('Location: ' . $to);
exit;
}
if (isset($_POST['submit'])) {
$missing_fields = array();
$to_email = $_POST['email'];
$_POST['subject'] = trim($_POST['subject']);
$_POST['body'] = trim($_POST['body']);
if ($_POST['subject'] == '') {
$missing_fields[] = _AT('subject');
}
if ($_POST['body'] == '') {
示例11: queryDB
$result = queryDB($sql, array(TABLE_PREFIX, $now, $_POST['parent_id']));
if ($subscriber_email_list) {
require AT_INCLUDE_PATH . 'classes/phpmailer/atutormailer.class.php';
if ($_POST['parent_name'] == '') {
$_POST['parent_name'] = $_POST['subject'];
}
$_POST['parent_name'] = urldecode($_POST['parent_name']);
foreach ($subscriber_email_list as $subscriber) {
$mail = new ATutorMailer();
$mail->AddAddress($subscriber['email'], get_display_name($subscriber['member_id']));
$body = _AT('forum_new_submsg', $_SESSION['course_title'], get_forum_name($_POST['fid']), $_POST['parent_name'], AT_BASE_HREF . 'mods/_standard/forums/forum/view.php?fid=' . $_POST['fid'] . SEP . 'pid=' . $_POST['parent_id']);
$body .= "\n----------------------------------------------\n";
$body .= _AT('course') . ': ' . $_SESSION['course_title'] . "\n";
$body .= _AT('forum') . ': ' . get_forum_name($_POST['fid']) . "\n";
$body .= _AT('thread') . ': ' . $_POST['parent_name'] . "\n";
$body .= _AT('posted_by') . ": " . get_display_name($_SESSION['member_id']) . "\n";
$body .= $_POST['body'] . "\n";
$mail->FromName = $_config['site_name'];
$mail->From = $_config['contact_email'];
$mail->Subject = _AT('thread_notify1') . ': ' . $_POST['parent_name'];
$mail->Body = $body;
if (!$mail->Send()) {
$msg->addError('SENDING_ERROR');
}
unset($mail);
}
}
if ($_REQUEST['subscribe']) {
if ($_POST['parent_id'] != 0) {
$this_id = $_POST['parent_id'];
$subject = $_POST['parent_name'];
示例12: htmlspecialchars
echo htmlspecialchars($file_info['file_name']);
?>
</label>
<?php
if ($file_info['description']) {
?>
<p class="fm-desc"><?php
echo htmlspecialchars($file_info['description']);
?>
</p>
<?php
}
?>
</td>
<td valign="top"><?php
echo get_display_name($file_info['member_id']);
?>
</td>
<td valign="top">
<?php
if ($_config['fs_versioning']) {
?>
<?php
if ($file_info['num_revisions']) {
if ($file_info['num_revisions'] == 1) {
$lang_var = 'fs_revision';
} else {
$lang_var = 'fs_revisions';
}
?>
示例13: mysql_query
if (defined('AUTO_APPROVE_INSTRUCTORS') && AUTO_APPROVE_INSTRUCTORS) {
$sql = "UPDATE " . TABLE_PREFIX . "members SET status=" . AT_STATUS_INSTRUCTOR . ", creation_date=creation_date, last_login=last_login WHERE member_id={$_SESSION['member_id']}";
$result = mysql_query($sql, $db);
$msg->addFeedback('ACCOUNT_APPROVED');
} else {
$_POST['description'] = $addslashes($_POST['description']);
$sql = "INSERT INTO " . TABLE_PREFIX . "instructor_approvals VALUES ({$_SESSION['member_id']}, NOW(), '{$_POST['description']}')";
$result = mysql_query($sql, $db);
/* email notification send to admin upon instructor request */
if (EMAIL_NOTIFY && $_config['contact_email'] != '') {
$sql = "SELECT login, email FROM " . TABLE_PREFIX . "members WHERE member_id={$_SESSION['member_id']}";
$result = mysql_query($sql, $db);
if ($row = mysql_fetch_assoc($result)) {
$email = $row['email'];
}
$tmp_message = _AT('req_message_instructor', get_display_name($_SESSION['member_id']), $_POST['description'], AT_BASE_HREF);
require AT_INCLUDE_PATH . 'classes/phpmailer/atutormailer.class.php';
$mail = new ATutorMailer();
$mail->From = $email;
$mail->AddAddress($_config['contact_email']);
$mail->Subject = _AT('req_message9');
$mail->Body = stripslashes($tmp_message);
if (!$mail->Send()) {
//echo 'There was an error sending the message';
$msg->printErrors('SENDING_ERROR');
exit;
}
unset($mail);
}
$msg->addFeedback('APPROVAL_PENDING');
}
示例14: get_display_name
echo $this->cats[$row['cat_id']];
?>
</a>
<?php
}
?>
</td>
<td>
<a href="<?php
echo AT_BASE_HREF;
?>
contact_instructor.php?id=<?php
echo $row['course_id'];
?>
"><?php
echo get_display_name($row['member_id']);
?>
</a>
</td>
<td>
<?php
echo _AT($row['access']);
?>
</td>
<td class="hidecol700">
<?php
// insert enrolment link if allowed
if (isset($row['enroll_link'])) {
?>
- <small><?php
示例15: _AT
$msg = _AT('from') . ': ' . get_display_name($row['from_member_id']) . "\r\n";
$msg .= _AT('to') . ': ' . $my_display_name . "\r\n";
$msg .= _AT('subject') . ': ' . $row['subject'] . "\r\n";
$msg .= _AT('date') . ': ' . $row['date_sent'] . "\r\n";
$msg .= _AT('body') . ': ' . $row['body'] . "\r\n";
$msg .= "\r\n=============================================\r\n\r\n";
$inbox_messages .= $msg;
}
}
// sent messages
if ($_POST['messages'] == 1 || $_POST['messages'] == 3) {
$sql = "SELECT * FROM " . TABLE_PREFIX . "messages_sent WHERE from_member_id={$_SESSION['member_id']} ORDER BY date_sent";
$result = mysql_query($sql, $db);
while ($row = mysql_fetch_assoc($result)) {
$msg = _AT('from') . ': ' . $my_display_name . "\r\n";
$msg .= _AT('to') . ': ' . get_display_name($row['from_member_id']) . "\r\n";
$msg .= _AT('subject') . ': ' . $row['subject'] . "\r\n";
$msg .= _AT('date') . ': ' . $row['date_sent'] . "\r\n";
$msg .= _AT('body') . ': ' . $row['body'] . "\r\n";
$msg .= "\r\n=============================================\r\n\r\n";
$sent_messages .= $msg;
}
}
if ($inbox_messages && $sent_messages) {
// add the two to a zip file
require AT_INCLUDE_PATH . 'classes/zipfile.class.php';
// for zipfile
$zipfile = new zipfile();
$zipfile->add_file($inbox_messages, _AT('inbox') . '.txt');
$zipfile->add_file($sent_messages, _AT('sent_messages') . '.txt');
$zipfile->close();