<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[MyBB Group - Guidebook]]></title>
		<link>https://mybb.group/</link>
		<description><![CDATA[MyBB Group - https://mybb.group]]></description>
		<pubDate>Sat, 02 May 2026 08:42:52 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[Fuzzy Time (with Live Update)]]></title>
			<link>https://mybb.group/Thread-jQuery-Fuzzy-Time-with-Live-Update</link>
			<pubDate>Mon, 15 Apr 2024 22:11:56 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://mybb.group/member.php?action=profile&uid=1">effone</a>]]></dc:creator>
			<guid isPermaLink="false">https://mybb.group/Thread-jQuery-Fuzzy-Time-with-Live-Update</guid>
			<description><![CDATA[Its been a while I have written a tutorial. Well here is another.<br />
<br />
Today we are going to learn a DOM manipulation to display fuzzy time (.... ago) in place of actual date and time in various places in our forums.<br />
Yes, I know, it is in core, somewhat, but not everywhere and not with much flexibility. This tutorial is to target that gap only. We will be playing with the frontend using js only, so no core edit, no plugins, no PHP.<br />
<br />
<span style="text-decoration: underline;" class="mycode_u">Dependency</span>: <br />
This code is dependent to jQuery library, well its already there with MyBB so don't worry about that.<br />
We will be using the awesome jQuery plugin <a href="https://github.com/rmm5t/jquery-timeago" target="_blank" rel="noopener" class="mycode_url">timeago</a> by Ryan McGeary.<br />
<br />
First things first, lets include the plugin in our forums. Open the <code class="inline-code">headerinclude</code> template, find <code class="inline-code">{$stylesheets}</code>, add <span style="text-decoration: underline;" class="mycode_u">before</span> that:<br />
 <br />
<pre class="block-code"><code class="language-none">&lt;script type=&quot;text/javascript&quot; src=&quot;https://cdn.jsdelivr.net/npm/timeago@1.6.7/jquery.timeago.min.js&quot;&gt;&lt;/script&gt;
</code></pre><br />
You can include it in your site by downloading and linking a local copy, if you are not so comfortable / trusting CDNs. For them I am attaching the compressed version of the plugin (only 3.52KB). Download it, extract and upload in <code class="inline-code">jscripts</code> folder. Then link as below instead of above:<br />
 <br />
<pre class="block-code"><code class="language-none">&lt;script type=&quot;text/javascript&quot; src=&quot;{$mybb-&gt;asset_url}/jscripts/jquery.timeago.min.js&quot;&gt;&lt;/script&gt;
</code></pre><br />
Save the template for now. We are not done here, we will be back to this template for adding some more codes.<br />
<br />
Now we have to deal with an issue. The jquery plugin expects the time format to be in <a href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank" rel="noopener" class="mycode_url">ISO 8601</a> format (something like: <code class="inline-code">2024-04-15T21:10:01Z</code>). MyBB displays the time in user readable strings which is of no use. Catch is we can always call the corresponding Unix Timestamp in template using different variables (find out, or else ask). Its then easy to convert to an ISO time string. So lets do this. For experiment we are gonna target <code class="inline-code">forumbit_depth2_forum_lastpost</code> template. Open the said template and find the variable <code class="inline-code">{$lastpost_date}</code>. This variable represents the last post time. We will use this too, as it will be transferred as tooltip. But the corresponding Unix timestamp variable for this is <code class="inline-code">{$lastpost_data['lastpost']}</code>. So replace the variable with the following line:<br />
 <br />
<pre class="block-code"><code class="language-none">&lt;time class=&quot;timeago&quot; data-timestamp=&quot;{$lastpost_data['lastpost']}&quot;&gt;{$lastpost_date}&lt;/time&gt;
</code></pre><br />
Save the template. Up to this everything is fine and backward compatible. <span style="text-decoration: underline;" class="mycode_u">In a no-js scenario the time will display exactly as it was before</span>. So, don't worry about breaking anything.<br />
<br />
We have pulled the Unix timestamp in data attribute. Now we have to use that and make the ISO Time String for every available instance in page. Now time to go back to <code class="inline-code">headerinclude</code> template. Add the following code at the end of the template:<br />
 <br />
<pre class="block-code"><code class="language-none">&lt;script type=&quot;text/javascript&quot;&gt;
$(function(){
$('time').each(function(){
let stamp = $(this).data('timestamp');
if(isNaN(stamp)){
$(this).removeClass('timeago');
} else {
$(this).attr('datetime', new Date(stamp*1000).toISOString());
}
})
$(&quot;time.timeago&quot;).timeago();
});
&lt;/script&gt;
</code></pre><br />
Save the template finally. Its done now.<br />
See the magic, make a new post and watch the fuzzy time change after a minute (default value) automatically, without refreshing page.<br />
<br />
Tutorial is not over, there is something more, but for now its all.<br />
<br />
Happy coding <img src="https://mybb.group/themes/tekutema/images/smilies/092-laughing-1.svg" alt="Big Grin" title="Big Grin" class="smilie smilie_4" /><br /><!-- start: postbit_attachments_attachment -->
<div class="row mt-2 g-1 text-muted">
	<div class="col-auto align-self-center">

<!-- start: attachment_icon -->
<img src="https://mybb.group/images/attachtypes/zip.png" title="ZIP File" style="height: 16px; width: 16px" border="0" alt=".zip" />
<!-- end: attachment_icon -->
		
	</div>
	<div class="col align-self-center">
		<a href="attachment.php?aid=107" target="_blank" title="">jquery.timeago.min.zip</a> (Size: <span class="text-dark">1.57 KB</span> Downloads: <span class="text-dark">6)</span>
	</div>
</div>
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[Its been a while I have written a tutorial. Well here is another.<br />
<br />
Today we are going to learn a DOM manipulation to display fuzzy time (.... ago) in place of actual date and time in various places in our forums.<br />
Yes, I know, it is in core, somewhat, but not everywhere and not with much flexibility. This tutorial is to target that gap only. We will be playing with the frontend using js only, so no core edit, no plugins, no PHP.<br />
<br />
<span style="text-decoration: underline;" class="mycode_u">Dependency</span>: <br />
This code is dependent to jQuery library, well its already there with MyBB so don't worry about that.<br />
We will be using the awesome jQuery plugin <a href="https://github.com/rmm5t/jquery-timeago" target="_blank" rel="noopener" class="mycode_url">timeago</a> by Ryan McGeary.<br />
<br />
First things first, lets include the plugin in our forums. Open the <code class="inline-code">headerinclude</code> template, find <code class="inline-code">{$stylesheets}</code>, add <span style="text-decoration: underline;" class="mycode_u">before</span> that:<br />
 <br />
<pre class="block-code"><code class="language-none">&lt;script type=&quot;text/javascript&quot; src=&quot;https://cdn.jsdelivr.net/npm/timeago@1.6.7/jquery.timeago.min.js&quot;&gt;&lt;/script&gt;
</code></pre><br />
You can include it in your site by downloading and linking a local copy, if you are not so comfortable / trusting CDNs. For them I am attaching the compressed version of the plugin (only 3.52KB). Download it, extract and upload in <code class="inline-code">jscripts</code> folder. Then link as below instead of above:<br />
 <br />
<pre class="block-code"><code class="language-none">&lt;script type=&quot;text/javascript&quot; src=&quot;{$mybb-&gt;asset_url}/jscripts/jquery.timeago.min.js&quot;&gt;&lt;/script&gt;
</code></pre><br />
Save the template for now. We are not done here, we will be back to this template for adding some more codes.<br />
<br />
Now we have to deal with an issue. The jquery plugin expects the time format to be in <a href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank" rel="noopener" class="mycode_url">ISO 8601</a> format (something like: <code class="inline-code">2024-04-15T21:10:01Z</code>). MyBB displays the time in user readable strings which is of no use. Catch is we can always call the corresponding Unix Timestamp in template using different variables (find out, or else ask). Its then easy to convert to an ISO time string. So lets do this. For experiment we are gonna target <code class="inline-code">forumbit_depth2_forum_lastpost</code> template. Open the said template and find the variable <code class="inline-code">{$lastpost_date}</code>. This variable represents the last post time. We will use this too, as it will be transferred as tooltip. But the corresponding Unix timestamp variable for this is <code class="inline-code">{$lastpost_data['lastpost']}</code>. So replace the variable with the following line:<br />
 <br />
<pre class="block-code"><code class="language-none">&lt;time class=&quot;timeago&quot; data-timestamp=&quot;{$lastpost_data['lastpost']}&quot;&gt;{$lastpost_date}&lt;/time&gt;
</code></pre><br />
Save the template. Up to this everything is fine and backward compatible. <span style="text-decoration: underline;" class="mycode_u">In a no-js scenario the time will display exactly as it was before</span>. So, don't worry about breaking anything.<br />
<br />
We have pulled the Unix timestamp in data attribute. Now we have to use that and make the ISO Time String for every available instance in page. Now time to go back to <code class="inline-code">headerinclude</code> template. Add the following code at the end of the template:<br />
 <br />
<pre class="block-code"><code class="language-none">&lt;script type=&quot;text/javascript&quot;&gt;
$(function(){
$('time').each(function(){
let stamp = $(this).data('timestamp');
if(isNaN(stamp)){
$(this).removeClass('timeago');
} else {
$(this).attr('datetime', new Date(stamp*1000).toISOString());
}
})
$(&quot;time.timeago&quot;).timeago();
});
&lt;/script&gt;
</code></pre><br />
Save the template finally. Its done now.<br />
See the magic, make a new post and watch the fuzzy time change after a minute (default value) automatically, without refreshing page.<br />
<br />
Tutorial is not over, there is something more, but for now its all.<br />
<br />
Happy coding <img src="https://mybb.group/themes/tekutema/images/smilies/092-laughing-1.svg" alt="Big Grin" title="Big Grin" class="smilie smilie_4" /><br /><!-- start: postbit_attachments_attachment -->
<div class="row mt-2 g-1 text-muted">
	<div class="col-auto align-self-center">

<!-- start: attachment_icon -->
<img src="https://mybb.group/images/attachtypes/zip.png" title="ZIP File" style="height: 16px; width: 16px" border="0" alt=".zip" />
<!-- end: attachment_icon -->
		
	</div>
	<div class="col align-self-center">
		<a href="attachment.php?aid=107" target="_blank" title="">jquery.timeago.min.zip</a> (Size: <span class="text-dark">1.57 KB</span> Downloads: <span class="text-dark">6)</span>
	</div>
</div>
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[View Unanswered Threads]]></title>
			<link>https://mybb.group/Thread-View-Unanswered-Threads</link>
			<pubDate>Tue, 23 Mar 2021 05:07:26 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://mybb.group/member.php?action=profile&uid=1">effone</a>]]></dc:creator>
			<guid isPermaLink="false">https://mybb.group/Thread-View-Unanswered-Threads</guid>
			<description><![CDATA[This will add a new specialized Search preset link "View Unanswered Threads" to header.<br />
<br />
Open template <code class="inline-code">header_welcomeblock_member_search</code> and add at the bottom:<br />
<pre class="block-code"><code class="language-none">&lt;li&gt;&lt;a href=&quot;{$mybb-&gt;settings['bburl']}/search.php?action=findunansweredthreads&quot;&gt;View Unanswered Threads&lt;/a&gt;&lt;/li&gt;
</code></pre> <br />
Now open your search.php file in an editor. Go to line no. around 1252, find this line:<br />
<code class="inline-code">elseif($mybb-&gt;input['action'] == &quot;finduserthreads&quot;)</code><br />
<br />
and change it to:<br />
<code class="inline-code">elseif($mybb-&gt;input['action'] == &quot;finduserthreads&quot; || $mybb-&gt;input['action'] == &quot;findunansweredthreads&quot;)</code><br />
<br />
Just after that, find this line:<br />
<code class="inline-code">$where_sql = &quot;uid='&quot;.$mybb-&gt;get_input('uid', MyBB::INPUT_INT).&quot;'&quot;;</code><br />
<br />
and change it to:<br />
<pre class="block-code"><code class="language-none"> 
    if($mybb-&gt;input['action'] == &quot;finduserthreads&quot;)
    {
        $where_sql = &quot;uid='&quot;.$mybb-&gt;get_input('uid', MyBB::INPUT_INT).&quot;'&quot;;
    }
    else
    {
        $where_sql = &quot;replies='0'&quot;;
    }
</code></pre><br />
Now save the modified search.php and reupload to your forum root, replacing the existing one.<br />
<br />
Result:<br />
<img src="https://user-images.githubusercontent.com/21265591/112095966-71db1980-8bc3-11eb-936d-2c72f7197633.gif" loading="lazy"  alt="[Image: 112095966-71db1980-8bc3-11eb-936d-2c72f7197633.gif]" class="mycode_img" />]]></description>
			<content:encoded><![CDATA[This will add a new specialized Search preset link "View Unanswered Threads" to header.<br />
<br />
Open template <code class="inline-code">header_welcomeblock_member_search</code> and add at the bottom:<br />
<pre class="block-code"><code class="language-none">&lt;li&gt;&lt;a href=&quot;{$mybb-&gt;settings['bburl']}/search.php?action=findunansweredthreads&quot;&gt;View Unanswered Threads&lt;/a&gt;&lt;/li&gt;
</code></pre> <br />
Now open your search.php file in an editor. Go to line no. around 1252, find this line:<br />
<code class="inline-code">elseif($mybb-&gt;input['action'] == &quot;finduserthreads&quot;)</code><br />
<br />
and change it to:<br />
<code class="inline-code">elseif($mybb-&gt;input['action'] == &quot;finduserthreads&quot; || $mybb-&gt;input['action'] == &quot;findunansweredthreads&quot;)</code><br />
<br />
Just after that, find this line:<br />
<code class="inline-code">$where_sql = &quot;uid='&quot;.$mybb-&gt;get_input('uid', MyBB::INPUT_INT).&quot;'&quot;;</code><br />
<br />
and change it to:<br />
<pre class="block-code"><code class="language-none"> 
    if($mybb-&gt;input['action'] == &quot;finduserthreads&quot;)
    {
        $where_sql = &quot;uid='&quot;.$mybb-&gt;get_input('uid', MyBB::INPUT_INT).&quot;'&quot;;
    }
    else
    {
        $where_sql = &quot;replies='0'&quot;;
    }
</code></pre><br />
Now save the modified search.php and reupload to your forum root, replacing the existing one.<br />
<br />
Result:<br />
<img src="https://user-images.githubusercontent.com/21265591/112095966-71db1980-8bc3-11eb-936d-2c72f7197633.gif" loading="lazy"  alt="[Image: 112095966-71db1980-8bc3-11eb-936d-2c72f7197633.gif]" class="mycode_img" />]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Bypass Registration Agreement]]></title>
			<link>https://mybb.group/Thread-Bypass-Registration-Agreement</link>
			<pubDate>Thu, 31 Dec 2020 14:51:12 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://mybb.group/member.php?action=profile&uid=1">effone</a>]]></dc:creator>
			<guid isPermaLink="false">https://mybb.group/Thread-Bypass-Registration-Agreement</guid>
			<description><![CDATA[Some admins find the Registration Agreement annoying and wants to get rid of it. So here is a little trick. This will place a Register button at header, clicking on which users will get Registration page directly.<br />
<br />
Go to template <code class="inline-code">header_welcomeblock_guest</code> and find this line of code:<br />
<pre class="block-code"><code class="language-none">&lt;a href=&quot;{$mybb-&gt;settings['bburl']}/member.php?action=register&quot; class=&quot;register&quot;&gt;{$lang-&gt;welcome_register}&lt;/a&gt;
</code></pre><br />
and replace with:<br />
<pre class="block-code"><code class="language-none">
&lt;form action=&quot;member.php&quot; method=&quot;post&quot; style=&quot;display: inline-block;&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;step&quot; value=&quot;agreement&quot; /&gt;
&lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;register&quot; /&gt;
&lt;input type=&quot;submit&quot; class=&quot;button&quot; name=&quot;agree&quot; value=&quot;{$lang-&gt;welcome_register}&quot; /&gt;
&lt;/form&gt;
</code></pre><br />
Save the template, done.]]></description>
			<content:encoded><![CDATA[Some admins find the Registration Agreement annoying and wants to get rid of it. So here is a little trick. This will place a Register button at header, clicking on which users will get Registration page directly.<br />
<br />
Go to template <code class="inline-code">header_welcomeblock_guest</code> and find this line of code:<br />
<pre class="block-code"><code class="language-none">&lt;a href=&quot;{$mybb-&gt;settings['bburl']}/member.php?action=register&quot; class=&quot;register&quot;&gt;{$lang-&gt;welcome_register}&lt;/a&gt;
</code></pre><br />
and replace with:<br />
<pre class="block-code"><code class="language-none">
&lt;form action=&quot;member.php&quot; method=&quot;post&quot; style=&quot;display: inline-block;&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;step&quot; value=&quot;agreement&quot; /&gt;
&lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;register&quot; /&gt;
&lt;input type=&quot;submit&quot; class=&quot;button&quot; name=&quot;agree&quot; value=&quot;{$lang-&gt;welcome_register}&quot; /&gt;
&lt;/form&gt;
</code></pre><br />
Save the template, done.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Locate IP On Page]]></title>
			<link>https://mybb.group/Thread-Locate-IP-On-Page</link>
			<pubDate>Thu, 26 Nov 2020 05:57:09 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://mybb.group/member.php?action=profile&uid=1">effone</a>]]></dc:creator>
			<guid isPermaLink="false">https://mybb.group/Thread-Locate-IP-On-Page</guid>
			<description><![CDATA[I know many of you like to monitor who is online at your site and the most irritating part is bunch of guests look alike surfing different locations of your site. You are curious who they are, where they are from, and you start hopping between your site and some online IP locator service copy-pasting IP strings. Happened with you? Well then, read ahead.<br />
<br />
This is the basic tutorial, so in this we are gonna get Country, City and Region for each IP we encounter in Who’s online page, inline, on page. Yes, with minimal template edits we can do that.<br />
<br />
Jump in the modifications:<br />
We are gonna edit 3 templates:<code class="inline-code">online</code>, ‘online_row_ip’ &amp; ‘online_row_ip_lookup’.<br />
<br />
1. Open template: ‘online_row_ip’, change this code:<br />
<pre class="block-code"><code class="language-none"> {$user['ip']}</code></pre>To<br />
<pre class="block-code"><code class="language-none"> &lt;span class=&quot;ip&quot;&gt;{$user['ip']}&lt;/span&gt; </code></pre><br />
2. Open template: ‘online_row_ip_lookup’, keep existing code, add at the beginning:<br />
<pre class="block-code"><code class="language-none"> &amp;nbsp;&lt;a href=&quot;#&quot; class=&quot;iplocate&quot;&gt;[Locate]&lt;/a&gt;&amp;nbsp;</code></pre> <br />
3. Open template: ‘online’, locate variable <span style="font-weight: bold;" class="mycode_b">{&#36;footer}</span>, add after that:<br />
<pre class="block-code"><code class="language-none">&lt;script type=&quot;text/javascript&quot;&gt;
$(function () {
    $('.iplocate').on('click', function (e) {
        e.preventDefault();
        var ref = $(this);
        ajaxCall($.trim(ref.prev('.ip').text()), function (result) {
            ref.before('[' + result + ']').remove();
        });
    });

    function ajaxCall(ipdata, callback) {
        $.ajax({
            url: &quot;http://ip-api.com/json/&quot; + ipdata + &quot;?fields=country,regionName,city&quot;,
            dataType: &quot;json&quot;,
            cache: false,
            success: function (msg) {
                var result = (typeof msg == 'object') ? (msg.country + ', ' + msg.regionName + ', ' + msg.city) : &quot;Unable to locate&quot;;
                callback(result);
            }
        });
    }
});
&lt;/script&gt;
</code></pre><br />
<br />
Save all templates. Result:<br />
<br />
[attachment=41349]<br />
<br />
<span style="font-style: italic;" class="mycode_i">Note</span>: <ul class="mycode_list"><li>If your server restricting CROB, you can get Cross-Origin Read Blocking warning in console, you can ignore the warning and the code will still work.<br />
</li>
<li><span style="text-decoration: underline;" class="mycode_u">If you are using SSL (https://) this code will not work</span> because in this tutorial we are using FREE ‘ip-api’ and secured XMLHttpRequest is a PAID service. You can purchase pro to make SSL access to API or ………… or there are few workarounds, but that’s another tutorial <img src="https://mybb.group/themes/tekutema/images/smilies/071-tongue-1.svg" alt="Tongue" title="Tongue" class="smilie smilie_5" /><br />
</li>
</ul>
So, that’s all for now. Happy coding …<br />
<br />
<hr class="mycode_hr" />
<br />
<span style="font-weight: bold;" class="mycode_b">Part 2: For those who uses SSL (https://).</span><br />
<br />
Clearly you can't request to that API using SSL, so you need a proxy.<br />
And the proxy is ...... our own <code class="inline-code">xmlhttp.php</code> <img src="https://mybb.group/themes/tekutema/images/smilies/092-laughing-1.svg" alt="Big Grin" title="Big Grin" class="smilie smilie_4" /><br />
<br />
Yes, we are gonna core edit (don't be sad, read on...)<br />
<br />
First, replace the above code in template with:<br />
<pre class="block-code"><code class="language-none">&amp;nbsp;&lt;a href=&quot;#&quot; class=&quot;iplocate&quot; style=&quot;display: none;&quot;&gt;[Locate]&lt;/a&gt;&amp;nbsp;
</code></pre><br />
Now, you need to use this js code in place of previous:<br />
<br />
<pre class="block-code"><code class="language-none">/**
 * IP Locator for MyBB 1.8
 * @author effone &lt;me@eff.one&gt;
 * @group MyBB Group (Unofficial)
 * @version 1.0.0
 * @copyright 2018 MyBB Group / Demonate
 *
 * Website: https://github.com/mybbgroup / https://demonate.club
 * 
 */

$(function () {
    var data = {
        &quot;error&quot;: &quot;Unable to locate.&quot;,
        &quot;ajax&quot;: parseInt(use_xmlhttprequest),
        &quot;secure&quot;: location.protocol == &quot;https:&quot; ? true : false,
        &quot;fields&quot;: &quot;country,regionName,city&quot;
    };

    if (!data.secure || (data.secure &amp;&amp; data.ajax)) {
        $('.iplocate').show();

        $('.iplocate').on('click', function (e) {
            e.preventDefault();
            var target = $(this);
            var ip = $.trim(target.prev('.ip').text());
            var bank = data.secure ? rootpath + &quot;/xmlhttp.php?action=get_iplocation&amp;ip=&quot; + ip + &quot;&amp;my_post_key=&quot; + my_post_key + &quot;&amp;fields=&quot; + data.fields : &quot;http://ip-api.com/json/&quot; + ip + &quot;?fields=&quot; + data.fields;

            ajaxCall(bank, function (result) {
                if (typeof result.errors === 'undefined') {
                    var message = (typeof result == 'object') ? (result.country + ', ' + result.regionName + ', ' + result.city) : data.error;
                    target.before('[' + message + ']').remove();
                } else {
                    $.each(result.errors, function (i, message) {
                        $.jGrowl(&quot;Error&quot; + ' ' + message, {
                            theme: 'jgrowl_error'
                        });
                    });
                    //console.log(JSON.stringify(result));
                }
            });
        });

        function ajaxCall(bank, callback) {
            $.ajax({
                url: bank,
                dataType: &quot;json&quot;,
                cache: true,
                success: function (result) {
                    callback(result);
                }
            });
        }
    }
});
</code></pre><br />
Next, open <code class="inline-code">xmlhttp.php</code>, go to about line number 1110 (where the action blocks end, before xmlhttp_error() function) and add the following:<br />
<br />
<pre class="block-code"><code class="language-none">else if($mybb-&gt;input['action'] == 'get_iplocation')
{
        if (!verify_post_check($mybb-&gt;get_input('my_post_key'), true)) {
            xmlhttp_error($lang-&gt;invalid_post_code);
        }
        
        if(!$mybb-&gt;usergroup['canuseipsearch'])
        {
            xmlhttp_error($lang-&gt;permission_error);
        }

        $response = file_get_contents(&quot;http://ip-api.com/json/&quot; . $mybb-&gt;get_input('ip') . &quot;?fields=&quot; . $mybb-&gt;get_input('fields'));

        json_decode($response);
        if(!json_last_error()  == 0)
        {
            xmlhttp_error($lang-&gt;ipapi_invalid_response);
        }

        header(&quot;Content-type: application/json; charset={$charset}&quot;);
        die($response);
}
</code></pre>and finally, open <code class="inline-code">global.lang.php</code> and add these two at the very end:<br />
<pre class="block-code"><code class="language-none">$l['ipapi_invalid_response'] = 'Invalid response received from IP-API.';
$l['permission_error'] = 'You are not allowed to perform this action.';
</code></pre>Save all. Done.<br />
<br />
Note:<br />
- For those who don't wanna core edit, Part 3 is coming up.<br />
- A plugin with advanced features (like map, custom cache, advanced validations etc) is also under development. Keep an eye on Demonate &amp; repo list of MyBB Group (unofficial):<br />
<a href="https://github.com/mybbgroup" target="_blank" rel="noopener" class="mycode_url">https://github.com/mybbgroup</a><br />
<br />
<div style="text-align: right;" class="mycode_align"><span style="color: #cccccc;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-style: italic;" class="mycode_i">More advanced &amp; detailed tutorials @ <a href="https://demonate.club" target="_blank" rel="noopener" class="mycode_url"><span style="color: #cccccc;" class="mycode_color">Demonate</span></a>.</span></span></span></div>]]></description>
			<content:encoded><![CDATA[I know many of you like to monitor who is online at your site and the most irritating part is bunch of guests look alike surfing different locations of your site. You are curious who they are, where they are from, and you start hopping between your site and some online IP locator service copy-pasting IP strings. Happened with you? Well then, read ahead.<br />
<br />
This is the basic tutorial, so in this we are gonna get Country, City and Region for each IP we encounter in Who’s online page, inline, on page. Yes, with minimal template edits we can do that.<br />
<br />
Jump in the modifications:<br />
We are gonna edit 3 templates:<code class="inline-code">online</code>, ‘online_row_ip’ &amp; ‘online_row_ip_lookup’.<br />
<br />
1. Open template: ‘online_row_ip’, change this code:<br />
<pre class="block-code"><code class="language-none"> {$user['ip']}</code></pre>To<br />
<pre class="block-code"><code class="language-none"> &lt;span class=&quot;ip&quot;&gt;{$user['ip']}&lt;/span&gt; </code></pre><br />
2. Open template: ‘online_row_ip_lookup’, keep existing code, add at the beginning:<br />
<pre class="block-code"><code class="language-none"> &amp;nbsp;&lt;a href=&quot;#&quot; class=&quot;iplocate&quot;&gt;[Locate]&lt;/a&gt;&amp;nbsp;</code></pre> <br />
3. Open template: ‘online’, locate variable <span style="font-weight: bold;" class="mycode_b">{&#36;footer}</span>, add after that:<br />
<pre class="block-code"><code class="language-none">&lt;script type=&quot;text/javascript&quot;&gt;
$(function () {
    $('.iplocate').on('click', function (e) {
        e.preventDefault();
        var ref = $(this);
        ajaxCall($.trim(ref.prev('.ip').text()), function (result) {
            ref.before('[' + result + ']').remove();
        });
    });

    function ajaxCall(ipdata, callback) {
        $.ajax({
            url: &quot;http://ip-api.com/json/&quot; + ipdata + &quot;?fields=country,regionName,city&quot;,
            dataType: &quot;json&quot;,
            cache: false,
            success: function (msg) {
                var result = (typeof msg == 'object') ? (msg.country + ', ' + msg.regionName + ', ' + msg.city) : &quot;Unable to locate&quot;;
                callback(result);
            }
        });
    }
});
&lt;/script&gt;
</code></pre><br />
<br />
Save all templates. Result:<br />
<br />
[attachment=41349]<br />
<br />
<span style="font-style: italic;" class="mycode_i">Note</span>: <ul class="mycode_list"><li>If your server restricting CROB, you can get Cross-Origin Read Blocking warning in console, you can ignore the warning and the code will still work.<br />
</li>
<li><span style="text-decoration: underline;" class="mycode_u">If you are using SSL (https://) this code will not work</span> because in this tutorial we are using FREE ‘ip-api’ and secured XMLHttpRequest is a PAID service. You can purchase pro to make SSL access to API or ………… or there are few workarounds, but that’s another tutorial <img src="https://mybb.group/themes/tekutema/images/smilies/071-tongue-1.svg" alt="Tongue" title="Tongue" class="smilie smilie_5" /><br />
</li>
</ul>
So, that’s all for now. Happy coding …<br />
<br />
<hr class="mycode_hr" />
<br />
<span style="font-weight: bold;" class="mycode_b">Part 2: For those who uses SSL (https://).</span><br />
<br />
Clearly you can't request to that API using SSL, so you need a proxy.<br />
And the proxy is ...... our own <code class="inline-code">xmlhttp.php</code> <img src="https://mybb.group/themes/tekutema/images/smilies/092-laughing-1.svg" alt="Big Grin" title="Big Grin" class="smilie smilie_4" /><br />
<br />
Yes, we are gonna core edit (don't be sad, read on...)<br />
<br />
First, replace the above code in template with:<br />
<pre class="block-code"><code class="language-none">&amp;nbsp;&lt;a href=&quot;#&quot; class=&quot;iplocate&quot; style=&quot;display: none;&quot;&gt;[Locate]&lt;/a&gt;&amp;nbsp;
</code></pre><br />
Now, you need to use this js code in place of previous:<br />
<br />
<pre class="block-code"><code class="language-none">/**
 * IP Locator for MyBB 1.8
 * @author effone &lt;me@eff.one&gt;
 * @group MyBB Group (Unofficial)
 * @version 1.0.0
 * @copyright 2018 MyBB Group / Demonate
 *
 * Website: https://github.com/mybbgroup / https://demonate.club
 * 
 */

$(function () {
    var data = {
        &quot;error&quot;: &quot;Unable to locate.&quot;,
        &quot;ajax&quot;: parseInt(use_xmlhttprequest),
        &quot;secure&quot;: location.protocol == &quot;https:&quot; ? true : false,
        &quot;fields&quot;: &quot;country,regionName,city&quot;
    };

    if (!data.secure || (data.secure &amp;&amp; data.ajax)) {
        $('.iplocate').show();

        $('.iplocate').on('click', function (e) {
            e.preventDefault();
            var target = $(this);
            var ip = $.trim(target.prev('.ip').text());
            var bank = data.secure ? rootpath + &quot;/xmlhttp.php?action=get_iplocation&amp;ip=&quot; + ip + &quot;&amp;my_post_key=&quot; + my_post_key + &quot;&amp;fields=&quot; + data.fields : &quot;http://ip-api.com/json/&quot; + ip + &quot;?fields=&quot; + data.fields;

            ajaxCall(bank, function (result) {
                if (typeof result.errors === 'undefined') {
                    var message = (typeof result == 'object') ? (result.country + ', ' + result.regionName + ', ' + result.city) : data.error;
                    target.before('[' + message + ']').remove();
                } else {
                    $.each(result.errors, function (i, message) {
                        $.jGrowl(&quot;Error&quot; + ' ' + message, {
                            theme: 'jgrowl_error'
                        });
                    });
                    //console.log(JSON.stringify(result));
                }
            });
        });

        function ajaxCall(bank, callback) {
            $.ajax({
                url: bank,
                dataType: &quot;json&quot;,
                cache: true,
                success: function (result) {
                    callback(result);
                }
            });
        }
    }
});
</code></pre><br />
Next, open <code class="inline-code">xmlhttp.php</code>, go to about line number 1110 (where the action blocks end, before xmlhttp_error() function) and add the following:<br />
<br />
<pre class="block-code"><code class="language-none">else if($mybb-&gt;input['action'] == 'get_iplocation')
{
        if (!verify_post_check($mybb-&gt;get_input('my_post_key'), true)) {
            xmlhttp_error($lang-&gt;invalid_post_code);
        }
        
        if(!$mybb-&gt;usergroup['canuseipsearch'])
        {
            xmlhttp_error($lang-&gt;permission_error);
        }

        $response = file_get_contents(&quot;http://ip-api.com/json/&quot; . $mybb-&gt;get_input('ip') . &quot;?fields=&quot; . $mybb-&gt;get_input('fields'));

        json_decode($response);
        if(!json_last_error()  == 0)
        {
            xmlhttp_error($lang-&gt;ipapi_invalid_response);
        }

        header(&quot;Content-type: application/json; charset={$charset}&quot;);
        die($response);
}
</code></pre>and finally, open <code class="inline-code">global.lang.php</code> and add these two at the very end:<br />
<pre class="block-code"><code class="language-none">$l['ipapi_invalid_response'] = 'Invalid response received from IP-API.';
$l['permission_error'] = 'You are not allowed to perform this action.';
</code></pre>Save all. Done.<br />
<br />
Note:<br />
- For those who don't wanna core edit, Part 3 is coming up.<br />
- A plugin with advanced features (like map, custom cache, advanced validations etc) is also under development. Keep an eye on Demonate &amp; repo list of MyBB Group (unofficial):<br />
<a href="https://github.com/mybbgroup" target="_blank" rel="noopener" class="mycode_url">https://github.com/mybbgroup</a><br />
<br />
<div style="text-align: right;" class="mycode_align"><span style="color: #cccccc;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-style: italic;" class="mycode_i">More advanced &amp; detailed tutorials @ <a href="https://demonate.club" target="_blank" rel="noopener" class="mycode_url"><span style="color: #cccccc;" class="mycode_color">Demonate</span></a>.</span></span></span></div>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Generate Syndication URL on the fly]]></title>
			<link>https://mybb.group/Thread-jQuery-Generate-Syndication-URL-on-the-fly</link>
			<pubDate>Sat, 13 Jun 2020 01:36:26 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://mybb.group/member.php?action=profile&uid=1">effone</a>]]></dc:creator>
			<guid isPermaLink="false">https://mybb.group/Thread-jQuery-Generate-Syndication-URL-on-the-fly</guid>
			<description><![CDATA[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 before that:<br />
Note: You need to add the script before the var, not after, else jQuery will be confused to identify the element holding URL.<br />
<pre class="block-code"><code class="language-none">&lt;script&gt;$(function(){var i=parseInt($(&quot;input[name=limit]&quot;).val(),10),t=[];$(&quot;input[type=submit]&quot;).hide(),$(&quot;:contains(syndication.php):last&quot;).attr(&quot;id&quot;,&quot;feedurl&quot;),$(&quot;select[name='forums[]'], input[name='version'], input[name=limit]&quot;).on(&quot;change keyup&quot;,function(){t.fid=$(&quot;select[name='forums[]']&quot;).val(),t.fid=0===t.fid.length||0===$.inArray(&quot;all&quot;,t.fid)?&quot;&quot;:&quot;fid=&quot;+t.fid.join(&quot;,&quot;),t.ver=$(&quot;input[name='version']:checked&quot;).val(),t.ver=&quot;&quot;===t.ver||&quot;rss2.0&quot;===t.ver?&quot;&quot;:&quot;type=&quot;+t.ver,t.lmt=$(&quot;input[name=limit]&quot;).val(),t.lmt=&quot;limit=&quot;+(isNaN(t.lmt)||t.lmt&lt;1?i:t.lmt),t=[t.fid,t.ver,t.lmt].filter(function(i){return&quot;&quot;!==i}),$(&quot;#feedurl&quot;).text(rootpath+&quot;/syndication.php?&quot;+t.join(&quot;&amp;&quot;))})});&lt;/script&gt;
</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="https://s7.gifyu.com/images/screen.gif" loading="lazy"  width="520" height="400" 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):<br />
<pre class="block-code"><code class="language-none">&lt;script type=&quot;text/javascript&quot;&gt;
$(function(){
    var rootLimit = parseInt($(&quot;input[name=limit]&quot;).val(), 10), param = [];
    $(&quot;input[type=submit]&quot;).hide();
    $(&quot;:contains(syndication.php):last&quot;).attr('id', 'feedurl');
    $(&quot;select[name='forums[]'], input[name='version'], input[name='limit']&quot;).on('change keyup', function(){
        param.fid = $(&quot;select[name='forums[]']&quot;).val();
        param.fid = (param.fid.length === 0 || $.inArray(&quot;all&quot;, param.fid) === 0) ? &quot;&quot; : &quot;fid=&quot;+param.fid.join(&quot;,&quot;);
        param.ver = $(&quot;input[name='version']:checked&quot;).val();
        param.ver = (param.ver === &quot;&quot; || param.ver === &quot;rss2.0&quot;) ? &quot;&quot; : &quot;type=&quot;+param.ver;
        param.lmt = $(&quot;input[name=limit]&quot;).val();
        param.lmt = &quot;limit=&quot; + ((isNaN(param.lmt) || param.lmt &lt; 1) ? rootLimit : param.lmt);
        param = [param.fid,param.ver,param.lmt].filter(function(v){return v!==''});
        $(&quot;#feedurl&quot;).text(rootpath + &quot;/syndication.php?&quot; + param.join(&quot;&amp;&quot;));
    });
});
&lt;/script&gt;
</code></pre>]]></description>
			<content:encoded><![CDATA[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 before that:<br />
Note: You need to add the script before the var, not after, else jQuery will be confused to identify the element holding URL.<br />
<pre class="block-code"><code class="language-none">&lt;script&gt;$(function(){var i=parseInt($(&quot;input[name=limit]&quot;).val(),10),t=[];$(&quot;input[type=submit]&quot;).hide(),$(&quot;:contains(syndication.php):last&quot;).attr(&quot;id&quot;,&quot;feedurl&quot;),$(&quot;select[name='forums[]'], input[name='version'], input[name=limit]&quot;).on(&quot;change keyup&quot;,function(){t.fid=$(&quot;select[name='forums[]']&quot;).val(),t.fid=0===t.fid.length||0===$.inArray(&quot;all&quot;,t.fid)?&quot;&quot;:&quot;fid=&quot;+t.fid.join(&quot;,&quot;),t.ver=$(&quot;input[name='version']:checked&quot;).val(),t.ver=&quot;&quot;===t.ver||&quot;rss2.0&quot;===t.ver?&quot;&quot;:&quot;type=&quot;+t.ver,t.lmt=$(&quot;input[name=limit]&quot;).val(),t.lmt=&quot;limit=&quot;+(isNaN(t.lmt)||t.lmt&lt;1?i:t.lmt),t=[t.fid,t.ver,t.lmt].filter(function(i){return&quot;&quot;!==i}),$(&quot;#feedurl&quot;).text(rootpath+&quot;/syndication.php?&quot;+t.join(&quot;&amp;&quot;))})});&lt;/script&gt;
</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="https://s7.gifyu.com/images/screen.gif" loading="lazy"  width="520" height="400" 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):<br />
<pre class="block-code"><code class="language-none">&lt;script type=&quot;text/javascript&quot;&gt;
$(function(){
    var rootLimit = parseInt($(&quot;input[name=limit]&quot;).val(), 10), param = [];
    $(&quot;input[type=submit]&quot;).hide();
    $(&quot;:contains(syndication.php):last&quot;).attr('id', 'feedurl');
    $(&quot;select[name='forums[]'], input[name='version'], input[name='limit']&quot;).on('change keyup', function(){
        param.fid = $(&quot;select[name='forums[]']&quot;).val();
        param.fid = (param.fid.length === 0 || $.inArray(&quot;all&quot;, param.fid) === 0) ? &quot;&quot; : &quot;fid=&quot;+param.fid.join(&quot;,&quot;);
        param.ver = $(&quot;input[name='version']:checked&quot;).val();
        param.ver = (param.ver === &quot;&quot; || param.ver === &quot;rss2.0&quot;) ? &quot;&quot; : &quot;type=&quot;+param.ver;
        param.lmt = $(&quot;input[name=limit]&quot;).val();
        param.lmt = &quot;limit=&quot; + ((isNaN(param.lmt) || param.lmt &lt; 1) ? rootLimit : param.lmt);
        param = [param.fid,param.ver,param.lmt].filter(function(v){return v!==''});
        $(&quot;#feedurl&quot;).text(rootpath + &quot;/syndication.php?&quot; + param.join(&quot;&amp;&quot;));
    });
});
&lt;/script&gt;
</code></pre>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Add Approve / Unapprove button to each post]]></title>
			<link>https://mybb.group/Thread-jQuery-Add-Approve-Unapprove-button-to-each-post</link>
			<pubDate>Thu, 07 May 2020 21:54:54 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://mybb.group/member.php?action=profile&uid=1">effone</a>]]></dc:creator>
			<guid isPermaLink="false">https://mybb.group/Thread-jQuery-Add-Approve-Unapprove-button-to-each-post</guid>
			<description><![CDATA[This will add Approve / Unapprove button to each post.<br />
This is a very basic and nominal mod for those new friends exploring MyBB. This can be further extended and enhanced as per your need.<br />
<br />
Open template <code class="inline-code">showthread_inlinemoderation</code>, find the first line:<br />
<code class="inline-code">&lt;script type=&quot;text/javascript&quot; src=&quot;{$mybb-&gt;asset_url}/jscripts/inline_moderation.js?ver=1818&quot;&gt;&lt;/script&gt;</code><br />
<br />
ADD the following piece of script just after that:<br />
<pre class="block-code"><code class="language-none">&lt;script type=&quot;text/javascript&quot;&gt;
var apbt = &quot;&lt;a href='#' data-act='{act}' class='postbit_approve'&gt;&lt;span&gt;{txt}&lt;/span&gt;&lt;/a&gt;&quot;, // Button template
    btxt = [&quot;Approve&quot;, &quot;Unapprove&quot;]; // Button texts
lang.noapprove = &quot;Deleted posts can't be approved / unapproved.&quot; // Error message for deleted posts

$(&quot;.post_management_buttons&quot;).each(function () {
    var act = $(this).parents(&quot;.post&quot;).hasClass(&quot;unapproved_post&quot;) ? 0 : 1;
    $(this).append(apbt.replace(&quot;{act}&quot;, act).replace(&quot;{txt}&quot;, btxt[act]))
}), $(function () {
    $(&quot;.postbit_approve&quot;).on(&quot;click&quot;, function () {
        return $(this).parents(&quot;.post&quot;).hasClass(&quot;deleted_post&quot;) ? $.jGrowl(lang.noapprove, {theme: &quot;jgrowl_error&quot;}) : ($(&quot;#&quot; + $(this).parents(&quot;.post&quot;).attr(&quot;id&quot;).replace(&quot;post&quot;, &quot;inlinemod&quot;)).trigger(&quot;click&quot;), $(&quot;#inlinemoderation_options_selector&quot;).val(&quot;multi&quot; + (+$(this).data(&quot;act&quot;) ? &quot;un&quot; : &quot;&quot;) + &quot;approveposts&quot;).change(), $(&quot;#inlinemoderation_options&quot;).trigger(&quot;submit&quot;)), !1
    })
});
&lt;/script&gt;
</code></pre><br />
Change the strings in first three lines, if you are using different language.<br />
<br />
Note: <ul class="mycode_list"><li>There are several ways to do this but this script uses MyBB's inbuilt tools only.<br />
</li>
<li>This mod is just for fun and with js only. js disabled sites will not work.<br />
</li>
<li>To obtain a proper full functionality you need to have a plugin.<br />
</li>
</ul>
<br />
Result:<br />
<br />
<img src="https://s6.gifyu.com/images/screen793366412e3a6466.gif" loading="lazy"  alt="[Image: screen793366412e3a6466.gif]" class="mycode_img" />]]></description>
			<content:encoded><![CDATA[This will add Approve / Unapprove button to each post.<br />
This is a very basic and nominal mod for those new friends exploring MyBB. This can be further extended and enhanced as per your need.<br />
<br />
Open template <code class="inline-code">showthread_inlinemoderation</code>, find the first line:<br />
<code class="inline-code">&lt;script type=&quot;text/javascript&quot; src=&quot;{$mybb-&gt;asset_url}/jscripts/inline_moderation.js?ver=1818&quot;&gt;&lt;/script&gt;</code><br />
<br />
ADD the following piece of script just after that:<br />
<pre class="block-code"><code class="language-none">&lt;script type=&quot;text/javascript&quot;&gt;
var apbt = &quot;&lt;a href='#' data-act='{act}' class='postbit_approve'&gt;&lt;span&gt;{txt}&lt;/span&gt;&lt;/a&gt;&quot;, // Button template
    btxt = [&quot;Approve&quot;, &quot;Unapprove&quot;]; // Button texts
lang.noapprove = &quot;Deleted posts can't be approved / unapproved.&quot; // Error message for deleted posts

$(&quot;.post_management_buttons&quot;).each(function () {
    var act = $(this).parents(&quot;.post&quot;).hasClass(&quot;unapproved_post&quot;) ? 0 : 1;
    $(this).append(apbt.replace(&quot;{act}&quot;, act).replace(&quot;{txt}&quot;, btxt[act]))
}), $(function () {
    $(&quot;.postbit_approve&quot;).on(&quot;click&quot;, function () {
        return $(this).parents(&quot;.post&quot;).hasClass(&quot;deleted_post&quot;) ? $.jGrowl(lang.noapprove, {theme: &quot;jgrowl_error&quot;}) : ($(&quot;#&quot; + $(this).parents(&quot;.post&quot;).attr(&quot;id&quot;).replace(&quot;post&quot;, &quot;inlinemod&quot;)).trigger(&quot;click&quot;), $(&quot;#inlinemoderation_options_selector&quot;).val(&quot;multi&quot; + (+$(this).data(&quot;act&quot;) ? &quot;un&quot; : &quot;&quot;) + &quot;approveposts&quot;).change(), $(&quot;#inlinemoderation_options&quot;).trigger(&quot;submit&quot;)), !1
    })
});
&lt;/script&gt;
</code></pre><br />
Change the strings in first three lines, if you are using different language.<br />
<br />
Note: <ul class="mycode_list"><li>There are several ways to do this but this script uses MyBB's inbuilt tools only.<br />
</li>
<li>This mod is just for fun and with js only. js disabled sites will not work.<br />
</li>
<li>To obtain a proper full functionality you need to have a plugin.<br />
</li>
</ul>
<br />
Result:<br />
<br />
<img src="https://s6.gifyu.com/images/screen793366412e3a6466.gif" loading="lazy"  alt="[Image: screen793366412e3a6466.gif]" class="mycode_img" />]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Hide reCAPTCHAInvisible badge]]></title>
			<link>https://mybb.group/Thread-Hide-reCAPTCHAInvisible-badge</link>
			<pubDate>Tue, 14 May 2019 04:47:47 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://mybb.group/member.php?action=profile&uid=1">effone</a>]]></dc:creator>
			<guid isPermaLink="false">https://mybb.group/Thread-Hide-reCAPTCHAInvisible-badge</guid>
			<description><![CDATA[Have ever reCAPTCHA Invisible badge annoyed you? Specially when you are using a mobile device with a responsive theme and the badge slides out from the right hiding some of your important form control? Say, the form Submit button? - disgusting situation. <br />
<img src="https://i.ibb.co/pR6qS2k/F8oS0.png" loading="lazy"  alt="[Image: F8oS0.png]" class="mycode_img" /><br />
Well, let's hide it.<br />
<br />
Wait! OMG! effone gone mad! Thats a straight breach of Google's TOS. <br />
<blockquote class="mycode_quote"><cite>Google reCAPTCHA v3 TOS Wrote:</cite>You agree to explicitly inform visitors to your site that you have implemented the Invisible reCAPTCHA on your site.</blockquote><br />
Well, well. Hang on. You can still hide it. Google now allows it under certain conditions (As per latest reCAPTCHA FAQ, 11 Dec, 2018 update).<br />
<a href="https://developers.google.com/recaptcha/docs/faq" target="_blank" rel="noopener" class="mycode_url">https://developers.google.com/recaptcha/docs/faq</a><br />
<br />
So, let's hide it. Super easy. Add this CSS at the end of your <code class="inline-code">global.css</code>:<br />
<pre class="block-code"><code class="language-none">.grecaptcha-badge {
    display: none;
}
</code></pre><br />
Save stylesheet. Refresh!<br />
Eh, the badge is still there sliding out. Because the container is not inline. You have to declare your badge to be inline in order to hide it.<br />
<br />
Open template <code class="inline-code">member_register_regimage_recaptcha_invisible</code> and find this chunk:<br />
<pre class="block-code"><code class="language-none">grecaptcha.render(target.get(0), {
    'sitekey': '{$public_key}',
    'callback': captchaOnSubmit
}, true);
</code></pre><br />
Change it to:<br />
<pre class="block-code"><code class="language-none">grecaptcha.render(target.get(0), {
    'sitekey': '{$public_key}',
    'callback': captchaOnSubmit,
    'badge' :'inline'
}, true);
</code></pre><br />
Yes, the badge is gone!<br />
<br />
Now, <span style="text-decoration: underline;" class="mycode_u">the most important part to remain legal</span>:<br />
You have to add this line to every page you are using reCAPTCHA in, if you are not sure - add it to footer template:<br />
<pre class="block-code"><code class="language-none">This site is protected by reCAPTCHA and the Google
    &lt;a href=&quot;https://policies.google.com/privacy&quot;&gt;Privacy Policy&lt;/a&gt; and
    &lt;a href=&quot;https://policies.google.com/terms&quot;&gt;Terms of Service&lt;/a&gt; apply.
</code></pre><br />
Note:<ul class="mycode_list"><li>This is demonstrated for registration page but is applicable to anywhere you are using reCAPTCHA.<br />
</li>
<li>Some additional requirement/s of Google Brand guidelines: "Don't mimic Google's typographic style. The writeup should blend your site's typography.<br />
</li>
</ul>
Done. Happy coding ... <img src="https://mybb.group/themes/tekutema/images/smilies/092-laughing-1.svg" alt="Big Grin" title="Big Grin" class="smilie smilie_4" />]]></description>
			<content:encoded><![CDATA[Have ever reCAPTCHA Invisible badge annoyed you? Specially when you are using a mobile device with a responsive theme and the badge slides out from the right hiding some of your important form control? Say, the form Submit button? - disgusting situation. <br />
<img src="https://i.ibb.co/pR6qS2k/F8oS0.png" loading="lazy"  alt="[Image: F8oS0.png]" class="mycode_img" /><br />
Well, let's hide it.<br />
<br />
Wait! OMG! effone gone mad! Thats a straight breach of Google's TOS. <br />
<blockquote class="mycode_quote"><cite>Google reCAPTCHA v3 TOS Wrote:</cite>You agree to explicitly inform visitors to your site that you have implemented the Invisible reCAPTCHA on your site.</blockquote><br />
Well, well. Hang on. You can still hide it. Google now allows it under certain conditions (As per latest reCAPTCHA FAQ, 11 Dec, 2018 update).<br />
<a href="https://developers.google.com/recaptcha/docs/faq" target="_blank" rel="noopener" class="mycode_url">https://developers.google.com/recaptcha/docs/faq</a><br />
<br />
So, let's hide it. Super easy. Add this CSS at the end of your <code class="inline-code">global.css</code>:<br />
<pre class="block-code"><code class="language-none">.grecaptcha-badge {
    display: none;
}
</code></pre><br />
Save stylesheet. Refresh!<br />
Eh, the badge is still there sliding out. Because the container is not inline. You have to declare your badge to be inline in order to hide it.<br />
<br />
Open template <code class="inline-code">member_register_regimage_recaptcha_invisible</code> and find this chunk:<br />
<pre class="block-code"><code class="language-none">grecaptcha.render(target.get(0), {
    'sitekey': '{$public_key}',
    'callback': captchaOnSubmit
}, true);
</code></pre><br />
Change it to:<br />
<pre class="block-code"><code class="language-none">grecaptcha.render(target.get(0), {
    'sitekey': '{$public_key}',
    'callback': captchaOnSubmit,
    'badge' :'inline'
}, true);
</code></pre><br />
Yes, the badge is gone!<br />
<br />
Now, <span style="text-decoration: underline;" class="mycode_u">the most important part to remain legal</span>:<br />
You have to add this line to every page you are using reCAPTCHA in, if you are not sure - add it to footer template:<br />
<pre class="block-code"><code class="language-none">This site is protected by reCAPTCHA and the Google
    &lt;a href=&quot;https://policies.google.com/privacy&quot;&gt;Privacy Policy&lt;/a&gt; and
    &lt;a href=&quot;https://policies.google.com/terms&quot;&gt;Terms of Service&lt;/a&gt; apply.
</code></pre><br />
Note:<ul class="mycode_list"><li>This is demonstrated for registration page but is applicable to anywhere you are using reCAPTCHA.<br />
</li>
<li>Some additional requirement/s of Google Brand guidelines: "Don't mimic Google's typographic style. The writeup should blend your site's typography.<br />
</li>
</ul>
Done. Happy coding ... <img src="https://mybb.group/themes/tekutema/images/smilies/092-laughing-1.svg" alt="Big Grin" title="Big Grin" class="smilie smilie_4" />]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[FontAwesome (v5) - usergroup stars]]></title>
			<link>https://mybb.group/Thread-FontAwesome-v5-usergroup-stars</link>
			<pubDate>Fri, 19 Apr 2019 09:33:59 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://mybb.group/member.php?action=profile&uid=2">Eldenroot</a>]]></dc:creator>
			<guid isPermaLink="false">https://mybb.group/Thread-FontAwesome-v5-usergroup-stars</guid>
			<description><![CDATA[To replace default MyBB userstars by a modern good looking FontAwesome icons.<br />
<br />
- FontAwesome v5.x library is required, please load it on your website<br />
<br />
1) Open "<span style="font-style: italic;" class="mycode_i">postbit_classic</span>" and "<span style="font-style: italic;" class="mycode_i">postbit</span>" template and find this this line of code:<br />
<pre class="block-code"><code class="language-none">{$post['userstars']}</code></pre><br />
and replace it with this code:<br />
<pre class="block-code"><code class="language-none">&lt;span style=&quot;text-align: center;&quot; class=&quot;userstar star_{$post['stars']}&quot; title=&quot;{$post['usertitle']}&quot;&gt;&lt;/span&gt;</code></pre><br />
2) Open "<span style="font-style: italic;" class="mycode_i">memberlist_user</span>" template and find this line of code:<br />
<pre class="block-code"><code class="language-none">{$user['userstars']}</code></pre><br />
and replace it with this code:<br />
<pre class="block-code"><code class="language-none">&lt;span style=&quot;text-align: center;&quot; class=&quot;userstar star_{$user['stars']}&quot; title=&quot;{$user['usertitle']}&quot;&gt;&lt;/span&gt;</code></pre><br />
3) Open "<span style="font-style: italic;" class="mycode_i">member_profile</span>" template and find this line of code:<br />
<pre class="block-code"><code class="language-none">{$userstars}</code></pre><br />
and replace it with this code:<br />
<pre class="block-code"><code class="language-none">&lt;span style=&quot;text-align: center;&quot; class=&quot;userstar star_{$stars}&quot; title=&quot;{$usertitle}&quot;&gt;&lt;/span&gt;</code></pre><br />
4) Open "<span style="font-style: italic;" class="mycode_i">global.css</span>" stylesheet and add at the end this block of code:<br />
<pre class="block-code"><code class="language-none">/** Usergroup star rating - FontAwesome v5 - MyBB.Group **/

.userstar {
	font-family: Font Awesome\ 5 Free;
	font-size: 13px;
	color: #969696;
	line-height: 13px;
	display: inline-block;
	letter-spacing: 2px;
	font-weight: 900;
}
.star_0 :before {
	content: &quot;\f005\f005\f005\f005\f005\f005\f005&quot;;
	font-weight: 400;
}
.star_1 :before {
	content: &quot;\f005&quot;;
}
.star_1 :after {
	content: &quot;\f005\f005\f005\f005\f005\f005&quot;;
	font-weight: 400;
}
.star_2 :before {
	content: &quot;\f005\f005&quot;;
}
.star_2 :after {
	content: &quot;\f005\f005\f005\f005\f005&quot;;
	font-weight: 400;
}
.star_3 :before {
	content: &quot;\f005\f005\f005&quot;;
}
.star_3 :after {
	content: &quot;\f005\f005\f005\f005&quot;;
	font-weight: 400;
}
.star_4 :before {
	content: &quot;\f005\f005\f005\f005&quot;;
}
.star_4 :after {
	content: &quot;\f005\f005\f005&quot;;
	font-weight: 400;
}
.star_5 :before {
	content: &quot;\f005\f005\f005\f005\f005&quot;;
}
.star_5 :after {
	content: &quot;\f005\f005&quot;;
	font-weight: 400;
}
.star_6 :before {
	content: &quot;\f005\f005\f005\f005\f005\f005&quot;;
}
.star_6 :after {
	content: &quot;\f005&quot;;
	font-weight: 400;
.star_7 :before {
	content: &quot;\f005\f005\f005\f005\f005\f005\f005&quot;;
}</code></pre><br />
5) You are done, check the result!]]></description>
			<content:encoded><![CDATA[To replace default MyBB userstars by a modern good looking FontAwesome icons.<br />
<br />
- FontAwesome v5.x library is required, please load it on your website<br />
<br />
1) Open "<span style="font-style: italic;" class="mycode_i">postbit_classic</span>" and "<span style="font-style: italic;" class="mycode_i">postbit</span>" template and find this this line of code:<br />
<pre class="block-code"><code class="language-none">{$post['userstars']}</code></pre><br />
and replace it with this code:<br />
<pre class="block-code"><code class="language-none">&lt;span style=&quot;text-align: center;&quot; class=&quot;userstar star_{$post['stars']}&quot; title=&quot;{$post['usertitle']}&quot;&gt;&lt;/span&gt;</code></pre><br />
2) Open "<span style="font-style: italic;" class="mycode_i">memberlist_user</span>" template and find this line of code:<br />
<pre class="block-code"><code class="language-none">{$user['userstars']}</code></pre><br />
and replace it with this code:<br />
<pre class="block-code"><code class="language-none">&lt;span style=&quot;text-align: center;&quot; class=&quot;userstar star_{$user['stars']}&quot; title=&quot;{$user['usertitle']}&quot;&gt;&lt;/span&gt;</code></pre><br />
3) Open "<span style="font-style: italic;" class="mycode_i">member_profile</span>" template and find this line of code:<br />
<pre class="block-code"><code class="language-none">{$userstars}</code></pre><br />
and replace it with this code:<br />
<pre class="block-code"><code class="language-none">&lt;span style=&quot;text-align: center;&quot; class=&quot;userstar star_{$stars}&quot; title=&quot;{$usertitle}&quot;&gt;&lt;/span&gt;</code></pre><br />
4) Open "<span style="font-style: italic;" class="mycode_i">global.css</span>" stylesheet and add at the end this block of code:<br />
<pre class="block-code"><code class="language-none">/** Usergroup star rating - FontAwesome v5 - MyBB.Group **/

.userstar {
	font-family: Font Awesome\ 5 Free;
	font-size: 13px;
	color: #969696;
	line-height: 13px;
	display: inline-block;
	letter-spacing: 2px;
	font-weight: 900;
}
.star_0 :before {
	content: &quot;\f005\f005\f005\f005\f005\f005\f005&quot;;
	font-weight: 400;
}
.star_1 :before {
	content: &quot;\f005&quot;;
}
.star_1 :after {
	content: &quot;\f005\f005\f005\f005\f005\f005&quot;;
	font-weight: 400;
}
.star_2 :before {
	content: &quot;\f005\f005&quot;;
}
.star_2 :after {
	content: &quot;\f005\f005\f005\f005\f005&quot;;
	font-weight: 400;
}
.star_3 :before {
	content: &quot;\f005\f005\f005&quot;;
}
.star_3 :after {
	content: &quot;\f005\f005\f005\f005&quot;;
	font-weight: 400;
}
.star_4 :before {
	content: &quot;\f005\f005\f005\f005&quot;;
}
.star_4 :after {
	content: &quot;\f005\f005\f005&quot;;
	font-weight: 400;
}
.star_5 :before {
	content: &quot;\f005\f005\f005\f005\f005&quot;;
}
.star_5 :after {
	content: &quot;\f005\f005&quot;;
	font-weight: 400;
}
.star_6 :before {
	content: &quot;\f005\f005\f005\f005\f005\f005&quot;;
}
.star_6 :after {
	content: &quot;\f005&quot;;
	font-weight: 400;
.star_7 :before {
	content: &quot;\f005\f005\f005\f005\f005\f005\f005&quot;;
}</code></pre><br />
5) You are done, check the result!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[FontAwesome (v5) - loading spinner]]></title>
			<link>https://mybb.group/Thread-FontAwesome-v5-loading-spinner</link>
			<pubDate>Fri, 19 Apr 2019 08:55:17 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://mybb.group/member.php?action=profile&uid=2">Eldenroot</a>]]></dc:creator>
			<guid isPermaLink="false">https://mybb.group/Thread-FontAwesome-v5-loading-spinner</guid>
			<description><![CDATA[To replace default MyBB spinner by a modern good looking FontAwesome spinner you will need to apply these changes:<br />
<br />
- FontAwesome v5.x library is required, please load it on your website<br />
<br />
1) Open "<span style="font-style: italic;" class="mycode_i">headerinclude</span>" template and find this block of code:<br />
<pre class="block-code"><code class="language-none">var spinner = &quot;&lt;img src='&quot; + spinner_image +&quot;' alt='' /&gt;&quot;;</code></pre><br />
and replace it with this one:<br />
<pre class="block-code"><code class="language-none">var spinner = &quot;&lt;img src='&quot; + spinner_image +&quot;' alt='' style='display: none' /&gt;&lt;i class='fas fa-spinner fa-spin'&gt;&lt;/i&gt;&quot;;</code></pre><br />
2) Open "<span style="font-style: italic;" class="mycode_i">showthread_quickreply</span>" template and find this block of code:<br />
<pre class="block-code"><code class="language-none">&lt;div id=&quot;quickreply_spinner&quot; class=&quot;showthread_spinner&quot; style=&quot;display: none&quot;&gt;&lt;img src=&quot;{$theme['imgdir']}/spinner.gif&quot; /&gt;&lt;/div&gt;</code></pre><br />
and replace it with this one:<br />
<pre class="block-code"><code class="language-none">&lt;div id=&quot;quickreply_spinner&quot; class=&quot;showthread_spinner&quot; style=&quot;display: none&quot;&gt;&lt;img src=&quot;{$theme['imgdir']}/spinner.gif&quot; style=&quot;display: none;&quot; /&gt;&lt;i class=&quot;fas fa-spinner fa-spin&quot;&gt;&lt;/i&gt;&lt;/div&gt;</code></pre>*note: do not forget to apply the code above to all places where you might have the spinner<br />
<br />
3) Open your "<span style="font-style: italic;" class="mycode_i">global.css</span>" in your theme and add these few line of code below at the end of file:<br />
<pre class="block-code"><code class="language-none">#quickreply_spinner .fas {
font-size: 36px;
}</code></pre><br />
4) You are done, refresh your page (Ctrl+F5) and check the result!]]></description>
			<content:encoded><![CDATA[To replace default MyBB spinner by a modern good looking FontAwesome spinner you will need to apply these changes:<br />
<br />
- FontAwesome v5.x library is required, please load it on your website<br />
<br />
1) Open "<span style="font-style: italic;" class="mycode_i">headerinclude</span>" template and find this block of code:<br />
<pre class="block-code"><code class="language-none">var spinner = &quot;&lt;img src='&quot; + spinner_image +&quot;' alt='' /&gt;&quot;;</code></pre><br />
and replace it with this one:<br />
<pre class="block-code"><code class="language-none">var spinner = &quot;&lt;img src='&quot; + spinner_image +&quot;' alt='' style='display: none' /&gt;&lt;i class='fas fa-spinner fa-spin'&gt;&lt;/i&gt;&quot;;</code></pre><br />
2) Open "<span style="font-style: italic;" class="mycode_i">showthread_quickreply</span>" template and find this block of code:<br />
<pre class="block-code"><code class="language-none">&lt;div id=&quot;quickreply_spinner&quot; class=&quot;showthread_spinner&quot; style=&quot;display: none&quot;&gt;&lt;img src=&quot;{$theme['imgdir']}/spinner.gif&quot; /&gt;&lt;/div&gt;</code></pre><br />
and replace it with this one:<br />
<pre class="block-code"><code class="language-none">&lt;div id=&quot;quickreply_spinner&quot; class=&quot;showthread_spinner&quot; style=&quot;display: none&quot;&gt;&lt;img src=&quot;{$theme['imgdir']}/spinner.gif&quot; style=&quot;display: none;&quot; /&gt;&lt;i class=&quot;fas fa-spinner fa-spin&quot;&gt;&lt;/i&gt;&lt;/div&gt;</code></pre>*note: do not forget to apply the code above to all places where you might have the spinner<br />
<br />
3) Open your "<span style="font-style: italic;" class="mycode_i">global.css</span>" in your theme and add these few line of code below at the end of file:<br />
<pre class="block-code"><code class="language-none">#quickreply_spinner .fas {
font-size: 36px;
}</code></pre><br />
4) You are done, refresh your page (Ctrl+F5) and check the result!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Add filtering by thread prefix in forumdisplay_thread page]]></title>
			<link>https://mybb.group/Thread-Add-filtering-by-thread-prefix-in-forumdisplay-thread-page</link>
			<pubDate>Fri, 19 Apr 2019 08:37:28 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://mybb.group/member.php?action=profile&uid=2">Eldenroot</a>]]></dc:creator>
			<guid isPermaLink="false">https://mybb.group/Thread-Add-filtering-by-thread-prefix-in-forumdisplay-thread-page</guid>
			<description><![CDATA[This is a simple tutorial how to add a support for easier filtering of threads by their thread prefix. After this change prefixes will be changed to URL links. When you click to them, threads with the selected prefix will be displayed.<br />
<br />
1) In ACP open and edit "forumdisplay_thread" template and find this line of code:<br />
<pre class="block-code"><code class="language-none">{$thread['threadprefix']}
</code></pre><br />
replace it by this line of code:<br />
<pre class="block-code"><code class="language-none">&lt;a href=&quot;{$mybb-&gt;settings['bburl']}/forumdisplay.php?fid={$mybb-&gt;input['fid']}&amp;prefix={$thread['prefix']}&quot; style=&quot;text-decoration: none !important;&quot;&gt;{$thread['threadprefix']}&lt;/a&gt;
</code></pre><br />
2) Save and reload (Ctrl+F5) your page to see the result!<br />
<br />
3) Click on any thread prefix and check the output  <img src="https://mybb.group/themes/tekutema/images/smilies/084-cool.svg" alt="Cool" title="Cool" class="smilie smilie_3" />]]></description>
			<content:encoded><![CDATA[This is a simple tutorial how to add a support for easier filtering of threads by their thread prefix. After this change prefixes will be changed to URL links. When you click to them, threads with the selected prefix will be displayed.<br />
<br />
1) In ACP open and edit "forumdisplay_thread" template and find this line of code:<br />
<pre class="block-code"><code class="language-none">{$thread['threadprefix']}
</code></pre><br />
replace it by this line of code:<br />
<pre class="block-code"><code class="language-none">&lt;a href=&quot;{$mybb-&gt;settings['bburl']}/forumdisplay.php?fid={$mybb-&gt;input['fid']}&amp;prefix={$thread['prefix']}&quot; style=&quot;text-decoration: none !important;&quot;&gt;{$thread['threadprefix']}&lt;/a&gt;
</code></pre><br />
2) Save and reload (Ctrl+F5) your page to see the result!<br />
<br />
3) Click on any thread prefix and check the output  <img src="https://mybb.group/themes/tekutema/images/smilies/084-cool.svg" alt="Cool" title="Cool" class="smilie smilie_3" />]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Adding Collapse Buttons to Any Table]]></title>
			<link>https://mybb.group/Thread-Adding-Collapse-Buttons-to-Any-Table</link>
			<pubDate>Thu, 18 Apr 2019 06:13:05 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://mybb.group/member.php?action=profile&uid=1">effone</a>]]></dc:creator>
			<guid isPermaLink="false">https://mybb.group/Thread-Adding-Collapse-Buttons-to-Any-Table</guid>
			<description><![CDATA[Today we will learn how to add MyBB's collapse buttons to any table. Interesting? Well, its easy too.<br />
Lets see how it can be done.<br />
<br />
The default table code structure of MyBB is something like this:<br />
<br />
<span style="font-family: Courier;" class="mycode_font">&lt;table border="0" cellspacing="{&#36;theme['borderwidth']}" cellpadding="{&#36;theme['tablespace']}" class="tborder"&gt;<br />
&lt;tr&gt;<br />
&lt;td class="thead"&gt;&lt;strong&gt;Title of the Table&lt;/strong&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td class="trow1"&gt; The first content row. &lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td class="trow2"&gt; The second content row. &lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;</span><br />
<br />
Now we will insert the collapse button code to show in title bar (.thead). Code for this is:<br />
<span style="font-family: Courier;" class="mycode_font">&lt;div class="expcolimage"&gt;&lt;img src="{&#36;theme['imgdir']}/collapse{&#36;collapsedimg['<span style="color: #FF0000;" class="mycode_color">unique_id</span>']}.gif" id="[color=#ff0000]unique_id</span>_img" class="expander" alt="[-]" title="[-]" /&gt;&lt;/div&gt;[/font]<br />
<br />
Note that:<br />
1. The red text part ID of the collapse button must be unique and not be repeated.<br />
2. The ID must have the word "_img" at the end of it.<br />
<br />
As we want to show the collapse button in out title bar, we will place the code Just after the title, within the thead class.<br />
<pre class="block-code"><code class="language-none">&lt;td class=&quot;thead&quot;&gt;&lt;strong&gt;Title of the Table&lt;/strong&gt;
&lt;div class=&quot;expcolimage&quot;&gt;&lt;img src=&quot;{$theme['imgdir']}/collapse{$collapsedimg['unique_id']}.gif&quot; id=&quot;unique_id_img&quot; class=&quot;expander&quot; alt=&quot;[-]&quot; title=&quot;[-]&quot; /&gt;&lt;/div&gt;
&lt;/td&gt;
</code></pre><br />
Now we will bind the area with tbody reffering the same red unique text and instead of '_img' we have to place '_e' now.<br />
<pre class="block-code"><code class="language-none">&lt;tbody style=&quot;{$collapsed['unique_id_e']}&quot; id=&quot;unique_id_e&quot;&gt;
Content to collapse ...
&lt;/tbody&gt;
</code></pre><br />
So, we will combine the code this way, its colored, explanatory:<br />
<br />
<span style="font-family: Courier;" class="mycode_font">&lt;table border="0" cellspacing="{&#36;theme['borderwidth']}" cellpadding="{&#36;theme['tablespace']}" class="tborder"&gt;<br />
&lt;tr&gt;<br />
&lt;td class="thead"&gt;&lt;strong&gt;Title of the Table&lt;/strong&gt;<br />
<span style="color: #000080;" class="mycode_color">&lt;div class="expcolimage"&gt;&lt;img src="{&#36;theme['imgdir']}/collapse{&#36;collapsedimg['[color=#FF0000]unique_id</span>']}.gif" id="</span><span style="color: #ff0000;" class="mycode_color">unique_id</span><span style="color: #000080;" class="mycode_color">_img" class="expander" alt="[-]" title="[-]" /&gt;&lt;/div&gt;</span><br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
<span style="color: #000080;" class="mycode_color">&lt;tbody style="{&#36;collapsed['</span><span style="color: #ff0000;" class="mycode_color">unique_id</span><span style="color: #000080;" class="mycode_color">_e']}" id="</span><span style="color: #ff0000;" class="mycode_color">unique_id</span><span style="color: #000080;" class="mycode_color">_e"&gt;</span><br />
&lt;tr&gt;<br />
&lt;td class="trow1"&gt; The first content row. &lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td class="trow2"&gt; The second content row. &lt;/td&gt;<br />
&lt;/tr&gt;<br />
<span style="color: #000080;" class="mycode_color">&lt;/tbody&gt;</span><br />
&lt;/table&gt;[/font]<br />
<br />
&gt;&gt; Blue text is newly added code.<br />
&gt;&gt; Red is the unique ID, don't repeat the ID if you are applying it in multiple tables, else : you will click to collapse in earth and the content will collapse in Jupiter <img src="https://mybb.group/themes/tekutema/images/smilies/092-laughing-1.svg" alt="Big Grin" title="Big Grin" class="smilie smilie_4" /><br />
<br />
<img src="http://i.imgur.com/8gppzg0.png" loading="lazy"  alt="[Image: 8gppzg0.png]" class="mycode_img" /><br />
<br />
Thats it. Happy coding.]]></description>
			<content:encoded><![CDATA[Today we will learn how to add MyBB's collapse buttons to any table. Interesting? Well, its easy too.<br />
Lets see how it can be done.<br />
<br />
The default table code structure of MyBB is something like this:<br />
<br />
<span style="font-family: Courier;" class="mycode_font">&lt;table border="0" cellspacing="{&#36;theme['borderwidth']}" cellpadding="{&#36;theme['tablespace']}" class="tborder"&gt;<br />
&lt;tr&gt;<br />
&lt;td class="thead"&gt;&lt;strong&gt;Title of the Table&lt;/strong&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td class="trow1"&gt; The first content row. &lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td class="trow2"&gt; The second content row. &lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;</span><br />
<br />
Now we will insert the collapse button code to show in title bar (.thead). Code for this is:<br />
<span style="font-family: Courier;" class="mycode_font">&lt;div class="expcolimage"&gt;&lt;img src="{&#36;theme['imgdir']}/collapse{&#36;collapsedimg['<span style="color: #FF0000;" class="mycode_color">unique_id</span>']}.gif" id="[color=#ff0000]unique_id</span>_img" class="expander" alt="[-]" title="[-]" /&gt;&lt;/div&gt;[/font]<br />
<br />
Note that:<br />
1. The red text part ID of the collapse button must be unique and not be repeated.<br />
2. The ID must have the word "_img" at the end of it.<br />
<br />
As we want to show the collapse button in out title bar, we will place the code Just after the title, within the thead class.<br />
<pre class="block-code"><code class="language-none">&lt;td class=&quot;thead&quot;&gt;&lt;strong&gt;Title of the Table&lt;/strong&gt;
&lt;div class=&quot;expcolimage&quot;&gt;&lt;img src=&quot;{$theme['imgdir']}/collapse{$collapsedimg['unique_id']}.gif&quot; id=&quot;unique_id_img&quot; class=&quot;expander&quot; alt=&quot;[-]&quot; title=&quot;[-]&quot; /&gt;&lt;/div&gt;
&lt;/td&gt;
</code></pre><br />
Now we will bind the area with tbody reffering the same red unique text and instead of '_img' we have to place '_e' now.<br />
<pre class="block-code"><code class="language-none">&lt;tbody style=&quot;{$collapsed['unique_id_e']}&quot; id=&quot;unique_id_e&quot;&gt;
Content to collapse ...
&lt;/tbody&gt;
</code></pre><br />
So, we will combine the code this way, its colored, explanatory:<br />
<br />
<span style="font-family: Courier;" class="mycode_font">&lt;table border="0" cellspacing="{&#36;theme['borderwidth']}" cellpadding="{&#36;theme['tablespace']}" class="tborder"&gt;<br />
&lt;tr&gt;<br />
&lt;td class="thead"&gt;&lt;strong&gt;Title of the Table&lt;/strong&gt;<br />
<span style="color: #000080;" class="mycode_color">&lt;div class="expcolimage"&gt;&lt;img src="{&#36;theme['imgdir']}/collapse{&#36;collapsedimg['[color=#FF0000]unique_id</span>']}.gif" id="</span><span style="color: #ff0000;" class="mycode_color">unique_id</span><span style="color: #000080;" class="mycode_color">_img" class="expander" alt="[-]" title="[-]" /&gt;&lt;/div&gt;</span><br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
<span style="color: #000080;" class="mycode_color">&lt;tbody style="{&#36;collapsed['</span><span style="color: #ff0000;" class="mycode_color">unique_id</span><span style="color: #000080;" class="mycode_color">_e']}" id="</span><span style="color: #ff0000;" class="mycode_color">unique_id</span><span style="color: #000080;" class="mycode_color">_e"&gt;</span><br />
&lt;tr&gt;<br />
&lt;td class="trow1"&gt; The first content row. &lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td class="trow2"&gt; The second content row. &lt;/td&gt;<br />
&lt;/tr&gt;<br />
<span style="color: #000080;" class="mycode_color">&lt;/tbody&gt;</span><br />
&lt;/table&gt;[/font]<br />
<br />
&gt;&gt; Blue text is newly added code.<br />
&gt;&gt; Red is the unique ID, don't repeat the ID if you are applying it in multiple tables, else : you will click to collapse in earth and the content will collapse in Jupiter <img src="https://mybb.group/themes/tekutema/images/smilies/092-laughing-1.svg" alt="Big Grin" title="Big Grin" class="smilie smilie_4" /><br />
<br />
<img src="http://i.imgur.com/8gppzg0.png" loading="lazy"  alt="[Image: 8gppzg0.png]" class="mycode_img" /><br />
<br />
Thats it. Happy coding.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Make the Tracking PM Titles Clickable]]></title>
			<link>https://mybb.group/Thread-jQuery-Make-the-Tracking-PM-Titles-Clickable</link>
			<pubDate>Thu, 18 Apr 2019 06:13:01 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://mybb.group/member.php?action=profile&uid=1">effone</a>]]></dc:creator>
			<guid isPermaLink="false">https://mybb.group/Thread-jQuery-Make-the-Tracking-PM-Titles-Clickable</guid>
			<description><![CDATA[PM subjects in <code class="inline-code">PM Tracking</code> page is not hyperlinked and its a problem if you forget the content and want to check back.<br />
So, here is a little jQuery magic to make all the PM titles clickable which will take you to the original PM in <code class="inline-code">Sent Items</code> folder.<br />
<br />
Open template <code class="inline-code">private_tracking</code> and find the variable <code class="inline-code">{$footer}</code>. Add the following script just before that:<br />
<pre class="block-code"><code class="language-none">&lt;script type=&quot;text/javascript&quot;&gt;
  $(function(){
      $( &quot;input[name*='readcheck']&quot; ).each(function(){
          var link = rootpath + &quot;/private.php?action=read&amp;pmid=&quot; + (parseInt($(this).attr('name').match(/\d+/)) + 1);
          $(this).parent('td').siblings('td:eq( 1 )').wrapInner('&lt;a href=' + link + '&gt;');
         
      });
  });
&lt;/script&gt;
</code></pre><br />
Save the template, BAM!<br />
<br />
All of the PM subjects in tracking page is now clickable.]]></description>
			<content:encoded><![CDATA[PM subjects in <code class="inline-code">PM Tracking</code> page is not hyperlinked and its a problem if you forget the content and want to check back.<br />
So, here is a little jQuery magic to make all the PM titles clickable which will take you to the original PM in <code class="inline-code">Sent Items</code> folder.<br />
<br />
Open template <code class="inline-code">private_tracking</code> and find the variable <code class="inline-code">{$footer}</code>. Add the following script just before that:<br />
<pre class="block-code"><code class="language-none">&lt;script type=&quot;text/javascript&quot;&gt;
  $(function(){
      $( &quot;input[name*='readcheck']&quot; ).each(function(){
          var link = rootpath + &quot;/private.php?action=read&amp;pmid=&quot; + (parseInt($(this).attr('name').match(/\d+/)) + 1);
          $(this).parent('td').siblings('td:eq( 1 )').wrapInner('&lt;a href=' + link + '&gt;');
         
      });
  });
&lt;/script&gt;
</code></pre><br />
Save the template, BAM!<br />
<br />
All of the PM subjects in tracking page is now clickable.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Color All Post Backgrounds of a Usergroup]]></title>
			<link>https://mybb.group/Thread-Color-All-Post-Backgrounds-of-a-Usergroup</link>
			<pubDate>Sun, 14 Apr 2019 11:23:06 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://mybb.group/member.php?action=profile&uid=1">effone</a>]]></dc:creator>
			<guid isPermaLink="false">https://mybb.group/Thread-Color-All-Post-Backgrounds-of-a-Usergroup</guid>
			<description><![CDATA[This tutorial is for those who want some specific usergroup's posts be different from the others. Like say all moderators' post background to be some different color. We can do it without using any plugin. Let's discuss about that trick today.<br />
<br />
First we have to add a special class to our postbit templates to override the default post colors. For that open the template:<br />
<br />
ACP &gt; Templates &amp; Styles &gt; Templates &gt; [Theme Name] Templates &gt; Postbit Templates &gt; postbit<br />
<br />
and find:<br />
<br />
<pre class="block-code"><code class="language-none">&lt;td class=&quot;trow2 post_content {$unapproved_shade}&quot;&gt;
</code></pre><br />
Now we have to add our special class <span style="font-weight: bold;" class="mycode_b">post{&#36;usergroup['gid']}</span> to it. So, change the code to:<br />
<br />
<pre class="block-code"><code class="language-none">&lt;td class=&quot;trow2 post_content post{$usergroup['gid']} {$unapproved_shade}&quot;&gt;
</code></pre><br />
<span style="text-decoration: underline;" class="mycode_u">Note that:</span> You have to place the class<br />
a) after class 'trow2' else the 'trow2' background color will govern.<br />
b) before class'{&#36;unapproved_shade}' so that Unapproved post's color can lead over any user's post.<br />
<br />
Do the same thing with postbit_classic template. Open:<br />
<br />
ACP &gt; Templates &amp; Styles &gt; Templates &gt; [Theme Name] Templates &gt; Postbit Templates &gt; postbit_classic<br />
<br />
and find:<br />
<br />
<pre class="block-code"><code class="language-none">&lt;div id=&quot;pid_{$post['pid']}&quot; class=&quot;post_body&quot;&gt;
</code></pre><br />
Change the code to:<br />
<br />
<pre class="block-code"><code class="language-none">&lt;div id=&quot;pid_{$post['pid']}&quot; class=&quot;post_body post{$usergroup['gid']}&quot;&gt;
</code></pre><br />
Now the CSS, main trick part. Our dynamic class 'post{&#36;usergroup['gid']}' will change at runtime based on group ID. ie. for all the posts of admins (default group ID is 4) it will be <span style="font-weight: bold;" class="mycode_b">post4</span>, for all the posts of members (default group ID is 2) it will be <span style="font-weight: bold;" class="mycode_b">post2</span><br />
<br />
So, as we said, if we want to target the specific group, for our example, say Moderators (default group ID is 6) we will declare our CSS class as <span style="font-weight: bold;" class="mycode_b">.post6</span><br />
<br />
Now, open your global.css and add at the end (or any suitable location):<br />
<br />
<pre class="block-code"><code class="language-none">.post6 { background: #FDB5FF; }</code></pre><br />
and save global.css.<br />
<br />
Now the background of all posts made by any Moderator is a decent light pink. <br />
We can change post backgrounds for as many usergroups as we wish using this trick, only we need to know the target group ID and change the number at the end of the class in css as per that group ID.]]></description>
			<content:encoded><![CDATA[This tutorial is for those who want some specific usergroup's posts be different from the others. Like say all moderators' post background to be some different color. We can do it without using any plugin. Let's discuss about that trick today.<br />
<br />
First we have to add a special class to our postbit templates to override the default post colors. For that open the template:<br />
<br />
ACP &gt; Templates &amp; Styles &gt; Templates &gt; [Theme Name] Templates &gt; Postbit Templates &gt; postbit<br />
<br />
and find:<br />
<br />
<pre class="block-code"><code class="language-none">&lt;td class=&quot;trow2 post_content {$unapproved_shade}&quot;&gt;
</code></pre><br />
Now we have to add our special class <span style="font-weight: bold;" class="mycode_b">post{&#36;usergroup['gid']}</span> to it. So, change the code to:<br />
<br />
<pre class="block-code"><code class="language-none">&lt;td class=&quot;trow2 post_content post{$usergroup['gid']} {$unapproved_shade}&quot;&gt;
</code></pre><br />
<span style="text-decoration: underline;" class="mycode_u">Note that:</span> You have to place the class<br />
a) after class 'trow2' else the 'trow2' background color will govern.<br />
b) before class'{&#36;unapproved_shade}' so that Unapproved post's color can lead over any user's post.<br />
<br />
Do the same thing with postbit_classic template. Open:<br />
<br />
ACP &gt; Templates &amp; Styles &gt; Templates &gt; [Theme Name] Templates &gt; Postbit Templates &gt; postbit_classic<br />
<br />
and find:<br />
<br />
<pre class="block-code"><code class="language-none">&lt;div id=&quot;pid_{$post['pid']}&quot; class=&quot;post_body&quot;&gt;
</code></pre><br />
Change the code to:<br />
<br />
<pre class="block-code"><code class="language-none">&lt;div id=&quot;pid_{$post['pid']}&quot; class=&quot;post_body post{$usergroup['gid']}&quot;&gt;
</code></pre><br />
Now the CSS, main trick part. Our dynamic class 'post{&#36;usergroup['gid']}' will change at runtime based on group ID. ie. for all the posts of admins (default group ID is 4) it will be <span style="font-weight: bold;" class="mycode_b">post4</span>, for all the posts of members (default group ID is 2) it will be <span style="font-weight: bold;" class="mycode_b">post2</span><br />
<br />
So, as we said, if we want to target the specific group, for our example, say Moderators (default group ID is 6) we will declare our CSS class as <span style="font-weight: bold;" class="mycode_b">.post6</span><br />
<br />
Now, open your global.css and add at the end (or any suitable location):<br />
<br />
<pre class="block-code"><code class="language-none">.post6 { background: #FDB5FF; }</code></pre><br />
and save global.css.<br />
<br />
Now the background of all posts made by any Moderator is a decent light pink. <br />
We can change post backgrounds for as many usergroups as we wish using this trick, only we need to know the target group ID and change the number at the end of the class in css as per that group ID.]]></content:encoded>
		</item>
	</channel>
</rss>