-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathajax.php
executable file
·35 lines (29 loc) · 1.26 KB
/
ajax.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Name: Threadz
// Author: Matt Lewis
// Organization: Eastern Washington University - Instructional Technology
// Copyright: Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License
// Version: 1.0
// Page Description: This page extracts the topic post data from SESSION and pushes it back to be used in the D3 function to create the graph.
// Called From: threadz.php
// Uses: function.php
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
session_start();
require_once("functions.php");
if(isset($_COOKIE['Threadz'])){
$topic_id = $_POST['topic_id'];
empty($_SESSION['d3_'.$topic_id]);
unset($_SESSION['d3_'.$topic_id]);
//the function d3Data() creates an array of lms data used by the d3 library
d3Data($topic_id);
//encode to json and save array to session
$discussionData = json_encode($_SESSION['d3_'.$topic_id]);
//Save to Session for Chord Diagram
$_SESSION['discussionData'] = $discussionData;
//send back to threadz.php
echo $discussionData;
}else{
echo 'Expired Session, please reauthenticate Threadz.';
}
?>