Skip to content

Commit

Permalink
minor analytics bug fix: removed wp_ table prefix reference in join
Browse files Browse the repository at this point in the history
  • Loading branch information
therealmarknelson committed Jun 5, 2015
1 parent 7f40754 commit 445c015
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
3 changes: 2 additions & 1 deletion includes/admin/class.llms.admin.analytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ public static function save_search_fields( $analytics ) {
$search->date_range = $date_range;
$search->start_date = $date_range['start_date'];
$search->end_date = $date_range['end_date'];
$search->end_date_plus_one = LLMS_Date::db_date( $date_range['end_date'] . '+ 1 day');

} else {

Expand Down Expand Up @@ -418,4 +419,4 @@ public static function save_search_fields( $analytics ) {

}

endif;
endif;
2 changes: 1 addition & 1 deletion includes/class.llms.analytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ public static function get_total_users_all_time( $post_id, $end_date ) {
MAX(IF(pa.meta_key = "_status", pa.meta_value, NULL)) AS status,
MAX(IF(pa.meta_key = "_is_complete", pa.updated_date, NULL)) AS completed_date
from '.$table_name.' p
left join wp_lifterlms_user_postmeta pa on p.user_id = pa.user_id and p.post_id = pa.post_id
left join '.$table_name.' pa on p.user_id = pa.user_id and p.post_id = pa.post_id
where p.post_id = %s
and p.updated_date <= %s
group by p.user_id',
Expand Down
15 changes: 9 additions & 6 deletions includes/llms.template.functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -599,19 +599,22 @@ function lifterlms_template_quiz_results() {
function llms_setup_course_data( $post ) {
if ( ! is_admin() ) {

if ($post->post_type == 'course') {
if ($post && $post->post_type == 'course') {
unset( $GLOBALS['course'] );

if ( is_int( $post ) )
if ( is_int( $post ) ) {
$post = get_post( $post );

if ( empty( $post->post_type ) )
}

if ( empty( $post->post_type ) ) {
return;
}

$GLOBALS['course'] = get_course( $post );
$GLOBALS['course'] = get_course( $post );

return $GLOBALS['course'];
return $GLOBALS['course'];
}

}

}
Expand Down
2 changes: 1 addition & 1 deletion templates/course/outline-list-small.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

<?php if ( LLMS_Course::check_enrollment( $course->id, get_current_user_id() ) ) : ?>

<a href="' . get_permalink( $lesson['id'] ) . '"><?php echo $lesson['title']; ?></a>
<a href="<?php echo get_permalink( $lesson['id'] ); ?>"><?php echo $lesson['title']; ?></a>

<?php else :

Expand Down

0 comments on commit 445c015

Please sign in to comment.