本文整理匯總了PHP中print_user函數的典型用法代碼示例。如果您正苦於以下問題:PHP print_user函數的具體用法?PHP print_user怎麽用?PHP print_user使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了print_user函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: print_paging_bar
}
}
echo '</div>';
print_paging_bar($matchcount, intval($table->get_page_start() / $perpage), $perpage, $baseurl . '&', 'spage');
}
if ($matchcount > 0) {
$usersprinted = array();
foreach ($userlist as $user) {
if (in_array($user->id, $usersprinted)) {
/// Prevent duplicates by r.hidden - MDL-13935
continue;
}
$usersprinted[] = $user->id;
/// Add new user to the array of users printed
$user = make_context_subobj($user);
print_user($user, $course, $bulkoperations);
}
} else {
print_heading(get_string('nothingtodisplay'));
}
}
} else {
$countrysort = strpos($sort, 'country') !== false;
$timeformat = get_string('strftimedate');
if ($userlist) {
// only show the plugin if multiple enrolment plugins
// are enabled...
if (strpos($CFG->enrol_plugins_enabled, ',') === false) {
$showenrolplugin = true;
} else {
$showenrolplugin = false;
示例2: lang_get
echo lang_get('sponsors_list');
?>
</th>
<td>
<?php
echo sprintf(lang_get('total_sponsorship_amount'), sponsorship_format_amount($t_total_sponsorship));
if (access_has_bug_level(config_get('view_sponsorship_details_threshold'), $f_bug_id)) {
echo '<br /><br />';
$i = 0;
foreach ($t_sponsorship_ids as $id) {
$t_sponsorship = sponsorship_get($id);
$t_date_added = date(config_get('normal_date_format'), $t_sponsorship->date_submitted);
echo $i > 0 ? '<br />' : '';
$i++;
echo sprintf(lang_get('label'), $t_date_added) . lang_get('word_separator');
print_user($t_sponsorship->user_id);
echo ' (' . sponsorship_format_amount($t_sponsorship->amount) . ')';
if (access_has_bug_level(config_get('handle_sponsored_bugs_threshold'), $f_bug_id)) {
echo ' ' . get_enum_element('sponsorship', $t_sponsorship->paid);
}
}
}
?>
</td>
</tr>
<?php
}
?>
</table>
<?php
示例3: print_avatar
print_avatar($t_bugnote->reporter_id);
?>
<span class="small bugnote-permalink"><a rel="bookmark" href="<?php
echo string_get_bugnote_view_url($t_bugnote->bug_id, $t_bugnote->id);
?>
" title="<?php
echo lang_get('bugnote_link_title');
?>
"><?php
echo htmlentities(config_get_global('bugnote_link_tag')) . $t_bugnote_id_formatted;
?>
</a></span><br />
<span class="bugnote-reporter">
<?php
echo print_user($t_bugnote->reporter_id);
?>
<span class="small access-level"><?php
if (user_exists($t_bugnote->reporter_id)) {
$t_access_level = access_get_project_level(null, (int) $t_bugnote->reporter_id);
// Only display access level when higher than 0 (ANYBODY)
if ($t_access_level > ANYBODY) {
echo '(', get_enum_element('access_levels', $t_access_level), ')';
}
}
?>
</span>
</span>
<?php
if (VS_PRIVATE == $t_bugnote->view_state) {
示例4: bugnote_format_id
</tr>
<tr>
<td class="nopad" width="20%">
<table class="hide" cellspacing="1">
<tr>
<td class="print">
(<?php
echo bugnote_format_id($t_row['id']);
?>
)
</td>
</tr>
<tr>
<td class="print">
<?php
print_user($t_row['reporter_id']);
?>
   
</td>
</tr>
<tr>
<td class="print">
<?php
echo $t_date_submitted;
?>
   
<?php
if ($t_date_submitted != $t_last_modified) {
echo '<br />(' . lang_get('last_edited') . lang_get('word_separator') . $t_last_modified . ')';
}
?>
示例5: news_get_rows
$rows = news_get_rows(helper_get_current_project());
# Loop through results
for ($i = 0; $i < sizeof($rows); $i++) {
extract($rows[$i], EXTR_PREFIX_ALL, 'v');
if (VS_PRIVATE == $v_view_state && !access_has_project_level(config_get('private_news_threshold'), $v_project_id)) {
continue;
}
$v_headline = string_display($v_headline);
$v_date_posted = date(config_get('complete_date_format'), $v_date_posted);
$t_notes = array();
$t_note_string = '';
if (1 == $v_announcement) {
array_push($t_notes, lang_get('announcement'));
}
if (VS_PRIVATE == $v_view_state) {
array_push($t_notes, lang_get('private'));
}
if (sizeof($t_notes) > 0) {
$t_note_string = '[' . implode(' ', $t_notes) . ']';
}
echo "<li><span class=\"italic-small\">{$v_date_posted}</span> - <span class=\"bold\"><a href=\"news_view_page.php?news_id={$v_id}\">{$v_headline}</a></span> <span class=\"small\"> ";
print_user($v_poster_id);
echo ' ' . $t_note_string;
echo "</span></li>";
}
# end for loop
?>
</ul>
<?php
html_page_bottom1(__FILE__);
示例6: db_query
}
if ($_GET['verbose']) {
$verbose = $_GET['verbose'];
} else {
$verbose = 0;
}
if ($uuser->createip) {
$sth = db_query("select * from u_users where createip = ? and aid != ?", array($uuser->createip, $uuser->aid));
$u = $sth->fetch();
if ($u) {
echo "<h2>Accounts created from " . $uuser->createip . "</h2>\n";
print_header();
do {
$bgcolor = $count % 2 ? "#F7F7F7" : "#ECECFF";
$uu = new ForumUser($u['aid'], false);
print_user($uu, get_stats($uu), $bgcolor);
$count++;
} while ($u = $sth->fetch());
print_footer();
}
$sth->closeCursor();
}
echo "<h2>IP addresses</h2>\n";
if ($verbose > 1) {
$v2 = "class=selected";
} else {
if ($verbose > 0) {
$v1 = "class=selected";
} else {
$v0 = "class=selected";
}
示例7: bugnote_format_id
</tr>
<tr>
<td class="nopad" width="20%">
<table class="hide" cellspacing="1">
<tr>
<td class="print">
(<?php
echo bugnote_format_id($t_row->id);
?>
)
</td>
</tr>
<tr>
<td class="print">
<?php
print_user($t_row->reporter_id);
?>
   
</td>
</tr>
<tr>
<td class="print">
<?php
echo $t_date_submitted;
?>
   
<?php
if ($t_date_submitted != $t_last_modified) {
echo '<br />(' . lang_get('last_edited') . lang_get('word_separator') . $t_last_modified . ')';
}
?>
示例8: lang_get
<td class="small-caption">
<?php echo lang_get( 'field' ) ?>
</td>
<td class="small-caption">
<?php echo lang_get( 'change' ) ?>
</td>
</tr>
<?php
foreach ( $t_history as $t_item ) {
?>
<tr <?php echo helper_alternate_class() ?>>
<td class="small-caption">
<?php echo $t_item['date'] ?>
</td>
<td class="small-caption">
<?php print_user( $t_item['userid'] ) ?>
</td>
<td class="small-caption">
<?php echo string_display( $t_item['note'] ) ?>
</td>
<td class="small-caption">
<?php echo ( $t_item['raw'] ? string_display_line_links( $t_item['change'] ) : $t_item['change'] ) ?>
</td>
</tr>
<?php
} # end for loop
?>
</table>
<?php
collapse_closed( 'history' );
?>
示例9: lang_get
echo lang_get('users_monitoring_bug');
?>
</td>
</tr>
<tr class="row-1">
<td class="category" width="15%">
<?php
echo lang_get('monitoring_user_list');
?>
</td>
<td>
<?php
for ($i = 0; $i < $num_users; $i++) {
$row = db_fetch_array($result);
echo $i > 0 ? ', ' : '';
echo print_user($row['user_id']);
}
?>
</td>
</tr>
<?php
}
?>
</table>
</div>
<?php
if (ON == config_get('use_javascript')) {
?>
<script type="text/javascript">
<!--
示例10: error
* @package mod-scheduler
* @category mod
* @author Gustav Delius, Valery Fremaux > 1.8
*/
/**
* Security traps
*/
if (!defined('MOODLE_INTERNAL')) {
error("This file cannot be loaded directly");
}
$studentid = required_param('studentid', PARAM_INT);
$usehtmleditor = can_use_html_editor();
if ($subaction != '') {
include "viewstudent.controller.php";
}
print_user(get_record('user', 'id', $studentid), $course);
//print tabs
$tabrows = array();
$row = array();
if ($page == 'appointments') {
$currenttab = get_string('appointments', 'scheduler');
} else {
$currenttab = get_string('notes', 'scheduler');
}
$tabname = get_string('appointments', 'scheduler');
$order = @$order;
$row[] = new tabobject($tabname, "view.php?what=viewstudent&id={$cm->id}&studentid={$studentid}&course={$scheduler->course}&order={$order}&page=appointments", $tabname);
$tabname = get_string('comments', 'scheduler');
$row[] = new tabobject($tabname, "view.php?what=viewstudent&id={$cm->id}&studentid={$studentid}&course={$scheduler->course}&order={$order}&page=notes", $tabname);
$tabrows[] = $row;
print_tabs($tabrows, $currenttab);
示例11: json_encode
$json['msg'] = '0';
echo json_encode($json);
} else {
$zip->addFile($pic_path_org, $file_name . '.bmp');
$zip->close();
@unlink($pic_path_org);
// 刪除圖片
$download_name = $url . $file_name . '.zip';
$json['msg'] = '1';
$json['url'] = $file_name . '.zip';
echo json_encode($json);
//dump($pic_path_org);
}
exit;
} elseif ($_REQUEST['act'] == 'print_ok') {
print_user();
$zip = isset($_REQUEST['xia']) ? $_REQUEST['xia'] : '';
if (strstr($zip, 'normal_a')) {
$name = '普通版,正麵';
} elseif (strstr($zip, 'normal_b')) {
$name = '普通版,背麵';
} elseif (strstr($zip, 'simple_a')) {
$name = '簡版,正麵';
} elseif (strstr($zip, 'simple_b')) {
$name = '簡版,背麵';
}
$smarty->assign('name', $name);
$smarty->assign('zip', $zip);
$smarty->assign('act', $_REQUEST['act']);
}
$smarty->display('print.dwt');
示例12: get_records
if ( !($attempts = get_records('questionnaire_attempts','qid',$instance) )) {
echo "oups";
}
*/
$attempts = get_records('questionnaire_attempts', 'qid', $instance);
//print_r($attempts);
foreach ($attempts as $attempt) {
$usersattempts[] = $attempt->userid;
}
echo "Questionnaire Users Attempts Count = " . count($usersattempts) . " , ";
//print_r($usersattempts);
$result = array_diff($usersincourse, $usersattempts);
echo "Lazy Users Count = " . count($result) . "<br/>";
foreach ($result as $lazzyuserid) {
$lazzyuser = get_record('user', 'id', $lazzyuserid);
print_user($lazzyuser, $COURSE);
}
print_footer($course);
break;
case 'cross':
$type = 'cross';
/// Fall down into the vresp section.
/// Fall down into the vresp section.
case 'vresp':
// view by response
if (!has_capability('mod/questionnaire:viewsingleresponse', $context, NULL, false)) {
/// Print the page header
$extranav = array();
$extranav[] = array('name' => get_string('questionnairereport', 'questionnaire'), 'link' => '', 'type' => 'activity');
$extranav[] = array('name' => $strviewallresponses, 'link' => "", 'type' => 'activity');
$navigation = build_navigation($extranav, $questionnaire->cm);
示例13: ADONewConnection
<?php
// This script allows for checking for similar user names. May be used
// when testing new algorithms for the similarity check.
require_once 'adodb/adodb.inc.php';
include_once 'libuseful/SqlQuery.class.php5';
include_once 'services/sql_query.class.php';
include_once 'services/userdb.class.php';
include_once 'functions/config.inc.php';
include_once 'objects/user.class.php';
$db =& ADONewConnection(cfg("db_dbn")) or die("FreechForum::FreechForum(): Error: Can't connect." . " Please check username, password and hostname.");
function print_user($user, $needle)
{
echo "Match: " . $user->get_name() . " = " . $user->get_lexical_similarity($needle) . "<br>";
}
$userdb = new UserDB($db);
$needle = new User();
$needle->set_name($_GET['name']);
if ($_GET['name2']) {
$user = new User();
$user->set_name($_GET['name2']);
die("Similarity: " . $user->get_lexical_similarity($needle) . "<br>");
}
$users = $userdb->get_similar_users_from_name($needle->get_name());
foreach ($users as $user) {
print_user($user, $needle);
}
echo "DONE.";
示例14: training_reports_print_header_html
/**
* a raster for html printing of a report structure header
* with all the relevant data about a user.
*
*/
function training_reports_print_header_html($userid, $courseid, $data, $short = false)
{
global $CFG;
$user = get_record('user', 'id', $userid);
$course = get_record('course', 'id', $courseid);
print_user($user, $course);
$usergroups = groups_get_all_groups($courseid, $userid, 0, 'g.id, g.name');
echo "<center>";
echo "<div style=\"width:80%;text-align:left;padding:3px;\" class=\"userinfobox\">";
// print group status
if (!empty($usergroups)) {
print_string('groups');
echo ' : ';
foreach ($usergroups as $group) {
$str = $group->name;
if ($group->id == get_current_group($courseid)) {
$str = "<b>{$str}</b>";
}
$groupnames[] = $str;
}
echo implode(', ', $groupnames);
}
$context = get_context_instance(CONTEXT_COURSE, $courseid);
echo '<br/>';
print_string('roles');
echo ' : ';
echo get_user_roles_in_context($userid, $context);
if (!empty($data->linktousersheet)) {
echo "<br/><a href=\"{$CFG->wwwroot}/course/report/trainingsessions/index.php?view=user&id={$courseid}&userid={$userid}\">" . get_string('seedetails', 'report_trainingsessions') . '</a>';
}
// print completion bar
if ($data->items) {
$completed = $data->done / $data->items;
} else {
$completed = 0;
}
$remaining = 1 - $completed;
$completedpc = ceil($completed * 100);
$remainingpc = 100 - $completedpc;
$completedwidth = floor(500 * $completed);
$remainingwidth = floor(500 * $remaining);
echo '<p class="completionbar">';
print_string('done', 'report_trainingsessions');
echo "<img src=\"{$CFG->wwwroot}/course/report/trainingsessions/pix/green.gif\" style=\"width:{$completedwidth}px\" class=\"donebar\" align=\"top\" title=\"{$completedpc} %\" />";
echo "<img src=\"{$CFG->wwwroot}/course/report/trainingsessions/pix/blue.gif\" style=\"width:{$remainingwidth}px\" class=\"remainingbar\" align=\"top\" title=\"{$remainingpc} %\" />";
// Start printing the overall times
if (!$short) {
echo '<br/>';
echo get_string('equlearningtime', 'report_trainingsessions');
echo training_reports_format_time(0 + @$data->elapsed, 'html');
echo ' (' . (0 + @$data->events) . ')';
// plug here specific details
}
echo '</p></div></center>';
}
示例15: print_news_entry
function print_news_entry($p_headline, $p_body, $p_poster_id, $p_view_state, $p_announcement, $p_date_posted)
{
$t_headline = string_display_links($p_headline);
$t_body = string_display_links($p_body);
$t_date_posted = date(config_get('normal_date_format'), $p_date_posted);
if (VS_PRIVATE == $p_view_state) {
$t_news_css = 'news-heading-private';
} else {
$t_news_css = 'news-heading-public';
}
$output = '<div align="center">';
$output .= '<table class="width75" cellspacing="0">';
$output .= '<tr>';
$output .= "<td class=\"{$t_news_css}\">";
$output .= "<span class=\"bold\">{$t_headline}</span> - ";
$output .= "<span class=\"italic-small\">{$t_date_posted}</span> - ";
echo $output;
/** @todo eventually we should replace print's with methods to construct the strings. */
print_user($p_poster_id);
$output = '';
if (1 == $p_announcement) {
$output .= ' <span class="small">';
$output .= '[' . lang_get('announcement') . ']';
$output .= '</span>';
}
if (VS_PRIVATE == $p_view_state) {
$output .= ' <span class="small">';
$output .= '[' . lang_get('private') . ']';
$output .= '</span>';
}
$output .= '</td>';
$output .= '</tr>';
$output .= '<tr>';
$output .= "<td class=\"news-body\">{$t_body}</td>";
$output .= '</tr>';
$output .= '</table>';
$output .= '</div>';
echo $output;
}