<?php

/* @phpbbservices_smartfeed/event/overall_header_head_append.html */
class __TwigTemplate_910f29eed051a88598e2ba97290d23b8db02b7585b8cca4b818f0ffcbc87d4b4 extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = array(
        );
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        // line 1
        if ((isset($context["S_AUTO_ADVERTISE_PUBLIC_FEED"]) ? $context["S_AUTO_ADVERTISE_PUBLIC_FEED"] : null)) {
            // line 2
            echo "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS\" href=\"";
            echo (isset($context["U_SMARTFEED_URL"]) ? $context["U_SMARTFEED_URL"] : null);
            echo (isset($context["U_RSS_PARAMETERS"]) ? $context["U_RSS_PARAMETERS"] : null);
            echo "\" />
<link rel=\"alternate\" type=\"application/atom+xml\" title=\"ATOM\" href=\"";
            // line 3
            echo (isset($context["U_SMARTFEED_URL"]) ? $context["U_SMARTFEED_URL"] : null);
            echo (isset($context["U_ATOM_PARAMETERS"]) ? $context["U_ATOM_PARAMETERS"] : null);
            echo "\" />
";
        }
        // line 5
        $asset_file = "@phpbbservices_smartfeed/custom.css";
        $asset = new \phpbb\template\asset($asset_file, $this->getEnvironment()->get_path_helper());
        if (substr($asset_file, 0, 2) !== './' && $asset->is_relative()) {
            $asset_path = $asset->get_path();            $local_file = $this->getEnvironment()->get_phpbb_root_path() . $asset_path;
            if (!file_exists($local_file)) {
                $local_file = $this->getEnvironment()->findTemplate($asset_path);
                $asset->set_path($local_file, true);
            $asset->add_assets_version('13');
            $asset_file = $asset->get_url();
            }
        }
        $context['definition']->append('STYLESHEETS', '<link href="' . $asset_file . '" rel="stylesheet" type="text/css" media="screen" />
');
        // line 6
        if ((isset($context["S_SMARTFEED_IN_SMARTFEED"]) ? $context["S_SMARTFEED_IN_SMARTFEED"] : null)) {
            // line 7
            echo "<script type=\"text/javascript\">
// <![CDATA[

// global variables
";
            // line 11
            if ( !(isset($context["S_SMARTFEED_IS_GUEST"]) ? $context["S_SMARTFEED_IS_GUEST"] : null)) {
                // line 12
                echo "var isIPV6 = ";
                echo (isset($context["S_SMARTFEED_IS_IPV6"]) ? $context["S_SMARTFEED_IS_IPV6"] : null);
                echo ";
var smartfeedKey = '";
                // line 13
                echo (isset($context["S_SMARTFEED_PWD"]) ? $context["S_SMARTFEED_PWD"] : null);
                echo "';
var smartfeedKeyWithIP = '";
                // line 14
                echo (isset($context["S_SMARTFEED_PWD_WITH_IP"]) ? $context["S_SMARTFEED_PWD_WITH_IP"] : null);
                echo "';
var thisIP = '";
                // line 15
                echo (isset($context["S_SMARTFEED_IP"]) ? $context["S_SMARTFEED_IP"] : null);
                echo "';
";
            }
            // line 17
            echo "var thereAreRequiredForums = ";
            echo (isset($context["S_SMARTFEED_REQUIRED_FORUMS"]) ? $context["S_SMARTFEED_REQUIRED_FORUMS"] : null);
            echo ";
";
            // line 18
            $asset_file = "@phpbbservices_smartfeed/js/smartfeed.js";
            $asset = new \phpbb\template\asset($asset_file, $this->getEnvironment()->get_path_helper());
            if (substr($asset_file, 0, 2) !== './' && $asset->is_relative()) {
                $asset_path = $asset->get_path();                $local_file = $this->getEnvironment()->get_phpbb_root_path() . $asset_path;
                if (!file_exists($local_file)) {
                    $local_file = $this->getEnvironment()->findTemplate($asset_path);
                    $asset->set_path($local_file, true);
                $asset->add_assets_version('13');
                $asset_file = $asset->get_url();
                }
            }
            $context['definition']->append('SCRIPTS', '<script type="text/javascript" src="' . $asset_file. '"></script>

');
            // line 19
            echo "function check_whole_number_range (field, maxValue, allowStar)
{
\t// If a star (wildcard) is allowed in a field, it is accepted. If the value is negative or it exceeds maxValue an error dialog appears and the default 
\t// value shows in the field again.
\tstarMessage = (allowStar) ? '";
            // line 23
            echo addslashes($this->env->getExtension('phpbb')->lang("SMARTFEED_STAR_MESSAGE"));
            echo "' : '';
\tif ((allowStar) && (field.value === '*')) {
\t\treturn;
\t}
\t
\tif (isNaN(field.value)) {
\t\talert(\"";
            // line 29
            echo addslashes($this->env->getExtension('phpbb')->lang("SMARTFEED_SIZE_ERROR"));
            echo "\" + starMessage);
\t\tfield.value = field.defaultValue;
\t\tfield.focus();
\t\treturn;
\t}
\tsize = parseInt(field.value);
\tif (size < 0) {
\t\talert(\"";
            // line 36
            echo addslashes($this->env->getExtension('phpbb')->lang("SMARTFEED_SIZE_ERROR"));
            echo "\" + starMessage);
\t\tfield.value = field.defaultValue;
\t\tfield.focus();
\t\treturn;
\t}
\t
\tif ((parseInt(maxValue) !== 0) && (size > parseInt(maxValue))) {
\t\talert(\"";
            // line 43
            echo addslashes($this->env->getExtension('phpbb')->lang("SMARTFEED_SIZE_ERROR"));
            echo "\" + starMessage);
\t\tfield.value = field.defaultValue;
\t\tfield.focus();
\t\treturn;
\t}
\tfield.value = size;
\treturn;
}

function check_for_negative_value (field) {
\t// Function returns an error if the value is negative or is not a number
\tfield_value = field.value;
\tif (isNaN(field_value)) {
\t\talert(\"";
            // line 56
            echo addslashes($this->env->getExtension('phpbb')->lang("SMARTFEED_SIZE_ERROR_MIN"));
            echo "\");
\t\tfield.value = field.defaultValue;
\t\tfield.focus();
\t}
\telse {
\t\tfield_value = parseInt(field_value);
\t\tif (field_value < 0) {
\t\t\talert(\"";
            // line 63
            echo addslashes($this->env->getExtension('phpbb')->lang("SMARTFEED_SIZE_ERROR_MIN"));
            echo "\");
\t\t\tfield.value = field.defaultValue;
\t\t\tfield.focus();
\t\t}
\t\telse {
\t\t\t//field.value = field.defaultValue;
\t\t\tfield.value = field_value;
\t\t}
\t}
}

function create_URL() {

\t// Creates a URL for display to be used by the newsreader to actually retrieve the newsfeed.
\tvar newsID = document.getElementById('phpbbservices_smartfeed');
\tvar numChecked;
\tvar forumString = '';
\t";
            // line 80
            if ((isset($context["S_SMARTFEED_IS_GUEST"]) ? $context["S_SMARTFEED_IS_GUEST"] : null)) {
                // line 81
                echo "\tvar loggedIn = 0;
\t";
            } else {
                // line 83
                echo "\tvar loggedIn = 1;
\tvar bookmarksID = document.getElementById('bookmarks');
\tvar pms1ID = document.getElementById('pms1');
\t";
            }
            // line 87
            echo "\t 
\t// Get # of checked forums
\tnumChecked = 0;
\tvar x = document.getElementById('div_0').getElementsByTagName('input');
\tfor(i=0;i<x.length;i++) {
\t\tthisObject = x[i];
\t\telementName = thisObject.name;
\t\tif(elementName !== null) {
\t\t\tif(elementName.substr(0,4) === \"elt_\") {
\t\t\t\tif (thisObject.checked === true) {
\t\t\t\t\tnumChecked++;
\t\t\t\t\tunderscoreLoc = thisObject.id.indexOf('_',5); // Look for underscore past the \"elt_\", or first 4 characters
\t\t\t\t\tforumString = forumString + \"&";
            // line 99
            echo (isset($context["S_SMARTFEED_FORUMS"]) ? $context["S_SMARTFEED_FORUMS"] : null);
            echo "=\" + elementName.substring(4,underscoreLoc);
\t\t\t\t}
\t\t\t}
\t\t}
\t}
\tif ((thereAreRequiredForums) && (numChecked===0)) {
\t\tforumString = forumString + \"&f=-1\"; // -1 means that no forums were selected but there are required forums
\t\tnumChecked++;
\t}
\t";
            // line 108
            if ( !(isset($context["S_SMARTFEED_IS_GUEST"]) ? $context["S_SMARTFEED_IS_GUEST"] : null)) {
                // line 109
                echo "\t// If bookmarks are checked, then the forum string should be blank
\tif (bookmarksID.checked) {
\t\tforumString = null;
\t}
\t";
            }
            // line 114
            echo "
\t// If no forums were checked there is no point in generating a URL. 
\t// Instead, give a Javascript warning and generate nothing.
\tcreateMyURL = false;

\t";
            // line 119
            if ( !(isset($context["S_SMARTFEED_IS_GUEST"]) ? $context["S_SMARTFEED_IS_GUEST"] : null)) {
                // line 120
                echo "\tif ((numChecked===0) && (newsID.all_forums.checked===false) && (bookmarksID.checked===false) && (pms1ID.checked===false))
\t";
            } else {
                // line 122
                echo "\tif ((numChecked===0) && (newsID.all_forums.checked===false)) ";
            }
            echo " {
\t\talert(\"";
            // line 123
            echo addslashes($this->env->getExtension('phpbb')->lang("SMARTFEED_NO_FORUMS_SELECTED"));
            echo "\");
\t}
\telse {
\t\tcreateMyURL = true;
\t}

\t// Forums are selected so let's go
\tif (createMyURL) {
\t\t// Initialise the URL
\t\turl = \"";
            // line 132
            echo (isset($context["UA_SMARTFEED_SITE_URL"]) ? $context["UA_SMARTFEED_SITE_URL"] : null);
            echo "feed\";
\t\t
\t\t// If user logged in, add the specific variables
\t\tif (loggedIn) {
\t\t\t// Add his user ID
\t\t\tappend = (url.indexOf('?') === -1) ? '?' : '&';
\t\t\turl = url + append + \"";
            // line 138
            echo (isset($context["S_SMARTFEED_USER_ID"]) ? $context["S_SMARTFEED_USER_ID"] : null);
            echo "=";
            echo (isset($context["UA_SMARTFEED_USER_ID"]) ? $context["UA_SMARTFEED_USER_ID"] : null);
            echo "\";

\t\t\t// Add his password + if needed address IP
\t\t\tappend = (url.indexOf('?') === -1) ? '?' : '&';
\t\t\t";
            // line 142
            if ((isset($context["S_SMARTFEED_REQUIRED_IP_AUTHENTICATION"]) ? $context["S_SMARTFEED_REQUIRED_IP_AUTHENTICATION"] : null)) {
                // line 143
                echo "\t\t\turl = url + append + \"";
                echo (isset($context["S_SMARTFEED_ENCRYPTION_KEY"]) ? $context["S_SMARTFEED_ENCRYPTION_KEY"] : null);
                echo "=\" + smartfeedKeyWithIP;
\t\t\t";
            } else {
                // line 145
                echo "\t\t\tif (newsID.ip_auth1.checked === true) {
\t\t\t\turl = url + append + \"";
                // line 146
                echo (isset($context["S_SMARTFEED_ENCRYPTION_KEY"]) ? $context["S_SMARTFEED_ENCRYPTION_KEY"] : null);
                echo "=\" + smartfeedKeyWithIP;
\t\t\t}
\t\t\telse {
\t\t\t\turl = url + append + \"";
                // line 149
                echo (isset($context["S_SMARTFEED_ENCRYPTION_KEY"]) ? $context["S_SMARTFEED_ENCRYPTION_KEY"] : null);
                echo "=\" + smartfeedKey;
\t\t\t}
\t\t\t";
            }
            // line 152
            echo "
\t\t\t// If checked, add to reset the last visit date
\t\t\tappend = (url.indexOf('?') === -1) ? '?' : '&';
\t\t\tif (newsID.lastvisit1.checked === true) {
\t\t\t\turl = url + append + \"";
            // line 156
            echo (isset($context["S_SMARTFEED_SINCE_LAST_VISIT"]) ? $context["S_SMARTFEED_SINCE_LAST_VISIT"] : null);
            echo "=1\";
\t\t\t}

\t\t\t// If checked, add to add his unread private messages
\t\t\tappend = (url.indexOf('?') === -1) ? '?' : '&';
\t\t\tif (newsID.pms1.checked === true) {
\t\t\t\turl = url + append + \"";
            // line 162
            echo (isset($context["S_SMARTFEED_PRIVATE_MESSAGE"]) ? $context["S_SMARTFEED_PRIVATE_MESSAGE"] : null);
            echo "=1\";
\t\t\t\tif (newsID.mark_read.checked === true) {
\t\t\t\t\tappend = (url.indexOf('?') === -1) ? '?' : '&';
\t\t\t\t\turl = url + append + \"";
            // line 165
            echo (isset($context["S_SMARTFEED_MARK_PRIVATE_MESSAGES"]) ? $context["S_SMARTFEED_MARK_PRIVATE_MESSAGES"] : null);
            echo "=1\";
\t\t\t\t}
\t\t\t}

\t\t\t// If checked, add to remove his posts
\t\t\tappend = (url.indexOf('?') === -1) ? '?' : '&';
\t\t\tif (newsID.remove_yours1.checked === true) {
\t\t\t\turl = url + append + \"";
            // line 172
            echo (isset($context["S_SMARTFEED_REMOVE_MINE"]) ? $context["S_SMARTFEED_REMOVE_MINE"] : null);
            echo "=1\";
\t\t\t}

\t\t\tappend = (url.indexOf('?') === -1) ? '?' : '&';
\t\t\t// If checked, add to remove posts from his foes
\t\t\tif (newsID.filter_foes1.checked === true) {
\t\t\t\turl = url + append + \"";
            // line 178
            echo (isset($context["S_SMARTFEED_FILTER_FOES"]) ? $context["S_SMARTFEED_FILTER_FOES"] : null);
            echo "=1\";
\t\t\t}

\t\t\t// If checked, add to select posts only from bookmarked topics, or from selected forums
\t\t\tappend = (url.indexOf('?') === -1) ? '?' : '&';
\t\t\tif (newsID.bookmarks.checked === true) {
\t\t\t\turl = url + append + \"";
            // line 184
            echo (isset($context["S_SMARTFEED_BOOKMARKS"]) ? $context["S_SMARTFEED_BOOKMARKS"] : null);
            echo "=1\";
\t\t\t}
\t\t\telse {
\t\t\t\tif (newsID.all_forums.checked === false && numChecked > 0) {
\t\t\t\t\t// Remove the 1st \"&\" of the string as it'll be the 1st variable of the url
\t\t\t\t\turl = url + append + forumString.substring(1);
\t\t\t\t}
\t\t\t}
\t\t}
\t\telse {
\t\t\tappend = (url.indexOf('?') === -1) ? '?' : '&';
\t\t\tif (newsID.all_forums.checked === false && numChecked > 0) {
\t\t\t\t// Add to select posts from selected forums
\t\t\t\turl = url + append + forumString.substring(1);
\t\t\t}
\t\t}

\t\t// Add the type of posts
\t\tappend = (url.indexOf('?') === -1) ? '?' : '&';
\t\tif (newsID.firstpostonly1.checked === true) {
\t\t\turl = url + append + \"";
            // line 204
            echo (isset($context["S_SMARTFEED_FIRST_POST"]) ? $context["S_SMARTFEED_FIRST_POST"] : null);
            echo "=1\";
\t\t}

\t\t// Add the time limit
\t\tappend = (url.indexOf('?') === -1) ? '?' : '&';
\t\turl = url + append + \"";
            // line 209
            echo (isset($context["S_SMARTFEED_TIME_LIMIT"]) ? $context["S_SMARTFEED_TIME_LIMIT"] : null);
            echo "=\" + newsID.post_limit.value;
\t\t
\t\t// Add the max number of posts
\t\tappend = (url.indexOf('?') === -1) ? '?' : '&';
\t\tmaxItems = newsID.max_items.value;
\t\tif (maxItems > 0) {
\t\t\tif (newsID.max_items.value <= maxItems) {
\t\t\t\turl = url + append + \"";
            // line 216
            echo (isset($context["S_SMARTFEED_MAX_ITEMS_L"]) ? $context["S_SMARTFEED_MAX_ITEMS_L"] : null);
            echo "=\" + newsID.max_items.value;
\t\t\t}
\t\t\telse if (maxItems < 0) {
\t\t\t\talert(\"";
            // line 219
            echo addslashes($this->env->getExtension('phpbb')->lang("SMARTFEED_SIZE_ERROR"));
            echo "\");
\t\t\t\tnewsID.max_items.focus();
\t\t\t\treturn;
\t\t\t}
\t\t}

\t\t// Add the sort order
\t\tappend = (url.indexOf('?') === -1) ? '?' : '&';
\t\turl = url + append + \"";
            // line 227
            echo (isset($context["S_SMARTFEED_SORT_BY"]) ? $context["S_SMARTFEED_SORT_BY"] : null);
            echo "=\" + newsID.sort_by.value;

\t\t// Add to select posts with minimum words
\t\tif (newsID.min_words.value !== '') {
\t\t\tif (newsID.min_words.value > 0) {
\t\t\t\tappend = (url.indexOf('?') === -1) ? '?' : '&';
\t\t\t\turl = url + append + \"";
            // line 233
            echo (isset($context["S_SMARTFEED_MIN_WORDS"]) ? $context["S_SMARTFEED_MIN_WORDS"] : null);
            echo "=\" + newsID.min_words.value;
\t\t\t}
\t\t\telse  if (newsID.min_words.value < 0) {
\t\t\t\talert(\"";
            // line 236
            echo addslashes($this->env->getExtension('phpbb')->lang("SMARTFEED_SIZE_ERROR_MIN"));
            echo "\");
\t\t\t\tnewsID.min_words.focus();
\t\t\t\treturn;
\t\t\t}
\t\t}

\t\t// Add the news feed type
\t\tappend = (url.indexOf('?') === -1) ? '?' : '&';
\t\tif (newsID.feed_type1.checked === true) {
\t\t\turl = url + append + \"";
            // line 245
            echo (isset($context["S_SMARTFEED_FEED_TYPE"]) ? $context["S_SMARTFEED_FEED_TYPE"] : null);
            echo "=\" + \"";
            echo (isset($context["S_SMARTFEED_RSS_20_VALUE"]) ? $context["S_SMARTFEED_RSS_20_VALUE"] : null);
            echo "\";
\t\t}
\t\telse {
\t\t\tif (newsID.feed_type2.checked === true) {
\t\t\t\turl = url + append + \"";
            // line 249
            echo (isset($context["S_SMARTFEED_FEED_TYPE"]) ? $context["S_SMARTFEED_FEED_TYPE"] : null);
            echo "=\" + \"";
            echo (isset($context["S_SMARTFEED_RSS_10_VALUE"]) ? $context["S_SMARTFEED_RSS_10_VALUE"] : null);
            echo "\";
\t\t\t}
\t\t\telse {
\t\t\t\turl = url + append + \"";
            // line 252
            echo (isset($context["S_SMARTFEED_FEED_TYPE"]) ? $context["S_SMARTFEED_FEED_TYPE"] : null);
            echo "=\" + \"";
            echo (isset($context["S_SMARTFEED_ATOM_10_VALUE"]) ? $context["S_SMARTFEED_ATOM_10_VALUE"] : null);
            echo "\";
\t\t\t}
\t\t}

\t\t// Add the news format
\t\tappend = (url.indexOf('?') === -1) ? '?' : '&';
\t\tif (newsID.style1.checked === true) {
\t\t\turl = url + append + \"";
            // line 259
            echo (isset($context["S_SMARTFEED_FEED_STYLE"]) ? $context["S_SMARTFEED_FEED_STYLE"] : null);
            echo "=\" + newsID.style1.value;
\t\t}
\t\telse {
\t\t\tif (newsID.style2.checked === true) {
\t\t\t\turl = url + append + \"";
            // line 263
            echo (isset($context["S_SMARTFEED_FEED_STYLE"]) ? $context["S_SMARTFEED_FEED_STYLE"] : null);
            echo "=\" + newsID.style2.value;
\t\t\t}
\t\t\telse {
\t\t\t\tif (newsID.style3.checked === true) {
\t\t\t\t\turl = url + append + \"";
            // line 267
            echo (isset($context["S_SMARTFEED_FEED_STYLE"]) ? $context["S_SMARTFEED_FEED_STYLE"] : null);
            echo "=\" + newsID.style3.value;
\t\t\t\t}
\t\t\t\telse {
\t\t\t\t\turl = url + append + \"";
            // line 270
            echo (isset($context["S_SMARTFEED_FEED_STYLE"]) ? $context["S_SMARTFEED_FEED_STYLE"] : null);
            echo "=\" + newsID.style4.value;
\t\t\t\t}
\t\t\t}
\t\t}


\t\tappend = (url.indexOf('?') === -1) ? '?' : '&';
\t\t// Add the maximum words in news
\t\tif (newsID.max_word_size.value !== '') {
\t\t\tif (newsID.max_word_size.value > 0) {
\t\t\t\turl = url + append + \"";
            // line 280
            echo (isset($context["S_SMARTFEED_MAX_WORDS"]) ? $context["S_SMARTFEED_MAX_WORDS"] : null);
            echo "=\" + newsID.max_word_size.value;
\t\t\t}
\t\t\telse if (newsID.max_word_size.value < 0) {
\t\t\t\talert(\"";
            // line 283
            echo addslashes($this->env->getExtension('phpbb')->lang("SMARTFEED_SIZE_ERROR_MIN"));
            echo "\");
\t\t\t\tnewsID.max_word_size.focus();
\t\t\t\treturn
\t\t\t}
\t\t}

\t\t// Place the url in the field
\t\tnewsID.url.value = encodeURI(url);
\t\treturn true;
\t}
\telse {
\t\treturn false;\t// Failed validation
\t}
}

// ]]>  
</script>
";
        }
    }

    public function getTemplateName()
    {
        return "@phpbbservices_smartfeed/event/overall_header_head_append.html";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  496 => 283,  490 => 280,  477 => 270,  471 => 267,  464 => 263,  457 => 259,  445 => 252,  437 => 249,  428 => 245,  416 => 236,  410 => 233,  401 => 227,  390 => 219,  384 => 216,  374 => 209,  366 => 204,  343 => 184,  334 => 178,  325 => 172,  315 => 165,  309 => 162,  300 => 156,  294 => 152,  288 => 149,  282 => 146,  279 => 145,  273 => 143,  271 => 142,  262 => 138,  253 => 132,  241 => 123,  236 => 122,  232 => 120,  230 => 119,  223 => 114,  216 => 109,  214 => 108,  202 => 99,  188 => 87,  182 => 83,  178 => 81,  176 => 80,  156 => 63,  146 => 56,  130 => 43,  120 => 36,  110 => 29,  101 => 23,  95 => 19,  80 => 18,  75 => 17,  70 => 15,  66 => 14,  62 => 13,  57 => 12,  55 => 11,  49 => 7,  47 => 6,  33 => 5,  27 => 3,  21 => 2,  19 => 1,);
    }
}
/* <!-- IF S_AUTO_ADVERTISE_PUBLIC_FEED -->*/
/* <link rel="alternate" type="application/rss+xml" title="RSS" href="{U_SMARTFEED_URL}{U_RSS_PARAMETERS}" />*/
/* <link rel="alternate" type="application/atom+xml" title="ATOM" href="{U_SMARTFEED_URL}{U_ATOM_PARAMETERS}" />*/
/* <!-- ENDIF -->*/
/* <!-- INCLUDECSS @phpbbservices_smartfeed/custom.css -->*/
/* <!-- IF S_SMARTFEED_IN_SMARTFEED -->*/
/* <script type="text/javascript">*/
/* // <![CDATA[*/
/* */
/* // global variables*/
/* <!-- IF not S_SMARTFEED_IS_GUEST -->*/
/* var isIPV6 = {S_SMARTFEED_IS_IPV6};*/
/* var smartfeedKey = '{S_SMARTFEED_PWD}';*/
/* var smartfeedKeyWithIP = '{S_SMARTFEED_PWD_WITH_IP}';*/
/* var thisIP = '{S_SMARTFEED_IP}';*/
/* <!-- ENDIF -->*/
/* var thereAreRequiredForums = {S_SMARTFEED_REQUIRED_FORUMS};*/
/* <!-- INCLUDEJS @phpbbservices_smartfeed/js/smartfeed.js -->*/
/* function check_whole_number_range (field, maxValue, allowStar)*/
/* {*/
/* 	// If a star (wildcard) is allowed in a field, it is accepted. If the value is negative or it exceeds maxValue an error dialog appears and the default */
/* 	// value shows in the field again.*/
/* 	starMessage = (allowStar) ? '{LA_SMARTFEED_STAR_MESSAGE}' : '';*/
/* 	if ((allowStar) && (field.value === '*')) {*/
/* 		return;*/
/* 	}*/
/* 	*/
/* 	if (isNaN(field.value)) {*/
/* 		alert("{LA_SMARTFEED_SIZE_ERROR}" + starMessage);*/
/* 		field.value = field.defaultValue;*/
/* 		field.focus();*/
/* 		return;*/
/* 	}*/
/* 	size = parseInt(field.value);*/
/* 	if (size < 0) {*/
/* 		alert("{LA_SMARTFEED_SIZE_ERROR}" + starMessage);*/
/* 		field.value = field.defaultValue;*/
/* 		field.focus();*/
/* 		return;*/
/* 	}*/
/* 	*/
/* 	if ((parseInt(maxValue) !== 0) && (size > parseInt(maxValue))) {*/
/* 		alert("{LA_SMARTFEED_SIZE_ERROR}" + starMessage);*/
/* 		field.value = field.defaultValue;*/
/* 		field.focus();*/
/* 		return;*/
/* 	}*/
/* 	field.value = size;*/
/* 	return;*/
/* }*/
/* */
/* function check_for_negative_value (field) {*/
/* 	// Function returns an error if the value is negative or is not a number*/
/* 	field_value = field.value;*/
/* 	if (isNaN(field_value)) {*/
/* 		alert("{LA_SMARTFEED_SIZE_ERROR_MIN}");*/
/* 		field.value = field.defaultValue;*/
/* 		field.focus();*/
/* 	}*/
/* 	else {*/
/* 		field_value = parseInt(field_value);*/
/* 		if (field_value < 0) {*/
/* 			alert("{LA_SMARTFEED_SIZE_ERROR_MIN}");*/
/* 			field.value = field.defaultValue;*/
/* 			field.focus();*/
/* 		}*/
/* 		else {*/
/* 			//field.value = field.defaultValue;*/
/* 			field.value = field_value;*/
/* 		}*/
/* 	}*/
/* }*/
/* */
/* function create_URL() {*/
/* */
/* 	// Creates a URL for display to be used by the newsreader to actually retrieve the newsfeed.*/
/* 	var newsID = document.getElementById('phpbbservices_smartfeed');*/
/* 	var numChecked;*/
/* 	var forumString = '';*/
/* 	<!-- IF S_SMARTFEED_IS_GUEST -->*/
/* 	var loggedIn = 0;*/
/* 	<!-- ELSE -->*/
/* 	var loggedIn = 1;*/
/* 	var bookmarksID = document.getElementById('bookmarks');*/
/* 	var pms1ID = document.getElementById('pms1');*/
/* 	<!-- ENDIF -->*/
/* 	 */
/* 	// Get # of checked forums*/
/* 	numChecked = 0;*/
/* 	var x = document.getElementById('div_0').getElementsByTagName('input');*/
/* 	for(i=0;i<x.length;i++) {*/
/* 		thisObject = x[i];*/
/* 		elementName = thisObject.name;*/
/* 		if(elementName !== null) {*/
/* 			if(elementName.substr(0,4) === "elt_") {*/
/* 				if (thisObject.checked === true) {*/
/* 					numChecked++;*/
/* 					underscoreLoc = thisObject.id.indexOf('_',5); // Look for underscore past the "elt_", or first 4 characters*/
/* 					forumString = forumString + "&{S_SMARTFEED_FORUMS}=" + elementName.substring(4,underscoreLoc);*/
/* 				}*/
/* 			}*/
/* 		}*/
/* 	}*/
/* 	if ((thereAreRequiredForums) && (numChecked===0)) {*/
/* 		forumString = forumString + "&f=-1"; // -1 means that no forums were selected but there are required forums*/
/* 		numChecked++;*/
/* 	}*/
/* 	<!-- IF not S_SMARTFEED_IS_GUEST -->*/
/* 	// If bookmarks are checked, then the forum string should be blank*/
/* 	if (bookmarksID.checked) {*/
/* 		forumString = null;*/
/* 	}*/
/* 	<!-- ENDIF -->*/
/* */
/* 	// If no forums were checked there is no point in generating a URL. */
/* 	// Instead, give a Javascript warning and generate nothing.*/
/* 	createMyURL = false;*/
/* */
/* 	<!-- IF not S_SMARTFEED_IS_GUEST -->*/
/* 	if ((numChecked===0) && (newsID.all_forums.checked===false) && (bookmarksID.checked===false) && (pms1ID.checked===false))*/
/* 	<!-- ELSE -->*/
/* 	if ((numChecked===0) && (newsID.all_forums.checked===false)) <!-- ENDIF --> {*/
/* 		alert("{LA_SMARTFEED_NO_FORUMS_SELECTED}");*/
/* 	}*/
/* 	else {*/
/* 		createMyURL = true;*/
/* 	}*/
/* */
/* 	// Forums are selected so let's go*/
/* 	if (createMyURL) {*/
/* 		// Initialise the URL*/
/* 		url = "{UA_SMARTFEED_SITE_URL}feed";*/
/* 		*/
/* 		// If user logged in, add the specific variables*/
/* 		if (loggedIn) {*/
/* 			// Add his user ID*/
/* 			append = (url.indexOf('?') === -1) ? '?' : '&';*/
/* 			url = url + append + "{S_SMARTFEED_USER_ID}={UA_SMARTFEED_USER_ID}";*/
/* */
/* 			// Add his password + if needed address IP*/
/* 			append = (url.indexOf('?') === -1) ? '?' : '&';*/
/* 			<!-- IF S_SMARTFEED_REQUIRED_IP_AUTHENTICATION -->*/
/* 			url = url + append + "{S_SMARTFEED_ENCRYPTION_KEY}=" + smartfeedKeyWithIP;*/
/* 			<!-- ELSE -->*/
/* 			if (newsID.ip_auth1.checked === true) {*/
/* 				url = url + append + "{S_SMARTFEED_ENCRYPTION_KEY}=" + smartfeedKeyWithIP;*/
/* 			}*/
/* 			else {*/
/* 				url = url + append + "{S_SMARTFEED_ENCRYPTION_KEY}=" + smartfeedKey;*/
/* 			}*/
/* 			<!-- ENDIF -->*/
/* */
/* 			// If checked, add to reset the last visit date*/
/* 			append = (url.indexOf('?') === -1) ? '?' : '&';*/
/* 			if (newsID.lastvisit1.checked === true) {*/
/* 				url = url + append + "{S_SMARTFEED_SINCE_LAST_VISIT}=1";*/
/* 			}*/
/* */
/* 			// If checked, add to add his unread private messages*/
/* 			append = (url.indexOf('?') === -1) ? '?' : '&';*/
/* 			if (newsID.pms1.checked === true) {*/
/* 				url = url + append + "{S_SMARTFEED_PRIVATE_MESSAGE}=1";*/
/* 				if (newsID.mark_read.checked === true) {*/
/* 					append = (url.indexOf('?') === -1) ? '?' : '&';*/
/* 					url = url + append + "{S_SMARTFEED_MARK_PRIVATE_MESSAGES}=1";*/
/* 				}*/
/* 			}*/
/* */
/* 			// If checked, add to remove his posts*/
/* 			append = (url.indexOf('?') === -1) ? '?' : '&';*/
/* 			if (newsID.remove_yours1.checked === true) {*/
/* 				url = url + append + "{S_SMARTFEED_REMOVE_MINE}=1";*/
/* 			}*/
/* */
/* 			append = (url.indexOf('?') === -1) ? '?' : '&';*/
/* 			// If checked, add to remove posts from his foes*/
/* 			if (newsID.filter_foes1.checked === true) {*/
/* 				url = url + append + "{S_SMARTFEED_FILTER_FOES}=1";*/
/* 			}*/
/* */
/* 			// If checked, add to select posts only from bookmarked topics, or from selected forums*/
/* 			append = (url.indexOf('?') === -1) ? '?' : '&';*/
/* 			if (newsID.bookmarks.checked === true) {*/
/* 				url = url + append + "{S_SMARTFEED_BOOKMARKS}=1";*/
/* 			}*/
/* 			else {*/
/* 				if (newsID.all_forums.checked === false && numChecked > 0) {*/
/* 					// Remove the 1st "&" of the string as it'll be the 1st variable of the url*/
/* 					url = url + append + forumString.substring(1);*/
/* 				}*/
/* 			}*/
/* 		}*/
/* 		else {*/
/* 			append = (url.indexOf('?') === -1) ? '?' : '&';*/
/* 			if (newsID.all_forums.checked === false && numChecked > 0) {*/
/* 				// Add to select posts from selected forums*/
/* 				url = url + append + forumString.substring(1);*/
/* 			}*/
/* 		}*/
/* */
/* 		// Add the type of posts*/
/* 		append = (url.indexOf('?') === -1) ? '?' : '&';*/
/* 		if (newsID.firstpostonly1.checked === true) {*/
/* 			url = url + append + "{S_SMARTFEED_FIRST_POST}=1";*/
/* 		}*/
/* */
/* 		// Add the time limit*/
/* 		append = (url.indexOf('?') === -1) ? '?' : '&';*/
/* 		url = url + append + "{S_SMARTFEED_TIME_LIMIT}=" + newsID.post_limit.value;*/
/* 		*/
/* 		// Add the max number of posts*/
/* 		append = (url.indexOf('?') === -1) ? '?' : '&';*/
/* 		maxItems = newsID.max_items.value;*/
/* 		if (maxItems > 0) {*/
/* 			if (newsID.max_items.value <= maxItems) {*/
/* 				url = url + append + "{S_SMARTFEED_MAX_ITEMS_L}=" + newsID.max_items.value;*/
/* 			}*/
/* 			else if (maxItems < 0) {*/
/* 				alert("{LA_SMARTFEED_SIZE_ERROR}");*/
/* 				newsID.max_items.focus();*/
/* 				return;*/
/* 			}*/
/* 		}*/
/* */
/* 		// Add the sort order*/
/* 		append = (url.indexOf('?') === -1) ? '?' : '&';*/
/* 		url = url + append + "{S_SMARTFEED_SORT_BY}=" + newsID.sort_by.value;*/
/* */
/* 		// Add to select posts with minimum words*/
/* 		if (newsID.min_words.value !== '') {*/
/* 			if (newsID.min_words.value > 0) {*/
/* 				append = (url.indexOf('?') === -1) ? '?' : '&';*/
/* 				url = url + append + "{S_SMARTFEED_MIN_WORDS}=" + newsID.min_words.value;*/
/* 			}*/
/* 			else  if (newsID.min_words.value < 0) {*/
/* 				alert("{LA_SMARTFEED_SIZE_ERROR_MIN}");*/
/* 				newsID.min_words.focus();*/
/* 				return;*/
/* 			}*/
/* 		}*/
/* */
/* 		// Add the news feed type*/
/* 		append = (url.indexOf('?') === -1) ? '?' : '&';*/
/* 		if (newsID.feed_type1.checked === true) {*/
/* 			url = url + append + "{S_SMARTFEED_FEED_TYPE}=" + "{S_SMARTFEED_RSS_20_VALUE}";*/
/* 		}*/
/* 		else {*/
/* 			if (newsID.feed_type2.checked === true) {*/
/* 				url = url + append + "{S_SMARTFEED_FEED_TYPE}=" + "{S_SMARTFEED_RSS_10_VALUE}";*/
/* 			}*/
/* 			else {*/
/* 				url = url + append + "{S_SMARTFEED_FEED_TYPE}=" + "{S_SMARTFEED_ATOM_10_VALUE}";*/
/* 			}*/
/* 		}*/
/* */
/* 		// Add the news format*/
/* 		append = (url.indexOf('?') === -1) ? '?' : '&';*/
/* 		if (newsID.style1.checked === true) {*/
/* 			url = url + append + "{S_SMARTFEED_FEED_STYLE}=" + newsID.style1.value;*/
/* 		}*/
/* 		else {*/
/* 			if (newsID.style2.checked === true) {*/
/* 				url = url + append + "{S_SMARTFEED_FEED_STYLE}=" + newsID.style2.value;*/
/* 			}*/
/* 			else {*/
/* 				if (newsID.style3.checked === true) {*/
/* 					url = url + append + "{S_SMARTFEED_FEED_STYLE}=" + newsID.style3.value;*/
/* 				}*/
/* 				else {*/
/* 					url = url + append + "{S_SMARTFEED_FEED_STYLE}=" + newsID.style4.value;*/
/* 				}*/
/* 			}*/
/* 		}*/
/* */
/* */
/* 		append = (url.indexOf('?') === -1) ? '?' : '&';*/
/* 		// Add the maximum words in news*/
/* 		if (newsID.max_word_size.value !== '') {*/
/* 			if (newsID.max_word_size.value > 0) {*/
/* 				url = url + append + "{S_SMARTFEED_MAX_WORDS}=" + newsID.max_word_size.value;*/
/* 			}*/
/* 			else if (newsID.max_word_size.value < 0) {*/
/* 				alert("{LA_SMARTFEED_SIZE_ERROR_MIN}");*/
/* 				newsID.max_word_size.focus();*/
/* 				return*/
/* 			}*/
/* 		}*/
/* */
/* 		// Place the url in the field*/
/* 		newsID.url.value = encodeURI(url);*/
/* 		return true;*/
/* 	}*/
/* 	else {*/
/* 		return false;	// Failed validation*/
/* 	}*/
/* }*/
/* */
/* // ]]>  */
/* </script>*/
/* <!-- ENDIF -->*/
