Skip to content

Commit

Permalink
adjust paths when both custom default and custom course badges exist
Browse files Browse the repository at this point in the history
  • Loading branch information
gregrgay committed May 10, 2018
1 parent 2fc735d commit 4416758
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions mods/_standard/gameme/index_instructor.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,16 +227,21 @@ function performKeyPress(elemId) {
$badge_file_array = explode('/',$badge['image_url']);
if($badge_file_array[1] == 0){
$custom_default = TRUE;
} elseif($badge_file_array[1] >= 1){
$custom_course = TRUE;
}
array_shift($badge_file_array);
$badge_file_stem = implode('/',$badge_file_array);

debug($badge_file_stem);
if(is_file(AT_CONTENT_DIR.$badge_file_stem)){
if(!$custom_default){
if($custom_course){
// Course Badge
$badge_file = $_base_href.'get.php/gameme/badges/'.end($badge_file_array);
} else if($custom_default){
//Custom Default
$badge_file = $_base_href.'content/0/gameme/badges/'.end($badge_file_array);
} else{
// Custom Default Badge
// Default Badge
$badge_file = $_base_href.'mods/_standard/gameme/get_badge_icon.php?badge_id='.$badge['id'];
}
}
Expand Down

0 comments on commit 4416758

Please sign in to comment.