Generate Syndication URL on the fly
For those lazy heads: let's save a click!<br />
<br />
To generate a new syndication URL you need to click on the "Generate Syndication URL" button after choosing your desired forums, syndication version and limit. This will generate the URL on the fly in front of your eyes as you change your preference. Lets do it.<br />
<br />
Open the template <code class="inline-code">misc_syndication</code> and find the variable <code class="inline-code">{$feedurl}</code>. Add the following script <span style="text-decoration: underline;" class="mycode_u">before</span> that: <br />
<span style="font-style: italic;" class="mycode_i">Note: You need to add the script before the var, not after, else jQuery will be confused to identify the element holding URL.</span><br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-none"><script>$(function(){var i=parseInt($("input[name=limit]"
.val(),10),t=[];$("input[type=submit]"
.hide(),$(":contains(syndication.php):last"
.attr("id","feedurl"
,$("select[name='forums[]'], input[name='version'], input[name=limit]"
.on("change keyup",function(){t.fid=$("select[name='forums[]']"
.val(),t.fid=0===t.fid.length||0===$.inArray("all",t.fid)?"":"fid="+t.fid.join(","
,t.ver=$("input[name='version']:checked"
.val(),t.ver=""===t.ver||"rss2.0"===t.ver?"":"type="+t.ver,t.lmt=$("input[name=limit]"
.val(),t.lmt="limit="+(isNaN(t.lmt)||t.lmt<1?i:t.lmt),t=[t.fid,t.ver,t.lmt].filter(function(i){return""!==i}),$("#feedurl"
.text(rootpath+"/syndication.php?"+t.join("&"
)})});</script>
</code></pre><br />
Thats all.<br />
<br />
This will hide the "Generate Syndication URL" button, but don't worry, wee don't need that anymore.<br />
<br />
Now save the template. Done.<br />
<br />
Result:<br />
<img src=" " data-original-url="https://s7.gifyu.com/images/screen.gif" loading="lazy" alt="[Image: screen.gif]" class="mycode_img" /><br />
<br />
tl;dr:<br />
For the readability of the curious minds, this is the expanded version of the script (which you can also use in place of the above):<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-none"><script type="text/javascript">
$(function(){
var rootLimit = parseInt($("input[name=limit]"
.val(), 10), param = [];
$("input[type=submit]"
.hide();
$(":contains(syndication.php):last"
.attr('id', 'feedurl');
$("select[name='forums[]'], input[name='version'], input[name='limit']"
.on('change keyup', function(){
param.fid = $("select[name='forums[]']"
.val();
param.fid = (param.fid.length === 0 || $.inArray("all", param.fid) === 0) ? "" : "fid="+param.fid.join(","
;
param.ver = $("input[name='version']:checked"
.val();
param.ver = (param.ver === "" || param.ver === "rss2.0"
? "" : "type="+param.ver;
param.lmt = $("input[name=limit]"
.val();
param.lmt = "limit=" + ((isNaN(param.lmt) || param.lmt < 1) ? rootLimit : param.lmt);
param = [param.fid,param.ver,param.lmt].filter(function(v){return v!==''});
$("#feedurl"
.text(rootpath + "/syndication.php?" + param.join("&"
);
});
});
</script>
</code></pre>
For those lazy heads: let's save a click!<br />
<br />
To generate a new syndication URL you need to click on the "Generate Syndication URL" button after choosing your desired forums, syndication version and limit. This will generate the URL on the fly in front of your eyes as you change your preference. Lets do it.<br />
<br />
Open the template <code class="inline-code">misc_syndication</code> and find the variable <code class="inline-code">{$feedurl}</code>. Add the following script <span style="text-decoration: underline;" class="mycode_u">before</span> that: <br />
<span style="font-style: italic;" class="mycode_i">Note: You need to add the script before the var, not after, else jQuery will be confused to identify the element holding URL.</span><br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-none"><script>$(function(){var i=parseInt($("input[name=limit]"
</code></pre><br />
Thats all.<br />
<br />
This will hide the "Generate Syndication URL" button, but don't worry, wee don't need that anymore.<br />
<br />
Now save the template. Done.<br />
<br />
Result:<br />
<img src=" " data-original-url="https://s7.gifyu.com/images/screen.gif" loading="lazy" alt="[Image: screen.gif]" class="mycode_img" /><br />
<br />
tl;dr:<br />
For the readability of the curious minds, this is the expanded version of the script (which you can also use in place of the above):<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-none"><script type="text/javascript">
$(function(){
var rootLimit = parseInt($("input[name=limit]"
$("input[type=submit]"
$(":contains(syndication.php):last"
$("select[name='forums[]'], input[name='version'], input[name='limit']"
param.fid = $("select[name='forums[]']"
param.fid = (param.fid.length === 0 || $.inArray("all", param.fid) === 0) ? "" : "fid="+param.fid.join(","
param.ver = $("input[name='version']:checked"
param.ver = (param.ver === "" || param.ver === "rss2.0"
param.lmt = $("input[name=limit]"
param.lmt = "limit=" + ((isNaN(param.lmt) || param.lmt < 1) ? rootLimit : param.lmt);
param = [param.fid,param.ver,param.lmt].filter(function(v){return v!==''});
$("#feedurl"
});
});
</script>
</code></pre>