<commit_before><?php
/**
 * 
 * syndication template, shows the syndication status for this template
 *
 * @author <NAME>
 * @version 1.0
 * @copyright Copyright (c) 2008,2009 University of Nottingham
 * @package
 */


require_once("../../../config.php");

include "../template_status.php";

include "../user_library.php";
include "../url_library.php";
include "properties_library.php";

//connect to the database

$database_connect_id = database_connect("notes template database connect success", "notes template database connect failed");

if(is_numeric($_POST['tutorial_id'])){

    if(is_user_creator(mysql_real_escape_string($_POST['tutorial_id']))||is_user_admin()){

        /**
         * Check template is public
         */

        if(template_access_settings(mysql_real_escape_string($_POST['tutorial_id']))=="Public"){

            syndication_display($xerte_toolkits_site,false);

        }else{

            syndication_not_public($xerte_toolkits_site);

        }

    }else{

        syndication_display_fail();

    }

}

?><commit_msg>remove unused mysql connect; unpack loops; ensure we display something (no blank response)<commit_after><?php
/**
 * 
 * syndication template, shows the syndication status for this template
 *
 * @author <NAME>
 * @version 1.0
 * @copyright Copyright (c) 2008,2009 University of Nottingham
 * @package
 */


require_once("../../../config.php");

include "../template_status.php";

include "../user_library.php";
include "../url_library.php";
include "properties_library.php";

if(!is_numeric($_POST['tutorial_id'])){
    syndication_display_fail();
    exit(0);
}
if(!is_user_creator((int) $_POST['tutorial_id']) && !is_user_admin()){
    syndication_display_fail();
    exit(0);
}

/**
 * Check template is public
 */
if(template_access_settings((int) $_POST['tutorial_id']) == "Public") {
    syndication_display($xerte_toolkits_site,false);
}
else{
    syndication_not_public($xerte_toolkits_site);
}
{'fraction_non_alphanumeric': 0.15227388860500765, 'fraction_numerical': 0.011241696474195196, 'mean_word_length': 4.221333333333333, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4550432', 'n_tokens_mistral': 638, 'n_tokens_neox': 603, 'n_words': 119}