3 date_default_timezone_set('America/Chicago');
5 include_once("auth_root.php");
7 include_once("conn.php");
11 /* TODO: Lock out account if this user keeps hitting this page. */
13 /* get most recent date for assignment change - this will be the publication date */
14 $sql = 'select DATE_FORMAT(max(timeposted),"%a, %d %b %Y %T CST") from schedule';
16 $result = mysql_query($sql);
17 if (!$result) { die("SQL ERROR"); }
18 $row = mysql_fetch_array($result);
20 $pub_date = $row['0'];
22 //if($role != 0) { die("Account \"".$user_name."\" Is Not Authorized To View This Page.<br><br>This Event Will Be Logged And Reported."); }
25 $sql = 'select class_name, title, chapter, type_name, section_id, ava_date, due_date, sched_id, DATE_FORMAT(schedule.timeposted,"%a, %d %b %Y %T CST") AS timeposted, DATE_FORMAT(schedule.timeposted, "%Y%c%d%H%i%S") AS timeposted_num from schedule, class, types where (types.assign_type = schedule.assign_type) and (class.class_id = schedule.class_id) order by schedule.timeposted desc limit 30';
28 // get list of classes this student is in
31 $sql = 'select class_id from enrollment where user_id='.$user_id;
33 $result = mysql_query($sql);
34 if (!$result) { die("SQL ERROR: Get Classes"); }
35 while( $row = mysql_fetch_array($result))
38 $classes .= "schedule.class_id=".$row['class_id'];
40 $classes .= " or schedule.class_id=".$row['class_id'];
46 $sql = 'select class_name, title, chapter, type_name, section_id, ava_date, due_date, sched_id, DATE_FORMAT(schedule.timeposted,"%a, %d %b %Y %T CST") AS timeposted, DATE_FORMAT(schedule.timeposted, "%Y%c%d%H%i%S") AS timeposted_num from schedule, class, types where (types.assign_type = schedule.assign_type) and (class.class_id = schedule.class_id) and '.$classes.' order by schedule.timeposted desc limit 30';
51 $result = mysql_query($sql);
53 $server_url = "http://".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'];
54 $server_url_base = "http://".$_SERVER['SERVER_NAME'];
57 if (!$result) { die("SQL ERROR"); }
60 while($row = mysql_fetch_array($result))
63 $row['title'] = htmlspecialchars($row['title']);
64 $row['type_name'] = htmlspecialchars($row['title']);
68 <title>'.$row['title'].' - '.$row['type_name'].'</title>
69 <description>An assignment for '.$row['class_name'].' has been updated.<p>Name: '.$row['title'].'<p>Chapter: '.$row['chapter'].'<p>Type: '.$row['type_name'].'<p>Section:
70 '.$row['section_id'].'<p>Avaliable Date: '.$row['ava_date'].'
71 <p>Due Date: '.$row['due_date'].'</description>
72 <link>'.$server_url_base.'/at/detail_root.php?sched='.$row['sched_id'].'&random='.$row['timeposted_num'].'</link>
73 <author>steven.schronk@my.tccd.edu (Schronk, Steven)</author>
74 <category domain="assignmnet feed">assignments</category>
75 <guid>'.$server_url_base.'/at/detail_root.php?sched='.$row['sched_id'].'</guid>
76 <pubDate>'.$row['timeposted'].'</pubDate>
82 $now = date("D, d M Y H:i:s T");
86 echo '<?xml version="1.0" encoding="UTF-8" ?>';
90 <rss version
="2.0" xmlns
:atom
="http://www.w3.org/2005/Atom">
92 <title
>Assignment Trapper
- Assignment Update Feed
</title
>
93 <description
>Latest assignment changes
.</description
>
94 <link
><?php
echo $server_url; ?
></link
>
95 <lastBuildDate
><?php
echo $pub_date; ?
></lastBuildDate
>
96 <pubDate
><?php
echo $pub_date; ?
></pubDate
>
97 <language
>en
-US
</language
>
98 <copyright
>Copyright
2011 Steven Schronk
</copyright
>
99 <managingEditor
>steven@schronk
.com (Steven Schronk
)</managingEditor
>
100 <webMaster
>steven@schronk
.com (Steven Schronk
)</webMaster
>
102 <atom
:link href
="http://www.opentextbook.info/at/comment_feed.php" rel
="self" type
="application/rss+xml" />
104 <title
>Assignment Trapper
- Assignment Update Feed
</title
>
105 <url
><?php
echo $server_url_base; ?
>/at
/gfx
/bug
.png
</url
>
106 <link
><?php
echo $server_url_base; ?
>/at
/assignment_feed
.php
</link
>
111 <?php
echo $items; ?
>