diff --git a/syndicate.php b/syndicate.php index b2511c5667..b0b7e2d564 100644 --- a/syndicate.php +++ b/syndicate.php @@ -1,73 +1,79 @@ -php_library_path . "database_library.php"; +include $xerte_toolkits_site->php_library_path . "url_library.php"; - include $xerte_toolkits_site->php_library_path . "database_library.php"; - include $xerte_toolkits_site->php_library_path . "url_library.php"; +function normal_date($string){ + $temp = explode("-", $string); + return $temp[2] . " " . $temp[1] . " " . $temp[0] . " 12:00:00 GMT"; +} - function normal_date($string){ +$database_id = database_connect("syndication worked","syndication failed"); - $temp = explode("-", $string); +$query = "SELECT {$xerte_toolkits_site->database_table_prefix}originaltemplatesdetails.template_name as origname, username, {$xerte_toolkits_site->database_table_prefix}logindetails.login_id, + {$xerte_toolkits_site->database_table_prefix}templatedetails.template_id, keywords, creator_id, date_created, {$xerte_toolkits_site->database_table_prefix}templatedetails.template_name, + license, category, export, {$xerte_toolkits_site->database_table_prefix}templatesyndication.description, firstname, surname + FROM {$xerte_toolkits_site->database_table_prefix}templatedetails, {$xerte_toolkits_site->database_table_prefix}templatesyndication, {$xerte_toolkits_site->database_table_prefix}logindetails, + {$xerte_toolkits_site->database_table_prefix}originaltemplatesdetails + WHERE syndication="true" + AND login_id = creator_id + AND {$xerte_toolkits_site->database_table_prefix}templatedetails.template_id = {$xerte_toolkits_site->database_table_prefix}templatesyndication.template_id + AND {$xerte_toolkits_site->database_table_prefix}templatedetails.template_type_id = {$xerte_toolkits_site->database_table_prefix}originaltemplatesdetails.template_type_id"; - return $temp[2] . " " . $temp[1] . " " . $temp[0] . " 12:00:00 GMT"; +$rows = db_query($query); - } +echo "" .$xerte_toolkits_site->rss_title . "" . $xerte_toolkits_site->site_url . "This RSS feed contains a list of all the syndicated content from the Xerte Online Toolkits installation at " . $xerte_toolkits_site->synd_publisher . "Xerte Online Toolkitsen-gbhttp://creativecommons.org/licenses/by-nc-sa/2.0/uk/ " . date("D, d M Y H:i:s", time()-20000) . " GMT" . date("D, d M Y H:i:s", time()-20000) . " GMT" . $xerte_toolkits_site->synd_publisher . "" . $xerte_toolkits_site->synd_license . ""; - $database_id = database_connect("syndication worked","syndication failed"); +foreach($rows as $row) { + $_dataxml = $xerte_toolkits_site->root_file_path . $xerte_toolkits_site->users_file_area_short . $row['template_id'] . '-' . $row['username'] . '-' . $row['origname'] . '/data.xml'; -$query = "select " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails.template_name as origname, username," . $xerte_toolkits_site->database_table_prefix . "logindetails.login_id, " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_id, keywords, creator_id, date_created, " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_name, license, category, export, " . $xerte_toolkits_site->database_table_prefix . "templatesyndication.description, firstname, surname from " . $xerte_toolkits_site->database_table_prefix . "templatedetails, " . $xerte_toolkits_site->database_table_prefix . "templatesyndication, " . $xerte_toolkits_site->database_table_prefix . "logindetails, " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails where syndication=\"true\" and login_id = creator_id and " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_id = " . $xerte_toolkits_site->database_table_prefix . "templatesyndication.template_id and " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_type_id = " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails.template_type_id"; - - $query_response = mysql_query($query); + echo "" . str_replace("_"," ",$row['template_name']) . " + " . $xerte_toolkits_site->site_url . url_return("play" , $row['template_id']) . " + " . date("D, d M y H:i:s O ", filemtime($_dataxml) . " + " . str_replace("_"," ",$row['template_name']) . " was developed by " . $row['firstname'] . " " . $row['surname'] . "
This content has the following license - " . $row['license']; - echo "" .$xerte_toolkits_site->rss_title . "" . $xerte_toolkits_site->site_url . "This RSS feed contains a list of all the syndicated content from the Xerte Online Toolkits installation at " . $xerte_toolkits_site->synd_publisher . "Xerte Online Toolkitsen-gbhttp://creativecommons.org/licenses/by-nc-sa/2.0/uk/ " . date("D, d M Y H:i:s", time()-20000) . " GMT" . date("D, d M Y H:i:s", time()-20000) . " GMT" . $xerte_toolkits_site->synd_publisher . "" . $xerte_toolkits_site->synd_license . ""; + if($row['export']=="true"){ - while($row = mysql_fetch_array($query_response)){ + echo "
Download this content from " . $xerte_toolkits_site->site_url . url_return("export", $row['template_id']); + echo "
Download this as a scorm package from " . $xerte_toolkits_site->site_url . url_return("scorm", $row['template_id']); - echo "" . str_replace("_"," ",$row['template_name']) . "" . $xerte_toolkits_site->site_url . url_return("play" , $row['template_id']) . "" . date("Y-m-d",filemtime($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->users_file_area_short . $row['template_id'] . "-" . $row['username'] . "-" . $row['origname'] . "/data.xml")) . "T" . date("H:i:s",filemtime($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->users_file_area_short . $row['template_id'] . "-" . $row['username'] . "-" . $row['origname'] . "/data.xml")) . "Z" . str_replace("_"," ",$row['template_name']) . " was developed by " . $row['firstname'] . " " . $row['surname'] . "
This content has the following license - " . $row['license']; + } - if($row['export']=="true"){ - - echo "
Download this content from " . $xerte_toolkits_site->site_url . url_return("export", $row['template_id']); - echo "
Download this as a scorm package from " . $xerte_toolkits_site->site_url . url_return("scorm", $row['template_id']); + echo "]]>
" . $xerte_toolkits_site->site_url . url_return("play", $row['template_id']) . "" . $xerte_toolkits_site->synd_publisher . "" . $row['surname'] . ", " . $row['firstname'] . " " . $row['template_name'] . "Course" . str_replace("_"," ",$row['template_name']) . " was developed by " . $row['firstname'] . " " . $row['surname'] . "
This content has the following license - " . $row['license']; - } + if($row['export']=="true"){ - echo "]]>
" . $xerte_toolkits_site->site_url . url_return("play", $row['template_id']) . "" . $xerte_toolkits_site->synd_publisher . "" . $row['surname'] . ", " . $row['firstname'] . " " . $row['template_name'] . "Course" . str_replace("_"," ",$row['template_name']) . " was developed by " . $row['firstname'] . " " . $row['surname'] . "
This content has the following license - " . $row['license']; + echo "
Download this content from " . $xerte_toolkits_site->site_url . url_return("export", $row['template_id']); + echo "
Download this as a scorm package from " . $xerte_toolkits_site->site_url . url_return("scorm", $row['template_id']); - if($row['export']=="true"){ - - echo "
Download this content from " . $xerte_toolkits_site->site_url . url_return("export", $row['template_id']); - echo "
Download this as a scorm package from " . $xerte_toolkits_site->site_url . url_return("scorm", $row['template_id']); + } - } + echo "]]>
text/htmlen-gbtext/htmlen-gbsite_url . url_return("export", $row['template_id']) . ""; - echo $xerte_toolkits_site->site_url . url_return("scorm", $row['template_id']); + echo $xerte_toolkits_site->site_url . url_return("export", $row['template_id']) . ""; + echo $xerte_toolkits_site->site_url . url_return("scorm", $row['template_id']); - } + } - echo "]]>" . $xerte_toolkits_site->synd_publisher . "" . $row['license'] . ""; + echo "]]>" . $xerte_toolkits_site->synd_publisher . "" . $row['license'] . ""; - $new_array = explode(",",$row['keywords']); + $new_array = explode(",",$row['keywords']); - while($word = array_pop($new_array)){ + while($word = array_pop($new_array)){ - echo "" . $word . ""; + echo "" . $word . ""; - } + } - echo "synd_license . "]]>
"; + echo "synd_license . "]]>"; - } +} - echo "
"; +echo ""; - mysql_close($database_id); - -?> \ No newline at end of file