本文整理汇总了PHP中UserProfile::userIdMailProfile方法的典型用法代码示例。如果您正苦于以下问题:PHP UserProfile::userIdMailProfile方法的具体用法?PHP UserProfile::userIdMailProfile怎么用?PHP UserProfile::userIdMailProfile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserProfile
的用法示例。
在下文中一共展示了UserProfile::userIdMailProfile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mycourses
function mycourses(&$url)
{
checkPerm('view');
require_once _base_ . '/lib/lib.user_profile.php';
$lang =& DoceboLanguage::createInstance('catalogue');
require_once $GLOBALS['where_lms'] . '/lib/lib.middlearea.php';
$ma = new Man_MiddleArea();
$course_stats = userCourseList($url, $ma->currentCanAccessObj('lo_tab'));
$access_career = $ma->currentCanAccessObj('career');
$access_news = $ma->currentCanAccessObj('news');
$access_search_form = $ma->currentCanAccessObj('search_form');
$access_user_details_full = $ma->currentCanAccessObj('user_details_full');
$access_user_details_short = $ma->currentCanAccessObj('user_details_short');
$onecol = !$access_career && !$access_news && !$access_user_details_full && !$access_user_details_short;
require_once $GLOBALS['where_framework'] . '/lib/lib.myfriends.php';
$friends = new MyFriends(getLogUserId());
$pendent = count($friends->getPendentRequest());
$GLOBALS['page']->addStart('' . '<div id="mycourse_top">' . ($onecol ? '' : '<div class="mycourse_left">'), 'content');
// user_details_short ------------------------------------------------------------------------
if ($access_user_details_short) {
$profile = new UserProfile(getLogUserId());
$profile->init('profile', 'framework', 'index.php?r=' . _after_login_, 'ap');
$GLOBALS['page']->addStart($profile->userIdMailProfile('normal', false, false), 'content');
}
// user_details_full ------------------------------------------------------------------------
if ($access_user_details_full) {
$profile = new UserProfile(getLogUserId());
$profile->init('profile', 'framework', 'index.php?r=' . _after_login_, 'ap');
$GLOBALS['page']->addStart($profile->homeUserProfile('normal', false, false), 'content');
}
// career ------------------------------------------------------------------------
if ($access_career) {
$base_url = 'index.php?r=' . _after_login_ . '&filter=';
$end = 0;
if (isset($course_stats['with_ustatus'][_CUS_END]) && $course_stats['with_ustatus'][_CUS_END] != 0) {
$end = $course_stats['with_ustatus'][_CUS_END];
}
$GLOBALS['page']->addStart('' . '<div class="course_stat">' . '<table summary="">' . '<caption>' . $lang->def('_CAREER') . '</caption>' . '<tr><th scope="row">' . $lang->def('_TOTAL_COURSE') . ' :</th><td><a href="' . $base_url . 'nothing">' . ($course_stats['total'] - $end) . '</a></td></tr>' . (isset($course_stats['with_ustatus'][_CUS_END]) && $course_stats['with_ustatus'][_CUS_END] != 0 ? '<tr><th scope="row">' . $lang->def('_COURSE_END') . ' :</th><td><a href="' . $base_url . 'end">' . $course_stats['with_ustatus'][_CUS_END] . '</a></td></tr>' : '') . (isset($course_stats['expiring']) && $course_stats['expiring'] != 0 ? '<tr><th scope="row">' . $lang->def('_COURSE_EXPIRING') . ' :</th><td><a href="' . $base_url . 'expiring">' . $course_stats['expiring'] . '</a></td></tr>' : ''), 'content');
if (count($course_stats['with_ulevel']) > 1) {
require_once $GLOBALS['where_lms'] . '/lib/lib.levels.php';
$lvl = CourseLevel::getLevels();
foreach ($course_stats['with_ulevel'] as $lvl_num => $quantity) {
$GLOBALS['page']->addStart('' . '<tr><th scope="row">' . str_replace('[level]', $lvl[$lvl_num], $lang->def('_COURSE_AS')) . ' :</th><td><a href="' . $base_url . 'level&filter_on=' . $lvl_num . '">' . $quantity . '</a></td></tr>', 'content');
}
//end foreach
}
$query = "SELECT c.idMetaCertificate, m.idCertificate" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_course as c" . " JOIN " . $GLOBALS['prefix_lms'] . "_certificate_meta as m ON c.idMetaCertificate = m.idMetaCertificate" . " WHERE c.idUser = '" . getLogUserId() . "'" . " GROUP BY c.idMetaCertificate" . " ORDER BY m.title, m.description";
$result = sql_query($query);
$num_meta_cert = mysql_num_rows($result);
while (list($id_meta, $id_certificate) = sql_fetch_row($result)) {
$query_released = "SELECT on_date" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_assign" . " WHERE idUser = '" . getLogUserId() . "'" . " AND idMetaCertificate = '" . $id_meta . "'";
$result_released = sql_query($query_released);
$query = "SELECT user_release" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate" . " WHERE id_certificate = '" . $id_certificate . "'";
list($user_release) = sql_fetch_row(sql_query($query));
if (mysql_num_rows($result_released)) {
} elseif ($user_release == 0) {
$num_meta_cert--;
} else {
$query = "SELECT idCourse" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_course" . " WHERE idUser = '" . getLogUserId() . "'" . " AND idMetaCertificate = '" . $id_meta . "'";
$result_int = sql_query($query);
$control = true;
while (list($id_course) = sql_fetch_row($result_int)) {
$query = "SELECT COUNT(*)" . " FROM " . $GLOBALS['prefix_lms'] . "_courseuser" . " WHERE idCourse = '" . $id_course . "'" . " AND idUser = '" . getLogUserId() . "'" . " AND status = '" . _CUS_END . "'";
list($number) = sql_fetch_row(sql_query($query));
if (!$number) {
$control = false;
}
}
if (!$control) {
$num_meta_cert--;
}
}
}
$tot_cert = $num_meta_cert + $course_stats['cert_relesable'];
$GLOBALS['page']->addStart('' . (isset($course_stats['cert_relesable']) && $tot_cert != 0 ? '<tr><th scope="row">' . $lang->def('_CERT_RELESABLE') . ' :</th><td><a href="index.php?modname=mycertificate&op=mycertificate">' . $tot_cert . '</a></td></tr>' : '') . ($pendent != 0 ? '<tr><th scope="row">' . $lang->def('_FRIEND_PENDENT') . ' :</th><td><a href="index.php?modname=myfriends&op=myfriends">' . $pendent . '</a></td></tr>' : '') . '</table>' . '</div>', 'content');
}
// career ------------------------------------------------------------------------
if ($access_search_form) {
$year_array = array(0 => $lang->def('_ALL_YEAR'));
$query_year = "SELECT DISTINCT create_date" . " FROM " . $GLOBALS['prefix_lms'] . "_course";
$result = sql_query($query_year);
while (list($year) = sql_fetch_row($result)) {
$year_array[$year[0] . $year[1] . $year[2] . $year[3]] = $year[0] . $year[1] . $year[2] . $year[3];
}
if (isset($year_array['0000'])) {
unset($year_array['0000']);
}
$GLOBALS['page']->addStart('' . '<div class="course_search">' . '<h2>' . $lang->def('_SEARCH') . '</h2>' . Form::openForm('course_filter', 'index.php?modname=course&op=mycourses') . '<p>' . Form::getLabel('search', $lang->def('_WORD')) . '</p>' . Form::getInputTextfield('textfield_nowh', 'search', 'search', importVar('search'), $lang->def('_WORD'), '255', '') . '<br/>' . '<p>' . Form::getLabel('year', $lang->def('_YEAR')) . '</p>' . Form::getInputDropdown('dropdown_nowh', 'year', 'year', $year_array, importVar('year'), '') . Form::getButton('apply_filter', 'apply_filter', $lang->def('_SEARCH')) . Form::closeForm() . '</div>', 'content');
}
// news ------------------------------------------------------------------------
if ($access_news) {
$GLOBALS['page']->addStart('' . '<div class="course_news">' . '<h2>' . $lang->def('_NEWS') . '</h2>', 'content');
$user_level = Docebo::user()->getUserLevelId();
$user_assigned = Docebo::user()->getArrSt();
$query_news = "\r\n\t\tSELECT idNews, publish_date, title, short_desc, important, viewer\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_news_internal\r\n\t\tWHERE language = '" . getLanguage() . "'\r\n\t\tORDER BY important DESC, publish_date DESC ";
$re_news = sql_query($query_news);
$displayed = 0;
while (list($id_news, $publish_date, $title, $short_desc, $impo, $viewer) = sql_fetch_row($re_news)) {
$viewer = is_string($viewer) && $viewer != false ? unserialize($viewer) : array();
$intersect = array_intersect($user_assigned, $viewer);
//.........这里部分代码省略.........
示例2: user_details_short
public function user_details_short($link)
{
require_once _lib_ . '/lib.user_profile.php';
$profile = new UserProfile(getLogUserId());
$profile->init('profile', 'framework', 'index.php?r=' . $link, 'ap');
echo $profile->userIdMailProfile('normal', false, false);
}