Skip to content

Commit

Permalink
Merge pull request #22 from gocodebox/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Benjamin R. Matthews committed Sep 5, 2015
2 parents bba70cf + d1da1c7 commit b8896df
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 26 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ LIFTER LMS

CHANGELOG
=========
v1.3.4 - 2015/09/04
-------------------
+ BugFixes: Fixes bug with featured image on course page
+ BugFixes: Fixes issue with lesson completed percentage on analytics page

v1.3.3 - 2015/09/01
-------------------
+ Updates: Removes depricated plugin updater
Expand Down
5 changes: 3 additions & 2 deletions includes/admin/analytics/class.llms.analytics.courses.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public function __construct() {
*/
public function get_analytics() {
$search = LLMS()->session->get( 'llms_analytics_course' );
//var_dump($search);

$title = __( 'Course Analytics', 'lifterlms' );

Expand Down Expand Up @@ -183,8 +184,8 @@ public function sales_chart( $search ) {
return $html;
}

public function lesson_completion_chart( $search ) {

public function lesson_completion_chart( $search )
{
$headers = array( 'Lesson', 'Completion Percentage' );

if ( $search ) {
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/class.llms.admin.analytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ public static function save_search_fields( $analytics ) {
$search->lessons = array();
foreach ( $lesson_ids as $id ) {

array_push( $search->lessons, get_post( $id['lesson_id'] ) );
array_push( $search->lessons, get_post($id));

}
//$search->test_student_progress = $course_obj->get_student_progress( '147' );
Expand Down
4 changes: 2 additions & 2 deletions includes/class.llms.analytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,8 @@ public static function get_lesson_completion_avg( $search ) {

if ( ! empty( $search->lessons ) ) {
//loop through each lesson
foreach ( $search->lessons as $lesson ) {

foreach ( $search->lessons as $lesson )
{
//create array and add post title
$lesson_array = array( $lesson->post_title );

Expand Down
42 changes: 26 additions & 16 deletions includes/class.llms.course.php
Original file line number Diff line number Diff line change
Expand Up @@ -403,26 +403,36 @@ public function get_next_uncompleted_lesson() {
* @return array $array [array of all lesson ids in a course]
*/
public function get_lesson_ids() {
$array = array ();
$syllabus = $this->get_syllabus();

if($syllabus) {

foreach($syllabus as $key => $value ) :

if($syllabus[$key]['lessons']) {

foreach ($syllabus[$key]['lessons'] as $keys) :
$lessons = array();

array_push($array, $keys);
$args = array(
'post_type' => 'section',
'posts_per_page' => 500,
'meta_key' => '_llms_order',
'order' => 'ASC',
'orderby' => 'meta_value_num',
'meta_query' => array(
array(
'key' => '_parent_course',
'value' => $this->id,
'compare' => '='
)
),
);

$sections = get_posts( $args );

endforeach;
}
endforeach;
foreach ($sections as $s)
{
$section = new LLMS_Section($s->ID);
$lessonset = $section->get_children_lessons();
foreach ($lessonset as $lessonojb)
{
$lessons[] = $lessonojb->ID;
}
}

return $array;

return $lessons;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions lifterlms.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: LifterLMS
* Plugin URI: http://lifterlms.com/
* Description: lifterLMS is the easiest way for anyone to create a Learning Management System on the Wordpress platform.
* Version: 1.3.3
* Version: 1.3.4
* Author: codeBOX
* Author URI: http://gocodebox.com
*
Expand Down Expand Up @@ -31,7 +31,7 @@
*/
final class LifterLMS {

public $version = '1.3.3';
public $version = '1.3.4';

protected static $_instance = null;

Expand Down
2 changes: 1 addition & 1 deletion templates/content-course.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<a class="llms-course-link" href="<?php the_permalink(); ?>">

<?php

do_action( 'lifterlms_before_shop_loop_item_title' );

?>
Expand Down
4 changes: 2 additions & 2 deletions templates/loop/featured-image.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

if ( has_post_thumbnail($post->ID) ) {

return llms_featured_img( $post->ID, 'full' );
echo llms_featured_img( $post->ID, 'full' );
}
elseif ( llms_placeholder_img_src() ) {

return llms_placeholder_img();
echo llms_placeholder_img();
}

0 comments on commit b8896df

Please sign in to comment.