本文整理汇总了PHP中WooThemes_Sensei_Utils::sensei_user_course_status_message方法的典型用法代码示例。如果您正苦于以下问题:PHP WooThemes_Sensei_Utils::sensei_user_course_status_message方法的具体用法?PHP WooThemes_Sensei_Utils::sensei_user_course_status_message怎么用?PHP WooThemes_Sensei_Utils::sensei_user_course_status_message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WooThemes_Sensei_Utils
的用法示例。
在下文中一共展示了WooThemes_Sensei_Utils::sensei_user_course_status_message方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: course_info
/**
* Load course results info
* @since 1.4.0
* @return void
*/
public function course_info()
{
global $course, $current_user;
do_action('sensei_course_results_top', $course->ID);
do_action('sensei_course_image', $course->ID);
?>
<header><h1><?php
echo $course->post_title;
?>
</h1></header>
<?php
$course_status = WooThemes_Sensei_Utils::sensei_user_course_status_message($course->ID, $current_user->ID);
echo '<div class="sensei-message ' . $course_status['box_class'] . '">' . $course_status['message'] . '</div>';
do_action('sensei_course_results_lessons', $course);
do_action('sensei_course_results_bottom', $course->ID);
}
示例2: savedquest_options
//.........这里部分代码省略.........
}
echo '<br />';
}
// End For Loop
echo "</td>";
echo "<td>";
echo $diftime;
echo "</td>";
echo "</tr>";
//echo $course->post_title." (".$course_status_update['percent'][0]."% Complete) (". $incomplete . "% incomplete) (". $course_user_grade . "% Competent)<br />";
$i++;
}
}
}
echo "</table>";
} elseif ($tab == "threshold") {
//declare the wpdb for custom query
global $wpdb;
//check for submitted data
if (isset($_POST['submittreshold']) && ($_POST['submittreshold'] = "submit")) {
// declare users and variables
$allUsers = get_users();
$modules_completed = $_POST['completionpermonth'];
$courseid = $_POST['course'];
$course_name = get_the_title($courseid);
$array_to_csv = array(array('Student Name', 'Course Name '));
//user loop ----- loop user get the groups and course the course they take
foreach ($allUsers as $user) {
//declare course function calls
$course_user_grade = WooThemes_Sensei_Utils::sensei_course_user_grade($courseid, $user->ID);
$user_course_status = WooThemes_Sensei_Utils::user_course_status($courseid, $user->ID);
$course_status_info = get_comment_meta($user_course_status->comment_ID);
$started_course = WooThemes_Sensei_Utils::user_started_course($courseid, $user->ID);
$course_status = WooThemes_Sensei_Utils::sensei_user_course_status_message($courseid, $user->ID);
$completed_course = WooThemes_Sensei_Utils::user_completed_course($user_course_status);
//get the user groups
$useringroup = new Groups_User($user->ID);
$user_groups = $useringroup->__get('groups');
$displayed_lessons = array();
//declare and get module values
$modules = Sensei()->modules->get_course_modules(intval($courseid));
$modules_content = Sensei()->modules->course_module_content(intval($courseid));
//echo "<pre>";
//echo $user->user_email."<br />";
//echo "sensei_user_course_status_message: ";
//print_r($course_status);
//echo "<br />";
//echo "started_course: "."<br />";
$course_status_info['start'][0];
$datenow = date('Y-m-d h:i:s');
$date1 = date_create($course_status_info['start'][0]);
$date2 = date_create($datenow);
$diff = date_diff($date1, $date2);
$diftime = $diff->format("%m");
if ($diftime < 1) {
$diftime = 1;
}
//echo "</pre>";
//module loop per user
foreach ($modules as $module) {
$args = array('post_type' => 'lesson', 'post_status' => 'publish', 'posts_per_page' => -1, 'meta_query' => array(array('key' => '_lesson_course', 'value' => intval($courseid), 'compare' => '=')), 'tax_query' => array(array('taxonomy' => Sensei()->modules->taxonomy, 'field' => 'id', 'terms' => intval($module->term_id))), 'meta_key' => '_order_module_' . $module->term_id, 'orderby' => 'meta_value_num date', 'order' => 'ASC', 'suppress_filters' => 0);
$lessons = get_posts($args);
$num_of_lesson = count($lessons);
//lessson loop per user
foreach ($lessons as $lesson_item) {
$is_lesson_completed = WooThemes_Sensei_Utils::user_completed_lesson($lesson_item->ID, $user->ID);
示例3: savedquest_options
//.........这里部分代码省略.........
//check for submitted data
if (isset($_POST['submittreshold']) && ($_POST['submittreshold'] = "submit")) {
// declare users and variables
$completionpermonth = $_POST['completionpermonth'];
$courseid = $_POST['course'];
$group_id = $_POST['group'];
$course_name = get_the_title($courseid);
$array_to_csv = array(array('Student Name', 'Course Name', 'Module(s)'));
$userincourse = BuddyPress_Sensei_Groups::bp_sensei_get_course_members($courseid);
//groups_get_groupmeta
//echo $group_attached = groups_get_groupmeta( $group_id, 'bp_course_attached', true)."<br />---";
if ($completionpermonth == "") {
$completionpermonth = groups_get_groupmeta($group_id, 'sensei_threshold', true);
}
/* echo "<pre>";
print_r($userincourse);
echo "</pre>";
echo "<pre>";
print_r($user_in_groups);
echo "</pre>"; */
$user_in_groups = $wpdb->get_results($wpdb->prepare("SELECT user_id FROM wp_bp_groups_members WHERE group_id = %d", $group_id));
//user loop ----- loop user get the groups and course the course they take
foreach ($user_in_groups as $user) {
//echo "user_id ".$user->user_id."<br />";
$course_user_grade = WooThemes_Sensei_Utils::sensei_course_user_grade($courseid, $user->user_id);
$user_course_status = WooThemes_Sensei_Utils::user_course_status($courseid, $user->user_id);
$course_status_info = get_comment_meta($user_course_status->comment_ID);
$started_course = WooThemes_Sensei_Utils::user_started_course($courseid, $user->user_id);
$course_status = WooThemes_Sensei_Utils::sensei_user_course_status_message($courseid, $user->user_id);
$completed_course = WooThemes_Sensei_Utils::user_completed_course($user_course_status);
$modules = Sensei()->modules->get_course_modules($courseid);
//$modules_content = Sensei()->modules->course_module_content( $courseid );
foreach ($modules as $module) {
$module_id = $module->term_id;
$args = array('post_type' => 'lesson', 'post_status' => 'publish', 'posts_per_page' => -1, 'tax_query' => array(array('taxonomy' => 'module', 'field' => 'id', 'terms' => $module_id)), 'meta_query' => array(array('key' => '_lesson_course', 'value' => $courseid)), 'fields' => 'ids');
$lessons = get_posts($args);
$completed = false;
$lesson_count = 0;
$completed_count = 0;
foreach ($lessons as $lesson_id) {
$completed = WooThemes_Sensei_Utils::user_completed_lesson($lesson_id, $user->user_id);
++$lesson_count;
if ($completed) {
++$completed_count;
}
}
$module_progress = $completed_count / $lesson_count * 100;
if ($module_progress == 100) {
$module_passed[] = 1;
$module_name[] = $module->name;
}
/* echo "<pre>";
echo $module_progress;
echo "---<br />";
//print_r($modules_content);
echo "</pre>"; */
}