2014-01-16, 06:51 PM
We have seen that every thread has an option at the bottom-left: "Subscribe to this thread" that automatically gets changed after thread subscription and displays as "Unsubscribe from this thread".
![[Image: 39tQeAM.png]](https://camo.mybb.com/587e9dd6601282ae6637b2cde548d4df7537be2e/687474703a2f2f692e696d6775722e636f6d2f3339745165414d2e706e67)
Well its a nice feature. It displays the required option only as well as the subscription state of the thread with the user's account. But what about this:
![[Image: Fy9y8g0.png]](https://camo.mybb.com/8414b8eae959b468645fc1c7e897f1f6b2abefeb/687474703a2f2f692e696d6775722e636f6d2f467939793867302e706e67)
It shows both the options every time viewing a thread no matter the thread view is 'Linear' or 'Threaded'.
Okay let's play with the codes a little to give the same functionality as the thread subscription option toggle to thread view also. Lets toggle it.
So, open the following template:
ACP > Templates & Styles > Templates > {theme_name} Templates > Show Thread Templates > showthread
and find this code line:
add just after that:
Now in the same template find this code chunk:
Replace with:
Save the template. You are done.
Now you can toggle you thread view links just like your thread subscription links.
![[Image: 5pHd0YV.png]](https://camo.mybb.com/07302a2bda0f10e415d653bac193cfd4bb66ccea/687474703a2f2f692e696d6775722e636f6d2f357048643059562e706e67)
Happy coding
Well its a nice feature. It displays the required option only as well as the subscription state of the thread with the user's account. But what about this:
It shows both the options every time viewing a thread no matter the thread view is 'Linear' or 'Threaded'.
Okay let's play with the codes a little to give the same functionality as the thread subscription option toggle to thread view also. Lets toggle it.
So, open the following template:
ACP > Templates & Styles > Templates > {theme_name} Templates > Show Thread Templates > showthread
and find this code line:
<script type="text/javascript" src="jscripts/thread.js?ver=1603"></script>
add just after that:
<style type="text/css">#mode_{$mybb->input['mode']} { display: none; }</style>
Now in the same template find this code chunk:
<a href="showthread.php?mode=threaded&tid={$tid}&pid={$pid}#pid{$pid}">{$lang->threaded}</a> | <a href="showthread.php?mode=linear&tid={$tid}&pid={$pid}#pid{$pid}">{$lang->linear}</a>
Replace with:
<a id="mode_threaded" href="showthread.php?mode=threaded&tid={$tid}&pid={$pid}#pid{$pid}">{$lang->threaded}</a><a id="mode_linear" href="showthread.php?mode=linear&tid={$tid}&pid={$pid}#pid{$pid}">{$lang->linear}</a>
Save the template. You are done.
Now you can toggle you thread view links just like your thread subscription links.
Happy coding
