diff scripts/comment_parser.php @ 2164:ce24c304f93c

comment/score _parser.php updated to match 'ref' 'name' attribute changes.
author Nicholas Jillings <nickjillings@users.noreply.github.com>
date Wed, 16 Mar 2016 16:52:30 +0000
parents c8317e07c15f
children f22a6240fb51
line wrap: on
line diff
--- a/scripts/comment_parser.php	Wed Mar 16 16:16:05 2016 +0000
+++ b/scripts/comment_parser.php	Wed Mar 16 16:52:30 2016 +0000
@@ -37,14 +37,14 @@
                 $page_struct = null;
                 foreach($comment_struct as $comment_struct_page)
                 {
-                    if ($pageInstance['id'] == $comment_struct_page->id)
+                    if ($pageInstance['ref'] == $comment_struct_page->id)
                     {
                         $page_struct = $comment_struct_page;
                         break;
                     }
                 }
                 if ($page_struct == null) {
-                    array_push($comment_struct,new testPage($pageInstance['id']));
+                    array_push($comment_struct,new testPage($pageInstance['ref']));
                     $page_struct = $comment_struct[count($comment_struct)-1];
                 }
                 // Get the audioelements of the page
@@ -54,14 +54,14 @@
                     $element_struct = null;
                     foreach($page_struct->elements as $page_struct_element)
                     {
-                        if ($fragment['id'] == $page_struct_element->id)
+                        if ($fragment['name'] == $page_struct_element->id)
                         {
                             $element_struct = $page_struct_element;
                             break;
                         }
                     }
                     if ($element_struct == null) {
-                        array_push($page_struct->elements,new audioElement($fragment['id']));
+                        array_push($page_struct->elements,new audioElement($fragment['name']));
                         $element_struct = $page_struct->elements[count($page_struct->elements)-1];
                     }
                     $element_struct->addComment($fragment->comment->response);